Merge branch 'develop' into 20201027_phpcs
This commit is contained in:
commit
5f3596ef3e
@ -616,6 +616,12 @@ class Documents extends DolibarrApi
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
$object = new Adherent($this->db);
|
$object = new Adherent($this->db);
|
||||||
}
|
}
|
||||||
|
elseif ($modulepart == 'proposal' || $modulepart == 'propal' || $modulepart == 'propale')
|
||||||
|
{
|
||||||
|
$modulepart = 'propale';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
|
$object = new Propal($this->db);
|
||||||
|
}
|
||||||
// TODO Implement additional moduleparts
|
// TODO Implement additional moduleparts
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3189,12 +3189,14 @@ class Product extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param string $sql Request to execute
|
* @param string $sql Request to execute
|
||||||
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
||||||
* @param int $year Year (0=current year)
|
* @param int $year Year (0=current year, -1=all years)
|
||||||
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
||||||
*/
|
*/
|
||||||
private function _get_stats($sql, $mode, $year = 0)
|
private function _get_stats($sql, $mode, $year = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
|
$tab = array();
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
@ -3202,11 +3204,15 @@ class Product extends CommonObject
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$arr = $this->db->fetch_array($resql);
|
$arr = $this->db->fetch_array($resql);
|
||||||
if ($mode == 'byunit') {
|
$keyfortab = (string) $arr[1];
|
||||||
$tab[$arr[1]] = $arr[0]; // 1st field
|
if ($year == -1) {
|
||||||
|
$keyfortab = substr($keyfortab, -2);
|
||||||
}
|
}
|
||||||
if ($mode == 'bynumber') {
|
|
||||||
$tab[$arr[1]] = $arr[2]; // 3rd field
|
if ($mode == 'byunit') {
|
||||||
|
$tab[$keyfortab] = (empty($tab[$keyfortab]) ? 0 : $tab[$keyfortab]) + $arr[0]; // 1st field
|
||||||
|
} elseif ($mode == 'bynumber') {
|
||||||
|
$tab[$keyfortab] = (empty($tab[$keyfortab]) ? 0 : $tab[$keyfortab]) + $arr[2]; // 3rd field
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -3218,16 +3224,21 @@ class Product extends CommonObject
|
|||||||
if (empty($year)) {
|
if (empty($year)) {
|
||||||
$year = strftime('%Y', time());
|
$year = strftime('%Y', time());
|
||||||
$month = strftime('%m', time());
|
$month = strftime('%m', time());
|
||||||
|
} elseif ($year == -1) {
|
||||||
|
$year = '';
|
||||||
|
$month = 12; // We imagine we are at end of year, so we get last 12 month before, so all correct year.
|
||||||
} else {
|
} else {
|
||||||
$month = 12; // We imagine we are at end of year, so we get last 12 month before, so all correct year.
|
$month = 12; // We imagine we are at end of year, so we get last 12 month before, so all correct year.
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
for ($j = 0; $j < 12; $j++)
|
for ($j = 0; $j < 12; $j++)
|
||||||
{
|
{
|
||||||
//$idx = ucfirst(dol_trunc(dol_print_date(dol_mktime(12, 0, 0, $month, 1, $year), "%b"), 3, 'right', 'UTF-8', 1));
|
// $ids is 'D', 'N', 'O', 'S', ... (First letter of month in user language)
|
||||||
$idx = ucfirst(dol_trunc(dol_print_date(dol_mktime(12, 0, 0, $month, 1, $year), "%b"), 1, 'right', 'UTF-8', 1));
|
$idx = ucfirst(dol_trunc(dol_print_date(dol_mktime(12, 0, 0, $month, 1, 1970), "%b"), 1, 'right', 'UTF-8', 1));
|
||||||
|
|
||||||
|
//print $idx.'-'.$year.'-'.$month.'<br>';
|
||||||
$result[$j] = array($idx, isset($tab[$year.$month]) ? $tab[$year.$month] : 0);
|
$result[$j] = array($idx, isset($tab[$year.$month]) ? $tab[$year.$month] : 0);
|
||||||
// $result[$j] = array($monthnum,isset($tab[$year.$month])?$tab[$year.$month]:0);
|
// $result[$j] = array($monthnum,isset($tab[$year.$month])?$tab[$year.$month]:0);
|
||||||
|
|
||||||
@ -3252,7 +3263,7 @@ class Product extends CommonObject
|
|||||||
* @param int $socid Limit count on a particular third party id
|
* @param int $socid Limit count on a particular third party id
|
||||||
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
||||||
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
||||||
* @param int $year Year (0=last 12 month)
|
* @param int $year Year (0=last 12 month, -1=all years)
|
||||||
* @param string $morefilter More sql filters
|
* @param string $morefilter More sql filters
|
||||||
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
||||||
*/
|
*/
|
||||||
@ -3305,7 +3316,7 @@ class Product extends CommonObject
|
|||||||
* @param int $socid Limit count on a particular third party id
|
* @param int $socid Limit count on a particular third party id
|
||||||
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
||||||
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
||||||
* @param int $year Year (0=last 12 month)
|
* @param int $year Year (0=last 12 month, -1=all years)
|
||||||
* @param string $morefilter More sql filters
|
* @param string $morefilter More sql filters
|
||||||
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
||||||
*/
|
*/
|
||||||
@ -3357,15 +3368,14 @@ class Product extends CommonObject
|
|||||||
* @param int $socid Limit count on a particular third party id
|
* @param int $socid Limit count on a particular third party id
|
||||||
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
||||||
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
||||||
* @param int $year Year (0=last 12 month)
|
* @param int $year Year (0=last 12 month, -1=all years)
|
||||||
* @param string $morefilter More sql filters
|
* @param string $morefilter More sql filters
|
||||||
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
||||||
*/
|
*/
|
||||||
public function get_nb_propal($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
|
public function get_nb_propal($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf, $user;
|
||||||
global $user;
|
|
||||||
|
|
||||||
$sql = "SELECT sum(d.qty), date_format(p.datep, '%Y%m')";
|
$sql = "SELECT sum(d.qty), date_format(p.datep, '%Y%m')";
|
||||||
if ($mode == 'bynumber') {
|
if ($mode == 'bynumber') {
|
||||||
@ -3409,7 +3419,7 @@ class Product extends CommonObject
|
|||||||
* @param int $socid Limit count on a particular third party id
|
* @param int $socid Limit count on a particular third party id
|
||||||
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
||||||
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
||||||
* @param int $year Year (0=last 12 month)
|
* @param int $year Year (0=last 12 month, -1=all years)
|
||||||
* @param string $morefilter More sql filters
|
* @param string $morefilter More sql filters
|
||||||
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
||||||
*/
|
*/
|
||||||
@ -3461,7 +3471,7 @@ class Product extends CommonObject
|
|||||||
* @param int $socid Limit count on a particular third party id
|
* @param int $socid Limit count on a particular third party id
|
||||||
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
||||||
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
||||||
* @param int $year Year (0=last 12 month)
|
* @param int $year Year (0=last 12 month, -1=all years)
|
||||||
* @param string $morefilter More sql filters
|
* @param string $morefilter More sql filters
|
||||||
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
||||||
*/
|
*/
|
||||||
@ -3512,7 +3522,7 @@ class Product extends CommonObject
|
|||||||
* @param int $socid Limit count on a particular third party id
|
* @param int $socid Limit count on a particular third party id
|
||||||
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
||||||
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
||||||
* @param int $year Year (0=last 12 month)
|
* @param int $year Year (0=last 12 month, -1=all years)
|
||||||
* @param string $morefilter More sql filters
|
* @param string $morefilter More sql filters
|
||||||
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
||||||
*/
|
*/
|
||||||
@ -3563,7 +3573,7 @@ class Product extends CommonObject
|
|||||||
* @param int $socid Limit count on a particular third party id
|
* @param int $socid Limit count on a particular third party id
|
||||||
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
||||||
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
||||||
* @param int $year Year (0=last 12 month)
|
* @param int $year Year (0=last 12 month, -1=all years)
|
||||||
* @param string $morefilter More sql filters
|
* @param string $morefilter More sql filters
|
||||||
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
||||||
*/
|
*/
|
||||||
@ -3617,7 +3627,7 @@ class Product extends CommonObject
|
|||||||
* @param int $socid Limit count on a particular third party id
|
* @param int $socid Limit count on a particular third party id
|
||||||
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
|
||||||
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
|
||||||
* @param int $year Year (0=last 12 month)
|
* @param int $year Year (0=last 12 month, -1=all years)
|
||||||
* @param string $morefilter More sql filters
|
* @param string $morefilter More sql filters
|
||||||
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -162,6 +162,7 @@ if (empty($id) && empty($ref)) {
|
|||||||
|
|
||||||
if ($result || empty($id)) {
|
if ($result || empty($id)) {
|
||||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
@ -188,13 +189,14 @@ if ($result || empty($id)) {
|
|||||||
// Year
|
// Year
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Year").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Year").'</td><td>';
|
||||||
$arrayyears = array();
|
$arrayyears = array();
|
||||||
for ($year = $currentyear - 10; $year < $currentyear + 10; $year++) {
|
for ($year = $currentyear - 25; $year < $currentyear; $year++)
|
||||||
|
{
|
||||||
$arrayyears[$year] = $year;
|
$arrayyears[$year] = $year;
|
||||||
}
|
}
|
||||||
if (!in_array($year, $arrayyears)) $arrayyears[$year] = $year;
|
if (!in_array($year, $arrayyears)) $arrayyears[$year] = $year;
|
||||||
if (!in_array($nowyear, $arrayyears)) $arrayyears[$nowyear] = $nowyear;
|
if (!in_array($currentyear, $arrayyears)) $arrayyears[$currentyear] = $currentyear;
|
||||||
arsort($arrayyears);
|
arsort($arrayyears);
|
||||||
print $form->selectarray('search_year', $arrayyears, $search_year, 0);
|
print $form->selectarray('search_year', $arrayyears, $search_year, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<div class="center"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></div>';
|
print '<div class="center"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></div>';
|
||||||
@ -240,49 +242,49 @@ if ($result || empty($id)) {
|
|||||||
|
|
||||||
if ($conf->propal->enabled) {
|
if ($conf->propal->enabled) {
|
||||||
$graphfiles['propal'] = array('modulepart'=>'productstats_proposals',
|
$graphfiles['propal'] = array('modulepart'=>'productstats_proposals',
|
||||||
'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year ? '_year'.$search_year : '').'.png',
|
'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
|
||||||
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsProposals") : $langs->transnoentitiesnoconv("NumberOfProposals")));
|
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsProposals") : $langs->transnoentitiesnoconv("NumberOfProposals")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->supplier_proposal->enabled) {
|
if ($conf->supplier_proposal->enabled) {
|
||||||
$graphfiles['proposalssuppliers'] = array('modulepart'=>'productstats_proposalssuppliers',
|
$graphfiles['proposalssuppliers'] = array('modulepart'=>'productstats_proposalssuppliers',
|
||||||
'file' => $object->id.'/proposalssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year ? '_year'.$search_year : '').'.png',
|
'file' => $object->id.'/proposalssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
|
||||||
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierProposals") : $langs->transnoentitiesnoconv("NumberOfSupplierProposals")));
|
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierProposals") : $langs->transnoentitiesnoconv("NumberOfSupplierProposals")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->order->enabled) {
|
if ($conf->order->enabled) {
|
||||||
$graphfiles['orders'] = array('modulepart'=>'productstats_orders',
|
$graphfiles['orders'] = array('modulepart'=>'productstats_orders',
|
||||||
'file' => $object->id.'/orders12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year ? '_year'.$search_year : '').'.png',
|
'file' => $object->id.'/orders12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
|
||||||
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsCustomerOrders") : $langs->transnoentitiesnoconv("NumberOfCustomerOrders")));
|
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsCustomerOrders") : $langs->transnoentitiesnoconv("NumberOfCustomerOrders")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->supplier_order->enabled) {
|
if ($conf->supplier_order->enabled) {
|
||||||
$graphfiles['orderssuppliers'] = array('modulepart'=>'productstats_orderssuppliers',
|
$graphfiles['orderssuppliers'] = array('modulepart'=>'productstats_orderssuppliers',
|
||||||
'file' => $object->id.'/orderssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year ? '_year'.$search_year : '').'.png',
|
'file' => $object->id.'/orderssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
|
||||||
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierOrders") : $langs->transnoentitiesnoconv("NumberOfSupplierOrders")));
|
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierOrders") : $langs->transnoentitiesnoconv("NumberOfSupplierOrders")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->facture->enabled) {
|
if ($conf->facture->enabled) {
|
||||||
$graphfiles['invoices'] = array('modulepart'=>'productstats_invoices',
|
$graphfiles['invoices'] = array('modulepart'=>'productstats_invoices',
|
||||||
'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year ? '_year'.$search_year : '').'.png',
|
'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
|
||||||
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices") : $langs->transnoentitiesnoconv("NumberOfCustomerInvoices")));
|
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices") : $langs->transnoentitiesnoconv("NumberOfCustomerInvoices")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->supplier_invoice->enabled) {
|
if ($conf->supplier_invoice->enabled) {
|
||||||
$graphfiles['invoicessuppliers'] = array('modulepart'=>'productstats_invoicessuppliers',
|
$graphfiles['invoicessuppliers'] = array('modulepart'=>'productstats_invoicessuppliers',
|
||||||
'file' => $object->id.'/invoicessuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year ? '_year'.$search_year : '').'.png',
|
'file' => $object->id.'/invoicessuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
|
||||||
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices") : $langs->transnoentitiesnoconv("NumberOfSupplierInvoices")));
|
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices") : $langs->transnoentitiesnoconv("NumberOfSupplierInvoices")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->contrat->enabled) {
|
if ($conf->contrat->enabled) {
|
||||||
$graphfiles['contracts'] = array('modulepart'=>'productstats_contracts',
|
$graphfiles['contracts'] = array('modulepart'=>'productstats_contracts',
|
||||||
'file' => $object->id.'/contracts12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year ? '_year'.$search_year : '').'.png',
|
'file' => $object->id.'/contracts12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
|
||||||
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsContracts") : $langs->transnoentitiesnoconv("NumberOfContracts")));
|
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsContracts") : $langs->transnoentitiesnoconv("NumberOfContracts")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->mrp->enabled) {
|
if ($conf->mrp->enabled) {
|
||||||
$graphfiles['mrp'] = array('modulepart'=>'productstats_mrp',
|
$graphfiles['mrp'] = array('modulepart'=>'productstats_mrp',
|
||||||
'file' => $object->id.'/mos12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year ? '_year'.$search_year : '').'.png',
|
'file' => $object->id.'/mos12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
|
||||||
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsMos") : $langs->transnoentitiesnoconv("NumberOfMos")));
|
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsMos") : $langs->transnoentitiesnoconv("NumberOfMos")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ $pageprev = $page - 1;
|
|||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (!$sortorder) $sortorder = "DESC";
|
if (!$sortorder) $sortorder = "DESC";
|
||||||
if (!$sortfield) $sortfield = "c.date_commande";
|
if (!$sortfield) $sortfield = "c.date_commande";
|
||||||
$search_month = GETPOST('search_month', 'alpha');
|
$search_month = GETPOST('search_month', 'int');
|
||||||
$search_year = GETPOST('search_year', 'int');
|
$search_year = GETPOST('search_year', 'int');
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||||
|
|||||||
@ -61,7 +61,7 @@ if (!$sortorder)
|
|||||||
$sortorder = "DESC";
|
$sortorder = "DESC";
|
||||||
if (!$sortfield)
|
if (!$sortfield)
|
||||||
$sortfield = "c.date_commande";
|
$sortfield = "c.date_commande";
|
||||||
$search_month = GETPOST('search_month', 'alpha');
|
$search_month = GETPOST('search_month', 'int');
|
||||||
$search_year = GETPOST('search_year', 'int');
|
$search_year = GETPOST('search_year', 'int');
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||||
|
|||||||
@ -61,7 +61,7 @@ $pagenext = $page + 1;
|
|||||||
if (!$sortorder) $sortorder = "DESC";
|
if (!$sortorder) $sortorder = "DESC";
|
||||||
if (!$sortfield) $sortfield = "f.datef";
|
if (!$sortfield) $sortfield = "f.datef";
|
||||||
|
|
||||||
$search_month = GETPOST('search_month', 'alpha');
|
$search_month = GETPOST('search_month', 'int');
|
||||||
$search_year = GETPOST('search_year', 'int');
|
$search_year = GETPOST('search_year', 'int');
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||||
|
|||||||
@ -60,7 +60,7 @@ $pageprev = $page - 1;
|
|||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (!$sortorder) $sortorder = "DESC";
|
if (!$sortorder) $sortorder = "DESC";
|
||||||
if (!$sortfield) $sortfield = "f.datef";
|
if (!$sortfield) $sortfield = "f.datef";
|
||||||
$search_month = GETPOST('search_month', 'alpha');
|
$search_month = GETPOST('search_month', 'int');
|
||||||
$search_year = GETPOST('search_year', 'int');
|
$search_year = GETPOST('search_year', 'int');
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||||
|
|||||||
@ -60,7 +60,7 @@ $pagenext = $page + 1;
|
|||||||
if (!$sortorder) $sortorder = "DESC";
|
if (!$sortorder) $sortorder = "DESC";
|
||||||
if (!$sortfield) $sortfield = "p.datep";
|
if (!$sortfield) $sortfield = "p.datep";
|
||||||
|
|
||||||
$search_month = GETPOST('search_month', 'alpha');
|
$search_month = GETPOST('search_month', 'int');
|
||||||
$search_year = GETPOST('search_year', 'int');
|
$search_year = GETPOST('search_year', 'int');
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||||
|
|||||||
@ -60,7 +60,7 @@ $pagenext = $page + 1;
|
|||||||
if (!$sortorder) $sortorder = "DESC";
|
if (!$sortorder) $sortorder = "DESC";
|
||||||
if (!$sortfield) $sortfield = "p.date_valid";
|
if (!$sortfield) $sortfield = "p.date_valid";
|
||||||
|
|
||||||
$search_month = GETPOST('search_month', 'alpha');
|
$search_month = GETPOST('search_month', 'int');
|
||||||
$search_year = GETPOST('search_year', 'int');
|
$search_year = GETPOST('search_year', 'int');
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user