Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop
This commit is contained in:
commit
7427a3704f
@ -19,6 +19,7 @@ class HelperFormBootstrap{
|
||||
public $_inputWizard;
|
||||
public $_inputTag;
|
||||
public $_dateTime;
|
||||
public $_dateTimePicker;
|
||||
|
||||
public function __construct(){
|
||||
$this->_html = '';
|
||||
@ -41,6 +42,7 @@ class HelperFormBootstrap{
|
||||
@import url("'.__PS_BASE_URI__.'adm/helpers/includes/jquery-ui-1.8.20.custom.css");
|
||||
@import url("'.__PS_BASE_URI__.'adm/helpers/includes/css/bootstrap.min.css");
|
||||
'.($this->_select2?'@import url("'.__PS_BASE_URI__.'adm/helpers/includes/css/select2.min.css");':'').'
|
||||
'.($this->_dateTimePicker?'@import url("'.__PS_BASE_URI__.'adm/helpers/includes/css/bootstrap-datetimepicker.min.css");':'').'
|
||||
'.($this->_inputTag?'@import url("'.__PS_BASE_URI__.'adm/helpers/includes/jquery.tagsinput.min.css");':'').'
|
||||
'.($this->_inputSwitch?'@import url("'.__PS_BASE_URI__.'adm/helpers/includes/switchery.min.css");':'').'
|
||||
@import url("'.__PS_BASE_URI__.'adm/helpers/includes/css/custom.css");
|
||||
@ -56,6 +58,10 @@ class HelperFormBootstrap{
|
||||
if ($this->_select2) {
|
||||
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.'adm/helpers/includes/js/select2.full.min.js"></script>';
|
||||
}
|
||||
if ($this->_dateTimePicker) {
|
||||
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.'adm/helpers/includes/js/moment-with-locales.min.js"></script>';
|
||||
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.'adm/helpers/includes/js/bootstrap-datetimepicker.min.js"></script>';
|
||||
}
|
||||
if ($this->_inputMask) {
|
||||
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.'adm/helpers/includes/jquery.inputmask.bundle.min.js"></script>';
|
||||
}
|
||||
|
5
adm/helpers/includes/css/bootstrap-datetimepicker.min.css
vendored
Normal file
5
adm/helpers/includes/css/bootstrap-datetimepicker.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2
adm/helpers/includes/js/bootstrap-datetimepicker.min.js
vendored
Normal file
2
adm/helpers/includes/js/bootstrap-datetimepicker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1216
adm/helpers/includes/js/moment-with-locales.min.js
vendored
Normal file
1216
adm/helpers/includes/js/moment-with-locales.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -9,6 +9,7 @@ include_once(_PS_ROOT_DIR_.'/modules/privatesales_logistique/classes/OrderForm.p
|
||||
include_once(_PS_ROOT_DIR_.'/modules/privatesales_logistique/classes/DateManager.php');
|
||||
include_once(_PS_ROOT_DIR_.'/modules/privatesales_logistique/classes/MakeStats.php');
|
||||
include_once(_PS_ROOT_DIR_.'/modules/privatesales_logistique/classes/SaleStats.php');
|
||||
include_once(PS_ADMIN_DIR . '/helpers/HelperFormBootstrap.php');
|
||||
/**
|
||||
* Description of AdminPrivateSalesLogistique
|
||||
*
|
||||
@ -66,28 +67,28 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
$this->getSaleExportsByDate($date_start, $date_end, $id_lang);
|
||||
|
||||
} else {
|
||||
$this->html .= '<p class="error">Vous devez choisir une vente ou une période</p>';
|
||||
HelperFormBootstrap::displayErrors($this->l('Vous devez choisir une vente ou une période'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function _displayHeader()
|
||||
public function _displayHeader($helperForm)
|
||||
{
|
||||
global $currentIndex;
|
||||
$this->html .= '
|
||||
<link rel="stylesheet" type="text/css" href="'.__PS_BASE_URI__.'modules/privatesales_logistique/css/chosen.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="'.__PS_BASE_URI__.'modules/privatesales_logistique/css/privatesales_logistique.css" />
|
||||
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/privatesales_logistique/js/jquery-ui-1.8.20.custom.min.js"></script>
|
||||
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/privatesales_logistique/js/jquery-ui-timepicker-addon.js"></script>
|
||||
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/privatesales_logistique/js/chosen.jquery.min.js"></script>
|
||||
<script type="text/javascript" src="'.__PS_BASE_URI__.'modules/privatesales_logistique/js/filtre.js"></script>
|
||||
<style type="text/css">
|
||||
@import url("'.__PS_BASE_URI__.'modules/privatesales/jquery-ui-1.8.20.custom.css");
|
||||
$helperForm->_select2 = true;
|
||||
$helperForm->_dateTimePicker = true;
|
||||
$helperForm->_inputSwitch = true;
|
||||
$helperForm->_inputMask = true;
|
||||
|
||||
#exportorderform { line-height:25px; }
|
||||
</style>';
|
||||
$helperForm->_css .= '
|
||||
#content .bootstrap-datetimepicker-widget tr th {
|
||||
border-radius :0px !important;
|
||||
}
|
||||
';
|
||||
$this->html .= $helperForm->renderStyle();
|
||||
|
||||
$this->html .= '<script>
|
||||
$helperForm->_js .= '
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
$("#category").change( function(){
|
||||
current_location = "'.$currentIndex.'&token='.Tools::getAdminTokenLite('AdminPrivateSalesLogistique').'";
|
||||
@ -96,20 +97,34 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#hasDatepicker_1, #hasDatepicker_2").datetimepicker({
|
||||
prevText:"",
|
||||
nextText:"",
|
||||
showSecond: true,
|
||||
timeFormat: "hh:mm:ss",
|
||||
dateFormat: "dd/mm/yy",
|
||||
addSliderAccess: true,
|
||||
showButtonPanel: false
|
||||
$("#date_start").inputmask("9999-99-99");
|
||||
$("#date_end").inputmask("9999-99-99");
|
||||
|
||||
$("#hasDatepicker_1").datetimepicker({
|
||||
format: "DD/MM/YYYY hh:mm:ss",
|
||||
widgetPositioning : {
|
||||
horizontal: "auto",
|
||||
vertical: "bottom"
|
||||
},
|
||||
locale:"fr"
|
||||
});
|
||||
$("#hasDatepicker_2").datetimepicker({
|
||||
format: "DD/MM/YYYY hh:mm:ss",
|
||||
widgetPositioning : {
|
||||
horizontal: "auto",
|
||||
vertical: "bottom"
|
||||
},
|
||||
locale:"fr"
|
||||
});
|
||||
|
||||
if($("#hidden_category").length>0){
|
||||
$("#sale_name").text($("#category option[value="+$("#hidden_category").val()+"]").text());
|
||||
}
|
||||
|
||||
$("#exportorderform").click(function(){
|
||||
var export_last = $("#export_last").is(":checked"), req;
|
||||
|
||||
req = "&id="+$("#category").val();
|
||||
req = "&id="+$("#hidden_category").val();
|
||||
|
||||
if(export_last) {
|
||||
req += "&last"
|
||||
@ -121,11 +136,11 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
req += "&from="+from+"&to="+to;
|
||||
}
|
||||
|
||||
var type = $("#export_form input[name=export_type]:checked").val();
|
||||
var type = $("#export_form select[name=export_type]").val();
|
||||
|
||||
if(type == 1 || type == 2 || type == 4 ) {
|
||||
req += "&type="+type;
|
||||
req += "&lang="+$("input[name=lang]:checked").val();
|
||||
req += "&lang="+$("select[name=lang]").val();
|
||||
|
||||
$(this)
|
||||
.attr("href", "../modules/privatesales_logistique/exportOrderForm.php?action=getOrderForm"+req)
|
||||
@ -133,7 +148,7 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
return true;
|
||||
} else if (type == 5) {
|
||||
req += "&type="+type;
|
||||
req += "&lang="+$("input[name=lang]:checked").val();
|
||||
req += "&lang="+$("select[name=lang]").val();
|
||||
var url_dest = "'.$currentIndex.'&token='.Tools::getAdminTokenLite('AdminPrivateSalesLogistique').'&changeCategory&action=getSaleExport";
|
||||
|
||||
$(this).attr("href", url_dest+req);
|
||||
@ -153,139 +168,223 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
$("#toggle_form_infos").click(function(){
|
||||
$("#form_infos").toggle();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$(".chosen-select").chosen(
|
||||
{
|
||||
allow_single_deselect:true,
|
||||
placeholder_text_single : "Choisir une vente",
|
||||
no_results_text : "Aucun résultat",
|
||||
enable_split_word_search : true,
|
||||
search_contains : true,
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>';
|
||||
|
||||
// $this->html .= '
|
||||
// <link rel="stylesheet" type="text/css" href="'.__PS_BASE_URI__.'modules/privatesales_logistique/css/chosen.min.css" />
|
||||
// <link rel="stylesheet" type="text/css" href="'.__PS_BASE_URI__.'modules/privatesales_logistique/css/privatesales_logistique.css" />
|
||||
// <script type="text/javascript" src="'.__PS_BASE_URI__.'modules/privatesales_logistique/js/jquery-ui-1.8.20.custom.min.js"></script>
|
||||
// <script type="text/javascript" src="'.__PS_BASE_URI__.'modules/privatesales_logistique/js/jquery-ui-timepicker-addon.js"></script>
|
||||
// <script type="text/javascript" src="'.__PS_BASE_URI__.'modules/privatesales_logistique/js/chosen.jquery.min.js"></script>
|
||||
// <script type="text/javascript" src="'.__PS_BASE_URI__.'modules/privatesales_logistique/js/filtre.js"></script>
|
||||
// <style type="text/css">
|
||||
// @import url("'.__PS_BASE_URI__.'modules/privatesales/jquery-ui-1.8.20.custom.css");
|
||||
|
||||
|
||||
// </script>
|
||||
// <script type="text/javascript">
|
||||
// $(function() {
|
||||
// $(".chosen-select").chosen(
|
||||
// {
|
||||
// allow_single_deselect:true,
|
||||
// placeholder_text_single : "Choisir une vente",
|
||||
// no_results_text : "Aucun résultat",
|
||||
// enable_split_word_search : true,
|
||||
// search_contains : true,
|
||||
// }
|
||||
// );
|
||||
// });
|
||||
// </script>';
|
||||
}
|
||||
|
||||
public function _displayAfterContent()
|
||||
public function _displayAfterContent($helperForm, $option_sales,$option_select_langs)
|
||||
{
|
||||
global $cookie;
|
||||
$this->html .= '
|
||||
</fieldset><p><br /></p>
|
||||
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
|
||||
<fieldset><legend><img src="/modules/bulkupdate/logo.gif" alt="" title="" />'.$this->l('Export').'</legend>
|
||||
<label>'.$this->l('Select a category to export:').'</label>
|
||||
<div class="margin-form">
|
||||
<br />
|
||||
<select class="chosen-select" id="export_category" name="export_category">
|
||||
<option value=""></option>
|
||||
';
|
||||
<div class="col-md-12">
|
||||
<div class="panel">
|
||||
<div class="panel-title">
|
||||
<h2><span class="text-rose anticon anticon-upload"></span> '.$this->l('Export').'</h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
|
||||
<br>
|
||||
<div class="col-md-5">';
|
||||
$input = array(
|
||||
'type' => 'select2',
|
||||
'name' => 'export_category',
|
||||
'id' => 'export_category',
|
||||
'label' => $this->l('Select a category to export:'),
|
||||
'label-class' => 'col-md-12',
|
||||
'input-class' => 'col-md-12',
|
||||
'select-class' => 'col-md-12',
|
||||
'options' => $option_sales
|
||||
);
|
||||
$this->html .= $helperForm->generateInput($input).
|
||||
'</div>';
|
||||
|
||||
foreach(Db::getInstance()->ExecuteS('
|
||||
SELECT c.`id_category`, l.`name`
|
||||
FROM `'._DB_PREFIX_.'category_lang` l
|
||||
LEFT JOIN `'._DB_PREFIX_.'category` c
|
||||
ON c.`id_category` = l.`id_category`
|
||||
WHERE l.`id_lang` = '.(int) $cookie->id_lang.'
|
||||
AND c.`id_parent` = 1
|
||||
ORDER BY id_category DESC
|
||||
') as $row) {
|
||||
$extrafields = Category::getSalesInfosWithDate(array((int) $row['id_category']));
|
||||
$this->html .= '<option value="'.$row['id_category'].'">'.$row['id_category'].' - '.date("d/m/Y",strtotime($extrafields[(int) $row['id_category']]['date_start'])).' - '.$row['name'].' - '.$extrafields[(int) $row['id_category']]['sales'][1].'</option>';
|
||||
}
|
||||
$this->html .= '</select>
|
||||
</div>
|
||||
<p> </p>
|
||||
<label>'.$this->l('Par date de début :').'</label>
|
||||
<div class="margin-form">
|
||||
Du <input type="text" name="date_start">
|
||||
au <input type="text" name="date_end">
|
||||
<p>Format : AAAA-MM-JJ</p>
|
||||
</div>
|
||||
<p> </p>
|
||||
<label>'.$this->l('Select a language:').'</label>
|
||||
<div class="margin-form">
|
||||
<select id="export_id_lang" name="export_id_lang">
|
||||
';
|
||||
foreach(Language::getLanguages(FALSE) as $lang) {
|
||||
$this->html .= '<option value="'.$lang['id_lang'].'"'.($cookie->id_lang == $lang['id_lang']? ' selected="selected"': '').'>'.$lang['name'].'</option>';
|
||||
}
|
||||
$this->html .='<div class="col-md-2 text-center"><span class="lateral-delimiter"></span></div>
|
||||
|
||||
$this->html.= '</select>
|
||||
<div class="col-md-5">';
|
||||
$input = array(
|
||||
'type' => 'simpleDate',
|
||||
'period' => true,
|
||||
'class-from' => 'col-md-6',
|
||||
'class-to' => 'col-md-6',
|
||||
'label' => 'Du :',
|
||||
'label-to' => 'Au :',
|
||||
'id' => 'date_start',
|
||||
'id-to' => 'date_end',
|
||||
'name' => 'date_start',
|
||||
'name-to' => 'date_end',
|
||||
'before' => '<span class="glyphicon glyphicon-calendar"></span>',
|
||||
'before-to' => '<span class="glyphicon glyphicon-calendar"></span>',
|
||||
);
|
||||
$this->html .= $helperForm->generateInput($input).
|
||||
'<p class="text-center help-block">Format : AAAA-MM-JJ</p>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<br>
|
||||
<div class="col-md-4 col-md-offset-4 text-center">';
|
||||
$input = array(
|
||||
'type' => 'select',
|
||||
'name' => 'export_id_lang',
|
||||
'id' => 'export_id_lang',
|
||||
'label' => $this->l('Select a language:'),
|
||||
'label-class' => 'col-md-12 text-center',
|
||||
'input-class' => 'col-md-12',
|
||||
'options' => $option_select_langs
|
||||
);
|
||||
$this->html .= $helperForm->generateInput($input).
|
||||
'</div>
|
||||
<div class="clearfix"></div>';
|
||||
|
||||
$this->html .= '</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="ln_solid"></div>
|
||||
<div class="form-group text-right">
|
||||
<button type="submit" class="btn btn-primary" name="submitExport">'.$this->l('Upload').'</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<p> </p>
|
||||
<center><input type="submit" name="submitExport" value="'.$this->l('Export').'" class="button" /></center>
|
||||
</fieldset>
|
||||
</form><br/><br/>';
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
public function _displayContent()
|
||||
public function _displayContent($helperForm,$option_sales)
|
||||
{
|
||||
global $cookie;
|
||||
//$categories = CategoryCore::getCategories($cookie->id_lang,FALSE);
|
||||
$categories = Category::getCategories($cookie->id_lang, FALSE, true, ' AND c.id_parent = 1', ' ORDER BY c.id_category DESC ', ' LIMIT 500');
|
||||
$ids = array();
|
||||
foreach ($categories as $key => $category) {
|
||||
foreach ($category as $key => $data) {
|
||||
$ids[] = $data['infos']['id_category'];
|
||||
}
|
||||
}
|
||||
$extrafields = Category::getSalesInfos($ids);
|
||||
|
||||
krsort($categories[1]);
|
||||
$this->html .= '
|
||||
<div class="col-md-12">
|
||||
<div class="panel">
|
||||
<div class="panel-title">
|
||||
<h2><span class="text-rose anticon anticon-wrench"></span> '.$this->l('Inventory Tracking').'</h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<div class="row">
|
||||
<div class="col-md-6">';
|
||||
if(count($option_sales) > 1) {
|
||||
$input = array(
|
||||
'type' => 'select2',
|
||||
'name' => 'category',
|
||||
'id' => 'category',
|
||||
'label' => $this->l('Ventes :'),
|
||||
'label-class' => 'text-left col-md-12',
|
||||
'input-class' => 'col-md-12',
|
||||
'select-class' => 'col-md-12',
|
||||
'options' => $option_sales
|
||||
);
|
||||
$this->html .= $helperForm->generateInput($input).
|
||||
'<div class="clearfix"></div>';
|
||||
} else {
|
||||
$this->html .= '<p>Aucune vente !</p>';
|
||||
}
|
||||
$this->html .= '</div>
|
||||
<div class="col-md-6 form-group text-right">
|
||||
<label class="col-md-12" style="opacity:0">A</label>
|
||||
<button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#BDCModal">
|
||||
Informations sur le bon de commande
|
||||
</button>
|
||||
</div>
|
||||
</div>';
|
||||
if(!empty($this->category)) {
|
||||
$this->html .= $this->getFormOrderForm($this->category);
|
||||
}
|
||||
|
||||
$this->html .= '<fieldset>
|
||||
<legend><img src="../img/admin/tab-tools.gif" alt="" />'.$this->l('Inventory Tracking').'</legend>
|
||||
<h3>Ventes :</h3>';
|
||||
if( Tools::getIsset('action') && Tools::getValue('action') == 'getStats') {
|
||||
$this->html .= $this->getStatsArray();
|
||||
}
|
||||
|
||||
if(count($categories) > 0)
|
||||
{
|
||||
$this->html .= '<select id="category" name="category" size="5" style="width:400px;height:150px;vertical-align:top;">';
|
||||
foreach($categories[1] as $categorie)
|
||||
{
|
||||
$select = "";
|
||||
|
||||
if($this->category->id == $categorie['infos']['id_category'])
|
||||
$select = "selected='selected'";
|
||||
|
||||
$this->html .= "<option ".$select." value='".$categorie['infos']['id_category']."'>".$categorie['infos']['name']." - ".$extrafields[$categorie['infos']['id_category']]['sales'][1].' - '.$categorie['infos']['id_category']."</option>";
|
||||
}
|
||||
$this->html .= '</select> - Filtre : <input type="text" value="" id="filter_sale" size="50"><br/><br/>';
|
||||
}
|
||||
else
|
||||
$this->html .= 'Aucune vente';
|
||||
|
||||
if(!empty($this->category))
|
||||
{
|
||||
$this->html .= $this->getFormOrderForm($this->category);
|
||||
$this->html .= '<br/><br/>';
|
||||
}
|
||||
|
||||
if( Tools::getIsset('action')
|
||||
&& Tools::getValue('action') == 'getStats')
|
||||
{
|
||||
$this->html .= $this->getStatsArray();
|
||||
$this->html .= '<br/><br/>';
|
||||
}
|
||||
$this->html .= '
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>';
|
||||
|
||||
}
|
||||
|
||||
public function display()
|
||||
{
|
||||
global $currentIndex;
|
||||
global $currentIndex, $cookie;
|
||||
|
||||
$helperForm = new HelperFormBootstrap();
|
||||
|
||||
$option_sales = array();
|
||||
$option_sales[] = array(
|
||||
'value' => 0,
|
||||
'label' => 'Selectionner une vente'
|
||||
);
|
||||
|
||||
$categories = Db::getInstance()->ExecuteS('
|
||||
SELECT c.`id_category`, l.`name`
|
||||
FROM `'._DB_PREFIX_.'category_lang` l
|
||||
LEFT JOIN `'._DB_PREFIX_.'category` c ON c.`id_category` = l.`id_category`
|
||||
WHERE l.`id_lang` = '.(int) $cookie->id_lang.'
|
||||
AND c.`id_parent` = 1
|
||||
ORDER BY c.id_category DESC
|
||||
LIMIT 500
|
||||
');
|
||||
$ids = array();
|
||||
foreach ($categories as $key => $category) {
|
||||
$ids[] = (int)$category['id_category'];
|
||||
}
|
||||
$extrafields = Category::getSalesInfosWithDate($ids);
|
||||
|
||||
foreach ($categories as $category) {
|
||||
$option_sales[] = array(
|
||||
'value' => $category['id_category'],
|
||||
'label' => '#'.$category['id_category'].(isset($extrafields[(int) $category['id_category']])?' ('.date("d/m/Y",strtotime($extrafields[(int) $category['id_category']]['date_start'])).')':'').' - '.$category['name'].(isset($extrafields[(int) $category['id_category']])?' - '.$extrafields[(int) $category['id_category']]['sales'][1]:'')
|
||||
);
|
||||
}
|
||||
|
||||
$option_select_langs = array();
|
||||
foreach (Language::getLanguages(false) as $key => $value) {
|
||||
$option_select_langs[$key] = array(
|
||||
'value' =>$value['id_lang'],
|
||||
'label' => $value['name']
|
||||
);
|
||||
if($value['id_lang'] == 2){
|
||||
$option_select_langs[$key]['selected'] = 1;
|
||||
}
|
||||
}
|
||||
//krsort($categories);
|
||||
|
||||
$this->_postProcess();
|
||||
$this->_displayHeader();
|
||||
$this->_displayContent();
|
||||
$this->_displayAfterContent();
|
||||
$this->_displayHeader($helperForm);
|
||||
$this->html .= $this->getFormOrderFormInfo();
|
||||
$this->_displayContent($helperForm, $option_sales);
|
||||
$this->_displayAfterContent($helperForm, $option_sales,$option_select_langs);
|
||||
|
||||
$this->html .= '<div class="clearfix"></div>'
|
||||
.(Tools::getValue('id')?'<input type="hidden" value="'.Tools::getValue('id').'" id="hidden_category"/>':'')
|
||||
.$helperForm->renderScript();
|
||||
|
||||
echo $this->html;
|
||||
}
|
||||
@ -297,6 +396,7 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
if (!Tools::getIsset('id')) {
|
||||
return false;
|
||||
}
|
||||
$lang_id = Tools::getValue('lang','fr');
|
||||
|
||||
// GET INFO FOR STAT
|
||||
$date_from = new DateManager(Tools::getValue('from'));
|
||||
@ -309,7 +409,6 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
$sale = Sale::getSaleFromCategory($id_category);
|
||||
$category = new Category($id_category, $cookie->id_lang);
|
||||
$products = MakeStats::getProductsByCat($id_category);
|
||||
|
||||
$arrayProduct = array();
|
||||
foreach($products as $product)
|
||||
$array_product[$product['id_product']] = $arrayProduct[$product['id_product']] = new Product($product['id_product']);
|
||||
@ -383,10 +482,10 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
<fieldset style="font-size:1em;">
|
||||
<legend>'.$this->l('Stats').' :</legend>';
|
||||
|
||||
$html.= '<h2>Rapport de vente : '.$stats->data_stats['name'].'</h2>';
|
||||
<br>
|
||||
<div style="font-size:1em;">
|
||||
<h2 class="text-center text-purple-dark"><b>'.$this->l('Rapport Stats').' Vente : '.$stats->data_stats['name'].'</b> </h2>';
|
||||
$html.= '<div class="ln_solid"></div>';
|
||||
$html.= '<table class="stats" style="width:45%; float:left">';
|
||||
$html.= '<tr>';
|
||||
$html.= '<td>'.$stats->lang['date_start'].'</td>';
|
||||
@ -499,11 +598,10 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
}
|
||||
}
|
||||
$html.= '</table>
|
||||
</fieldset>';
|
||||
</div>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
public function getFormOrderForm($category)
|
||||
{
|
||||
global $link, $cookie;
|
||||
@ -518,10 +616,7 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
$date_now = $date_end->format('d/m/Y H:i:s');
|
||||
|
||||
$export_list = OrderForm::getByCategorie($category->id);
|
||||
|
||||
|
||||
if($export_list && count($export_list) > 0)
|
||||
{
|
||||
if($export_list && count($export_list) > 0) {
|
||||
$old_date = OrderForm::getLastByCategory($category->id);
|
||||
$old_date = new DateManager($old_date);
|
||||
}
|
||||
@ -547,87 +642,145 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<fieldset style="font-size:1em;" id="export_form">
|
||||
<legend>'.$this->l('Export').' :</legend>
|
||||
<div style="width:450px;float:left;">
|
||||
<div>
|
||||
<h4>'.$this->l('Date d\'import').'</h4>
|
||||
Du <input type="text" value="'.$date_first_of_month.'" size="20" id="hasDatepicker_1" style="text-align:center;">
|
||||
<br />
|
||||
Au <input type="text" value="'.$date_now.'" size="20" id="hasDatepicker_2" style="text-align:center;">
|
||||
'.( count($export_list) > 0 ? '<br />
|
||||
Ou
|
||||
<br />
|
||||
<input type="checkbox" id="export_last" value="1"> '.$this->l('depuis la génération du dernier bon').' : '.$old_date->getDate('STR') : '').'
|
||||
<br />
|
||||
<div class="ln_solid"></div>
|
||||
<h2 class="text-center text-purple-dark" id="sale_name"></h2>
|
||||
<br>
|
||||
<div class="row" id="export_form">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="text-left" for="date_start">Du :</label>
|
||||
<div class="input-group input-group-sm ">
|
||||
<div class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></div>
|
||||
<input type="text" class="form-control" value="'.$date_first_of_month.'" name="date_start" id="hasDatepicker_1" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>'.$this->l('Selection du type de fichier').'</h4>
|
||||
<input type="radio" name="export_type" value="1" checked> '.$this->l('Bon de commande').'
|
||||
<br />
|
||||
<input type="radio" name="export_type" value="2"> '.$this->l('Etat de la vente').'
|
||||
<br />
|
||||
<input type="radio" name="export_type" value="3"> '.$this->l('Stats de la vente').'
|
||||
<br />
|
||||
<input type="radio" name="export_type" value="4"> '.$this->l('BDC Logistique').'
|
||||
<br />
|
||||
<input type="radio" name="export_type" value="5"> '.$this->l('Exporter la Vente (ne tient pas compte de la date)').'
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="text-left" for="date_end">Au :</label>
|
||||
<div class="input-group input-group-sm ">
|
||||
<div class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></div>
|
||||
<input type="text" class="form-control" value="'.$date_now.'" name="date_end" id="hasDatepicker_2" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
'.( count($export_list) > 0 ?
|
||||
'<p class="text-center">Ou</p>
|
||||
<div class="form-group row">
|
||||
<label for="export_last" class="col-md-12 text-center">
|
||||
<input type="checkbox" id="export_last" value="1"> '.$this->l('Depuis la génération du dernier bon').' : '.$old_date->getDate('STR').'
|
||||
</label>
|
||||
</div>':''
|
||||
).'
|
||||
</div>
|
||||
|
||||
<h4>'.$this->l('Selection de la langue').'</h4>
|
||||
<input type="radio" name="lang" value="fr" checked> '.$this->l('Français').'
|
||||
<br />
|
||||
<input type="radio" name="lang" value="en"> '.$this->l('Anglais').'
|
||||
';
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label class="text-left" for="export_type">Fichier :</label>
|
||||
<select class="form-control input-sm" name="export_type">
|
||||
<option value="1">'.$this->l('Bon de commande').'</option>
|
||||
<option value="2">'.$this->l('Etat de la vente').'</option>
|
||||
<option value="3">'.$this->l('Stats de la vente').'</option>
|
||||
<option value="4">'.$this->l('BDC Logistique').'</option>
|
||||
<option value="5">'.$this->l('Exporter la Vente (ne tient pas compte de la date)').'</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label class="text-left" for="lang">Langue :</label>
|
||||
<select class="form-control input-sm" name="lang">
|
||||
<option value="fr">'.$this->l('Français').'</option>
|
||||
<option value="en">'.$this->l('Anglais').'</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label style="opacity:0;">A :</label>
|
||||
<a href="" class="btn btn-primary btn-sm" id="exportorderform">'.$this->l('Obtenir le fichier').'</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>';
|
||||
|
||||
// <div style="width:450px;float:left;">
|
||||
// <div>
|
||||
// <h4>'.$this->l('Date d\'import').'</h4>
|
||||
// Du <input type="text" value="'.$date_first_of_month.'" size="20" id="hasDatepicker_1" style="text-align:center;">
|
||||
// <br />
|
||||
// Au <input type="text" value="'.$date_now.'" size="20" id="hasDatepicker_2" style="text-align:center;">
|
||||
// '.( count($export_list) > 0 ? '<br />
|
||||
// Ou
|
||||
// <br />
|
||||
// <input type="checkbox" id="export_last" value="1"> '.$this->l('depuis la génération du dernier bon').' : '.$old_date->getDate('STR') : '').'
|
||||
// <br />
|
||||
|
||||
// <h4>'.$this->l('Selection du type de fichier').'</h4>
|
||||
// <input type="radio" name="export_type" value="1" checked> '.$this->l('Bon de commande').'
|
||||
// <br />
|
||||
// <input type="radio" name="export_type" value="2"> '.$this->l('Etat de la vente').'
|
||||
// <br />
|
||||
// <input type="radio" name="export_type" value="3"> '.$this->l('Stats de la vente').'
|
||||
// <br />
|
||||
// <input type="radio" name="export_type" value="4"> '.$this->l('BDC Logistique').'
|
||||
// <br />
|
||||
// <input type="radio" name="export_type" value="5"> '.$this->l('Exporter la Vente (ne tient pas compte de la date)').'
|
||||
|
||||
// <h4>'.$this->l('Selection de la langue').'</h4>
|
||||
// <input type="radio" name="lang" value="fr" checked> '.$this->l('Français').'
|
||||
// <br />
|
||||
// <input type="radio" name="lang" value="en"> '.$this->l('Anglais').'
|
||||
// ';
|
||||
|
||||
|
||||
$html .= '<br /><br />
|
||||
<a href="" class="button" id="exportorderform">'.$this->l('Obtenir le fichier').'</a>
|
||||
</div>';
|
||||
// $html .= '<br /><br />
|
||||
// <a href="" class="button" id="exportorderform">'.$this->l('Obtenir le fichier').'</a>
|
||||
// </div>';
|
||||
|
||||
|
||||
$html .= '
|
||||
</div>
|
||||
<div style="width:300px;float:left;padding-left:30px">';
|
||||
|
||||
$html .= $this->getFormOrderFormInfo($category);
|
||||
|
||||
$html .= '
|
||||
</div>
|
||||
<div class="clear">
|
||||
<br /><br />';
|
||||
|
||||
if($export_list && count($export_list) > 0)
|
||||
{
|
||||
<div class="ln_solid"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">';
|
||||
if($export_list && count($export_list) > 0) {
|
||||
$html .= '
|
||||
<table class="table" cellspacing="0" cellpadding="0">
|
||||
<thead><tr><th>'.$this->l('ID').'</th><th>'.$this->l('Date de d\'export').'</th><th>'.$this->l('A partir de').'</th><th>'.$this->l('Jusqu\'a').'</th><th style="text-align:center;">'.$this->l('Exporter à nouveau').'</th></tr></thead>
|
||||
<tbody>';
|
||||
|
||||
foreach($export_list as $export)
|
||||
{
|
||||
$html .='<tr>
|
||||
<td>'.$export['id_order_form'].'</td>
|
||||
<td>'.$export['date_add'].'</td>
|
||||
<td>'.$export['from'].'</td><td>'.$export['to'].'</td>
|
||||
<td style="text-align:center;">';
|
||||
|
||||
// <a href="../modules/privatesales_logistique/exportOrderForm.php?action=getOrderForm&id_exportorderform='.$export['id_order_form'].'&type=1" title="'.$this->l('Exporter le bon de commande').'"><img src="../img/tmp/tab_mini_AdminSuppliers.gif"></a>
|
||||
|
||||
foreach($export_list as $export){
|
||||
$html .='
|
||||
<a href="../modules/privatesales_logistique/exportOrderForm.php?action=getOrderForm&id_exportorderform='.$export['id_order_form'].'&type=1&lang=fr" title="'.$this->l('Exporter le bon de commande').' FR">FR <img src="../img/admin/delivery.gif"></a>
|
||||
<a href="../modules/privatesales_logistique/exportOrderForm.php?action=getOrderForm&id_exportorderform='.$export['id_order_form'].'&type=1&lang=en" title="'.$this->l('Exporter le bon de commande').' EN">EN <img src="../img/admin/delivery.gif"></a>
|
||||
<tr>
|
||||
<td>'.$export['id_order_form'].'</td>
|
||||
<td>'.$export['date_add'].'</td>
|
||||
<td>'.$export['from'].'</td><td>'.$export['to'].'</td>
|
||||
<td style="text-align:center;">';
|
||||
|
||||
<a href="#" title="'.$this->l('Supprimer cette extraction').'" class="deleteOrderForm" data-order-form="'.$export['id_order_form'].'" ><img src="/img/admin/delete.gif"></a>
|
||||
</td></tr>';
|
||||
}
|
||||
// <a href="../modules/privatesales_logistique/exportOrderForm.php?action=getOrderForm&id_exportorderform='.$export['id_order_form'].'&type=1" title="'.$this->l('Exporter le bon de commande').'"><img src="../img/tmp/tab_mini_AdminSuppliers.gif"></a>
|
||||
|
||||
$html .='
|
||||
<a href="../modules/privatesales_logistique/exportOrderForm.php?action=getOrderForm&id_exportorderform='.$export['id_order_form'].'&type=1&lang=fr" title="'.$this->l('Exporter le bon de commande').' FR">FR <img src="../img/admin/delivery.gif"></a>
|
||||
<a href="../modules/privatesales_logistique/exportOrderForm.php?action=getOrderForm&id_exportorderform='.$export['id_order_form'].'&type=1&lang=en" title="'.$this->l('Exporter le bon de commande').' EN">EN <img src="../img/admin/delivery.gif"></a>
|
||||
<a href="#" title="'.$this->l('Supprimer cette extraction').'" class="deleteOrderForm" data-order-form="'.$export['id_order_form'].'" ><img src="/img/admin/delete.gif"></a>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
$html .= '</tbody>
|
||||
</table>';
|
||||
} else {
|
||||
$html .= '<p class="text-center">'.$this->l('Il n\'y a pas d\'anciens exports de bon de commande').'</p>';
|
||||
}
|
||||
else
|
||||
$html .= '<br /><br />'.$this->l('Il n\'y a pas d\'anciens exports de bon de commande');
|
||||
|
||||
$html .= '
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>';
|
||||
<div class="clearfix"></div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
@ -1239,8 +1392,7 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
{
|
||||
global $cookie;
|
||||
|
||||
$html = '
|
||||
<div id="toggle_form_infos" style="cursor:pointer;text-align:center;" class="button">Informations sur le bon de commande</div>';
|
||||
$html = '';
|
||||
$array_lang = array(
|
||||
'fr', 'en'
|
||||
);
|
||||
@ -1275,42 +1427,61 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
}
|
||||
|
||||
$html .= '
|
||||
<form method="post" action="#" id="form_infos" style="display:none;">';
|
||||
<div class="modal fade" id="BDCModal" tabindex="-1" role="dialog" aria-labelledby="BDCModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<form method="post" action="#" id="form_infos">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="BDCModalLabel">Info Bon de Commande</h4>
|
||||
</div>
|
||||
<div class="modal-body">';
|
||||
foreach($array_lang as $key => $lang) {
|
||||
if($key == 1){
|
||||
$html.='<div class="ln_solid"></div>';
|
||||
}
|
||||
$html .= '
|
||||
<div class="col-md-12">
|
||||
<p class="text-center"><strong>'.($lang=="fr"?"Français":"Anglais").'</strong></p>';
|
||||
foreach($array as $k => $arr) {
|
||||
${$arr[0].'_'.$lang} = Configuration::get($k.'_'.$lang);
|
||||
$html .= '
|
||||
<div class="form-group">
|
||||
<label class="text-left">'.$arr[1].'</label>
|
||||
'.(isset($arr[2])
|
||||
? '<textarea class="form-control" name="'.$arr[0].'_'.$lang.'" size="50">'.${$arr[0].'_'.$lang}.'</textarea>'
|
||||
: '<input class="form-control" type="text" value="'.${$arr[0].'_'.$lang}.'" name="'.$arr[0].'_'.$lang.'">' ).'
|
||||
</div>';
|
||||
}
|
||||
$html .= '
|
||||
</div>
|
||||
<div class="clearfix"></div>';
|
||||
}
|
||||
|
||||
foreach($array_lang as $lang)
|
||||
{
|
||||
$html .= '<div><strong>'.$lang.' :</strong></div>';
|
||||
foreach($array as $k => $arr)
|
||||
{
|
||||
${$arr[0].'_'.$lang} = Configuration::get($k.'_'.$lang);
|
||||
$html .= '
|
||||
<br />
|
||||
<div>
|
||||
'.$arr[1].' <br />
|
||||
'.(isset($arr[2])
|
||||
? '<textarea name="'.$arr[0].'_'.$lang.'" size="50">'.${$arr[0].'_'.$lang}.'</textarea>'
|
||||
: '<input type="text" value="'.${$arr[0].'_'.$lang}.'" name="'.$arr[0].'_'.$lang.'" size="50">' ).'
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$order_state = OrderState::getOrderStates($cookie->id_lang);
|
||||
$order_state_selected = explode(',', Configuration::get('PS_IT_OF_ORDER_STATES'));
|
||||
$html .= '
|
||||
<br />
|
||||
<div>
|
||||
'.$this->l('Statut des commandes que vous souhaitez traiter').' : <br /><br />
|
||||
';
|
||||
foreach($order_state as $state)
|
||||
$html .= '<label for="order_state_'.$state['id_order_state'].'" style="float:none;padding:0;font-weight:normal;display:block;cursor:pointer;text-align:left;width:auto;">
|
||||
<input type="checkbox" value="'.$state['id_order_state'].'" '.(in_array($state['id_order_state'], $order_state_selected) ? 'checked' : '').' id="order_state_'.$state['id_order_state'].'" name="states[]"> '.$state['name'].'
|
||||
</label>';
|
||||
$html .= '
|
||||
$order_state = OrderState::getOrderStates($cookie->id_lang);
|
||||
$order_state_selected = explode(',', Configuration::get('PS_IT_OF_ORDER_STATES'));
|
||||
$html .= '
|
||||
<div class="clearfix"></div>
|
||||
<div class="ln_solid"></div>
|
||||
<div class="col-md-12">
|
||||
<p class="text-center">'.$this->l('Statut des commandes que vous souhaitez traiter').' : </p>';
|
||||
foreach($order_state as $state) {
|
||||
$html .= '
|
||||
<label for="order_state_'.$state['id_order_state'].'" style="float:none;padding:0;font-weight:normal;display:block;cursor:pointer;text-align:left;width:auto;">
|
||||
<input type="checkbox" value="'.$state['id_order_state'].'" '.(in_array($state['id_order_state'], $order_state_selected) ? 'checked' : '').' id="order_state_'.$state['id_order_state'].'" name="states[]"> '.$state['name'].'
|
||||
</label>';
|
||||
}
|
||||
$html .= '</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
|
||||
<button type="submit" class="btn btn-primary" name="submitFormInfos">Enregistrer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<input type="submit" value="'.$this->l('Sauvegarder').'" name="submitFormInfos" class="button">
|
||||
</form>';
|
||||
</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user