mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-09 01:44:31 +02:00
Fixed error mapping for orderdetails edit page.
This commit is contained in:
parent
d47e482b3c
commit
6e34cc3633
5 changed files with 15 additions and 12 deletions
|
@ -53,7 +53,7 @@ class OrderdetailType extends AbstractType
|
||||||
|
|
||||||
$builder->add('supplier', StructuralEntityType::class, ['class' => Supplier::class, 'disable_not_selectable' => true]);
|
$builder->add('supplier', StructuralEntityType::class, ['class' => Supplier::class, 'disable_not_selectable' => true]);
|
||||||
|
|
||||||
$builder->add('supplierProductUrl', UrlType::class, [
|
$builder->add('supplier_product_url', UrlType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'empty_data' => ""
|
'empty_data' => ""
|
||||||
]);
|
]);
|
||||||
|
@ -64,7 +64,7 @@ class OrderdetailType extends AbstractType
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//Attachment section
|
//Attachment section
|
||||||
$builder->add('priceDetails', CollectionType::class, [
|
$builder->add('pricedetails', CollectionType::class, [
|
||||||
'entry_type' => PricedetailType::class,
|
'entry_type' => PricedetailType::class,
|
||||||
'allow_add' => true, 'allow_delete' => true,
|
'allow_add' => true, 'allow_delete' => true,
|
||||||
'label' => false,
|
'label' => false,
|
||||||
|
|
|
@ -145,7 +145,7 @@ class PartBaseType extends AbstractType
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//Attachment section
|
//Attachment section
|
||||||
$builder->add('orderDetails', CollectionType::class, [
|
$builder->add('orderdetails', CollectionType::class, [
|
||||||
'entry_type' => OrderdetailType::class,
|
'entry_type' => OrderdetailType::class,
|
||||||
'allow_add' => true, 'allow_delete' => true,
|
'allow_add' => true, 'allow_delete' => true,
|
||||||
'label' => false,
|
'label' => false,
|
||||||
|
|
|
@ -47,8 +47,8 @@ class PricedetailType extends AbstractType
|
||||||
{
|
{
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder->add("minDiscountQuantity", IntegerType::class);
|
$builder->add("min_discount_quantity", IntegerType::class);
|
||||||
$builder->add("priceRelatedQuantity", IntegerType::class);
|
$builder->add("price_related_quantity", IntegerType::class);
|
||||||
$builder->add("price", NumberType::class);
|
$builder->add("price", NumberType::class);
|
||||||
$builder->add("currency", CurrencyEntityType::class, ['required' => false]);
|
$builder->add("currency", CurrencyEntityType::class, ['required' => false]);
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ class PricedetailType extends AbstractType
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'data_class' => Pricedetail::class,
|
'data_class' => Pricedetail::class,
|
||||||
|
'error_bubbling' => false
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{% form_theme form with ['Parts/edit/edit_form_styles.html.twig', "bootstrap_4_layout.html.twig"] %}
|
{% form_theme form with ['Parts/edit/edit_form_styles.html.twig', "bootstrap_4_layout.html.twig"] %}
|
||||||
|
|
||||||
<table class="table table-striped" id="orderdetails_table" data-prototype="{{ form_widget(form.orderDetails.vars.prototype)|e('html_attr') }}">
|
<table class="table table-striped" id="orderdetails_table" data-prototype="{{ form_widget(form.orderdetails.vars.prototype)|e('html_attr') }}">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for detail in form.orderDetails %}
|
{% for detail in form.orderdetails %}
|
||||||
{{ form_widget(detail) }}
|
{{ form_widget(detail) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{% form_theme form.currency 'Form/extendedBootstrap4_layout.html.twig' %}
|
{% form_theme form.currency 'Form/extendedBootstrap4_layout.html.twig' %}
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ form_widget(form.minDiscountQuantity, {'attr': {'class': 'form-control-sm'}}) }} {{ form_errors(form.minDiscountQuantity) }}</td>
|
<td>{{ form_widget(form.min_discount_quantity, {'attr': {'class': 'form-control-sm'}}) }} {{ form_errors(form.min_discount_quantity) }}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
{{ form_widget(form.price) }}
|
{{ form_widget(form.price) }}
|
||||||
|
@ -13,10 +13,11 @@
|
||||||
{{ form_errors(form.price) }}
|
{{ form_errors(form.price) }}
|
||||||
{{ form_errors(form.currency) }}
|
{{ form_errors(form.currency) }}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ form_widget(form.priceRelatedQuantity, {'attr': {'class': 'form-control-sm'}}) }} {{ form_errors(form.price) }}</td>
|
<td>{{ form_widget(form.price_related_quantity, {'attr': {'class': 'form-control-sm'}}) }} {{ form_errors(form.price_related_quantity) }}</td>
|
||||||
<td><button type="button" class="btn btn-danger order_btn_delete btn-sm" title="{% trans %}orderdetail.delete{% endtrans %}" onclick="delete_pricedetail_entry(this);">
|
<td><button type="button" class="btn btn-danger order_btn_delete btn-sm" title="{% trans %}orderdetail.delete{% endtrans %}" onclick="delete_pricedetail_entry(this);">
|
||||||
<i class="fas fa-trash-alt fa-fw"></i>
|
<i class="fas fa-trash-alt fa-fw"></i>
|
||||||
</button>
|
</button>
|
||||||
|
{{ form_errors(form) }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -26,11 +27,11 @@
|
||||||
<td>
|
<td>
|
||||||
{{ form_row(form.supplier, {'attr': {'class': 'form-control-sm'}}) }}
|
{{ form_row(form.supplier, {'attr': {'class': 'form-control-sm'}}) }}
|
||||||
{{ form_row(form.supplierpartnr, {'attr': {'class': 'form-control-sm'}}) }}
|
{{ form_row(form.supplierpartnr, {'attr': {'class': 'form-control-sm'}}) }}
|
||||||
{{ form_row(form.supplierProductUrl, {'attr': {'class': 'form-control-sm'}}) }}
|
{{ form_row(form.supplier_product_url, {'attr': {'class': 'form-control-sm'}}) }}
|
||||||
{{ form_widget(form.obsolete) }}
|
{{ form_widget(form.obsolete) }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<table class="table table-sm table-bordered" data-prototype="{{ form_widget(form.priceDetails.vars.prototype)|e('html_attr') }}">
|
<table class="table table-sm table-bordered" data-prototype="{{ form_widget(form.pricedetails.vars.prototype)|e('html_attr') }}">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Min Qty.</th>
|
<th>Min Qty.</th>
|
||||||
|
@ -40,7 +41,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for price in form.priceDetails %}
|
{% for price in form.pricedetails %}
|
||||||
{{ form_widget(price) }}
|
{{ form_widget(price) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -55,6 +56,7 @@
|
||||||
<button type="button" class="btn btn-danger order_btn_delete" onclick="delete_orderdetail_entry(this);" title="{% trans %}orderdetail.delete{% endtrans %}">
|
<button type="button" class="btn btn-danger order_btn_delete" onclick="delete_orderdetail_entry(this);" title="{% trans %}orderdetail.delete{% endtrans %}">
|
||||||
<i class="fas fa-trash-alt fa-fw"></i>
|
<i class="fas fa-trash-alt fa-fw"></i>
|
||||||
</button>
|
</button>
|
||||||
|
{{ form_errors(form) }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue