fix conflict

This commit is contained in:
Marion Muszynski 2016-10-12 18:15:01 +02:00
commit 14a7368a90
2 changed files with 29 additions and 28 deletions

View File

@ -377,7 +377,7 @@ class Paybox extends PaymentModule
if ($count_cards) {
$refabonne = $customer->email.((int)$count_cards+1);
}
$num_value = (int)$values["n"].'XXXXX'.(int)$values["j"];
$num_value = $values["n"].'XXXXX'.$values["j"];
$save = Db::getInstance()->execute('
INSERT INTO `ps_paybox_customer_agreement`
(`id_customer`,`refabonne`,`handle`,`value`,`date`,`payment_type`)

View File

@ -14,7 +14,7 @@ class AdminStatsLogistic extends AdminTab {
$this->date_expe_begin = date('Y-m-d');
$this->date_expe_end = date('Y-m-d');
if (!empty($_GET['date_begin'])) {
$this->date_begin = $_GET['date_begin'];
}
@ -54,6 +54,7 @@ class AdminStatsLogistic extends AdminTab {
$result[(int)$sale['id_sale']] = array(
/*'name' => $ps->title[2],
'date' => $ps->date_start,*/
'id' => $sale['id_sale'],
'name' => $sale['title'],
'date' => $sale['date_start'],
'ca_ttc' => 0,
@ -236,7 +237,7 @@ class AdminStatsLogistic extends AdminTab {
}
}
}
public function display() {
global $currentIndex, $cookie;
$date = Configuration::get('MAJ_STAT_LOGISTIC');
@ -295,7 +296,7 @@ class AdminStatsLogistic extends AdminTab {
</script>
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/privatesales_livestats/jquery-ui-fr.js"></script>';
echo
echo
'<fieldset>
<form method="GET" action="'.$currentIndex.'">'
.'<span class="form-group">'
@ -316,7 +317,7 @@ class AdminStatsLogistic extends AdminTab {
$stats = $this->getStats();
$poles = array();
for ($i=0; $i < 6; $i++) {
for ($i=0; $i < 6; $i++) {
$poles[] = array(
'recap' => array(
'quantity' => 0,
@ -376,7 +377,7 @@ class AdminStatsLogistic extends AdminTab {
$total_quantity += $stat['quantity'];
}
$total_colis = $this->getTotalColis();
echo '
<h2 style="margin-top:15px">Stats de la logistique</h2>
<table class="table" style="width:100%; margin-top:15px">
@ -529,16 +530,16 @@ class AdminStatsLogistic extends AdminTab {
public function getStats() {
return Db::getInstance()->executeS('
SELECT
e.`id_employee`,
e.`email`,
e.`lastname`,
e.`id_employee`,
e.`email`,
e.`lastname`,
e.`firstname`,
SUM(s.`nb_product`) AS `nb_product`,
SUM(s.`quantity`) AS `quantity`,
SUM(s.`nb_package`) AS `nb_package`
SUM(s.`nb_package`) AS `nb_package`
FROM `'._DB_PREFIX_.'stats_logistic` s
LEFT JOIN `'._DB_PREFIX_.'employee` e USING(`id_employee`)
WHERE s.`date` BETWEEN "'.pSQL($this->date_begin).'" AND "'.pSQL($this->date_end).'"
LEFT JOIN `'._DB_PREFIX_.'employee` e USING(`id_employee`)
WHERE s.`date` BETWEEN "'.pSQL($this->date_begin).'" AND "'.pSQL($this->date_end).'"
GROUP BY s.`id_employee`
');
}
@ -546,7 +547,7 @@ class AdminStatsLogistic extends AdminTab {
public function getTotalColis() {
return Db::getInstance()->getValue('
SELECT
SUM(s.`nb_package`) AS `nb_package`
SUM(s.`nb_package`) AS `nb_package`
FROM `'._DB_PREFIX_.'stats_logistic` s
WHERE s.`date` BETWEEN "'.pSQL($this->date_begin).'" AND "'.pSQL($this->date_end).'"
');
@ -557,15 +558,15 @@ class AdminStatsLogistic extends AdminTab {
SELECT COUNT(o.`id_order`)
FROM `'._DB_PREFIX_.'orders` o
LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON (oh.`id_order` = o.`id_order`)
WHERE o.`date_add` < DATE_SUB("'.pSQL($this->date_stock).'",INTERVAL '.((int)$day-1).' DAY)
AND oh.`id_order_state` = '.(int)$state.'
WHERE o.`date_add` < DATE_SUB("'.pSQL($this->date_stock).'",INTERVAL '.((int)$day-1).' DAY)
AND oh.`id_order_state` = '.(int)$state.'
AND oh.`id_order_history` = (SELECT MAX(`id_order_history`) FROM `'._DB_PREFIX_.'order_history` moh WHERE moh.`id_order` = o.`id_order` GROUP BY moh.`id_order`)
-- AND
-- AND
-- (
-- SELECT `id_order_state`
-- SELECT `id_order_state`
-- FROM '._DB_PREFIX_.'order_history oh
-- WHERE o.id_order = oh.id_order
-- ORDER BY id_order_history DESC
-- ORDER BY id_order_history DESC
-- LIMIT 1
-- ) = '.(int)$state.'
');
@ -573,15 +574,15 @@ class AdminStatsLogistic extends AdminTab {
public function getSaleDetails($product_ids) {
return Db::getInstance()->ExecuteS('
SELECT od.*, rr.`id_reason`, pws.`id_employee`, pws.`shipping_number`,
SELECT od.*, rr.`id_reason`, pws.`id_employee`, pws.`shipping_number`,
ROUND(((od.`product_price` * (1 - od.`reduction_percent` / 100) - od.`reduction_amount`) * (1 - od.`group_reduction` / 100) * (1 + od.`tax_rate` / 100)), 6) AS `price`
FROM `'._DB_PREFIX_.'order_detail` od
FROM `'._DB_PREFIX_.'order_detail` od
-- LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = od.`id_order`)
LEFT JOIN `'._DB_PREFIX_.'order_slip` os ON (os.`id_order` = od.`id_order`)
LEFT JOIN `'._DB_PREFIX_.'lapostews` pws ON (pws.`id_order_detail` = od.`id_order_detail`)
LEFT JOIN `'._DB_PREFIX_.'refundreason` rr ON (rr.`id_order_slip` = os.`id_order_slip`)
WHERE od.`product_id` IN ('.implode(',', $product_ids).')
-- AND o.`valid` = 1
WHERE od.`product_id` IN ('.implode(',', $product_ids).')
-- AND o.`valid` = 1
-- AND od.`product_quantity_refunded`>0
ORDER BY rr.`id_reason`
');
@ -597,13 +598,13 @@ class AdminStatsLogistic extends AdminTab {
public function getShippingDetails() {
return Db::getInstance()->ExecuteS('
SELECT pws.`id_order_detail`, pws.`shipping_number`, pws.`date_add`, pws.`quantity`, e.`email` AS `poste`, od.`id_order`, od.`product_id`, od.`product_attribute_id`, od.`product_name`, psc.`id_sale`, od.`product_quantity`,
SELECT pws.`id_order_detail`, pws.`shipping_number`, pws.`date_add`, pws.`quantity`, e.`email` AS `poste`, od.`id_order`, od.`product_id`, od.`product_attribute_id`, od.`product_name`, psc.`id_sale`, od.`product_quantity`,
ROUND(((od.`product_price` * (1 - od.`reduction_percent` / 100) - od.`reduction_amount`) * (1 - od.`group_reduction` / 100) * (1 + od.`tax_rate` / 100)), 6) AS `price`
FROM `'._DB_PREFIX_.'lapostews` pws
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = pws.`id_order_detail`)
LEFT JOIN `'._DB_PREFIX_.'employee` e ON (e.`id_employee` = pws.`id_employee`)
LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` psc ON (psc.`id_product` = od.`product_id`)
WHERE pws.`date_add` BETWEEN "'.pSQL($this->date_expe_begin).'" AND "'.pSQL($this->date_expe_end).'"
WHERE pws.`date_add` BETWEEN "'.pSQL($this->date_expe_begin).'" AND "'.pSQL($this->date_expe_end).'"
ORDER BY pws.`date_add` ASC
');
}
@ -614,7 +615,7 @@ class AdminStatsLogistic extends AdminTab {
FROM `'._DB_PREFIX_.'privatesale` p
LEFT JOIN `ps_privatesale_category` c ON (c.`id_sale` = p.`id_sale`)
LEFT JOIN `ps_category_lang` l ON (l.`id_category` = p.`id_category`)
WHERE p.`date_start` BETWEEN "'.pSQL($this->date_export_begin).'" AND "'.pSQL($this->date_export_end).'"
WHERE p.`date_start` BETWEEN "'.pSQL($this->date_export_begin).'" AND "'.pSQL($this->date_export_end).'"
AND l.`id_lang` = '. (int) Context::getContext()->language->id.'
');
}
@ -634,7 +635,7 @@ class AdminStatsLogistic extends AdminTab {
$product_ids = array();
foreach(Db::getInstance()->ExecuteS('
SELECT DISTINCT `id_product`
FROM `'._DB_PREFIX_.'product_ps_cache`
FROM `'._DB_PREFIX_.'product_ps_cache`
WHERE `id_sale`='.(int)$id_sale.'
') as $row ) {
$product_ids[] = (int) $row['id_product'];
@ -680,7 +681,7 @@ class AdminStatsLogistic extends AdminTab {
$delim = ';';
$row_1 = array("","","","","","","","");
$row_2 = array("Marque","Date de Debut","CA produit TTC","CA remb TTC","% remb valeur","Quantite vendue","Quantite remb","% remb volume");
$row_2 = array("Vente","Marque","Date de Debut","CA produit TTC","CA remb TTC","% remb valeur","Quantite vendue","Quantite remb","% remb volume");
$reasons = array();
$reasons[] = array(
@ -769,7 +770,7 @@ class AdminStatsLogistic extends AdminTab {
foreach ($row as $k => $value) {
if (is_array($value)){
foreach ($value as $key => $val) {
$data[] = $val;
$data[] = $val;
}
} else {
$data[] = $value;