Merge branch 'master' of git@gitlab.antadis.net:dev-antadis/bebeboutik.git

This commit is contained in:
Michael RICOIS 2017-12-04 11:13:44 +01:00
commit 38feb4d6f6
10 changed files with 1299 additions and 32 deletions

View File

@ -30,6 +30,9 @@ ul#menu li a {
.text-purple-dark{
color: #504d8b!important;
}
.text-grey-light{
color: #EFEFEF!important;
}
#content {
background-color: #f5f5f9;
}
@ -73,7 +76,6 @@ a:active,
color: #fff;
background: #504d8b;
border-color: #504d8b;}
.btn-success {
background: #26B99A;
border: 1px solid #169F85;}
@ -83,11 +85,57 @@ a:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
background: #169F85;}
.btn-green-light {
background: rgba(38, 185, 154, 0.6);
border: 1px solid #169F85;
color:#fff;}
.btn-green-light:hover,
.btn-green-light:focus,
.btn-green-light:active,
.btn-green-light.active,
.open .dropdown-toggle.btn-green-light {
background: #169F85;}
.btn-grey {
background: #efefef;
border: 1px solid #CCCCCC;
color:#333333;}
.btn-grey:hover,
.btn-grey:focus,
.btn-grey:active,
.btn-grey.active,
.open .dropdown-toggle.btn-grey {
background: #CCCCCC;}
.btn-red {
background: rgba(217, 83, 79, 0.3);
border: 1px solid #d43f3a;
color:#d43f3a;}
.btn-red:hover,
.btn-red:focus,
.btn-red:active,
.btn-red.active,
.open .dropdown-toggle.btn-red {
background: #d43f3a;}
.btn-warning-more {
color: #eea236;
background-color: rgba(240, 173, 78, 0.2);
border-color: #eea236;}
.btn-warning-more:hover,
.btn-warning-more:focus,
.btn-warning-more:active,
.btn-warning-more.active,
.open .dropdown-toggle.btn-warning-more {
background: #eea236;}
h2 {
font-size: 18px;
font-weight: 400;
}
.label-purple{
background-color: #504d8b;
}
.label-rose{
background-color: #E36EA2;
}
label{
color: #504d8b;
}
@ -139,6 +187,13 @@ form label{
white-space: nowrap;
color: #504d8b;
}
.panel h2.high_title{
margin: 5px 0 6px;
font-weight: bold;
text-overflow: ellipsis;
overflow: hidden;
color: #504d8b;
}
.div-title h4{
font-size: 15px;
}
@ -296,6 +351,16 @@ div.tagsinput span.tag a {
background-color: #FFA74E;
border: 1px solid #FFA74E;
}
#content .alert-warning-light {
color: #fc9732;
background-color: rgba(255, 167, 78, 0.3);
border: 1px solid #FFA74E;
}
#content .alert-info {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;
}
#content .alter-warning i.glyphicon,
#content .alert-warning span.glyphicon,
#content .alert-warning i.anticon,
@ -389,6 +454,10 @@ table.table tr th {
background: #504d8b;
color: #fff;
}
table.table.th-grey tr th {
background: #efefef;
color: #504d8b;
}
.table tr td {
color: #000;
}

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@ class AdminAntConfigurations extends AdminTab
global $cookie;
if(Tools::isSubmit('submitUpdateConfigurations')) {
Configuration::updateValue('ANT_BOOTSTRAP_TPL', Tools::getValue('bootstrap_tpl'));
Configuration::updateValue('ANT_CARRIER_DROP', Tools::getValue('carrier_dropshipping'));
Configuration::updateValue('ANT_CARRIER_DOM', Tools::getValue('carrier_domicile'));
Configuration::updateValue('ANT_CARRIERS_SOCOL', Tools::getValue('carriers_socol'));
@ -361,6 +362,7 @@ class AdminAntConfigurations extends AdminTab
$helperForm = new HelperFormBootstrap();
$helperForm->_select2 = true;
$helperForm->_inputMask = true;
$helperForm->_inputSwitch = true;
$form .= $helperForm->renderStyle();
$form .= '
@ -559,6 +561,15 @@ class AdminAntConfigurations extends AdminTab
'label' => $this->l('Cache Meilleures ventes :'),
'value' => $this->l('Vider le cache'),
),
array(
'type' => 'switch',
'name' => 'bootstrap_tpl',
'label-class' => 'col-md-6',
'input-class' => 'col-md-4',
'label' => $this->l('Bootstrap TPL (BO) :'),
'default' => Configuration::get('ANT_BOOTSTRAP_TPL'),
'checked' => Configuration::get('ANT_BOOTSTRAP_TPL'),
),
array(
'type' => 'simpleText',
'name' => 'carrier_dropshipping',

View File

@ -2242,12 +2242,12 @@ class AdminAntReturnprocess extends AdminTab
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'mr_method`
WHERE `id_carrier` = '.(int) $cart->id_carrier.'
AND `MR_Selected_Num` IS NOT NULL
')) {
$mr = Db::getInstance()->getRow('
SELECT mr_s.*
FROM `' . _DB_PREFIX_ . 'mr_selected` mr_s
WHERE `id_cart` = ' . (int) $cart->id . '
AND `MR_Selected_Num` IS NOT NULL
');
if($mr) {
$order_address = nl2br(preg_replace("/(\r\n){2,}/", "\r\n", implode("\r\n", array(
@ -2256,6 +2256,7 @@ class AdminAntReturnprocess extends AdminTab
$mr['MR_Selected_LgAdr3'] . ' ' . $mr['MR_Selected_LgAdr4'],
$mr['MR_Selected_CP'] . ' ' . $mr['MR_Selected_Ville'],
'FRANCE',
'('.$mr['MR_Selected_Num'].')',
))));
} else {
$order_address = nl2br(AddressFormat::generateAddress(new Address((int) $order->id_address_delivery)));

View File

@ -97,6 +97,48 @@ class Fraud extends Module {
}
}
public function hookAdminOrderNew($params) {
global $currentIndex;
$data .= '';
$reputation = FraudCore::getReputationOrder((int) $params['id_order']);
if ($reputation) {
$data .= '
<div class="col-md-12">
<div class="panel">
<div class="panel-title">
<h2><span class="anticon anticon-shield"></span> '.$this->l('Suspect Order').''.($reputation['pass']!=0?' <span style="font-size:12px;" class="text-rose"><em>('.$this->l('Order validate manually').')</span></em>':'').'</h2>
<div class="clearfix"></div>
</div>
<div class="panel-content">';
if (Tools::getIsset('validFraud')) {
$id_order = Tools::getValue('id_order');
if (!FraudCore::validOrder($id_order)) {
$data .= '<br /><p class="alert">'.$this->l('Update impossible').'</p>';
} else {
$data .= '<br /><p class="conf">'.$this->l('Valid order with success').'</p>';
}
}
if ($reputation['score'] >= 100) {
$info = json_decode($reputation['report']);
$data .= '
<a class="btn btn-danger" role="button" data-toggle="collapse" href="#collapseFraudModule">
<b>'.$this->l('Score : ').'</b> <span class="badge">'.$reputation['score'].'</span>
</a>
<div class="collapse" id="collapseFraudModule">
<h4>'.$this->l('Details : ').'</h4>
<p>'.implode('<br />', $info).'</p>
</div>';
if ($reputation['pass'] == 0) {
$data .= '<a class="pull-right btn btn-primary btn-sm" onclick="if(!confirm(\'Voulez-vous valider la commande ? \')) return false;" href="'.$_SERVER['REQUEST_URI'].'&validFraud=1" class="button">'.$this->l('Valid Order').'</a>';
}
}
$data .= '</div>
</div>
</div>';
}
return $data;
}
/* This method is called after the response returned by paybox */
public function testPaybox($id_order, $ip_country)
{

View File

@ -670,6 +670,14 @@ class PayPal extends PaymentModule
return $this->_html;
}
public function hookAdminOrderNew($params)
{
if (Tools::isSubmit('submitPayPalRefund')){
echo '<pre>';var_dump('test');echo '</pre>';die();
$this->_doTotalRefund($params['id_order']);
}
}
public function hookCancelProduct($params)
{
// if (Tools::isSubmit('generateDiscount') || !$this->isPayPalAPIAvailable())

View File

@ -12,15 +12,16 @@ class AdminPhileaMagistor extends AdminTab {
public function postProcess() {
if(Tools::getIsset('send_to_philea') && Tools::getValue('id_sale')) {
$id_sale = (int)Tools::getValue('id_sale');
$mode = Tools::getValue('mode', 0);
if(Db::getInstance()->getRow('
SELECT *
FROM `'._DB_PREFIX_.'philea_sync`
WHERE `id_sale` = '.(int) $id_sale.'
AND `status` = 7
AND (`status` = 7 OR `status` = 9)
')) {
Db::getInstance()->ExecuteS('
UPDATE `'._DB_PREFIX_.'philea_sync`
SET `status` = 8
SET `status` = 8, `mode` = '.(int) $mode.'
WHERE id_sale = '.(int) $id_sale.'
LIMIT 1
');
@ -93,6 +94,7 @@ class AdminPhileaMagistor extends AdminTab {
'.(int) $id_sale.',
0,
NOW(),
0,
0
)
');
@ -205,6 +207,7 @@ class AdminPhileaMagistor extends AdminTab {
'.(int) $id_sale.',
5,
NOW(),
0,
0
)
');
@ -729,7 +732,9 @@ class AdminPhileaMagistor extends AdminTab {
$auto_sync_btn = '<a title="' . $this->l('La vente est terminée') .'" class="text-' . ($auto_sync ? 'green-light' : 'rose') . '"><span style="opacity: 0.4;font-size:21px;" class="anticon anticon-rss2"></span></a>';
}
$submit_link = (isset($CRR['id_shipping']) && $CRR['id_shipping']==1)?$upload_link:$upload_link.'&id_sale=' . (int) $CRR['id_sale'] . '&send_to_philea=1';
$submit_link = (isset($CRR['id_shipping']) && $CRR['id_shipping']==1)?$upload_link:$base_link.'&id_sale=' . (int) $CRR['id_sale'] . '&send_to_philea=1&mode=0';
$submit_link_single = (isset($CRR['id_shipping']) && $CRR['id_shipping']==1)?null:$base_link.'&id_sale=' . (int) $CRR['id_sale'] . '&send_to_philea=1&mode=1';
$submit_link_multi = (isset($CRR['id_shipping']) && $CRR['id_shipping']==1)?null:$base_link.'&id_sale=' . (int) $CRR['id_sale'] . '&send_to_philea=1&mode=2';
$art_reports = Db::getInstance()->executeS('
SELECT `report_data`, `report_date`, `id_sale`
@ -783,7 +788,12 @@ class AdminPhileaMagistor extends AdminTab {
}
$form .= '</td>
<td style="text-align: center;">
<a class="text-purple-dark '.((isset($CRR['id_shipping']) && $CRR['id_shipping']==1)?'upload_link':'').'" data-id="' . (int) $CRR['id_sale'] . '" href="'.$submit_link.'" title="'.$this->l('Envoyer à Philéa').'"><i style="font-size:18px;" class="glyphicon glyphicon-send"></i></a>'.$auto_sync_btn.'
<a class="text-purple-dark '.((isset($CRR['id_shipping']) && $CRR['id_shipping']==1)?'upload_link':'').'" data-id="' . (int) $CRR['id_sale'] . '" href="'.$submit_link.'" title="'.$this->l('Envoyer à Philéa').'"><i style="font-size:18px;" class="glyphicon glyphicon-send"></i></a>
'.((isset($CRR['id_shipping']) && $CRR['id_shipping']==1)
? $auto_sync_btn
:'<a class="text-green-light " href="'.$submit_link_single.'" title="'.$this->l('Envoyer Single').'"><i style="font-size:18px;" class="glyphicon glyphicon-send"></i></a>
<a class="text-orange " href="'.$submit_link_multi.'" title="'.$this->l('Envoyer Multi').'"><i style="font-size:18px;" class="glyphicon glyphicon-send"></i></a>'
).'
</td>
<td style="text-align: center;">
<a class="text-purple-dark" data-toggle="collapse" data-target=".row_more_'.(int) $CRR['id_sale'].'"><span style="font-size:21px;cursor:pointer" class="anticon anticon-info"></span></a>
@ -799,7 +809,8 @@ class AdminPhileaMagistor extends AdminTab {
<td align="center" colspan="2">';
if(!empty($art_reports)){
foreach($art_reports as $key => $report) {
$form .= '<div>
$form .= '
<div>
<a class="btn btn-primary btn-xs see_report" data-id="'. (int) $CRR['id_sale'] .'" data-key="'.(int)$key.'" data-type="ART" href="#" title="'.$this->l('See ART 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.'_ART" style="display:none">'.(!empty($report['report_data'])?$report['report_data']:'Pas encore de Rapport').'</div>
</div>';
@ -844,7 +855,8 @@ class AdminPhileaMagistor extends AdminTab {
if(!empty($cdc_reports)){
$form .= '<div class="reports">';
foreach($cdc_reports as $key => $report) {
$form .= '<div>
$form .= '
<div>
<a class="btn btn-primary btn-xs 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>';
@ -858,7 +870,8 @@ class AdminPhileaMagistor extends AdminTab {
if(!empty($crp_reports)){
$form .= '<div class="reports">';
foreach($crp_reports as $key => $report) {
$form .= '<div>
$form .= '
<div>
<a class="btn btn-primary btn-xs 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>';

View File

@ -105,12 +105,11 @@ if($row = Db::getInstance()->getRow('
WHERE `status` = 8
ORDER BY `date_add` ASC
')) {
// SEND CDC02
Db::getInstance()->ExecuteS('
UPDATE `'._DB_PREFIX_.'philea_sync`
SET `status` = 9
WHERE `id_sync` = '.(int) $row['id_sync'].'
LIMIT 1
');
system('cd '.dirname(__FILE__).'/script && php send_commande_after.php '.(int) $row['id_sale']);
system('cd '.dirname(__FILE__).'/script && php send_commande_after.php '.(int) $row['id_sale'].' '.(int) $row['mode']);
}

View File

@ -9,6 +9,7 @@ include( dirname(__FILE__) . '/../philea_magistor.php');
ini_set('memory_limit', '4G');
$id_sale = (int) $argv[1];
$mode = isset($argv[2])?(int)$argv[2]:0;
$_id_shipping = 1; // philea
@ -117,9 +118,9 @@ if($magistorModule->active) {
$fileArchive = $repo_archive . 'CDC02' . date('ymdHis');
$data = '';
$sent_order = array();
foreach($orders as $o) {
$order = new Order($o['id_order']);
$sales = array();
$sales[(int)$id_sale] = (int) $id_sale;
@ -127,9 +128,26 @@ if($magistorModule->active) {
// ANTADIS
$products_ids = array();
foreach($products as $product) {
$product_sale = Db::getInstance()->getRow('
SELECT `id_sale`
FROM `'._DB_PREFIX_.'product_ps_cache`
WHERE `id_product` = '.(int) $product['product_id'].'
');
if((int)$product_sale['id_sale'] != (int)$id_sale && $mode==1) {
// si multi et que le mode est à 1 (envoi uniquement des singles) on ne gère pas la commande
continue 2;
}
$sales[(int)$product_sale['id_sale']] = (int)$product_sale['id_sale'];
$products_ids[] = (int) $product['product_id'];
}
if(count($sales) == 1 && $mode == 2){
// si single et que le mode est à 2 (envoi uniquement des multis) on ne gère pas la commande
continue;
}
$sent_order[] = $o['id_order'];
$nbProducts = 0;
$nbProducts = (int) Db::getInstance()->getValue('
SELECT COUNT(d.`id_order_detail`)
@ -432,7 +450,6 @@ if($magistorModule->active) {
require_once('connection_ftp.php');
}
}
function cleanChar($string) {

View File

@ -101,6 +101,32 @@ class RefundReason extends Module {
return $output;
}
public function hookAdminOrderNew($params) {
global $cookie;
$output .= '
<script type="text/javascript">
<!--
$(document).ready(function() {
$(\'<select id=\"typeReason\" class="form-control" name=\"typeReason\" style=\"display:none; margin-top: 5px;\"><option value=\"0\" style="color: #999999;">'.$this->l('Refund reason').'</option><option value=\"1\">'.$this->l('Cancelled (before shipping)').'</option><option value=\"2\">'.$this->l('Cancelled (received, -7d)').'</option><option value=\"11\">'.$this->l('ZZZZZ4').'</option><option value=\"4\">'.$this->l('Product default').'</option><option value=\"5\">'.$this->l('Missing product (supplier)').'</option><option value=\"3\">'.$this->l('Return (received +7d)').'</option><option value=\"6\">'.$this->l('Logistics error').'</option><option value=\"8\">'.$this->l('ZZZZZ1').'</option><option value=\"12\">'.$this->l('ZZZZZ5').'</option><option value=\"9\">'.$this->l('ZZZZZ2').'</option><option value=\"10\">'.$this->l('ZZZZZ3').'</option><option value=\"7\">'.$this->l('Other').'</option></select>\').insertAfter(\'#spanShippingBack\');
$(\'<p class="center"><select id=\"typeReasonTotal\" class="form-control" name=\"typeReason\"><option value=\"0\" style="color: #999999;">'.$this->l('Refund reason').'</option><option value=\"1\">'.$this->l('Cancelled (before shipping)').'</option><option value=\"2\">'.$this->l('Cancelled (received, -7d)').'</option><option value=\"11\">'.$this->l('ZZZZZ4').'</option><option value=\"4\">'.$this->l('Product default').'</option><option value=\"5\">'.$this->l('Missing product (supplier)').'</option><option value=\"3\">'.$this->l('Return (received +7d)').'</option><option value=\"6\">'.$this->l('Logistics error').'</option><option value=\"8\">'.$this->l('ZZZZZ1').'</option><option value=\"12\">'.$this->l('ZZZZZ5').'</option><option value=\"9\">'.$this->l('ZZZZZ2').'</option><option value=\"10\">'.$this->l('ZZZZZ3').'</option><option value=\"7\">'.$this->l('Other').'</option></select></p>\').insertBefore(\'form.refundform p\');
$("#generateCreditSlip").click(function() {
if($("#generateCreditSlip:checked").length == 1) {
$("#typeReason").show();
} else {
$("#typeReason").hide();
}
});
});
-->
</script>
';
return $output;
}
public function hookOrderSlip($params) {
global $cookie;