[-] PDF : Bug Fixed #PSCFV-2724 - Incorrect SQL query for ecotax breakdown
This commit is contained in:
@@ -349,11 +349,13 @@ class OrderInvoiceCore extends ObjectModel
|
||||
public function getEcoTaxTaxesBreakdown()
|
||||
{
|
||||
return Db::getInstance()->executeS('
|
||||
SELECT `ecotax_tax_rate`, SUM(`ecotax`) as `ecotax_tax_excl`, SUM(`ecotax`) as `ecotax_tax_incl`
|
||||
SELECT `ecotax_tax_rate` as `rate`, SUM(`ecotax`) as `ecotax_tax_excl`, SUM(`ecotax`) as `ecotax_tax_incl`
|
||||
FROM `'._DB_PREFIX_.'order_detail`
|
||||
WHERE `id_order` = '.(int)$this->id_order.'
|
||||
AND `id_order_invoice` = '.(int)$this->id
|
||||
AND `id_order_invoice` = '.(int)$this->id.'
|
||||
GROUP BY `ecotax_tax_rate`'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,6 +62,15 @@
|
||||
<td style="width: 20%; text-align: right;">{displayPrice currency=$order->id_currency price=$shipping_tax_infos.total_amount}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
{foreach $ecotax_tax_breakdown as $ecotax_tax_infos}
|
||||
<tr style="line-height:6px;background-color:{cycle values='#FFF,#DDD'};">
|
||||
<td style="width: 30%">{l s='Ecotax' pdf='true'}</td>
|
||||
<td style="width: 20%; text-align: right;">{$ecotax_tax_infos.rate} %</td>
|
||||
<td style="width: 20%; text-align: right;">{displayPrice currency=$order->id_currency price=$ecotax_tax_infos.ecotax_tax_excl}</td>
|
||||
<td style="width: 20%; text-align: right;">{displayPrice currency=$order->id_currency price=($ecotax_tax_infos.ecotax_tax_incl - $ecotax_tax_infos.ecotax_tax_excl)}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user