Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions Resources/Private/Partials/Backend/Order/Show/CartTable/Body.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,13 @@
<td class="cart-figure">
<cart:format.currency currencySign="{currencySign}">{product.gross}</cart:format.currency>
</td>
<f:for each="{product.orderItem.orderTotalTax}" as="orderTotalTax">
<td class="cart-figure">
<f:if condition="{0: orderTotalTax.orderTaxClass.id} == {0: {product.orderTaxClass.id}}">
<f:then>
<cart:format.currency currencySign="{currencySign}">{product.orderTax.tax}</cart:format.currency>
</f:then>
<f:else>
<!-- -->
</f:else>
</f:if>
</td>
</f:for>
<f:render partial="Backend/Order/Show/CartTable/TaxColumns"
arguments="{totalTaxes: totalTaxes, taxClass: product.taxClass, tax: product.tax, currencySign: currencySign}"/>
</tr>
</f:section>

<f:for each="{orderItem.products}" as="product">
<f:render section="product"
arguments="{product: product, currencySign: orderItem.currency}"/>
arguments="{product: product, totalTaxes: orderItem.totalTax, currencySign: orderItem.currency}"/>
</f:for>
</html>
</html>
130 changes: 55 additions & 75 deletions Resources/Private/Partials/Backend/Order/Show/CartTable/Footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,90 +12,70 @@
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.gross}</cart:format.currency>
</td>
<f:for each="{orderItem.orderTax}" as="orderTax">
<f:for each="{orderItem.totalTax}" as="totalTax">
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderTax.tax}</cart:format.currency>
<f:for each="{orderItem.tax}" as="tax">
<f:if condition="{tax.taxClass.uid} == {totalTax.taxClass.uid}">
<cart:format.currency currencySign="{orderItem.currency}">{tax.tax}</cart:format.currency>
</f:if>
</f:for>
</td>
</f:for>
</tr>

<tr>
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_item.order_shipping"/>: {orderItem.shipping.name}
</td>
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.shipping.net}</cart:format.currency>
</td>
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.shipping.gross}</cart:format.currency>
</td>
<f:for each="{orderItem.orderTotalTax}" as="orderTotalTax">
<f:if condition="{orderItem.shipping}">
<tr>
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_item.order_shipping"/>: {orderItem.shipping.name}
</td>
<td class="cart-figure">
<f:if condition="{0: orderTotalTax.orderTaxClass.id} == {0: orderItem.shipping.orderTaxClass.id}">
<f:then>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.shipping.orderTax.tax}</cart:format.currency>
</f:then>
<f:else>
<!-- -->
</f:else>
</f:if>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.shipping.net}</cart:format.currency>
</td>
</f:for>
</tr>

<tr>
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_item.order_payment"/>: {orderItem.payment.name}
</td>
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.payment.net}</cart:format.currency>
</td>
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.payment.gross}</cart:format.currency>
</td class=cart-figure>
<f:for each="{orderItem.orderTotalTax}" as="orderTotalTax">
<td class="cart-figure">
<f:if condition="{0: orderTotalTax.orderTaxClass.id} == {0: orderItem.payment.orderTaxClass.id}">
<f:then>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.payment.orderTax.tax}</cart:format.currency>
</f:then>
<f:else>
<!-- -->
</f:else>
</f:if>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.shipping.gross}</cart:format.currency>
</td>
</f:for>
</tr>
<f:render partial="Backend/Order/Show/CartTable/TaxColumns"
arguments="{totalTaxes: orderItem.totalTax, taxClass: orderItem.shipping.taxClass, tax: orderItem.shipping.tax, currencySign: orderItem.currency}"/>
</tr>
</f:if>

<f:if condition="{orderItem.discounts}">
<f:for each="{orderItem.discounts}" as="orderDiscount">
<tr>
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_discount"/>
{orderDiscount.title}
</td>
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderDiscount.net}</cart:format.currency>
</td>
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderDiscount.gross}</cart:format.currency>
</td>
<f:for each="{orderItem.orderTotalTax}" as="orderTotalTax">
<td class="cart-figure">
<f:if condition="{0: orderTotalTax.orderTaxClass.id} == {0: orderDiscount.orderTaxClass.id}">
<f:then>
<cart:format.currency currencySign="{orderItem.currency}">{orderDiscount.orderTax.tax}</cart:format.currency>
</f:then>
<f:else>
<!-- -->
</f:else>
</f:if>
</td>
</f:for>
</tr>
</f:for>
<f:if condition="{orderItem.payment}">
<tr>
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_item.order_payment"/>: {orderItem.payment.name}
</td>
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.payment.net}</cart:format.currency>
</td>
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.payment.gross}</cart:format.currency>
</td>
<f:render partial="Backend/Order/Show/CartTable/TaxColumns"
arguments="{totalTaxes: orderItem.totalTax, taxClass: orderItem.payment.taxClass, tax: orderItem.payment.tax, currencySign: orderItem.currency}"/>
</tr>
</f:if>

<f:for each="{orderItem.discounts}" as="orderDiscount">
<tr>
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_discount"/>
{orderDiscount.title}
</td>
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderDiscount.net}</cart:format.currency>
</td>
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderDiscount.gross}</cart:format.currency>
</td>
<f:comment>
The tax class of a discount is not stored in the order, so its tax can not be assigned to a column.
</f:comment>
<f:for each="{orderItem.totalTax}" as="totalTax">
<td class="cart-figure"></td>
</f:for>
</tr>
</f:for>

<tr class="sum">
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_item.cart_total_price"/>
Expand All @@ -106,10 +86,10 @@
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.totalGross}</cart:format.currency>
</td>
<f:for each="{orderItem.orderTotalTax}" as="orderTotalTax">
<f:for each="{orderItem.totalTax}" as="totalTax">
<td class="cart-figure">
<cart:format.currency currencySign="{orderItem.currency}">{orderTotalTax.tax}</cart:format.currency>
<cart:format.currency currencySign="{orderItem.currency}">{totalTax.tax}</cart:format.currency>
</td>
</f:for>
</tr>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<th class="cart-figure">
<f:translate key="tx_cart_domain_model_order_product.gross"/>
</th>
<f:for each="{orderItem.orderTotalTax}" as="orderTotalTax">
<td>
<f:translate key="plugin.cart.product.tax" arguments="{0: orderTotalTax.orderTaxClass.name}"/>
</td>
<f:for each="{orderItem.totalTax}" as="totalTax">
<th class="cart-figure">
<f:translate key="tx_cart.tax_vat.value" arguments="{0: totalTax.taxClass.value}"/>
</th>
</f:for>
</tr>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:cart="http://typo3.org/ns/Extcode/Cart/ViewHelpers"
data-namespace-typo3-fluid="true">

<f:comment>
One column per tax class of the order (totalTaxes), the tax is shown in the column of its tax class.
</f:comment>
<f:for each="{totalTaxes}" as="totalTax">
<td class="cart-figure">
<f:if condition="{taxClass} && {totalTax.taxClass.uid} == {taxClass.uid}">
<cart:format.currency currencySign="{currencySign}">{tax}</cart:format.currency>
</f:if>
</td>
</f:for>
</html>
8 changes: 4 additions & 4 deletions Resources/Private/Partials/Order/Show/Cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
<th class="bg-light-grey border-left-grey">
<f:translate key="LLL:EXT:cart/Resources/Private/Language/locallang.xlf:tx_cart_domain_model_order_product.gross"/>
</th>
<f:for each="{orderItem.orderTotalTax}" as="orderTotalTax">
<f:for each="{orderItem.totalTax}" as="totalTax">
<th class="bg-light-grey border-left-grey">
<f:translate key="LLL:EXT:cart/Resources/Private/Language/locallang.xlf:plugin.cart.product.tax"
arguments="{0: orderTotalTax.orderTaxClass.name}"/>
<f:translate key="LLL:EXT:cart/Resources/Private/Language/locallang.xlf:tx_cart.tax_vat.value"
arguments="{0: totalTax.taxClass.value}"/>
</th>
</f:for>
</tr>
</thead>
<tbody>
<f:for each="{orderItem.products}" as="product">
<f:render partial="Order/Show/Product"
arguments="{product: product, currencySign: orderItem.currency}"/>
arguments="{product: product, totalTaxes: orderItem.totalTax, currencySign: orderItem.currency}"/>
</f:for>
</tbody>
<tfoot>
Expand Down
16 changes: 3 additions & 13 deletions Resources/Private/Partials/Order/Show/Product.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,7 @@
<td class="product-gross">
<cart:format.currency>{product.gross}</cart:format.currency>
</td>
<f:for each="{product.orderItem.orderTotalTax}" as="orderTotalTax">
<td class="order-tax">
<f:if condition="{0: orderTotalTax.orderTaxClass.id} == {0: {product.orderTaxClass.id}}">
<f:then>
<cart:format.currency>{product.orderTax.tax}</cart:format.currency>
</f:then>
<f:else>
&nbsp;
</f:else>
</f:if>
</td>
</f:for>
<f:render partial="Order/Show/TaxColumns"
arguments="{totalTaxes: totalTaxes, taxClass: product.taxClass, tax: product.tax, currencySign: currencySign}"/>
</tr>
</html>
</html>
86 changes: 37 additions & 49 deletions Resources/Private/Partials/Order/Show/Summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,50 @@
<td>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.gross}</cart:format.currency>
</td>
<f:for each="{orderItem.orderTax}" as="orderTax">
<f:for each="{orderItem.totalTax}" as="totalTax">
<td>
<cart:format.currency currencySign="{orderItem.currency}">{orderTax.tax}</cart:format.currency>
<f:for each="{orderItem.tax}" as="tax">
<f:if condition="{tax.taxClass.uid} == {totalTax.taxClass.uid}">
<cart:format.currency currencySign="{orderItem.currency}">{tax.tax}</cart:format.currency>
</f:if>
</f:for>
</td>
</f:for>
</tr>

<tr class="summary-shipping">
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_item.order_shipping"/>
{orderItem.orderShipping.name}
</td>
<td>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.orderShipping.net}</cart:format.currency>
</td>
<td>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.orderShipping.gross}</cart:format.currency>
</td>
<f:for each="{orderItem.orderTotalTax}" as="orderTotalTax">
<f:if condition="{orderItem.shipping}">
<tr class="summary-shipping">
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_item.order_shipping"/>
{orderItem.shipping.name}
</td>
<td>
<f:if condition="{0: orderTotalTax.orderTaxClass.id} == {0: orderItem.orderShipping.orderTaxClass.id}">
<f:then>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.orderShipping.orderTax.tax}</cart:format.currency>
</f:then>
<f:else>
&nbsp;
</f:else>
</f:if>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.shipping.net}</cart:format.currency>
</td>
</f:for>
</tr>
<td>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.shipping.gross}</cart:format.currency>
</td>
<f:render partial="Order/Show/TaxColumns"
arguments="{totalTaxes: orderItem.totalTax, taxClass: orderItem.shipping.taxClass, tax: orderItem.shipping.tax, currencySign: orderItem.currency}"/>
</tr>
</f:if>

<tr class="summary-payment">
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_item.order_payment"/>
{orderItem.orderPayment.name}
</td>
<td>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.orderPayment.net}</cart:format.currency>
</td>
<td>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.orderPayment.gross}</cart:format.currency>
</td>
<f:for each="{orderItem.orderTotalTax}" as="orderTotalTax">
<f:if condition="{orderItem.payment}">
<tr class="summary-payment">
<td colspan="5">
<f:translate key="tx_cart_domain_model_order_item.order_payment"/>
{orderItem.payment.name}
</td>
<td>
<f:if condition="{0: orderTotalTax.orderTaxClass.id} == {0: orderItem.orderPayment.orderTaxClass.id}">
<f:then>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.orderPayment.orderTax.tax}</cart:format.currency>
</f:then>
<f:else>
&nbsp;
</f:else>
</f:if>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.payment.net}</cart:format.currency>
</td>
</f:for>
</tr>
<td>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.payment.gross}</cart:format.currency>
</td>
<f:render partial="Order/Show/TaxColumns"
arguments="{totalTaxes: orderItem.totalTax, taxClass: orderItem.payment.taxClass, tax: orderItem.payment.tax, currencySign: orderItem.currency}"/>
</tr>
</f:if>

<tr class="summary-total-price">
<td colspan="5">
Expand All @@ -79,10 +67,10 @@
<td>
<cart:format.currency currencySign="{orderItem.currency}">{orderItem.totalGross}</cart:format.currency>
</td>
<f:for each="{orderItem.orderTotalTax}" as="orderTotalTax">
<f:for each="{orderItem.totalTax}" as="totalTax">
<td>
<cart:format.currency currencySign="{orderItem.currency}">{orderTotalTax.tax}</cart:format.currency>
<cart:format.currency currencySign="{orderItem.currency}">{totalTax.tax}</cart:format.currency>
</td>
</f:for>
</tr>
</html>
</html>
20 changes: 20 additions & 0 deletions Resources/Private/Partials/Order/Show/TaxColumns.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:cart="http://typo3.org/ns/Extcode/Cart/ViewHelpers"
data-namespace-typo3-fluid="true">

<f:comment>
One column per tax class of the order (totalTaxes), the tax is shown in the column of its tax class.
</f:comment>
<f:for each="{totalTaxes}" as="totalTax">
<td class="order-tax">
<f:if condition="{taxClass} && {totalTax.taxClass.uid} == {taxClass.uid}">
<f:then>
<cart:format.currency currencySign="{currencySign}">{tax}</cart:format.currency>
</f:then>
<f:else>
&nbsp;
</f:else>
</f:if>
</td>
</f:for>
</html>
Loading
Loading