fix conflict
This commit is contained in:
commit
60577f145a
@ -1767,23 +1767,25 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor=
|
||||
}
|
||||
|
||||
private function _send_credit_mail($params) {
|
||||
Mail::Send(
|
||||
$params['id_lang'],
|
||||
'invite-credit',
|
||||
Mail::l('Congratulations!'),
|
||||
array(
|
||||
'{firstname}' => $params['firstname'],
|
||||
'{lastname}' => $params['lastname'],
|
||||
'{credit}' => $params['credit'],
|
||||
),
|
||||
$params['email'],
|
||||
$params['firstname'].' '.$params['lastname'],
|
||||
strval(Configuration::get('PS_SHOP_EMAIL')),
|
||||
strval(Configuration::get('PS_SHOP_NAME')),
|
||||
NULL,
|
||||
NULL,
|
||||
dirname(__FILE__).'/mails/'
|
||||
);
|
||||
if(!preg_match("/bebeboutik.com/i", $params['email'])) {
|
||||
Mail::Send(
|
||||
$params['id_lang'],
|
||||
'invite-credit',
|
||||
Mail::l('Congratulations!'),
|
||||
array(
|
||||
'{firstname}' => $params['firstname'],
|
||||
'{lastname}' => $params['lastname'],
|
||||
'{credit}' => $params['credit'],
|
||||
),
|
||||
$params['email'],
|
||||
$params['firstname'].' '.$params['lastname'],
|
||||
strval(Configuration::get('PS_SHOP_EMAIL')),
|
||||
strval(Configuration::get('PS_SHOP_NAME')),
|
||||
NULL,
|
||||
NULL,
|
||||
dirname(__FILE__).'/mails/'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function _send_loyalty_mail($params) {
|
||||
|
@ -654,6 +654,15 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
$employees[(int) $row['id_employee']] = $row['firstname'].' '.$row['lastname'];
|
||||
}
|
||||
|
||||
$sale_shipping = array();
|
||||
foreach(Db::getInstance()->ExecuteS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'privatesale_shipping_sale`
|
||||
WHERE 1
|
||||
') as $ss) {
|
||||
$sale_shipping[$ss['id_sale']] = $ss['id_shipping'];
|
||||
}
|
||||
|
||||
//ANTADIS
|
||||
echo '<fieldset class="bg-grey" style="margin-top:15px">';
|
||||
echo '<legend>Tri des ventes</legend>';
|
||||
@ -757,7 +766,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
type: "GET",
|
||||
data: "id_sale=" + id_sale + "&position=" + diff +"&updatePositionDrag",
|
||||
success: function(html) {
|
||||
var loader = "<p class=\"text-align:center\"><img src=\"../img/loader.gif\" /></p>";
|
||||
var loader = "<p style=\"text-align:center\"><img style=\"display:inline-block;\" src=\"../img/loader_payment.gif\" /></p>";
|
||||
$(".list_vente").html(loader);
|
||||
ajax_query();
|
||||
}
|
||||
@ -789,6 +798,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
<th>'.$this->l('Employee').'</th>
|
||||
<th>'.$this->l('FR').'</th>
|
||||
<th>'.$this->l('ES').'</th>
|
||||
<th>'.$this->l('Shipping').'</th>
|
||||
<th>'.$this->l('News').'</th>
|
||||
<th>'.$this->l('Position').'</th>
|
||||
<th style="width: '.($export? '68': '55').'px;">'.$this->l('Actions').'</th>
|
||||
@ -828,6 +838,8 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
<td '.(in_array('fr', $sale->versions) ? 'class="green"' : 'class="red"').'>FR</td>
|
||||
<td '.(in_array('es', $sale->versions) ? 'class="green"' : 'class="red"').'>ES</td>
|
||||
|
||||
<td>'.(isset($sale_shipping[(int) $sale->id])? ($sale_shipping[(int) $sale->id] == 1? 'Philea': ''): '').'</td>
|
||||
|
||||
<td>'. $sale->forward_news .'</td>
|
||||
|
||||
<td class="position">';
|
||||
|
@ -1,6 +1,12 @@
|
||||
<h4>{l s='Delivery Delay' mod='privatesales_delay'}</h4>
|
||||
{foreach from=$delivery_date item=date}
|
||||
<p>
|
||||
<b style="color: #e26ea2;">{$date.name}</b> : {l s='Date de réception prévue entre le' mod='privatesales_delay'} <b>{$date.date_start|date_format:'%d/%m/%Y'}</b> {l s='et le' mod='privatesales_delay'} <b>{$date.date_end|date_format:'%d/%m/%Y'}</b>
|
||||
</p>
|
||||
{/foreach}
|
||||
{foreach from=$delivery_date key=k item=date}
|
||||
{if $k == 5}
|
||||
<p>
|
||||
<b style="color: #e26ea2;">{$date.name}</b> : {l s='Date de réception prévue avant le' mod='privatesales_delay'} <b>24/12/{$date.date_start|date_format:'%Y'}</b>
|
||||
</p>
|
||||
{else}
|
||||
<p>
|
||||
<b style="color: #e26ea2;">{$date.name}</b> : {l s='Date de réception prévue entre le' mod='privatesales_delay'} <b>{$date.date_start|date_format:'%d/%m/%Y'}</b> {l s='et le' mod='privatesales_delay'} <b>{$date.date_end|date_format:'%d/%m/%Y'}</b>
|
||||
</p>
|
||||
{/if}
|
||||
{/foreach}
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
include_once(_PS_ROOT_DIR_.'/modules/privatesales/Sale.php');
|
||||
|
||||
class PrivateSales_Delay extends Module
|
||||
class PrivateSales_Delay extends Module
|
||||
{
|
||||
public function __construct()
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'privatesales_delay';
|
||||
$this->tab = 'pricing_promotion';
|
||||
@ -146,7 +146,7 @@ class PrivateSales_Delay extends Module
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
public function hookdeliveryDelay($params)
|
||||
public function hookdeliveryDelay($params)
|
||||
{
|
||||
global $smarty, $cookie;
|
||||
|
||||
@ -163,7 +163,12 @@ class PrivateSales_Delay extends Module
|
||||
$products = $order->getProducts();
|
||||
$products = SaleDelay::associateDelay($products);
|
||||
$delays = array_keys($products);
|
||||
$delivery_date = SaleDelay::getDeliveryDate($delays, $cookie->id_lang, null, true);
|
||||
if ($order!=null) {
|
||||
$date = new DateTime($order->date_add);
|
||||
} else {
|
||||
$date = new DateTime();
|
||||
}
|
||||
$delivery_date = SaleDelay::getDeliveryDate($delays, $cookie->id_lang, $date, true);
|
||||
|
||||
$smarty->assign(array(
|
||||
'delivery_date' => $delivery_date
|
||||
|
@ -10,14 +10,14 @@ $_SERVER['SERVER_NAME'] = 'www.bebeboutik.com';
|
||||
include dirname(__FILE__).'/../../config/config.inc.php';
|
||||
include dirname(__FILE__).'/../../modules/privatesales/Sale.php';
|
||||
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'product_ps_cache` (
|
||||
SELECT `id_product`, `id_sale`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale_category` c
|
||||
ON p.`id_category_default` = c.`id_category`
|
||||
)
|
||||
');
|
||||
// Db::getInstance()->ExecuteS('
|
||||
// INSERT IGNORE INTO `'._DB_PREFIX_.'product_ps_cache` (
|
||||
// SELECT `id_product`, `id_sale`
|
||||
// FROM `'._DB_PREFIX_.'product` p
|
||||
// LEFT JOIN `'._DB_PREFIX_.'privatesale_category` c
|
||||
// ON p.`id_category_default` = c.`id_category`
|
||||
// )
|
||||
// ');
|
||||
|
||||
// echo date('Y-m-d', strtotime(date('Y-m-d 00:00:00').' - '.(int) $argv[1].' day'))."\n";
|
||||
|
||||
@ -57,7 +57,7 @@ foreach ($langs as $iso => $id_lang) {
|
||||
|
||||
foreach($sales as $sale) {
|
||||
$period[(int) $sale['id_sale']] = array(0, 0);
|
||||
|
||||
|
||||
$ids_product = array();
|
||||
foreach (Db::getInstance()->ExecuteS('
|
||||
SELECT `id_product`
|
||||
@ -67,7 +67,7 @@ foreach ($langs as $iso => $id_lang) {
|
||||
$ids_product[] = $value['id_product'];
|
||||
}
|
||||
|
||||
$total = Db::getInstance()->getRow('
|
||||
$total = Db::getInstance()->getRow('
|
||||
SELECT SUM(d.`product_quantity`) AS `total_products`, SUM(ROUND(((d.`product_price` * (1 - d.`reduction_percent` / 100) - d.`reduction_amount`) * (1 - d.`group_reduction` / 100) * (1 + d.`tax_rate` / 100)) * d.`product_quantity`, 6)) AS `total_sales_wt`
|
||||
FROM `'._DB_PREFIX_.'order_detail` d
|
||||
LEFT JOIN `'._DB_PREFIX_.'orders` o
|
||||
@ -81,7 +81,7 @@ foreach ($langs as $iso => $id_lang) {
|
||||
|
||||
$ids_total[(int) $id_lang][(int) $sale['id_sale']] = array();
|
||||
$ids_actual[(int) $sale['id_sale']] = array();
|
||||
|
||||
|
||||
$ids = Db::getInstance()->ExecuteS('
|
||||
SELECT DISTINCT d.`id_order`, CAST(o.`date_add` as DATE) as `date_add`
|
||||
FROM `'._DB_PREFIX_.'order_detail` d
|
||||
@ -94,11 +94,11 @@ foreach ($langs as $iso => $id_lang) {
|
||||
|
||||
foreach ($ids as $key => $id) {
|
||||
$ids_total[(int) $id_lang][(int) $sale['id_sale']][] = $id['id_order'];
|
||||
if ($id['date_add'] == $day_from) {
|
||||
if ($id['date_add'] == $day_from) {
|
||||
$ids_actual[(int) $sale['id_sale']][] = $id['id_order'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// multi orders by sale
|
||||
$sale_obj = new Sale((int) $sale['id_sale']);
|
||||
$statuts = array(17, Configuration::get('PS_OS_PAYMENT'));
|
||||
@ -139,13 +139,13 @@ foreach ($langs as $iso => $id_lang) {
|
||||
NOW()
|
||||
)
|
||||
');
|
||||
|
||||
|
||||
// stats for each lang (total_sales_wt, total_products)
|
||||
$total = Db::getInstance()->getRow('
|
||||
SELECT SUM(d.`product_quantity`) AS `total_products`, SUM(ROUND(((d.`product_price` * (1 - d.`reduction_percent` / 100) - d.`reduction_amount`) * (1 - d.`group_reduction` / 100) * (1 + d.`tax_rate` / 100)) * d.`product_quantity`, 6)) AS `total_sales_wt`, SUM(d.`product_quantity`) AS `total_products`, SUM(ROUND(((d.`product_price` * (1 - d.`reduction_percent` / 100) - d.`reduction_amount`) * (1 - d.`group_reduction` / 100)), 6)) AS `total_unit_sales`
|
||||
FROM `'._DB_PREFIX_.'order_detail` d
|
||||
INNER JOIN `'._DB_PREFIX_.'orders` o ON o.id_order = d.id_order
|
||||
WHERE d.`product_id` IN ('.implode(',', $ids_product).')
|
||||
WHERE d.`product_id` IN ('.implode(',', $ids_product).')
|
||||
AND o.valid = 1
|
||||
AND o.`id_lang` = '.(int) $id_lang.'
|
||||
');
|
||||
@ -174,13 +174,13 @@ foreach ($langs as $iso => $id_lang) {
|
||||
/**
|
||||
* PART 2
|
||||
* global @data
|
||||
*/
|
||||
*/
|
||||
$sales = array();
|
||||
foreach(Db::getInstance()->ExecuteS('
|
||||
SELECT p.*, l.`name`
|
||||
FROM `'._DB_PREFIX_.'privatesale` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` l
|
||||
ON p.`id_category` = l.`id_category`
|
||||
ON p.`id_category` = l.`id_category`
|
||||
WHERE ((CAST(p.`date_start` AS DATE) >= "'.pSQL($day_from).'" AND CAST(p.`date_start` AS DATE) <= "'.pSQL($day_to).'")
|
||||
OR (CAST(p.`date_end` AS DATE) >= "'.pSQL($day_from).'" AND CAST(p.`date_end` AS DATE) <= "'.pSQL($day_to).'")
|
||||
OR (CAST(p.`date_start` AS DATE) <= "'.pSQL($day_from).'" AND CAST(p.`date_end` AS DATE) >= "'.pSQL($day_to).'"))
|
||||
@ -234,7 +234,7 @@ foreach($sales as $sale) {
|
||||
FROM `'._DB_PREFIX_.'product_attribute` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON p.`id_product` = a.`id_product`
|
||||
WHERE a.`id_product` IN ('.implode(',', $ids_product).')
|
||||
WHERE a.`id_product` IN ('.implode(',', $ids_product).')
|
||||
GROUP BY a.`id_product_attribute`
|
||||
');
|
||||
|
||||
@ -385,7 +385,7 @@ foreach($sales as $sale) {
|
||||
$multi_total_sale += count($multi_total[(int) $id_lang][(int) $sale['id_sale']]);
|
||||
$total_sale += count($ids_total[(int) $id_lang][(int) $sale['id_sale']]);
|
||||
}
|
||||
|
||||
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT INTO `'._DB_PREFIX_.'privatesale_livestats_sale`
|
||||
VALUES (
|
||||
|
Loading…
Reference in New Issue
Block a user