Merge branch 'change-AdminInvoice' into develop
This commit is contained in:
commit
f07dd8c316
@ -314,10 +314,10 @@ class HelperFormBootstrap{
|
||||
}
|
||||
$this->_html .='
|
||||
<div class="form-group">
|
||||
'.(isset($p['label']) && $p['label'] ?'<label class="control-label '.$p['label-class'].'" for="'.(isset($p['id']) ? $p['id'] : $p['name']).'">'.$p['label'].'</label>':'').'
|
||||
'.(isset($p['label']) && $p['label'] ?'<label class="'.$p['label-class'].'" for="'.(isset($p['id']) ? $p['id'] : $p['name']).'">'.$p['label'].'</label>':'').'
|
||||
<div class="input-group">
|
||||
'.(isset($p['before']) && $p['before'] ?'<div class="input-group-addon">'.$p['before'].'</div>':'').'
|
||||
<input type="text" class="form-control" name="'.$p['name'].'" id="'.(isset($p['id']) ? $p['id'] : $p['name']).'" placeholder="'.((isset($p['placeholder']) && $p['placeholder'])?$p['placeholder']:'').'">
|
||||
<input type="text" class="form-control" value="'.(isset($p['value'])?$p['value']:'').'" name="'.$p['name'].'" id="'.(isset($p['id']) ? $p['id'] : $p['name']).'" placeholder="'.((isset($p['placeholder']) && $p['placeholder'])?$p['placeholder']:'').'">
|
||||
'.(isset($p['after']) && $p['after'] ?'<div class="input-group-addon">'.$p['after'].'</div>':'').'
|
||||
</div>
|
||||
</div>';
|
||||
@ -325,10 +325,10 @@ class HelperFormBootstrap{
|
||||
$this->_html .='</div>
|
||||
<div class="'.(isset($p['class-to'])?$p['class-to']:'').'">
|
||||
<div class="form-group">
|
||||
'.(isset($p['label-to']) && $p['label-to'] ?'<label class="control-label '.$p['label-class'].'" for="'.(isset($p['id-to']) ? $p['id-to'] : $p['name-to']).'">'.$p['label-to'].'</label>':'').'
|
||||
'.(isset($p['label-to']) && $p['label-to'] ?'<label class="'.$p['label-class'].'" for="'.(isset($p['id-to']) ? $p['id-to'] : $p['name-to']).'">'.$p['label-to'].'</label>':'').'
|
||||
<div class="input-group">
|
||||
'.(isset($p['before-to']) && $p['before-to'] ?'<div class="input-group-addon">'.$p['before-to'].'</div>':'').'
|
||||
<input type="text" class="form-control" name="'.$p['name-to'].'" id="'.(isset($p['id-to']) ? $p['id-to'] : $p['name-to']).'" placeholder="'.((isset($p['placeholder-to']) && $p['placeholder-to'])?$p['placeholder-to']:'').'">
|
||||
<input type="text" class="form-control" value="'.(isset($p['value-to'])?$p['value-to']:'').'" name="'.$p['name-to'].'" id="'.(isset($p['id-to']) ? $p['id-to'] : $p['name-to']).'" placeholder="'.((isset($p['placeholder-to']) && $p['placeholder-to'])?$p['placeholder-to']:'').'">
|
||||
'.(isset($p['after-to']) && $p['after-to'] ?'<div class="input-group-addon">'.$p['after-to'].'</div>':'').'
|
||||
</div>
|
||||
</div>
|
||||
|
@ -65,6 +65,11 @@ h2 {
|
||||
label{
|
||||
color: #504d8b;
|
||||
}
|
||||
form label{
|
||||
float: none;
|
||||
width: auto;
|
||||
text-align: left;
|
||||
}
|
||||
.panel{
|
||||
border-radius: 0px;
|
||||
-moz-box-shadow: 2px 2px 5px #cccccc;
|
||||
@ -225,6 +230,13 @@ div.tagsinput span.tag a {
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"],
|
||||
input[type="file"],
|
||||
textarea {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
/* table */
|
||||
table.table-custombordered {
|
||||
border: 1px solid rgba(221,221,221,0.78);
|
||||
|
@ -24,6 +24,8 @@
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
require_once(PS_ADMIN_DIR . '/helpers/HelperFormBootstrap.php');
|
||||
require_once(PS_ADMIN_DIR . '/helpers/HelperList.php');
|
||||
|
||||
class AdminInvoices extends AdminTab
|
||||
{
|
||||
@ -66,51 +68,154 @@ class AdminInvoices extends AdminTab
|
||||
foreach ($result as $row)
|
||||
$statusStats[$row['id_order_state']] = $row['nbOrders'];
|
||||
|
||||
$helperForm = new HelperFormBootstrap();
|
||||
$helperForm->_inputMask = true;
|
||||
$helperForm->_forms = array(
|
||||
array(
|
||||
'action' => $currentIndex.'&token='.$this->token,
|
||||
'title' => $this->l('Print PDF ').' - '.$this->l('By date and Sale'),
|
||||
'icon' => '<span class="anticon anticon-file-pdf"></span> ',
|
||||
'class' => 'form-horizontal',
|
||||
'class_div' => 'col-md-6',
|
||||
'sections' => array(
|
||||
array(
|
||||
'inputs' => array(
|
||||
array(
|
||||
'type' => 'simpleDate',
|
||||
'period' => true,
|
||||
'class-from' => 'col-md-6',
|
||||
'class-to' => 'col-md-6',
|
||||
'id' => 'date_from',
|
||||
'id-to' => 'date_to',
|
||||
'name' => 'date_from',
|
||||
'name-to' => 'date_to',
|
||||
'label' => $this->l('De :'),
|
||||
'label-to' => $this->l('A :'),
|
||||
'label-class' => 'text-left',
|
||||
'before' => '<span class="glyphicon glyphicon-calendar"></span>',
|
||||
'before-to' => '<span class="glyphicon glyphicon-calendar"></span>',
|
||||
'value' => (!empty(Tools::getValue('date_from')) ? Tools::getValue('date_from') : date('Y-m-d')),
|
||||
'value-to' => (!empty(Tools::getValue('date_to')) ? Tools::getValue('date_to') : date('Y-m-d')),
|
||||
),
|
||||
),
|
||||
'actions' => array(
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'class' => 'btn-primary',
|
||||
'name' => 'submitGetSale',
|
||||
'value' => $this->l('Get Sales')
|
||||
)
|
||||
),
|
||||
'actions-class' => 'text-right',
|
||||
),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'action' => $currentIndex.'&token='.$this->token,
|
||||
'title' => $this->l('Print PDF invoices').' - '.$this->l('By date'),
|
||||
'icon' => '<span class="anticon anticon-file-pdf"></span> ',
|
||||
'class' => 'form-horizontal',
|
||||
'class_div' => 'col-md-6',
|
||||
'sections' => array(
|
||||
array(
|
||||
'inputs' => array(
|
||||
array(
|
||||
'type' => 'simpleDate',
|
||||
'period' => true,
|
||||
'class-from' => 'col-md-6',
|
||||
'class-to' => 'col-md-6',
|
||||
'id' => 'date_from2',
|
||||
'id-to' => 'date_to2',
|
||||
'name' => 'date_from',
|
||||
'name-to' => 'date_to',
|
||||
'label' => $this->l('De :'),
|
||||
'label-to' => $this->l('A :'),
|
||||
'label-class' => 'text-left',
|
||||
'before' => '<span class="glyphicon glyphicon-calendar"></span>',
|
||||
'before-to' => '<span class="glyphicon glyphicon-calendar"></span>',
|
||||
'value' => date('Y-m-d'),
|
||||
'value-to' => date('Y-m-d'),
|
||||
),
|
||||
),
|
||||
'actions' => array(
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'class' => 'btn-primary',
|
||||
'name' => 'submitPrint',
|
||||
'value' => $this->l('Generate PDF file')
|
||||
)
|
||||
),
|
||||
'actions-class' => 'text-right',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
echo '<h2>'.$this->l('Print PDF ').'</h2>
|
||||
<fieldset style="width:300px;margin-right: 10px;"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('By date').'</legend>
|
||||
<form action="'.$currentIndex.'&token='.$this->token.'" method="post">
|
||||
<label style="width:90px">'.$this->l('From:').' </label>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<input type="text" size="4" maxlength="10" name="date_from" value="'.(!empty(Tools::getValue('date_from')) ? Tools::getValue('date_from') : date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
|
||||
<p class="clear">'.$this->l('Format: 2007-12-31 (inclusive)').'</p>
|
||||
</div>
|
||||
<label style="width:90px">'.$this->l('To:').' </label>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<input type="text" size="4" maxlength="10" name="date_to" value="'.(!empty(Tools::getValue('date_to')) ? Tools::getValue('date_to') : date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
|
||||
<p class="clear">'.$this->l('Format: 2008-12-31 (inclusive)').'</p>
|
||||
</div>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<input type="submit" value="'.$this->l('Get Sales').'" name="submitGetSale" class="button" />
|
||||
</div>
|
||||
<div class="small"><sup>*</sup> '.$this->l('Required fields').'</div>
|
||||
</form>
|
||||
</fieldset>';
|
||||
$helperForm->_css .= '
|
||||
#invoices_form .table tr th {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
}
|
||||
#invoices_form .table tr td {
|
||||
border-bottom: 1px solid #DEDEDE;
|
||||
color: #000;
|
||||
height: auto;
|
||||
padding: 5px 4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
#invoices_form .table tr td label {
|
||||
font-size: 13px;
|
||||
}
|
||||
#invoices_form input[type=checkbox],
|
||||
#invoices_form input[type=radio] {
|
||||
margin: 0;
|
||||
}
|
||||
';
|
||||
|
||||
$helperForm->_js .= '
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#date_from").inputmask("9999-99-99");
|
||||
$("#date_to").inputmask("9999-99-99");
|
||||
$("#date_from2").inputmask("9999-99-99");
|
||||
$("#date_to2").inputmask("9999-99-99");
|
||||
$("#date_from3").inputmask("9999-99-99");
|
||||
$("#date_to3").inputmask("9999-99-99");
|
||||
});
|
||||
</script>';
|
||||
|
||||
$form .= $helperForm->renderStyle();
|
||||
$form .= '<div class="row">'.$helperForm->renderForm(false, NULL, NULL, true).'</div>';
|
||||
|
||||
if($this->print_sales) {
|
||||
echo '<form id="form_admin_invoice" action="'.$currentIndex.'&token='.$this->token.'" method="post">
|
||||
<table class="table" style="margin-top:30px; width: 100%">';
|
||||
$form .= '<div class="panel">
|
||||
<div class="panel-title">
|
||||
<h2>Factures par vente</h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<form id="invoices_form" action="'.$currentIndex.'&token='.$this->token.'" method="post">
|
||||
<table class="table table-custombordered">';
|
||||
|
||||
/*echo '
|
||||
<tr>
|
||||
<td colspan="6"></td>
|
||||
<td align="center"><a id="checkm3" data-checked="0" href="#">'. $this->l('Check all') .'</a></td>
|
||||
</tr>*/
|
||||
echo '<tr>
|
||||
<th align="center" width="50">'.$this->l('Id Sale').'</th>
|
||||
$form .= '<tr>
|
||||
<th colspan="2">'.$this->l('ID Sale').'</th>
|
||||
<th>'.$this->l('Name sale').'</th>
|
||||
<th align="center">'.$this->l('Date start').'</th>';
|
||||
<th>'.$this->l('Date start').'</th>';
|
||||
/*<th align="center">48h</th>';
|
||||
if ($cookie->id_employee == 1) {
|
||||
echo '<th align="center">48H bis</th>';
|
||||
}*/
|
||||
echo '<th align="center">M1</th>';
|
||||
/*<th align="center">M2</th>*/
|
||||
echo '<th align="center">M2+</th>
|
||||
<th align="center">Même marque</th>
|
||||
<th align="center">All</th>
|
||||
<th align="center">'. $this->l('Delay') .'</th>
|
||||
$form .= '<th>M1</th>';
|
||||
/*<th>M2</th>*/
|
||||
$form .= '<th>M2+</th>
|
||||
<th>Même marque</th>
|
||||
<th>All</th>
|
||||
<th>'. $this->l('Delay') .'</th>
|
||||
</tr>';
|
||||
// <th align="center">M2\'</th>
|
||||
$id_sales = unserialize(Configuration::get("ANT_CHECKED_SALES"));
|
||||
@ -122,10 +227,11 @@ class AdminInvoices extends AdminTab
|
||||
}
|
||||
$date = DateTime::createFromFormat('Y-m-d H:i:s', $sale['date_start']);
|
||||
|
||||
echo '<tr class="'.$class.'">
|
||||
<td align="center">'. $sale['id_sale'] .'</td>
|
||||
<td><label for="multi_'.$sale['id_sale'].'" style="text-align: left; font-weight: bold">'. $sale['title'] .'<label></td>
|
||||
<td align="center">'. $date->format('Y-m-d') .'</td>';
|
||||
$form .= '<tr class="'.$class.'">
|
||||
<td></td>
|
||||
<td><label for="multi_'.$sale['id_sale'].'" style="float:none; width:auto; padding: 0; text-align: left; font-weight: normal; margin:0;">'. $sale['id_sale'] .'</label></td>
|
||||
<td><label for="multi_'.$sale['id_sale'].'" style="float:none; width:auto; padding: 0; text-align: left; font-weight: normal; margin:0;"><strong>'. $sale['title'] .'</strong></label></td>
|
||||
<td align="center"><p style="padding:0px;color: #565485;font-size:12px;">'. $date->format('Y-m-d') .'</p></td>';
|
||||
/*<td align="center">';
|
||||
if ($sale['delivery_delay'] == 2
|
||||
|| $sale['delivery_delay'] == 6) {
|
||||
@ -147,7 +253,7 @@ class AdminInvoices extends AdminTab
|
||||
}
|
||||
}
|
||||
echo '</td>*/
|
||||
echo '</td>
|
||||
$form .= '</td>
|
||||
<td align="center">
|
||||
<!--a title="Facture - Avec prix" onclick="this.target=\'_blank\'" href="'.$currentIndex.'&printM1=1&id_sale='. $sale['id_sale'] .'&token='.$this->token.'">
|
||||
<span class="text-green-light anticon anticon-file-pdf" style="cursor:pointer;"></span>
|
||||
@ -162,7 +268,7 @@ class AdminInvoices extends AdminTab
|
||||
</a>
|
||||
</td>*/
|
||||
|
||||
echo '<td align="center"><input id="multi_'. $sale['id_sale'].'" type="checkbox" name="multi2[]" value="'.$sale['id_sale'].'" '.(in_array((int)$sale['id_sale'], $id_sales)?'checked':'').'/></td>
|
||||
$form .= '<td align="center"><input id="multi_'. $sale['id_sale'].'" type="checkbox" name="multi2[]" value="'.$sale['id_sale'].'" '.(in_array((int)$sale['id_sale'], $id_sales)?'checked':'').'/></td>
|
||||
<td align="center"><input id="multi_plus_'. $sale['id_sale'].'" type="checkbox" name="multiPlus[]" value="'.$sale['id_sale'].'"/></td>
|
||||
<td align="center">
|
||||
<!--a onclick="this.target=\'_blank\'" href="'.$currentIndex.'&printAll=1&id_sale='. $sale['id_sale'] .'&token='.$this->token.'">
|
||||
@ -177,8 +283,9 @@ class AdminInvoices extends AdminTab
|
||||
|
||||
}
|
||||
// <td align="center"><input id="m2_'. $sale['id_sale'].'" type="checkbox" name="m2[]" value="'.$sale['id_sale'].'" /></td>
|
||||
echo '<tr>
|
||||
<td colspan="4" style="padding:5px;"></td>';
|
||||
|
||||
$form .= '<tr>
|
||||
<td colspan="5" style="padding:5px;"></td>';
|
||||
// <td colspan="4" style="padding:5px;">
|
||||
// <input type="hidden" name="date_to" value="'. Tools::getValue('date_to') .'" />
|
||||
// <input type="hidden" name="date_from" value="'. Tools::getValue('date_from') .'" />
|
||||
@ -188,134 +295,130 @@ class AdminInvoices extends AdminTab
|
||||
/*<td align="center">
|
||||
<input type="submit" name="submitPrintM2Bis" class="button" value="'.$this->l('Print M2\'').'" />
|
||||
</td>*/
|
||||
echo '<td align="center" style="padding:5px;">
|
||||
<input type="submit" name="submitPrintM2Plus" class="btn btn-bbb btn-xs" value="'.$this->l('Print M2+').'" />
|
||||
<input type="submit" name="resetPrintM2Plus" class="btn btn-bbb btn-xs" value="'.$this->l('Unselect all').'" />
|
||||
$form .= '<td align="center" style="padding:5px;">
|
||||
<input type="submit" name="submitPrintM2Plus" class="btn btn-default btn-xs" value="'.$this->l('Print M2+').'" />
|
||||
<input type="submit" name="resetPrintM2Plus" class="btn btn-default btn-xs" value="'.$this->l('Unselect all').'" />
|
||||
</td>
|
||||
<td align="center" style="padding:5px;">
|
||||
<input type="submit" name="submitPrintMPlus" class="btn btn-bbb btn-xs" value="'.$this->l('Print Même Marque').'" />
|
||||
<input type="submit" name="submitPrintMPlus" class="btn btn-default btn-xs" value="'.$this->l('Print Même Marque').'" />
|
||||
</td>
|
||||
<td style="padding:5px;">
|
||||
<p><label style="float:none;" class="text-purple"><input type="checkbox" name="gift" value="1" /> '.$this->l('Factures Cadeaux').'</label></p>
|
||||
<p><label style="float:none;"><input type="checkbox" name="gift" value="1" /> '.$this->l('Factures Cadeaux').'</label></p>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>';
|
||||
echo '</table>
|
||||
</form>';
|
||||
$form .= '</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
echo '<br />';
|
||||
|
||||
echo '
|
||||
<h2>'.$this->l('Print PDF invoices').'</h2>
|
||||
<fieldset style="float:left;width:300px;margin-right: 10px;"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('By date').'</legend>
|
||||
<form action="'.$currentIndex.'&token='.$this->token.'" method="post">
|
||||
<label style="width:90px">'.$this->l('From:').' </label>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<input type="text" size="4" maxlength="10" name="date_from" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
|
||||
<p class="clear">'.$this->l('Format: 2007-12-31 (inclusive)').'</p>
|
||||
</div>
|
||||
<label style="width:90px">'.$this->l('To:').' </label>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<input type="text" size="4" maxlength="10" name="date_to" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
|
||||
<p class="clear">'.$this->l('Format: 2008-12-31 (inclusive)').'</p>
|
||||
</div>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<input type="submit" value="'.$this->l('Generate PDF file').'" name="submitPrint" class="button" />
|
||||
</div>
|
||||
<div class="small"><sup>*</sup> '.$this->l('Required fields').'</div>
|
||||
</form>
|
||||
</fieldset>';
|
||||
|
||||
$form .= '<div class="row">';
|
||||
if(Module::isInstalled('privatesales')) {
|
||||
include_once(dirname(__FILE__).'/../../modules/privatesales/Sale.php');
|
||||
echo '
|
||||
<fieldset style="float:left;width:450px;margin-bottom:10px;margin-right: 10px;"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('By private sale').'</legend>
|
||||
<form action="'.$currentIndex.'&token='.$this->token.'" method="post">
|
||||
<div><strong>'.$this->l('Orders from a single sale').'</strong></div>
|
||||
<br />
|
||||
<label style="width:90px">'.$this->l('Select a sale:').' </label>
|
||||
<div class="margin-form" style="padding-left:100px"><br />
|
||||
<select name="id_sale">
|
||||
';
|
||||
// foreach(Sale::getSales(NULL, NULL, NULL, NULL, FALSE, FALSE, '`date_start` DESC') as $sale) {
|
||||
// echo '<option value="'.$sale->id.'">'.$sale->id.' - '.$sale->title[(int) $cookie->id_lang].'</option>';
|
||||
// }
|
||||
echo '</select>
|
||||
<div class="clear"></div>
|
||||
$form .= '<div class="col-md-6">
|
||||
<div class="panel">
|
||||
<div class="panel-title">
|
||||
<h2>'.$this->l('By private sale').'</h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<form action="'.$currentIndex.'&token='.$this->token.'" method="post" class="form-inline">
|
||||
<div><strong>'.$this->l('Orders from a single sale').'</strong></div>
|
||||
<br />
|
||||
<div class="form-group">
|
||||
<label>'.$this->l('Select a sale:').' </label>
|
||||
<select class="form-control" name="id_sale" disabled="disabled">
|
||||
<option>Fonction inactive</option>
|
||||
';
|
||||
// foreach(Sale::getSales(NULL, NULL, NULL, NULL, FALSE, FALSE, '`date_start` DESC') as $sale) {
|
||||
// echo '<option value="'.$sale->id.'">'.$sale->id.' - '.$sale->title[(int) $cookie->id_lang].'</option>';
|
||||
// }
|
||||
$form .= '</select>
|
||||
<input type="submit" value="'.$this->l('Generate PDF file').'" name="submitPrintOneSale" class="btn btn-primary btn-sm" disabled="disabled"/>
|
||||
</div>
|
||||
<div class="ln_solid-small"></div>
|
||||
<div><strong>'.$this->l('Orders from multiple sales').'</strong></div>
|
||||
<br>
|
||||
<div>
|
||||
<div class="form-group">
|
||||
<div class="input-group col-md-4">
|
||||
<div class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></div>
|
||||
<input type="text" class="form-control" name="date_from" value="'.(date('Y-m-d')).'" id="date_from3">
|
||||
</div>
|
||||
<label>'.$this->l('To:').' </label>
|
||||
<div class="input-group col-md-4">
|
||||
<div class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></div>
|
||||
<input type="text" class="form-control" name="date_to" value="'.(date('Y-m-d')).'" id="date_to3">
|
||||
</div>
|
||||
<input type="submit" value="'.$this->l('Generate PDF file').'" name="submitPrintMultipleSales" class="btn btn-primary btn-sm" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</form>
|
||||
<div class="ln_solid-small"></div>
|
||||
<div class="text-center">';
|
||||
if(Tools::getValue('check_print')) {
|
||||
$check = '';
|
||||
$token = Tools::getAdminTokenLite('AdminOrders');
|
||||
foreach(Db::getInstance()->ExecuteS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
WHERE o.`invoice_number` != 0
|
||||
AND o.`id_order` NOT IN (
|
||||
SELECT p.`id_order`
|
||||
FROM `'._DB_PREFIX_.'privatesale_printedinvoices` p
|
||||
)
|
||||
') as $not_printed) {
|
||||
$check .= '<li><a href="/adm/index.php?tab=AdminOrders&vieworder&id_order='.$not_printed['id_order'].'&token='.$token.'" onclick="window.open(this.href); return false;">'.$not_printed['id_order'].'</a></li>';
|
||||
}
|
||||
$form .= '<strong>'.$this->l('Unprinted orders:').'</strong><ul>'.$check.'</ul>';
|
||||
} else {
|
||||
$form .= '<a class="btn btn-primary" href="'.$_SERVER['REQUEST_URI'].'&check_print=1">'.$this->l('Display unprinted orders').'</a>';
|
||||
}
|
||||
$form .= '</div>
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<input type="submit" value="'.$this->l('Generate PDF file').'" name="submitPrintOneSale" class="button" />
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div><strong>'.$this->l('Orders from multiple sales').'</strong></div>
|
||||
<br />
|
||||
<label style="width:90px">'.$this->l('From:').' </label>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<input type="text" size="4" maxlength="10" name="date_from" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
|
||||
<p class="clear">'.$this->l('Format: 2007-12-31 (inclusive)').'</p>
|
||||
</div>
|
||||
<label style="width:90px">'.$this->l('To:').' </label>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<input type="text" size="4" maxlength="10" name="date_to" value="'.(date('Y-m-d')).'" style="width: 120px;" /> <sup>*</sup>
|
||||
<p class="clear">'.$this->l('Format: 2008-12-31 (inclusive)').'</p>
|
||||
</div>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<input type="submit" value="'.$this->l('Generate PDF file').'" name="submitPrintMultipleSales" class="button" />
|
||||
</div>
|
||||
<div class="small"><sup>*</sup> '.$this->l('Required fields').'</div>
|
||||
</form>
|
||||
<br /><br />
|
||||
<div style="padding-left:100px">';
|
||||
if(Tools::getValue('check_print')) {
|
||||
$check = '';
|
||||
$token = Tools::getAdminTokenLite('AdminOrders');
|
||||
foreach(Db::getInstance()->ExecuteS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
WHERE o.`invoice_number` != 0
|
||||
AND o.`id_order` NOT IN (
|
||||
SELECT p.`id_order`
|
||||
FROM `'._DB_PREFIX_.'privatesale_printedinvoices` p
|
||||
)
|
||||
') as $not_printed) {
|
||||
$check .= '<li><a href="/adm/index.php?tab=AdminOrders&vieworder&id_order='.$not_printed['id_order'].'&token='.$token.'" onclick="window.open(this.href); return false;">'.$not_printed['id_order'].'</a></li>';
|
||||
}
|
||||
echo '<strong>'.$this->l('Unprinted orders:').'</strong><ul>'.$check.'</ul>';
|
||||
} else {
|
||||
echo '<a class="button" href="'.$_SERVER['REQUEST_URI'].'&check_print=1">'.$this->l('Display unprinted orders').'</a>';
|
||||
}
|
||||
echo '</div>
|
||||
<br />
|
||||
</fieldset>';
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '<fieldset style="float:left;width: 500px;margin-left:10px"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('By statuses').'</legend>
|
||||
<form action="'.$currentIndex.'&token='.$this->token.'" method="post">
|
||||
<label style="width:90px">'.$this->l('Statuses').' :</label>
|
||||
<div class="margin-form" style="padding-left:100px">
|
||||
<ul>';
|
||||
foreach ($statuses as $status)
|
||||
echo ' <li style="list-style: none;">
|
||||
<input type="checkbox" name="id_order_state[]" value="'.(int)$status['id_order_state'].'" id="id_order_state_'.(int)$status['id_order_state'].'">
|
||||
<label for="id_order_state_'.(int)$status['id_order_state'].'" style="float:none;'.((isset($statusStats[$status['id_order_state']]) AND $statusStats[$status['id_order_state']]) ? '' : 'font-weight:normal;').'padding:0;text-align:left;width:100%;color:#000">
|
||||
<img src="../img/admin/charged_'.($status['invoice'] ? 'ok' : 'ko').'.gif" alt="" />
|
||||
'.$status['name'].' ('.((isset($statusStats[$status['id_order_state']]) AND $statusStats[$status['id_order_state']]) ? $statusStats[$status['id_order_state']] : '0').')
|
||||
</label>
|
||||
</li>';
|
||||
echo ' </ul>
|
||||
<p class="clear">'.$this->l('You can also export orders which have not been charged yet.').'(<img src="../img/admin/charged_ko.gif" alt="" />)</p>
|
||||
$form .= '<div class="col-md-6">
|
||||
<div class="panel">
|
||||
<div class="panel-title">
|
||||
<h2>'.$this->l('By statuses').'</h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<form action="'.$currentIndex.'&token='.$this->token.'" method="post">
|
||||
<label style="width:90px">'.$this->l('Statuses').' :</label>
|
||||
<div class="margin-form" style="padding-left:100px">';
|
||||
foreach ($statuses as $status)
|
||||
$form .= '<div class="checkbox">
|
||||
<label for="id_order_state_'.(int)$status['id_order_state'].'" style="'.((isset($statusStats[$status['id_order_state']]) AND $statusStats[$status['id_order_state']]) ? 'font-weight: bold;' : 'font-weight:normal;').'color:#000">
|
||||
<input type="checkbox" name="id_order_state[]" value="'.(int)$status['id_order_state'].'" id="id_order_state_'.(int)$status['id_order_state'].'">
|
||||
<img src="../img/admin/charged_'.($status['invoice'] ? 'ok' : 'ko').'.gif" alt="" />
|
||||
'.$status['name'].' ('.((isset($statusStats[$status['id_order_state']]) AND $statusStats[$status['id_order_state']]) ? $statusStats[$status['id_order_state']] : '0').')
|
||||
</label>
|
||||
</div>';
|
||||
$form .= '<p class="clear">'.$this->l('You can also export orders which have not been charged yet.').'(<img src="../img/admin/charged_ko.gif" alt="" />)</p>
|
||||
</div>
|
||||
<div class="ln_solid-small"></div>
|
||||
<div class="form-group text-right">
|
||||
<input type="submit" value="'.$this->l('Generate PDF file').'" name="submitPrint2" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="margin-form">
|
||||
<input type="submit" value="'.$this->l('Generate PDF file').'" name="submitPrint2" class="button" />
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
<div class="clear"> </div>';
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>';
|
||||
|
||||
$form .= '</div>';
|
||||
$form .= $helperForm->renderScript();
|
||||
echo $form;
|
||||
|
||||
echo '<script>
|
||||
$(\'input[name="m2[]"]\').live("click", function(e){
|
||||
$(\'input[name="m2[]"]\').on("click", function(e){
|
||||
if ($(\'input[name="m2[]"]:checked\').length > 2 ) {
|
||||
alert("You can choose only 2 sales for this export");
|
||||
return false;
|
||||
@ -324,8 +427,7 @@ class AdminInvoices extends AdminTab
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#checkm3").live("click", function(e){
|
||||
$("#checkm3").on("click", function(e){
|
||||
e.preventDefault();
|
||||
if( $(this).attr("data-checked") == 0 ) {
|
||||
$(\'input[name="multi3[]"]\').each(function(){
|
||||
@ -362,6 +464,104 @@ class AdminInvoices extends AdminTab
|
||||
return parent::displayForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Override Antadis Options lists
|
||||
*/
|
||||
public function displayOptionsList()
|
||||
{
|
||||
global $currentIndex, $cookie, $tab;
|
||||
|
||||
if (!isset($this->_fieldsOptions) OR !sizeof($this->_fieldsOptions))
|
||||
return false;
|
||||
|
||||
$defaultLanguage = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
$this->_languages = Language::getLanguages(false);
|
||||
$tab = Tab::getTab((int)$cookie->id_lang, Tab::getIdFromClassName($tab));
|
||||
echo '<br /><br />';
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
id_language = Number('.$defaultLanguage.');
|
||||
</script>
|
||||
<div class="panel">
|
||||
<div class="panel-title">
|
||||
<h2>'.(isset($this->optionTitle) ? '<h2>'.$this->optionTitle.'</h2>' : '').'</h2>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<form action="'.$currentIndex.'" id="'.$tab['name'].'" name="'.$tab['name'].'" method="post" class="form-horizontal">';
|
||||
foreach ($this->_fieldsOptions AS $key => $field)
|
||||
{
|
||||
$val = Tools::getValue($key, Configuration::get($key));
|
||||
if ($field['type'] != 'textLang')
|
||||
if (!Validate::isCleanHtml($val))
|
||||
$val = Configuration::get($key);
|
||||
|
||||
echo '<div class="form-group">
|
||||
<label class="col-sm-2 col-offset-sm-2 control-label">'.$field['title'].' </label>
|
||||
<div class="col-sm-6">';
|
||||
switch ($field['type'])
|
||||
{
|
||||
case 'select':
|
||||
echo '<select class="form-control" name="'.$key.'">';
|
||||
foreach ($field['list'] AS $value)
|
||||
echo '<option
|
||||
value="'.(isset($field['cast']) ? $field['cast']($value[$field['identifier']]) : $value[$field['identifier']]).'"'.($val == $value[$field['identifier']] ? ' selected="selected"' : '').'>'.$value['name'].'</option>';
|
||||
echo '</select>';
|
||||
break;
|
||||
case 'bool':
|
||||
echo '<label class="radio-inline" for="'.$key.'_on">
|
||||
<input type="radio" name="'.$key.'" id="'.$key.'_on" value="1"'.($val ? ' checked="checked"' : '').' /> <span><span class="anticon anticon-checkmark text-green-light"></span> '.$this->l('Yes').'</span>
|
||||
</label>
|
||||
<label class="radio-inline" for="'.$key.'_off">
|
||||
<input type="radio" name="'.$key.'" id="'.$key.'_off" value="0" '.(!$val ? 'checked="checked"' : '').'/> <span><span class="anticon anticon-cross text-rose"></span> '.$this->l('No').'</span>
|
||||
</label>';
|
||||
break;
|
||||
case 'textLang':
|
||||
foreach ($this->_languages as $language)
|
||||
{
|
||||
$val = Tools::getValue($key.'_'.$language['id_lang'], Configuration::get($key, $language['id_lang']));
|
||||
if (!Validate::isCleanHtml($val))
|
||||
$val = Configuration::get($key);
|
||||
echo '
|
||||
<div id="'.$key.'_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $defaultLanguage ? 'block' : 'none').';">
|
||||
<input class="form-control" size="'.$field['size'].'" type="text" name="'.$key.'_'.$language['id_lang'].'" value="'.$val.'" />
|
||||
</div>';
|
||||
}
|
||||
$this->displayFlags($this->_languages, $defaultLanguage, $key, $key);
|
||||
echo '<br style="clear:both">';
|
||||
break;
|
||||
case 'textareaLang':
|
||||
foreach ($this->_languages as $language)
|
||||
{
|
||||
$val = Configuration::get($key, $language['id_lang']);
|
||||
echo '
|
||||
<div id="'.$key.'_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $defaultLanguage ? 'block' : 'none').';">
|
||||
<textarea class="form-control" rows="3" name="'.$key.'_'.$language['id_lang'].'">'.str_replace('\r\n', "\n", $val).'</textarea>
|
||||
</div>';
|
||||
}
|
||||
$this->displayFlags($this->_languages, $defaultLanguage, $key, $key);
|
||||
echo '<br style="clear:both">';
|
||||
break;
|
||||
case 'text':
|
||||
default:
|
||||
echo '<input type="text" class="form-control" name="'.$key.'" value="'.$val.'" size="'.$field['size'].'" />'.(isset($field['suffix']) ? $field['suffix'] : '');
|
||||
}
|
||||
|
||||
echo (isset($field['desc']) ? '<span class="help-block">'.$field['desc'].'</span>' : '');
|
||||
echo '<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
echo '<div class="ln_solid-small"></div>
|
||||
<div class="text-right">
|
||||
<input type="submit" value="'.$this->l(' Save ').'" name="submitOptions'.$this->table.'" class="btn btn-primary" />
|
||||
</div>
|
||||
<input type="hidden" name="token" value="'.$this->token.'" />
|
||||
</form>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
|
||||
public function ajaxProcessResetPrintM2Plus()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user