From a8a412d8ce8e34320f1c687849f44ef692cffe2c Mon Sep 17 00:00:00 2001 From: TheCoreDev Date: Mon, 15 Jul 2024 23:04:57 +0200 Subject: [PATCH] [15/07/2024] On modifie la facture pour affichage de tous les montants HT, puis des taxes, puis des TTC. --- .../I18n/frontOffice/default/fr_FR.php | 5 ++ .../I18n/frontOffice/default/fr_FR.php | 6 +- templates/pdf/default2020/I18n/fr_FR.php | 4 + templates/pdf/default2020/invoice.html | 82 ++++++++++++------- 4 files changed, 66 insertions(+), 31 deletions(-) create mode 100644 local/modules/BrandsOnHome/I18n/frontOffice/default/fr_FR.php diff --git a/local/modules/BrandsOnHome/I18n/frontOffice/default/fr_FR.php b/local/modules/BrandsOnHome/I18n/frontOffice/default/fr_FR.php new file mode 100644 index 00000000..c85aeb64 --- /dev/null +++ b/local/modules/BrandsOnHome/I18n/frontOffice/default/fr_FR.php @@ -0,0 +1,5 @@ + 'Nos marques', +); diff --git a/local/modules/HookProductsNew/I18n/frontOffice/default/fr_FR.php b/local/modules/HookProductsNew/I18n/frontOffice/default/fr_FR.php index 4c0449ee..172df194 100644 --- a/local/modules/HookProductsNew/I18n/frontOffice/default/fr_FR.php +++ b/local/modules/HookProductsNew/I18n/frontOffice/default/fr_FR.php @@ -1,6 +1,6 @@ '+ Tout voir', - 'Latest' => 'Top des ventes', -]; + 'Latest' => 'Top des ventes - Laurent', +); diff --git a/templates/pdf/default2020/I18n/fr_FR.php b/templates/pdf/default2020/I18n/fr_FR.php index fa482c45..e970cf0b 100755 --- a/templates/pdf/default2020/I18n/fr_FR.php +++ b/templates/pdf/default2020/I18n/fr_FR.php @@ -7,6 +7,7 @@ return array( 'Delivery address' => 'Adresse de livraison', 'Delivery module' => 'Module de livraison', 'Discount' => 'Remise', + 'Discount without tax' => 'Remise HT', 'Email: ' => 'Email :', 'INVOICE' => 'FACTURE', 'Invoice REF' => 'Numéro de facture', @@ -16,13 +17,16 @@ return array( 'Phone: ' => 'Tél.: ', 'Postage' => 'Frais de livraison', 'Postage TTC' => 'Frais de livraison TTC', + 'Postage without tax' => 'Frais de livraison HT', 'Product' => 'Produit', 'Product ref : ' => 'Réf. produit : ', + 'Products' => 'Matériel', 'Quantity' => 'Quantité', 'Ref' => 'Réf.', 'Tax' => 'Taxe', 'Taxed total' => 'Total TTC', 'Total' => 'Total', + 'Total products with tax' => 'Total matériel TTC', 'Total products without tax' => 'Total matériel HT', 'Total taxes' => 'Total taxes', 'Total to pay' => 'Total à payer', diff --git a/templates/pdf/default2020/invoice.html b/templates/pdf/default2020/invoice.html index 644db834..92960bd1 100644 --- a/templates/pdf/default2020/invoice.html +++ b/templates/pdf/default2020/invoice.html @@ -252,6 +252,8 @@ {$totalItemsPriceWtTaxes = 0} + {$totalItemsPriceWithTaxes = 0} + {$totalItemsTax = 0} {loop type="order_product" name="order-products" order=$ID} {if $WAS_IN_PROMO == 1} @@ -267,6 +269,7 @@ {/if} {$totalItemsPriceWtTaxes = $totalItemsPriceWtTaxes + ($realPrice * $QUANTITY)} + {$totalItemsPriceWithTaxes = $totalItemsPriceWithTaxes + ($realTaxedPrice * $QUANTITY)} {$taxes[{$TAX_RULE_TITLE}][] = $realTax * $QUANTITY} @@ -297,6 +300,10 @@ {hook name="invoice.after-products" order=$order_id} + + {assign var="taux_tva" value={($totalItemsPriceWithTaxes / $totalItemsPriceWtTaxes) - 1}} + {assign var="discount_without_tax" value="{$DISCOUNT / (1 + $taux_tva)}"} + @@ -316,14 +323,12 @@ {hook name="invoice.after-payment-module" order=$order_id module_id=$PAYMENT_MODULE} -

{intl l="Delivery module"}

{loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}

{hook name="invoice.after-delivery-module" order=$order_id module_id=$DELIVERY_MODULE} -
@@ -334,24 +339,47 @@ + {if $DISCOUNT != 0} + + + + + {/if} + + + + + + {assign var="tax_on_products" value={($totalItemsPriceWtTaxes - $discount_without_tax) * $taux_tva}} + {assign var="total_tax" value={$tax_on_products + $POSTAGE_TAX}} + + + + + {strip} {capture name="tax"} {foreach $taxes as $name=>$prices} - {assign var="_price_taxe_" value="0"} - {foreach $prices as $price} - {$_price_taxe_= $_price_taxe_ + $price} - {/foreach} - - - - - - - + {assign var="_price_taxe_" value="0"} + {foreach $prices as $price} + {$_price_taxe_= $_price_taxe_ + $price} + {/foreach} + {if $DISCOUNT != 0} + {$_price_taxe_ = $_price_taxe_ - $DISCOUNT} + {/if} + + + + + + + + {/foreach} + {if $POSTAGE_TAX != 0} @@ -361,15 +389,12 @@ {/capture} {/strip} - - - - {if $smarty.capture.tax ne ""} + {assign var="total_taxes" value=$TOTAL_TAX} - + {$smarty.capture.tax nofilter} {/if} @@ -377,25 +402,26 @@ + + + - - + + - - - - - - - - {if $DISCOUNT} + {if $DISCOUNT != 0} {/if} + + + + +

{intl l="Total products without tax"}

{format_money number={$totalItemsPriceWtTaxes} currency_id=$CURRENCY}

{intl l="Discount without tax"}

-{format_money number={$discount_without_tax} currency_id=$CURRENCY}

{intl l="Postage without tax"}

{format_money number={$POSTAGE_UNTAXED} currency_id=$CURRENCY}

Détail des taxes

{$name}

{format_money number=$_price_taxe_ currency_id=$CURRENCY}

{intl l="Products"}
{$name}

{format_money number=$tax_on_products currency_id=$CURRENCY}

{intl l="Postage"}
{$POSTAGE_TAX_RULE_TITLE}

Détail des taxes

{intl l="Total taxes"}

{format_money number=$TOTAL_TAX currency_id=$CURRENCY}

{format_money number=$total_tax currency_id=$CURRENCY}

Montants TTC

{intl l="Total with tax"}

{format_money number=$TOTAL_TAXED_AMOUNT-$POSTAGE currency_id=$CURRENCY}

{intl l="Total products with tax"}

{format_money number=$totalItemsPriceWithTaxes currency_id=$CURRENCY}

{intl l="Postage TTC"}

{format_money number=$POSTAGE currency_id=$CURRENCY}

{intl l="Discount"}

-{format_money number=$DISCOUNT currency_id=$CURRENCY}

{intl l="Postage TTC"}

{format_money number=$POSTAGE currency_id=$CURRENCY}

{intl l="Total to pay"}