diff --git a/src/Marello/Bundle/OrderBundle/Entity/Order.php b/src/Marello/Bundle/OrderBundle/Entity/Order.php index 271f6ee28..e977da123 100644 --- a/src/Marello/Bundle/OrderBundle/Entity/Order.php +++ b/src/Marello/Bundle/OrderBundle/Entity/Order.php @@ -290,6 +290,13 @@ class Order extends ExtendOrder implements */ protected $shippingMethodType; + /** + * @var string + * + * @ORM\Column(name="shipping_method_reference", type="string", length=255, nullable=true) + */ + protected $shippingMethodReference; + /** * @var float * @@ -1075,7 +1082,7 @@ public function getShippingMethodType() /** * @param string $shippingMethodType - * @return Order + * @return $this */ public function setShippingMethodType($shippingMethodType) { @@ -1084,6 +1091,25 @@ public function setShippingMethodType($shippingMethodType) return $this; } + /** + * @return string + */ + public function getShippingMethodReference(): ?string + { + return $this->shippingMethodReference; + } + + /** + * @param string $shippingMethodReference + * @return $this + */ + public function setShippingMethodReference(string $shippingMethodReference) + { + $this->shippingMethodReference = $shippingMethodReference; + + return $this; + } + /** * @return Price|null */ diff --git a/src/Marello/Bundle/OrderBundle/Migrations/Schema/MarelloOrderBundleInstaller.php b/src/Marello/Bundle/OrderBundle/Migrations/Schema/MarelloOrderBundleInstaller.php index 6ec2eb810..3434cbebb 100644 --- a/src/Marello/Bundle/OrderBundle/Migrations/Schema/MarelloOrderBundleInstaller.php +++ b/src/Marello/Bundle/OrderBundle/Migrations/Schema/MarelloOrderBundleInstaller.php @@ -107,6 +107,7 @@ protected function createMarelloOrderOrderTable(Schema $schema) ); $table->addColumn('shipping_method', 'string', ['notnull' => false, 'length' => 255]); $table->addColumn('shipping_method_type', 'string', ['notnull' => false, 'length' => 255]); + $table->addColumn('shipping_method_reference', 'string', ['notnull' => false, 'length' => 255]); $table->addColumn( 'estimated_shipping_cost_amount', 'money', diff --git a/src/Marello/Bundle/OrderBundle/Migrations/Schema/v1_11/MarelloOrderBundle.php b/src/Marello/Bundle/OrderBundle/Migrations/Schema/v1_11/MarelloOrderBundle.php new file mode 100644 index 000000000..5fb23a8df --- /dev/null +++ b/src/Marello/Bundle/OrderBundle/Migrations/Schema/v1_11/MarelloOrderBundle.php @@ -0,0 +1,20 @@ +getTable('marello_order_order'); + $table->addColumn('shipping_method_reference', 'string', ['notnull' => false, 'length' => 255]); + } +} diff --git a/src/Marello/Bundle/OrderBundle/Resources/config/validation.yml b/src/Marello/Bundle/OrderBundle/Resources/config/validation.yml index 507cce212..91b2aa411 100644 --- a/src/Marello/Bundle/OrderBundle/Resources/config/validation.yml +++ b/src/Marello/Bundle/OrderBundle/Resources/config/validation.yml @@ -28,7 +28,7 @@ Marello\Bundle\OrderBundle\Entity\Order: paymentMethod: - NotBlank: { groups: [Default, commerce] } shippingMethod: - - NotBlank: { groups: [Default, commerce] } + - NotBlank: { groups: [Default] } billingAddress: - NotBlank: { groups: [Default, commerce], message: 'marello.order.address.validation.billing_not_blank' } diff --git a/src/Marello/Bundle/OrderBundle/Resources/translations/messages.en.yml b/src/Marello/Bundle/OrderBundle/Resources/translations/messages.en.yml index db27ea0a9..60ac58d06 100644 --- a/src/Marello/Bundle/OrderBundle/Resources/translations/messages.en.yml +++ b/src/Marello/Bundle/OrderBundle/Resources/translations/messages.en.yml @@ -32,6 +32,7 @@ marello: payment_reference.label: Payment Reference shipping_method.label: Shipping Method shipping_method_type.label: Shipping Method Type + shipping_method_reference.label: Shipping Method Reference shipment.label: Shipment data.label: Data shipping_amount_incl_tax.label: Shipping Costs Incl. tax @@ -61,6 +62,7 @@ marello: order_totals: Order Totals packing_slips: Packing Slips invoices: Invoices + source_references_information: Source References # OrderItem entity orderitem: entity_label: Ordered Item diff --git a/src/Marello/Bundle/OrderBundle/Resources/views/Order/view.html.twig b/src/Marello/Bundle/OrderBundle/Resources/views/Order/view.html.twig index cbead907d..3112935e3 100644 --- a/src/Marello/Bundle/OrderBundle/Resources/views/Order/view.html.twig +++ b/src/Marello/Bundle/OrderBundle/Resources/views/Order/view.html.twig @@ -30,6 +30,36 @@ {% block content_data %} {% set id = 'marello-order-view' %} {% set generalSubblocks = [] %} + {% set customerInformation %} +
+
+ {{ 'marello.order.datablock.customer_information'|trans }} +
+ {% if entity.customer.company %} + {{ UI.renderHtmlProperty( + 'marello.customer.company.entity_label'|trans, + UI.entityViewLink(entity.customer.company, entity.customer.company.name, 'marello_customer_company_view') + ) }} + {% endif %} + {{ UI.renderHtmlProperty( + 'marello.customer.entity_label'|trans, + UI.entityViewLink(entity.customer, entity.customer|oro_format_name, 'marello_customer_view') + )}} + {{ UI.renderProperty('marello.customer.email.label'|trans, entity.customer.email) }} +
+ {% endset %} + + {% set sourceReferences %} +
+
+ {{ 'marello.order.datablock.source_references_information'|trans }} +
+ {{ UI.renderProperty('marello.order.order_reference.label'|trans, entity.orderReference) }} + {{ UI.renderProperty('marello.order.invoice_reference.label'|trans, entity.invoiceReference) }} + {{ UI.renderProperty('marello.order.shipping_method_reference.label'|trans, entity.shippingMethodReference) }} +
+ {% endset %} + {% set generalInformation %}
@@ -50,9 +80,10 @@ 'marello.order.sales_channel.label'|trans, UI.entityViewLink(entity.salesChannel, entity.salesChannelName, 'marello_sales_saleschannel_view') )}} - {{ UI.renderProperty('marello.order.order_reference.label'|trans, entity.orderReference) }} {{ UI.renderProperty('marello.order.localization.label'|trans, entity.localization) }}
+ {{ customerInformation }} + {{ sourceReferences }}
@@ -78,32 +109,6 @@ {% endset %} {% set generalSubblocks = generalSubblocks|merge([{'data' : [totalsWidget] }]) %} - {% set customerInformation %} -
-
-
-
-
- {{ 'marello.order.datablock.customer_information'|trans }} -
- {% if entity.customer.company %} - {{ UI.renderHtmlProperty( - 'marello.customer.company.entity_label'|trans, - UI.entityViewLink(entity.customer.company, entity.customer.company.name, 'marello_customer_company_view') - ) }} - {% endif %} - {{ UI.renderHtmlProperty( - 'marello.customer.entity_label'|trans, - UI.entityViewLink(entity.customer, entity.customer|oro_format_name, 'marello_customer_view') - )}} - {{ UI.renderProperty('marello.customer.email.label'|trans, entity.customer.email) }} -
-
-
-
- {% endset %} - {% set generalSubblocks = generalSubblocks|merge([{'data' : [customerInformation] }]) %} - {% set paymentSubblocks = [] %} {% set billingAddressWidget %} {{ oro_widget_render({