fix conflict
This commit is contained in:
commit
853ae921ec
@ -453,22 +453,22 @@ class AdminOrders extends AdminTab
|
||||
$product_ids[] = (int) $row['product_id'];
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @Override Philea
|
||||
// */
|
||||
// if(Db::getInstance()->getRow('
|
||||
// SELECT *
|
||||
// FROM `'._DB_PREFIX_.'philea_parcel`
|
||||
// WHERE `id_order` = '.(int) $order->id.'
|
||||
// ')) {
|
||||
// foreach(Db::getInstance()->ExecuteS('
|
||||
// SELECT c.`id_product`
|
||||
// FROM `'._DB_PREFIX_.'product_ps_cache` c
|
||||
// WHERE c.`id_product` IN ('.implode(', ', $products_ids).')
|
||||
// ') as $row) {
|
||||
// $quantities_sent[(int) $row['id_product']] = -1;
|
||||
// }
|
||||
// }
|
||||
/**
|
||||
* @Override Philea
|
||||
*/
|
||||
if(Db::getInstance()->getRow('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'philea_parcel`
|
||||
WHERE `id_order` = '.(int) $order->id.'
|
||||
')) {
|
||||
foreach(Db::getInstance()->ExecuteS('
|
||||
SELECT c.`id_product`
|
||||
FROM `'._DB_PREFIX_.'product_ps_cache` c
|
||||
WHERE c.`id_product` IN ('.implode(', ', $products_ids).')
|
||||
') as $row) {
|
||||
$quantities_sent[(int) $row['id_product']] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
$parcel_quantities = array();
|
||||
foreach($to_send as $ts) {
|
||||
@ -833,7 +833,12 @@ class AdminOrders extends AdminTab
|
||||
|
||||
/* Display shipping infos */
|
||||
$sql = "SELECT `shipping_number`, `date_add` FROM `ps_lapostews` WHERE `id_order` =". $order->id;
|
||||
$sql2 = "SELECT DISTINCT ppp.`shipping_number`, ppp.`date_add`
|
||||
FROM `ps_philea_parcel` ppp
|
||||
LEFT JOIN `ps_order_detail` od ON (od.`id_order_detail` = ppp.`id_order_detail`)
|
||||
WHERE od.`id_order` =". $order->id;
|
||||
$numbers = Db::getInstance()->ExecuteS($sql);
|
||||
$numbers2 = Db::getInstance()->ExecuteS($sql2);
|
||||
echo '
|
||||
<fieldset style="width:400px">';
|
||||
if(count($numbers) > 0){
|
||||
@ -842,6 +847,12 @@ class AdminOrders extends AdminTab
|
||||
echo '<p><b>Numéro de suivi </b> : '. $number['shipping_number'] .' ajouté le '. $date->format('d m Y') .'</p>';
|
||||
}
|
||||
}
|
||||
if(count($numbers2) > 0){
|
||||
foreach ($numbers2 as $key => $number) {
|
||||
$date = new DateTime($number['date_add']);
|
||||
echo '<p><b>Numéro de suivi </b> : '. $number['shipping_number'] .' ajouté le '. $date->format('d m Y') .'</p>';
|
||||
}
|
||||
}
|
||||
echo '<legend><img src="../img/admin/delivery.gif" /> '.$this->l('Shipping information').'</legend>
|
||||
'.$this->l('Total weight:').' <b>'.number_format($order->getTotalWeight(), 3).' '.Configuration::get('PS_WEIGHT_UNIT').'</b><br />
|
||||
'.$this->l('Carrier:').' <b>'.($carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name).'</b><br />
|
||||
|
@ -3721,8 +3721,3 @@ form.form-forward-message .button:focus{
|
||||
.tab_customer_thread .button:focus{
|
||||
background-color: rgba(86,84,133,0.6);
|
||||
}
|
||||
|
||||
|
||||
=======
|
||||
}
|
||||
>>>>>>> ticket-philea2
|
||||
|
@ -10,32 +10,38 @@ class AdminPhileaMagistor extends AdminTab {
|
||||
|
||||
public function postProcess() {
|
||||
if(Tools::isSubmit('submitProductSaleCache')) {
|
||||
$min_id_product = Db::getInstance()->getValue('
|
||||
SELECT MIN(`id_product`) FROM `'._DB_PREFIX_.'product` WHERE `date_add` > DATE_SUB(NOW(), INTERVAL 10 DAY)
|
||||
');
|
||||
if ($min_id_product) {
|
||||
Db::getInstance()->ExecuteS('
|
||||
DELETE FROM `'._DB_PREFIX_.'product_ps_cache`
|
||||
WHERE `id_product` >= '.$min_id_product.'
|
||||
');
|
||||
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'product_ps_cache` (
|
||||
SELECT p.id_product, IFNULL(
|
||||
(
|
||||
SELECT s.id_sale
|
||||
FROM `'._DB_PREFIX_.'privatesale_category` s
|
||||
WHERE s.`id_category` = p.`id_category_default`
|
||||
LIMIT 1)
|
||||
, 0
|
||||
)
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
WHERE p.`id_product` >= '.$min_id_product.'
|
||||
)
|
||||
');
|
||||
echo '<p class="conf">'.$this->l('Produits associés aux ventes depuis le produit #').$min_id_product.'</p><br />';
|
||||
$hour = (int) date('H');
|
||||
$min = (int) date('i');
|
||||
if ($hour%3 == 0 && $min <= 20 && $min >= 10 ){
|
||||
echo '<p class="error">'.$this->l('Association automatique en cours, réessayez plus tard').'</p><br />';
|
||||
} else {
|
||||
echo '<p class="error">'.$this->l('Pas de produit ajouté depuis 10 jours').'</p><br />';
|
||||
$min_id_product = Db::getInstance()->getValue('
|
||||
SELECT MIN(`id_product`) FROM `'._DB_PREFIX_.'product` WHERE `date_add` > DATE_SUB(NOW(), INTERVAL 10 DAY)
|
||||
');
|
||||
if ($min_id_product) {
|
||||
Db::getInstance()->ExecuteS('
|
||||
DELETE FROM `'._DB_PREFIX_.'product_ps_cache`
|
||||
WHERE `id_product` >= '.$min_id_product.'
|
||||
');
|
||||
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'product_ps_cache` (
|
||||
SELECT p.id_product, IFNULL(
|
||||
(
|
||||
SELECT s.id_sale
|
||||
FROM `'._DB_PREFIX_.'privatesale_category` s
|
||||
WHERE s.`id_category` = p.`id_category_default`
|
||||
LIMIT 1)
|
||||
, 0
|
||||
)
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
WHERE p.`id_product` >= '.$min_id_product.'
|
||||
)
|
||||
');
|
||||
echo '<p class="conf">'.$this->l('Produits associés aux ventes depuis le produit #').$min_id_product.'</p><br />';
|
||||
} else {
|
||||
echo '<p class="error">'.$this->l('Pas de produit ajouté depuis 10 jours').'</p><br />';
|
||||
}
|
||||
}
|
||||
} elseif(Tools::isSubmit('submitPhilea')) {
|
||||
$id_sale = (int) Tools::getValue('id_sale');
|
||||
@ -309,7 +315,7 @@ class AdminPhileaMagistor extends AdminTab {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.table td .button{
|
||||
padding: 5px 3px;
|
||||
padding: 5px 2px;
|
||||
}
|
||||
.div_report_overlay{
|
||||
background: rgb(181,189,200); /* Old browsers */
|
||||
@ -511,22 +517,27 @@ class AdminPhileaMagistor extends AdminTab {
|
||||
<td style="text-align: center;" id="CDC_'. (int) $CRR['id_sale'] .'">
|
||||
<p style="color: #565485;">'.(!empty($CRR['sent_date'])?'<span style="font-size: 12px;" class="anticon anticon-clock"></span> '.date('d/m/Y H:i',strtotime($CRR['sent_date'])):'--').'</p>';
|
||||
if(!empty($cdc_reports)){
|
||||
$form .= '<span class="see_more anticon anticon-zoom-in" style="color:#565485;cursor:pointer"></span><div class="reports" style="display:none">';
|
||||
foreach($cdc_reports as $key => $report) {
|
||||
$form .= '<div>
|
||||
<a class="button see_report" data-id="'. (int) $CRR['id_sale'] .'" data-key="'.(int)$key.'" data-type="CDC" href="#" title="'.$this->l('See CDC report').'"><span class="anticon anticon-file-text2"></span> '.date('d/m/Y H:i',strtotime($report['report_date'])).'</a>
|
||||
<div id="'.(int) $CRR['id_sale'].'_'.$key.'_CDC" style="display:none">'.(!empty($report['report_data'])?$report['report_data']:'Pas encore de Rapport').'</div>
|
||||
</div>';
|
||||
}
|
||||
$form .= '</div>';
|
||||
}
|
||||
$form .= '</td>
|
||||
<td style="text-align: center;" id="CRP_'. (int) $CRR['id_sale'] .'">';
|
||||
if(!empty($crp_reports)){
|
||||
$form .= '<p style="color: #565485;"><span style="font-size: 12px;" class="anticon anticon-clock"></span> '.date('d/m/Y H:i',strtotime($crp_reports[0]['report_date'])).'</p>
|
||||
<span class="see_more anticon anticon-zoom-in" style="color:#565485;cursor:pointer"></span><div class="reports" style="display:none">';
|
||||
foreach($crp_reports as $key => $report) {
|
||||
$form .= '<div>
|
||||
<a class="button see_report" data-id="'. (int) $CRR['id_sale'] .'" data-key="'.(int)$key.'" data-type="CRP" href="#" title="'.$this->l('See CDC report').'"><span class="anticon anticon-file-text2"></span> '.date('d/m/Y H:i',strtotime($report['report_date'])).'</a>
|
||||
<div id="'.(int) $CRR['id_sale'].'_'.$key.'_CRP" style="display:none">'.(!empty($report['report_data'])?$report['report_data']:'Pas encore de Rapport').'</div>
|
||||
</div>';
|
||||
}
|
||||
$form .= '</div>';
|
||||
}
|
||||
$form .= '</td>
|
||||
<td style="text-align: center;">'.$auto_sync_btn.'</td>
|
||||
@ -542,6 +553,11 @@ class AdminPhileaMagistor extends AdminTab {
|
||||
<div class="div_report_overlay"></div>
|
||||
<script type="text/javascript">
|
||||
$("document").ready(function(){
|
||||
$(".see_more").click(function(){
|
||||
$(this).toggleClass("anticon-zoom-in");
|
||||
$(this).toggleClass("anticon-zoom-out");
|
||||
$(this).next("div.reports").toggle();
|
||||
});
|
||||
$(".upload_link").click(function(e){
|
||||
e.preventDefault();
|
||||
$("#id_sale_hidden").val($(this).data("id"));
|
||||
@ -650,7 +666,7 @@ class AdminPhileaMagistor extends AdminTab {
|
||||
WHERE `id_sale` IN (' . implode(', ', $id_sales) . ')
|
||||
AND pm_as.`active` = 1';
|
||||
foreach (Db::getInstance()->executeS($sql) as $row)
|
||||
$pm_active[] = (int) $row['id_sale'];
|
||||
$pm_active[(int) $row['id_sale']] = (int) $row['auto_sync_active'];
|
||||
|
||||
$pm_sent = array();
|
||||
$sql = '
|
||||
|
@ -8,8 +8,8 @@ if(isset($_SERVER['REMOTE_ADDR'])) {
|
||||
set_time_limit(600);
|
||||
$auto_sync_sales = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT pmas.`id_sale`
|
||||
FROM `'._DB_PREFIX_.'philea_magistor_auto_sync` pmas
|
||||
LEFT JOIN `'._DB_PREFIX_.'philea_magistor_sync` pms
|
||||
FROM `'._DB_PREFIX_.'philea_auto_sync` pmas
|
||||
LEFT JOIN `'._DB_PREFIX_.'philea_sync` pms
|
||||
ON pms.`id_sale` = pmas.`id_sale`
|
||||
LEFT JOIN `'._DB_PREFIX_.'privatesale` p
|
||||
ON p.`id_sale` = pmas.`id_sale`
|
||||
@ -25,28 +25,28 @@ if ($auto_sync_sales && count($auto_sync_sales))
|
||||
|
||||
if (Db::getInstance()->getValue('
|
||||
SELECT COUNT(*)
|
||||
FROM `'._DB_PREFIX_.'philea_magistor_sync`
|
||||
FROM `'._DB_PREFIX_.'philea_sync`
|
||||
WHERE `id_sale` = ' . (int) $id_sale . '
|
||||
AND `status` = 3
|
||||
')){
|
||||
continue;
|
||||
}
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'philea_magistor_sync`
|
||||
VALUES (
|
||||
DEFAULT,
|
||||
'.(int) $id_sale.',
|
||||
3,
|
||||
NOW()
|
||||
)
|
||||
');
|
||||
// Db::getInstance()->execute('
|
||||
// INSERT INTO `'._DB_PREFIX_.'philea_sync`
|
||||
// VALUES (
|
||||
// DEFAULT,
|
||||
// '.(int) $id_sale.',
|
||||
// 3,
|
||||
// NOW()
|
||||
// )
|
||||
// ');
|
||||
$sql = '
|
||||
UPDATE `'._DB_PREFIX_.'philea_magistor_auto_sync`
|
||||
UPDATE `'._DB_PREFIX_.'philea_auto_sync`
|
||||
SET `last_sent` = NOW()
|
||||
WHERE `id_sale` = ' . (int) $id_sale . '
|
||||
LIMIT 1';
|
||||
Db::getInstance()->execute($sql);
|
||||
// system('cd '.dirname(__FILE__).'/script && php send_commande.php '.(int) $id_sale);
|
||||
// sleep(10);
|
||||
system('cd '.dirname(__FILE__).'/script && php send_commande.php '.(int) $id_sale);
|
||||
sleep(10);
|
||||
}
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
|
||||
$_SERVER['HTTP_HOST'] = 'www.bebeboutik.com';
|
||||
include('../../../config/settings.inc.php');
|
||||
include('../../../config/config.inc.php');
|
||||
|
||||
$_SERVER['SERVER_PORT'] = 80;
|
||||
|
||||
include( dirname(__FILE__) . '/../philea_magistor.php');
|
||||
global $regex_file_in;
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
$format = $CRE;
|
||||
if($magistorModule->active) {
|
||||
//require_once('connection_ftp.php');
|
||||
require_once('connection_ftp.php');
|
||||
@set_time_limit(0);
|
||||
|
||||
// Checking for ".bal" files with a "CRE" prefix that has an equivalent ".dat" file and process them...
|
||||
@ -410,6 +410,9 @@
|
||||
'{product_list_txt}' => !empty($products_sent)? $content_txt.strip_tags($products_sent): '',
|
||||
);
|
||||
|
||||
$order->shipping_number = $parcel[0];
|
||||
$order->update();
|
||||
|
||||
if(in_array($order->id, $status_sent)) {
|
||||
$history = new OrderHistory();
|
||||
$history->id_order = (int) $order->id;
|
||||
@ -422,6 +425,8 @@
|
||||
$history->addWithemail(true, $templateVars);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$subjects = array(
|
||||
1 => 'Package in transit',
|
||||
2 => 'Livraison en cours',
|
||||
@ -443,6 +448,7 @@
|
||||
if(count($errors) > 0) {
|
||||
mail('marion@antadis.com', '[BBB] Erreurs integration envoi Philea', serialize($errors));
|
||||
}
|
||||
mail('marion@antadis.com', '[BBB] Erreurs integration envoi Philea', $datFile);
|
||||
}
|
||||
|
||||
$repo_archive = './archives/IN/LIVRAISON/';
|
||||
|
@ -22,4 +22,8 @@
|
||||
<div class="delivery_delay">
|
||||
<img src="{$img_ps_dir}delay/72h_site_{$cookie->id_lang}.png" alt="72h">
|
||||
</div>
|
||||
{elseif $delivery_delay == 8}
|
||||
<div class="delivery_delay">
|
||||
<img src="{$img_ps_dir}delay/48h_noel_{$cookie->id_lang}.png" alt="72h">
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -22,4 +22,8 @@
|
||||
<div class="delivery_delay">
|
||||
<img src="{$img_ps_dir}delay/delay_72h_{$cookie->id_lang}.png" alt="72h">
|
||||
</div>
|
||||
{elseif $delivery_delay == 8}
|
||||
<div class="delivery_delay">
|
||||
<img src="{$img_ps_dir}delay/delay_48h_noel_{$cookie->id_lang}.png" alt="72h">
|
||||
</div>
|
||||
{/if}
|
@ -22,4 +22,8 @@
|
||||
<div class="delivery_delay">
|
||||
<img src="{$img_ps_dir}delay/72h_{$cookie->id_lang}.png" alt="72h">
|
||||
</div>
|
||||
{elseif $delivery_delay == 8}
|
||||
<div class="delivery_delay">
|
||||
<img src="{$img_ps_dir}delay/48h_noel_{$cookie->id_lang}.png" alt="72h">
|
||||
</div>
|
||||
{/if}
|
||||
|
Loading…
Reference in New Issue
Block a user