[15/07/2024] On modifie la facture pour affichage de tous les montants HT, puis des taxes, puis des TTC.

This commit is contained in:
2024-07-15 23:04:57 +02:00
parent ca3d2f4621
commit a8a412d8ce
4 changed files with 66 additions and 31 deletions

View File

@@ -0,0 +1,5 @@
<?php
return array(
'Our brands' => 'Nos marques',
);

View File

@@ -1,6 +1,6 @@
<?php
return [
return array(
'+ View All' => '+ Tout voir',
'Latest' => 'Top des ventes',
];
'Latest' => 'Top des ventes - Laurent',
);

View File

@@ -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',

View File

@@ -252,6 +252,8 @@
</tr>
{$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}
<!-- Calcul du taux de TVA, pour la remise et pour les TVA //-->
{assign var="taux_tva" value={($totalItemsPriceWithTaxes / $totalItemsPriceWtTaxes) - 1}}
{assign var="discount_without_tax" value="{$DISCOUNT / (1 + $taux_tva)}"}
<table cellspacing="0" cellpadding="0" style="padding-top: 5mm;">
<col style="width: 60%; padding: 1mm;" />
<col style="width: 40%; padding: 1mm;" />
@@ -316,14 +323,12 @@
{hook name="invoice.after-payment-module" order=$order_id module_id=$PAYMENT_MODULE}
<h3>{intl l="Delivery module"}</h3>
<p>
<span>{loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}</span>
</p>
{hook name="invoice.after-delivery-module" order=$order_id module_id=$DELIVERY_MODULE}
</td>
<td>
<table class="table-3">
@@ -334,8 +339,26 @@
<td class="table-3-1"><p>{intl l="Total products without tax"}</p></td>
<td class="table-3-1 align-right"><p>{format_money number={$totalItemsPriceWtTaxes} currency_id=$CURRENCY}</p></td>
</tr>
{if $DISCOUNT != 0}
<tr>
<td class="table-3-1"><p>{intl l="Discount without tax"}</p></td>
<td class="table-3-1 align-right"><p>-{format_money number={$discount_without_tax} currency_id=$CURRENCY}</p></td>
</tr>
{/if}
<tr>
<td class="table-3-1"><p>{intl l="Postage without tax"}</p></td>
<td class="table-3-1 align-right"><p>{format_money number={$POSTAGE_UNTAXED} currency_id=$CURRENCY}</p></td>
</tr>
{assign var="tax_on_products" value={($totalItemsPriceWtTaxes - $discount_without_tax) * $taux_tva}}
{assign var="total_tax" value={$tax_on_products + $POSTAGE_TAX}}
<!-- Séparateur //-->
<tr><td colspan="2" class="table-3-1"></td></tr>
<!-- Détail des taxes -->
<tr>
<td colspan="2" class="table-3-1 section">Détail des taxes</td>
</tr>
{strip}
{capture name="tax"}
@@ -344,14 +367,19 @@
{foreach $prices as $price}
{$_price_taxe_= $_price_taxe_ + $price}
{/foreach}
<!-- TheCoreDev le 03/05/2020 : on affiche la taxe, même si nulle -->
<!-- {if $_price_taxe_ != 0}-->
{if $DISCOUNT != 0}
{$_price_taxe_ = $_price_taxe_ - $DISCOUNT}
{/if}
<!-- TheCoreDev le 03/05/2020 : on affiche la taxe, même si nulle -->
<!-- {if $_price_taxe_ != 0}-->
<!-- TVA applicable //-->
<tr>
<td class="table-3-2"><p>{$name}</p></td>
<td class="table-3-2 align-right"><p>{format_money number=$_price_taxe_ currency_id=$CURRENCY}</p></td>
<td class="table-3-2"><p>{intl l="Products"}<br>{$name}</p></td>
<td class="table-3-2 align-right"><p>{format_money number=$tax_on_products currency_id=$CURRENCY}</p></td>
</tr>
<!-- {/if}-->
<!--{/if}-->
{/foreach}
<!-- TVA sur frais de port //-->
{if $POSTAGE_TAX != 0}
<tr>
<td class="table-3-2"><p>{intl l="Postage"}<br>{$POSTAGE_TAX_RULE_TITLE}</p></td>
@@ -361,15 +389,12 @@
{/capture}
{/strip}
<!-- Détail des taxes -->
<tr>
<td colspan="2" class="table-3-1 section">Détail des taxes</td>
</tr>
<!-- Total taxes -->
{if $smarty.capture.tax ne ""}
{assign var="total_taxes" value=$TOTAL_TAX}
<tr>
<td class="table-3-1"><p>{intl l="Total taxes"}</p></td>
<td class="table-3-1 align-right"><p>{format_money number=$TOTAL_TAX currency_id=$CURRENCY}</p></td>
<td class="table-3-1 align-right"><p>{format_money number=$total_tax currency_id=$CURRENCY}</p></td>
</tr>
{$smarty.capture.tax nofilter}
{/if}
@@ -377,25 +402,26 @@
<!-- Séparateur //-->
<tr><td colspan="2" class="table-3-1"></td></tr>
<tr>
<td colspan="2" class="table-3-1 section">Montants TTC</td>
</tr>
<!-- Total produits TTC -->
<tr>
<td class="table-3-1" ><p>{intl l="Total with tax"}</p></td>
<td class="table-3-1 align-right"><p>{format_money number=$TOTAL_TAXED_AMOUNT-$POSTAGE currency_id=$CURRENCY}</p></td>
<td class="table-3-1" ><p>{intl l="Total products with tax"}</p></td>
<td class="table-3-1 align-right"><p>{format_money number=$totalItemsPriceWithTaxes currency_id=$CURRENCY}</p></td>
</tr>
<!-- Frais de livraison TTC -->
<tr>
<td class="table-3-1"><p>{intl l="Postage TTC"}</p></td>
<td class="table-3-1 align-right"><p>{format_money number=$POSTAGE currency_id=$CURRENCY}</p></td>
</tr>
<!-- Remise -->
{if $DISCOUNT}
{if $DISCOUNT != 0}
<tr>
<td class="table-3-1"><p>{intl l="Discount"}</p></td>
<td class="table-3-1 align-right"><p>-{format_money number=$DISCOUNT currency_id=$CURRENCY}</p></td>
</tr>
{/if}
<!-- Frais de livraison TTC -->
<tr>
<td class="table-3-1"><p>{intl l="Postage TTC"}</p></td>
<td class="table-3-1 align-right"><p>{format_money number=$POSTAGE currency_id=$CURRENCY}</p></td>
</tr>
<!-- Total -->
<tr>
<td class="table-3-1" style="background:#f6993c;"><h3 style="color:white;">{intl l="Total to pay"}</h3></td>