Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
commit
d4667abc63
11 files changed
+133
-104
No files matched your search
+7
-8
@@ -1331,6 +1331,9 @@ class CartCore extends ObjectModel
|
|||||||
else
|
else
|
||||||
$shipping_fees = 0;
|
$shipping_fees = 0;
|
||||||
|
|
||||||
|
if ($type == Cart::ONLY_SHIPPING)
|
||||||
|
return $shipping_fees;
|
||||||
|
|
||||||
if ($type == Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING)
|
if ($type == Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING)
|
||||||
$type = Cart::ONLY_PRODUCTS;
|
$type = Cart::ONLY_PRODUCTS;
|
||||||
|
|
||||||
@@ -1455,12 +1458,14 @@ class CartCore extends ObjectModel
|
|||||||
$wrapping_fees = 0;
|
$wrapping_fees = 0;
|
||||||
if ($this->gift)
|
if ($this->gift)
|
||||||
$wrapping_fees = Tools::convertPrice(Tools::ps_round($this->getGiftWrappingPrice($with_taxes), 2), Currency::getCurrencyInstance((int)$this->id_currency));
|
$wrapping_fees = Tools::convertPrice(Tools::ps_round($this->getGiftWrappingPrice($with_taxes), 2), Currency::getCurrencyInstance((int)$this->id_currency));
|
||||||
|
if ($type == Cart::ONLY_WRAPPING)
|
||||||
|
return $wrapping_fees;
|
||||||
|
|
||||||
$order_total_discount = 0;
|
$order_total_discount = 0;
|
||||||
if (!in_array($type, array(Cart::ONLY_SHIPPING, Cart::ONLY_PRODUCTS)) && CartRule::isFeatureActive())
|
if (!in_array($type, array(Cart::ONLY_SHIPPING, Cart::ONLY_PRODUCTS)) && CartRule::isFeatureActive())
|
||||||
{
|
{
|
||||||
// First, retrieve the cart rules associated to this "getOrderTotal"
|
// First, retrieve the cart rules associated to this "getOrderTotal"
|
||||||
if ($with_shipping)
|
if ($with_shipping || $type == Cart::ONLY_DISCOUNTS)
|
||||||
$cart_rules = $this->getCartRules(CartRule::FILTER_ACTION_ALL);
|
$cart_rules = $this->getCartRules(CartRule::FILTER_ACTION_ALL);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1486,7 +1491,7 @@ class CartCore extends ObjectModel
|
|||||||
foreach ($cart_rules as $cart_rule)
|
foreach ($cart_rules as $cart_rule)
|
||||||
{
|
{
|
||||||
// If the cart rule offers free shipping, add the shipping cost
|
// If the cart rule offers free shipping, add the shipping cost
|
||||||
if ($with_shipping && $cart_rule['obj']->free_shipping)
|
if (($with_shipping || $type == Cart::ONLY_DISCOUNTS) && $cart_rule['obj']->free_shipping)
|
||||||
$order_total_discount += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_SHIPPING, ($param_product ? $package : null), $use_cache), 2);
|
$order_total_discount += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_SHIPPING, ($param_product ? $package : null), $use_cache), 2);
|
||||||
|
|
||||||
// If the cart rule is a free gift, then add the free gift value only if the gift is in this package
|
// If the cart rule is a free gift, then add the free gift value only if the gift is in this package
|
||||||
@@ -1512,12 +1517,6 @@ class CartCore extends ObjectModel
|
|||||||
$order_total -= $order_total_discount;
|
$order_total -= $order_total_discount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type == Cart::ONLY_SHIPPING)
|
|
||||||
return $shipping_fees;
|
|
||||||
|
|
||||||
if ($type == Cart::ONLY_WRAPPING)
|
|
||||||
return $wrapping_fees;
|
|
||||||
|
|
||||||
if ($type == Cart::BOTH)
|
if ($type == Cart::BOTH)
|
||||||
$order_total += $shipping_fees + $wrapping_fees;
|
$order_total += $shipping_fees + $wrapping_fees;
|
||||||
|
|
||||||
|
|||||||
+19
-14
@@ -223,7 +223,7 @@ class CartRuleCore extends ObjectModel
|
|||||||
FROM `'._DB_PREFIX_.'cart_rule` cr
|
FROM `'._DB_PREFIX_.'cart_rule` cr
|
||||||
LEFT JOIN `'._DB_PREFIX_.'cart_rule_lang` crl ON (cr.`id_cart_rule` = crl.`id_cart_rule` AND crl.`id_lang` = '.(int)$id_lang.')
|
LEFT JOIN `'._DB_PREFIX_.'cart_rule_lang` crl ON (cr.`id_cart_rule` = crl.`id_cart_rule` AND crl.`id_lang` = '.(int)$id_lang.')
|
||||||
WHERE (
|
WHERE (
|
||||||
cr.`id_customer` = '.(int)$id_customer.'
|
cr.`id_customer` = '.(int)$id_customer.' OR cr.group_restriction = 1
|
||||||
'.($includeGeneric ? 'OR cr.`id_customer` = 0' : '').'
|
'.($includeGeneric ? 'OR cr.`id_customer` = 0' : '').'
|
||||||
)
|
)
|
||||||
AND cr.date_from < "'.date('Y-m-d H:i:s').'"
|
AND cr.date_from < "'.date('Y-m-d H:i:s').'"
|
||||||
@@ -232,20 +232,17 @@ class CartRuleCore extends ObjectModel
|
|||||||
'.($inStock ? 'AND cr.`quantity` > 0' : ''));
|
'.($inStock ? 'AND cr.`quantity` > 0' : ''));
|
||||||
|
|
||||||
// Remove cart rule that does not match the customer groups
|
// Remove cart rule that does not match the customer groups
|
||||||
if ($includeGeneric)
|
$customerGroups = Customer::getGroupsStatic($id_customer);
|
||||||
{
|
foreach ($result as $key => $cart_rule)
|
||||||
$customerGroups = Customer::getGroupsStatic($id_customer);
|
if ($cart_rule['group_restriction'])
|
||||||
foreach ($result as $key => $cart_rule)
|
{
|
||||||
if ($cart_rule['group_restriction'])
|
$cartRuleGroups = Db::getInstance()->executeS('SELECT id_group FROM '._DB_PREFIX_.'cart_rule_group WHERE id_cart_rule = '.(int)$cart_rule['id_cart_rule']);
|
||||||
{
|
foreach ($cartRuleGroups as $cartRuleGroup)
|
||||||
$cartRuleGroups = Db::getInstance()->getValue('SELECT id_group FROM '._DB_PREFIX_.'cart_rule_group WHERE id_cart_rule = '.(int)$cart_rule['id_cart_rule']);
|
if (in_array($cartRuleGroup['id_group'], $customerGroups))
|
||||||
foreach ($cartRuleGroups as $cartRuleGroup)
|
continue 2;
|
||||||
if (in_array($cartRuleGroups['id_group'], $customerGroups))
|
|
||||||
continue 2;
|
|
||||||
|
|
||||||
unset($result[$key]);
|
unset($result[$key]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($result as &$cart_rule)
|
foreach ($result as &$cart_rule)
|
||||||
if ($cart_rule['quantity_per_user'])
|
if ($cart_rule['quantity_per_user'])
|
||||||
@@ -867,7 +864,15 @@ class CartRuleCore extends ObjectModel
|
|||||||
|
|
||||||
// If it has the same tax application that you need, then it's the right value, whatever the product!
|
// If it has the same tax application that you need, then it's the right value, whatever the product!
|
||||||
if ($this->reduction_tax == $use_tax)
|
if ($this->reduction_tax == $use_tax)
|
||||||
|
{
|
||||||
|
// The reduction cannot exceed the products total, except when we do not want it to be limited (for the partial use calculation)
|
||||||
|
if ($filter != CartRule::FILTER_ACTION_ALL_NOCAP)
|
||||||
|
{
|
||||||
|
$cart_amount = $context->cart->getOrderTotal($use_tax, Cart::ONLY_PRODUCTS);
|
||||||
|
$reduction_amount = min($reduction_amount, $cart_amount);
|
||||||
|
}
|
||||||
$reduction_value += $prorata * $reduction_amount;
|
$reduction_value += $prorata * $reduction_amount;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($this->reduction_product > 0)
|
if ($this->reduction_product > 0)
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ abstract class PaymentModuleCore extends Module
|
|||||||
$values['tax_excl'] -= $values['tax_excl'] - $order->total_products;
|
$values['tax_excl'] -= $values['tax_excl'] - $order->total_products;
|
||||||
}
|
}
|
||||||
|
|
||||||
$order->addCartRule($cart_rule['obj']->id, $cart_rule['obj']->name, $values);
|
$order->addCartRule($cart_rule['obj']->id, $cart_rule['obj']->name, $values, 0, $cart_rule['obj']->free_shipping);
|
||||||
|
|
||||||
if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && !in_array($cart_rule['obj']->id, $cart_rule_used))
|
if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && !in_array($cart_rule['obj']->id, $cart_rule_used))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1027,7 +1027,7 @@ class OrderCore extends ObjectModel
|
|||||||
* @param int $id_order_invoice
|
* @param int $id_order_invoice
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function addCartRule($id_cart_rule, $name, $values, $id_order_invoice = 0)
|
public function addCartRule($id_cart_rule, $name, $values, $id_order_invoice = 0, $free_shipping = null)
|
||||||
{
|
{
|
||||||
$order_cart_rule = new OrderCartRule();
|
$order_cart_rule = new OrderCartRule();
|
||||||
$order_cart_rule->id_order = $this->id;
|
$order_cart_rule->id_order = $this->id;
|
||||||
@@ -1036,6 +1036,12 @@ class OrderCore extends ObjectModel
|
|||||||
$order_cart_rule->name = $name;
|
$order_cart_rule->name = $name;
|
||||||
$order_cart_rule->value = $values['tax_incl'];
|
$order_cart_rule->value = $values['tax_incl'];
|
||||||
$order_cart_rule->value_tax_excl = $values['tax_excl'];
|
$order_cart_rule->value_tax_excl = $values['tax_excl'];
|
||||||
|
if ($free_shipping === null)
|
||||||
|
{
|
||||||
|
$cart_rule = new CartRule($id_cart_rule);
|
||||||
|
$free_shipping = $cart_rule->free_shipping;
|
||||||
|
}
|
||||||
|
$order_cart_rule->free_shipping = (int)$free_shipping;
|
||||||
$order_cart_rule->add();
|
$order_cart_rule->add();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -346,6 +346,11 @@ class OrderInvoiceCore extends ObjectModel
|
|||||||
if ($this->useOneAfterAnotherTaxComputationMethod())
|
if ($this->useOneAfterAnotherTaxComputationMethod())
|
||||||
return $taxes_breakdown;
|
return $taxes_breakdown;
|
||||||
|
|
||||||
|
// No shipping breakdown if it's free!
|
||||||
|
foreach ($order->getCartRules() as $cart_rule)
|
||||||
|
if ($cart_rule['free_shipping'])
|
||||||
|
return $taxes_breakdown;
|
||||||
|
|
||||||
$shipping_tax_amount = $this->total_shipping_tax_incl - $this->total_shipping_tax_excl;
|
$shipping_tax_amount = $this->total_shipping_tax_incl - $this->total_shipping_tax_excl;
|
||||||
|
|
||||||
if ($shipping_tax_amount > 0)
|
if ($shipping_tax_amount > 0)
|
||||||
|
|||||||
@@ -1182,6 +1182,7 @@ CREATE TABLE `PREFIX_order_cart_rule` (
|
|||||||
`name` varchar(254) NOT NULL,
|
`name` varchar(254) NOT NULL,
|
||||||
`value` decimal(17,2) NOT NULL default '0.00',
|
`value` decimal(17,2) NOT NULL default '0.00',
|
||||||
`value_tax_excl` decimal(17,2) NOT NULL default '0.00',
|
`value_tax_excl` decimal(17,2) NOT NULL default '0.00',
|
||||||
|
`free_shipping` BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
PRIMARY KEY (`id_order_cart_rule`),
|
PRIMARY KEY (`id_order_cart_rule`),
|
||||||
KEY `id_order` (`id_order`),
|
KEY `id_order` (`id_order`),
|
||||||
KEY `id_cart_rule` (`id_cart_rule`)
|
KEY `id_cart_rule` (`id_cart_rule`)
|
||||||
|
|||||||
@@ -10,3 +10,13 @@ UPDATE `PREFIX_customer` c, `PREFIX_orders` o SET c.id_lang = o.id_lang WHERE c.
|
|||||||
|
|
||||||
UPDATE `PREFIX_quick_access` SET `link` = 'index.php?controller=AdminCartRules&addcart_rule' WHERE `link` = 'index.php?tab=AdminDiscounts&adddiscount';
|
UPDATE `PREFIX_quick_access` SET `link` = 'index.php?controller=AdminCartRules&addcart_rule' WHERE `link` = 'index.php?tab=AdminDiscounts&adddiscount';
|
||||||
|
|
||||||
|
ALTER TABLE `PREFIX_order_cart_rule` ADD `free_shipping` BOOLEAN NOT NULL DEFAULT FALSE AFTER `value_tax_excl`;
|
||||||
|
|
||||||
|
UPDATE `PREFIX_order_cart_rule` ocr, `PREFIX_cart_rule` cr SET ocr.free_shipping = 1 WHERE ocr.id_cart_rule = cr.id_cart_rule AND cr.free_shipping = 1;
|
||||||
|
|
||||||
|
UPDATE `PREFIX_orders` o, `PREFIX_order_cart_rule` ocr SET
|
||||||
|
o.`total_discounts` = o.total_discounts + o.`total_shipping_tax_incl`,
|
||||||
|
o.`total_discounts_tax_incl` = o.`total_discounts_tax_incl` + o.`total_shipping_tax_incl`,
|
||||||
|
o.`total_discounts_tax_excl` = o.`total_discounts_tax_excl` + o.`total_shipping_tax_excl`
|
||||||
|
WHERE o.id_order = ocr.id_order AND ocr.free_shipping = 1;
|
||||||
|
|
||||||
@@ -123,7 +123,8 @@ class StatsForecast extends Module
|
|||||||
$dataTable[$row['fix_date']] = $row;
|
$dataTable[$row['fix_date']] = $row;
|
||||||
|
|
||||||
$this->_html .= '<div>
|
$this->_html .= '<div>
|
||||||
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
|
<div class="blocStats">
|
||||||
|
<h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
|
||||||
<p>'.$this->l('All amounts are without taxes.').'</p>
|
<p>'.$this->l('All amounts are without taxes.').'</p>
|
||||||
<form id="granularity" action="'.Tools::safeOutput($ru).'#granularity" method="post">
|
<form id="granularity" action="'.Tools::safeOutput($ru).'#granularity" method="post">
|
||||||
<input type="hidden" name="submitGranularity" value="1" />
|
<input type="hidden" name="submitGranularity" value="1" />
|
||||||
@@ -300,30 +301,28 @@ class StatsForecast extends Module
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="separation"></div>
|
<div class="separation"></div>
|
||||||
<div class="blocConversion">
|
|
||||||
<span style="float:left;text-align:center;margin-right:10px; width:100px;">'.$this->l('Registered visitors').'</span>
|
|
||||||
<span style="float:left;text-align:center;margin-right:10px">
|
|
||||||
<img src="../modules/'.$this->name.'/next.png"> '.round(100 * $orders / max(1, $customers), 2).' % <img src="../modules/'.$this->name.'/next.png">
|
|
||||||
</span>
|
|
||||||
<span style="float:left;text-align:center;margin-right:10px">'.$this->l('orders').'</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="separation"></div>
|
|
||||||
|
|
||||||
<div class="blocConversion">
|
<div class="blocConversion">
|
||||||
<span style="float:left;text-align:center;margin-right:10px; width:100px;">'.$this->l('Visitors').'</span>
|
<span style="float:left;text-align:center;margin-right:10px; width:100px;">'.$this->l('Registered visitors').'</span>
|
||||||
<span style="float:left;text-align:center;margin-right:10px">
|
<span style="float:left;text-align:center;margin-right:10px">
|
||||||
<img src="../modules/'.$this->name.'/next.png"> '.round(100 * $orders / max(1, $visitors), 2).' % <img src="../modules/'.$this->name.'/next.png">
|
<img src="../modules/'.$this->name.'/next.png"> '.round(100 * $orders / max(1, $customers), 2).' % <img src="../modules/'.$this->name.'/next.png">
|
||||||
</span>
|
</span>
|
||||||
<span style="float:left;text-align:center;margin-right:10px">'.$this->l('orders').'</span>
|
<span style="float:left;text-align:center;margin-right:10px">'.$this->l('orders').'</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="separation"></div>
|
<div class="separation"></div>
|
||||||
<p>
|
<div class="blocConversion">
|
||||||
'.$this->l('Turn your visitors into money:').'
|
<span style="float:left;text-align:center;margin-right:10px; width:100px;">'.$this->l('Visitors').'</span>
|
||||||
<br />'.$this->l('Each visitor yields').' <b style="color:#000;">'.Tools::displayPrice($ca['ventil']['total'] / max(1, $visitors), $currency).'.</b>
|
<span style="float:left;text-align:center;margin-right:10px">
|
||||||
<br />'.$this->l('Each registered visitor yields').' <b style="color:#000;">'.Tools::displayPrice($ca['ventil']['total'] / max(1, $customers), $currency).'</b>.
|
<img src="../modules/'.$this->name.'/next.png"> '.round(100 * $orders / max(1, $visitors), 2).' % <img src="../modules/'.$this->name.'/next.png">
|
||||||
</p></div>';
|
</span>
|
||||||
|
<span style="float:left;text-align:center;margin-right:10px">'.$this->l('orders').'</span>
|
||||||
|
</div>
|
||||||
|
<div class="separation"></div>
|
||||||
|
<p>
|
||||||
|
'.$this->l('Turn your visitors into money:').'
|
||||||
|
<br />'.$this->l('Each visitor yields').' <b style="color:#000;">'.Tools::displayPrice($ca['ventil']['total'] / max(1, $visitors), $currency).'.</b>
|
||||||
|
<br />'.$this->l('Each registered visitor yields').' <b style="color:#000;">'.Tools::displayPrice($ca['ventil']['total'] / max(1, $customers), $currency).'</b>.
|
||||||
|
</p>
|
||||||
|
</div>';
|
||||||
|
|
||||||
$from = strtotime($employee->stats_date_from.' 00:00:00');
|
$from = strtotime($employee->stats_date_from.' 00:00:00');
|
||||||
$to = strtotime($employee->stats_date_to.' 23:59:59');
|
$to = strtotime($employee->stats_date_to.' 23:59:59');
|
||||||
@@ -332,7 +331,10 @@ class StatsForecast extends Module
|
|||||||
|
|
||||||
$this->_html .= '
|
$this->_html .= '
|
||||||
<br />';
|
<br />';
|
||||||
$this->_html .= '<div class="blocStats"><h2 class="icon-payment"><span></span>'.$this->l('Payment distribution').'</h2>
|
$this->_html .= '
|
||||||
|
<div class="blocStats">
|
||||||
|
<h2 class="icon-payment"><span></span>'.$this->l('Payment distribution').'</h2>
|
||||||
|
<p>'.$this->l('The amounts are <b>with</b> taxes, so you can get an estimation of the commission due to the payment method.').'</p>
|
||||||
<form id="cat" action="'.$ru.'#payment" method="post" >
|
<form id="cat" action="'.$ru.'#payment" method="post" >
|
||||||
<input type="hidden" name="submitIdZone" value="1" />
|
<input type="hidden" name="submitIdZone" value="1" />
|
||||||
'.$this->l('Zone:').' <select name="stats_id_zone" onchange="this.form.submit();">
|
'.$this->l('Zone:').' <select name="stats_id_zone" onchange="this.form.submit();">
|
||||||
@@ -490,7 +492,7 @@ class StatsForecast extends Module
|
|||||||
WHERE l.active = 1';
|
WHERE l.active = 1';
|
||||||
$languages = Db::getInstance()->executeS($sql);
|
$languages = Db::getInstance()->executeS($sql);
|
||||||
foreach ($languages as $language)
|
foreach ($languages as $language)
|
||||||
$langValues .= 'SUM(IF(o.id_lang = '.(int)$language['id_lang'].', total_products / o.conversion_rate, 0)) as '.pSQL($language['iso_code']).',';
|
$langValues .= 'SUM(IF(o.id_lang = '.(int)$language['id_lang'].', total_paid_tax_excl / o.conversion_rate, 0)) as '.pSQL($language['iso_code']).',';
|
||||||
$langValues = rtrim($langValues, ',');
|
$langValues = rtrim($langValues, ',');
|
||||||
|
|
||||||
if ($langValues)
|
if ($langValues)
|
||||||
@@ -516,18 +518,18 @@ class StatsForecast extends Module
|
|||||||
$ca['langprev'] = array();
|
$ca['langprev'] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT module, SUM(total_products / o.conversion_rate) as total, COUNT(*) as nb, AVG(total_products / o.conversion_rate) as cart
|
$sql = 'SELECT module, SUM(total_paid_tax_incl / o.conversion_rate) as total, COUNT(*) as nb, AVG(total_paid_tax_incl / o.conversion_rate) as cart
|
||||||
FROM `'._DB_PREFIX_.'orders` o
|
FROM `'._DB_PREFIX_.'orders` o
|
||||||
'.$join.'
|
'.$join.'
|
||||||
WHERE o.valid = 1
|
WHERE o.valid = 1
|
||||||
AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween().'
|
AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween().'
|
||||||
'.$where.'
|
'.$where.'
|
||||||
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').'
|
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').'
|
||||||
GROUP BY o.module
|
GROUP BY o.module
|
||||||
ORDER BY total DESC';
|
ORDER BY total DESC';
|
||||||
$ca['payment'] = Db::getInstance()->executeS($sql);
|
$ca['payment'] = Db::getInstance()->executeS($sql);
|
||||||
|
|
||||||
$sql = 'SELECT z.name, SUM(o.total_products / o.conversion_rate) as total, COUNT(*) as nb
|
$sql = 'SELECT z.name, SUM(o.total_paid_tax_excl / o.conversion_rate) as total, COUNT(*) as nb
|
||||||
FROM `'._DB_PREFIX_.'orders` o
|
FROM `'._DB_PREFIX_.'orders` o
|
||||||
LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_invoice = a.id_address
|
LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_invoice = a.id_address
|
||||||
LEFT JOIN `'._DB_PREFIX_.'country` c ON c.id_country = a.id_country
|
LEFT JOIN `'._DB_PREFIX_.'country` c ON c.id_country = a.id_country
|
||||||
@@ -539,7 +541,7 @@ class StatsForecast extends Module
|
|||||||
ORDER BY total DESC';
|
ORDER BY total DESC';
|
||||||
$ca['zones'] = Db::getInstance()->executeS($sql);
|
$ca['zones'] = Db::getInstance()->executeS($sql);
|
||||||
|
|
||||||
$sql = 'SELECT cu.name, SUM(o.total_products / o.conversion_rate) as total, COUNT(*) as nb
|
$sql = 'SELECT cu.name, SUM(o.total_paid_tax_excl / o.conversion_rate) as total, COUNT(*) as nb
|
||||||
FROM `'._DB_PREFIX_.'orders` o
|
FROM `'._DB_PREFIX_.'orders` o
|
||||||
LEFT JOIN `'._DB_PREFIX_.'currency` cu ON o.id_currency = cu.id_currency
|
LEFT JOIN `'._DB_PREFIX_.'currency` cu ON o.id_currency = cu.id_currency
|
||||||
'.$join.'
|
'.$join.'
|
||||||
@@ -551,7 +553,7 @@ class StatsForecast extends Module
|
|||||||
ORDER BY total DESC';
|
ORDER BY total DESC';
|
||||||
$ca['currencies'] = Db::getInstance()->executeS($sql);
|
$ca['currencies'] = Db::getInstance()->executeS($sql);
|
||||||
|
|
||||||
$sql = 'SELECT SUM(total_products / o.conversion_rate) as total, COUNT(*) AS nb
|
$sql = 'SELECT SUM(total_paid_tax_excl / o.conversion_rate) as total, COUNT(*) AS nb
|
||||||
FROM `'._DB_PREFIX_.'orders` o
|
FROM `'._DB_PREFIX_.'orders` o
|
||||||
WHERE o.valid = 1
|
WHERE o.valid = 1
|
||||||
AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween().'
|
AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween().'
|
||||||
|
|||||||
@@ -194,9 +194,6 @@
|
|||||||
<tr style="line-height:6px;background-color:{$bgcolor}" text-align="left">
|
<tr style="line-height:6px;background-color:{$bgcolor}" text-align="left">
|
||||||
<td style="line-height:3px;text-align:left;width:60%;vertical-align:top" colspan="{if !$tax_excluded_display}5{else}4{/if}">{$cart_rule.name}</td>
|
<td style="line-height:3px;text-align:left;width:60%;vertical-align:top" colspan="{if !$tax_excluded_display}5{else}4{/if}">{$cart_rule.name}</td>
|
||||||
<td>
|
<td>
|
||||||
{if $cart_rule.free_shipping}
|
|
||||||
{assign var="shipping_discount_tax_incl" value=$order_invoice->total_shipping_tax_incl}
|
|
||||||
{/if}
|
|
||||||
{if $tax_excluded_display}
|
{if $tax_excluded_display}
|
||||||
- {$cart_rule.value_tax_excl}
|
- {$cart_rule.value_tax_excl}
|
||||||
{else}
|
{else}
|
||||||
|
|||||||
@@ -88,31 +88,7 @@
|
|||||||
<td class="price" id="total_product">{displayPrice price=$total_products}</td>
|
<td class="price" id="total_product">{displayPrice price=$total_products}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
<tr class="cart_total_voucher" {if $total_discounts == 0}style="display: none;"{/if}>
|
<tr class="cart_total_voucher" {if $total_wrapping == 0}style="display:none"{/if}>
|
||||||
<td colspan="5">
|
|
||||||
{if $use_taxes}
|
|
||||||
{if $priceDisplay}
|
|
||||||
{if $display_tax_label}{l s='Total vouchers (tax excl.):'}{else}{l s='Total vouchers:'}{/if}
|
|
||||||
{else}
|
|
||||||
{if $display_tax_label}{l s='Total vouchers (tax incl.):'}{else}{l s='Total vouchers:'}{/if}
|
|
||||||
{/if}
|
|
||||||
{else}
|
|
||||||
{l s='Total vouchers:'}
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
<td class="price-discount price" id="total_discount">
|
|
||||||
{if $use_taxes}
|
|
||||||
{if $priceDisplay}
|
|
||||||
{displayPrice price=$total_discounts_tax_exc}
|
|
||||||
{else}
|
|
||||||
{displayPrice price=$total_discounts}
|
|
||||||
{/if}
|
|
||||||
{else}
|
|
||||||
{displayPrice price=$total_discounts_tax_exc}
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="cart_total_voucher" {if $total_wrapping == 0}style="display: none;"{/if}>
|
|
||||||
<td colspan="5">
|
<td colspan="5">
|
||||||
{if $use_taxes}
|
{if $use_taxes}
|
||||||
{if $priceDisplay}
|
{if $priceDisplay}
|
||||||
@@ -144,23 +120,47 @@
|
|||||||
{else}
|
{else}
|
||||||
{if $use_taxes}
|
{if $use_taxes}
|
||||||
{if $priceDisplay}
|
{if $priceDisplay}
|
||||||
<tr class="cart_total_delivery" {if $shippingCost <= 0} style="display:none;"{/if}>
|
<tr class="cart_total_delivery" {if $shippingCost <= 0} style="display:none"{/if}>
|
||||||
<td colspan="5">{if $display_tax_label}{l s='Total shipping (tax excl.):'}{else}{l s='Total shipping:'}{/if}</td>
|
<td colspan="5">{if $display_tax_label}{l s='Total shipping (tax excl.):'}{else}{l s='Total shipping:'}{/if}</td>
|
||||||
<td class="price" id="total_shipping">{displayPrice price=$shippingCostTaxExc}</td>
|
<td class="price" id="total_shipping">{displayPrice price=$shippingCostTaxExc}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{else}
|
{else}
|
||||||
<tr class="cart_total_delivery"{if $shippingCost <= 0} style="display:none;"{/if}>
|
<tr class="cart_total_delivery"{if $shippingCost <= 0} style="display:none"{/if}>
|
||||||
<td colspan="5">{if $display_tax_label}{l s='Total shipping (tax incl.):'}{else}{l s='Total shipping:'}{/if}</td>
|
<td colspan="5">{if $display_tax_label}{l s='Total shipping (tax incl.):'}{else}{l s='Total shipping:'}{/if}</td>
|
||||||
<td class="price" id="total_shipping" >{displayPrice price=$shippingCost}</td>
|
<td class="price" id="total_shipping" >{displayPrice price=$shippingCost}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
{else}
|
{else}
|
||||||
<tr class="cart_total_delivery"{if $shippingCost <= 0} style="display:none;"{/if}>
|
<tr class="cart_total_delivery"{if $shippingCost <= 0} style="display:none"{/if}>
|
||||||
<td colspan="5">{l s='Total shipping:'}</td>
|
<td colspan="5">{l s='Total shipping:'}</td>
|
||||||
<td class="price" id="total_shipping" >{displayPrice price=$shippingCostTaxExc}</td>
|
<td class="price" id="total_shipping" >{displayPrice price=$shippingCostTaxExc}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
<tr class="cart_total_voucher" {if $total_discounts == 0}style="display:none"{/if}>
|
||||||
|
<td colspan="5">
|
||||||
|
{if $use_taxes}
|
||||||
|
{if $priceDisplay}
|
||||||
|
{if $display_tax_label}{l s='Total vouchers (tax excl.):'}{else}{l s='Total vouchers:'}{/if}
|
||||||
|
{else}
|
||||||
|
{if $display_tax_label}{l s='Total vouchers (tax incl.):'}{else}{l s='Total vouchers:'}{/if}
|
||||||
|
{/if}
|
||||||
|
{else}
|
||||||
|
{l s='Total vouchers:'}
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
<td class="price-discount price" id="total_discount">
|
||||||
|
{if $use_taxes}
|
||||||
|
{if $priceDisplay}
|
||||||
|
{displayPrice price=$total_discounts_tax_exc*-1}
|
||||||
|
{else}
|
||||||
|
{displayPrice price=$total_discounts*-1}
|
||||||
|
{/if}
|
||||||
|
{else}
|
||||||
|
{displayPrice price=$total_discounts_tax_exc*-1}
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{if $use_taxes}
|
{if $use_taxes}
|
||||||
{if $priceDisplay && $total_tax != 0}
|
{if $priceDisplay && $total_tax != 0}
|
||||||
<tr class="cart_total_tax">
|
<tr class="cart_total_tax">
|
||||||
|
|||||||
@@ -100,23 +100,6 @@
|
|||||||
<td colspan="2" class="price" id="total_product">{displayPrice price=$total_products}</td>
|
<td colspan="2" class="price" id="total_product">{displayPrice price=$total_products}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
<tr class="cart_total_voucher" {if $total_discounts == 0}style="display:none"{/if}>
|
|
||||||
<td colspan="5">
|
|
||||||
{if $use_taxes && $display_tax_label}
|
|
||||||
{l s='Total vouchers (tax excl.):'}
|
|
||||||
{else}
|
|
||||||
{l s='Total vouchers:'}
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
<td colspan="2" class="price-discount price" id="total_discount">
|
|
||||||
{if $use_taxes && !$priceDisplay}
|
|
||||||
{assign var='total_discounts_negative' value=$total_discounts * -1}
|
|
||||||
{else}
|
|
||||||
{assign var='total_discounts_negative' value=$total_discounts_tax_exc * -1}
|
|
||||||
{/if}
|
|
||||||
{displayPrice price=$total_discounts_negative}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="cart_total_voucher" {if $total_wrapping == 0}style="display: none;"{/if}>
|
<tr class="cart_total_voucher" {if $total_wrapping == 0}style="display: none;"{/if}>
|
||||||
<td colspan="5">
|
<td colspan="5">
|
||||||
{if $use_taxes}
|
{if $use_taxes}
|
||||||
@@ -162,6 +145,27 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
<tr class="cart_total_voucher" {if $total_discounts == 0}style="display:none"{/if}>
|
||||||
|
<td colspan="5">
|
||||||
|
{if $display_tax_label}
|
||||||
|
{if $use_taxes && $priceDisplay == 0}
|
||||||
|
{l s='Total vouchers (tax incl.):'}
|
||||||
|
{else}
|
||||||
|
{l s='Total vouchers (tax excl.):'}
|
||||||
|
{/if}
|
||||||
|
{else}
|
||||||
|
{l s='Total vouchers:'}
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
<td colspan="2" class="price-discount price" id="total_discount">
|
||||||
|
{if $use_taxes}
|
||||||
|
{assign var='total_discounts_negative' value=$total_discounts * -1}
|
||||||
|
{else}
|
||||||
|
{assign var='total_discounts_negative' value=$total_discounts_tax_exc * -1}
|
||||||
|
{/if}
|
||||||
|
{displayPrice price=$total_discounts_negative}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{if $use_taxes}
|
{if $use_taxes}
|
||||||
<tr class="cart_total_price">
|
<tr class="cart_total_price">
|
||||||
<td colspan="5">{l s='Total (tax excl.):'}</td>
|
<td colspan="5">{l s='Total (tax excl.):'}</td>
|
||||||
|
|||||||
Reference in new issue
Block a user