[-] Core: Fix cache issue and order slip pdf generation

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17902 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-10-22 12:40:15 +00:00
parent 6c09e8328d
commit 20ac37e6bb
13 changed files with 96 additions and 37 deletions
+3 -3
View File
@@ -381,7 +381,7 @@ class OrderInvoiceCore extends ObjectModel
public function getEcoTaxTaxesBreakdown()
{
$res = Db::getInstance()->executeS('
SELECT `ecotax_tax_rate` as `rate`, SUM(`ecotax`) as `ecotax_tax_excl`, SUM(`ecotax`) as `ecotax_tax_incl`, `product_quantity`
SELECT `ecotax_tax_rate` as `rate`, SUM(`ecotax` * `product_quantity`) as `ecotax_tax_excl`, SUM(`ecotax` * `product_quantity`) as `ecotax_tax_incl`
FROM `'._DB_PREFIX_.'order_detail`
WHERE `id_order` = '.(int)$this->id_order.'
AND `id_order_invoice` = '.(int)$this->id.'
@@ -391,8 +391,8 @@ class OrderInvoiceCore extends ObjectModel
if ($res)
foreach ($res as &$row)
{
$row['ecotax_tax_incl'] = Tools::ps_round(($row['ecotax_tax_excl'] * $row['product_quantity']) + ($row['ecotax_tax_excl'] * $row['product_quantity'] * $row['rate'] / 100), 2);
$row['ecotax_tax_excl'] = Tools::ps_round($row['ecotax_tax_excl'] * $row['product_quantity'], 2);
$row['ecotax_tax_incl'] = Tools::ps_round($row['ecotax_tax_excl'] + ($row['ecotax_tax_excl'] * $row['rate'] / 100), 2);
$row['ecotax_tax_excl'] = Tools::ps_round($row['ecotax_tax_excl'], 2);
}
return $res;
}