diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 7ab04adf923..a099547fbc0 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -558,13 +558,13 @@ $langs->load("companies");
// Managing Director(s)
print '
| ';
diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php
index 82829fca12e..554143e7a7e 100644
--- a/htdocs/compta/tva/list.php
+++ b/htdocs/compta/tva/list.php
@@ -1,8 +1,9 @@
- * Copyright (C) 2004-2020 Laurent Destailleur
- * Copyright (C) 2005-2009 Regis Houssin
- * Copyright (C) 2011-2019 Alexandre Spangaro
+/* Copyright (C) 2001-2003 Rodolphe Quiedeville
+ * Copyright (C) 2004-2020 Laurent Destailleur
+ * Copyright (C) 2005-2009 Regis Houssin
+ * Copyright (C) 2011-2019 Alexandre Spangaro
+ * Copyright (C) 2020 Tobias Sekan
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,12 +20,18 @@
*/
/**
- * \file htdocs/compta/tva/list.php
- * \ingroup tax
- * \brief List of VAT payments
+ * \file htdocs/compta/tva/list.php
+ * \ingroup tax
+ * \brief List of VAT payments
*/
require '../../main.inc.php';
+
+// Security check
+$socid = GETPOST('socid', 'int');
+if ($user->socid) $socid = $user->socid;
+$result = restrictedArea($user, 'tax', '', '', 'charges');
+
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@@ -34,61 +41,79 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
// Load translation files required by the page
$langs->loadLangs(array('compta', 'bills'));
-// Security check
-$socid = GETPOST('socid', 'int');
-if ($user->socid) $socid = $user->socid;
-$result = restrictedArea($user, 'tax', '', '', 'charges');
+$action = GETPOST('action', 'alpha');
+$massaction = GETPOST('massaction', 'alpha');
+$confirm = GETPOST('confirm', 'alpha');
+$optioncss = GETPOST('optioncss', 'alpha');
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'salestaxeslist';
-$search_ref = GETPOST('search_ref', 'int');
-$search_label = GETPOST('search_label', 'alpha');
-$search_account = GETPOST('search_account', 'int');
-$search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int'));
-$search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int'));
-$search_datepayment_start = dol_mktime(0, 0, 0, GETPOST('search_datepayment_startmonth', 'int'), GETPOST('search_datepayment_startday', 'int'), GETPOST('search_datepayment_startyear', 'int'));
-$search_datepayment_end = dol_mktime(23, 59, 59, GETPOST('search_datepayment_endmonth', 'int'), GETPOST('search_datepayment_endday', 'int'), GETPOST('search_datepayment_endyear', 'int'));
-$search_amount = GETPOST('search_amount', 'alpha');
-$month = GETPOST("month", "int");
-$year = GETPOST("year", "int");
+$search_ref = GETPOST('search_ref', 'alpha');
+$search_label = GETPOST('search_label', 'alpha');
+$search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int'));
+$search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int'));
+$search_datepayment_start = dol_mktime(0, 0, 0, GETPOST('search_datepayment_startmonth', 'int'), GETPOST('search_datepayment_startday', 'int'), GETPOST('search_datepayment_startyear', 'int'));
+$search_datepayment_end = dol_mktime(23, 59, 59, GETPOST('search_datepayment_endmonth', 'int'), GETPOST('search_datepayment_endday', 'int'), GETPOST('search_datepayment_endyear', 'int'));
+$search_type = GETPOST('search_type', 'int');
+$search_cheque = GETPOST('search_cheque', 'alpha');
+$search_account = GETPOST('search_account', 'int');
+$search_amount = GETPOST('search_amount', 'alpha');
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
-$sortfield = GETPOST("sortfield", 'alpha');
-$sortorder = GETPOST("sortorder", 'alpha');
-$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
-if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
+$sortfield = GETPOST('sortfield', 'alpha');
+$sortorder = GETPOST('sortorder', 'alpha');
+$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST('page', 'int');
+
+if (empty($page) || $page == -1) $page = 0; // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
-if (!$sortfield) $sortfield = "t.datev";
-if (!$sortorder) $sortorder = "DESC";
-$filtre = $_GET["filtre"];
+if (!$sortfield) $sortfield = 't.datev';
+if (!$sortorder) $sortorder = 'DESC';
-if (empty($_REQUEST['typeid']))
-{
- $newfiltre = str_replace('filtre=', '', $filtre);
- $filterarray = explode('-', $newfiltre);
- foreach ($filterarray as $val)
+$arrayfields = array(
+ 't.rowid' =>array('checked'=>1, 'position'=>10, 'label'=>"Ref",),
+ 't.label' =>array('checked'=>1, 'position'=>20, 'label'=>"Label"),
+ 't.datev' =>array('checked'=>1, 'position'=>30, 'label'=>"PeriodEndDate"),
+ 't.datep' =>array('checked'=>1, 'position'=>40, 'label'=>"DatePayment"),
+ 't.fk_typepayment' =>array('checked'=>1, 'position'=>50, 'label'=>"Type"),
+ 't.num_payment' =>array('checked'=>1, 'position'=>60, 'label'=>"Numero", 'tooltip'=>"ChequeOrTransferNumber"),
+ 'transaction' =>array('checked'=>1, 'position'=>70, 'label'=>"BankTransactionLine", 'enabled'=>(!empty($conf->banque->enabled))),
+ 'ba.label' =>array('checked'=>1, 'position'=>80, 'label'=>"Account", 'enable'=>(!empty($conf->banque->enabled))),
+ 't.amount' =>array('checked'=>1, 'position'=>90, 'label'=>"PayedByThisPayment"),
+);
+$arrayfields = dol_sort_array($arrayfields, 'position');
+
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
+$hookmanager->initHooks(array('salestaxeslist'));
+$object = new Tva($db);
+
+
+/*
+ * Actions
+ */
+
+$parameters = array('socid'=>$socid);
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+
+
+if (empty($reshook)) {
+ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
+
+ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers
{
- $part = explode(':', $val);
- if ($part[0] == 't.fk_typepayment') $typeid = $part[1];
+ $search_ref = '';
+ $search_label = '';
+ $search_dateend_start = '';
+ $search_dateend_end = '';
+ $search_datepayment_start = '';
+ $search_datepayment_end = '';
+ $search_type = '';
+ $search_cheque = '';
+ $search_account = '';
+ $search_amount = '';
}
-} else {
- $typeid = $_REQUEST['typeid'];
-}
-
-if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers
-{
- $search_ref = "";
- $search_label = "";
- $search_dateend_start = '';
- $search_dateend_end = '';
- $search_datepayment_start = '';
- $search_datepayment_end = '';
- $search_account = '';
- $search_amount = "";
- $year = "";
- $month = "";
- $typeid = "";
}
@@ -96,194 +121,325 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
* View
*/
-llxHeader('', $langs->trans("VATPayments"));
-
$form = new Form($db);
$formother = new FormOther($db);
$tva_static = new Tva($db);
$bankstatic = new Account($db);
+$accountingjournal = new AccountingJournal($db);
+$bankline = new AccountLine($db);
+
+llxHeader('', $langs->trans("VATPayments"));
+
+$sql = 'SELECT t.rowid, t.amount, t.label, t.datev, t.datep, t.fk_typepayment as type, t.num_payment, t.fk_bank';
+$sql .= ', ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel';
+$sql .= ', pst.code as payment_code';
+$sql .= ' FROM '.MAIN_DB_PREFIX.'tva as t';
+$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pst ON t.fk_typepayment = pst.id';
+$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid';
+$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
+$sql .= ' WHERE t.entity IN ('.getEntity($object->element).')';
+
+if (!empty($search_ref)) $sql .= natural_search('t.rowid', $search_ref);
+if (!empty($search_label)) $sql .= natural_search('t.label', $search_label);
+if (!empty($search_dateend_start)) $sql .= ' AND t.datev >= "'.$db->idate($search_dateend_start).'"';
+if (!empty($search_dateend_end)) $sql .= ' AND t.datev <= "'.$db->idate($search_dateend_end).'"';
+if (!empty($search_datepayment_start)) $sql .= ' AND t.datep >= "'.$db->idate($search_datepayment_start).'"';
+if (!empty($search_datepayment_end)) $sql .= ' AND t.datep <= "'.$db->idate($search_datepayment_end).'"';
+if (!empty($search_type) && $search_type > 0) $sql .= ' AND t.fk_typepayment='.$search_type;
+if (!empty($search_cheque)) $sql .= natural_search('t.num_payment', $search_cheque);
+if (!empty($search_account) && $search_account > 0) $sql .= ' AND b.fk_account='.$search_account;
+if (!empty($search_amount)) $sql .= natural_search('t.amount', price2num(trim($search_amount)), 1);
-$sql = "SELECT t.rowid, t.amount, t.label, t.datev, t.datep, t.fk_typepayment as type, t.num_payment, t.fk_bank, pst.code as payment_code,";
-$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
-$sql .= " FROM ".MAIN_DB_PREFIX."tva as t";
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id";
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
-$sql .= " WHERE t.entity IN (".getEntity('tax').")";
-if ($search_ref) $sql .= natural_search("t.rowid", $search_ref);
-if ($search_label) $sql .= natural_search("t.label", $search_label);
-if ($search_account > 0) $sql .= " AND b.fk_account=".$search_account;
-if ($search_amount) $sql .= natural_search("t.amount", price2num(trim($search_amount)), 1);
-if ($search_dateend_start) $sql .= " AND t.datev >= '".$db->idate($search_dateend_start)."'";
-if ($search_dateend_end) $sql .= " AND t.datev <= '".$db->idate($search_dateend_end)."'";
-if ($search_datepayment_start) $sql .= " AND t.datep >= '".$db->idate($search_datepayment_start)."'";
-if ($search_datepayment_end) $sql .= " AND t.datep <= '".$db->idate($search_datepayment_end)."'";
-if ($filtre) {
- $filtre = str_replace(":", "=", $filtre);
- $sql .= " AND ".$filtre;
-}
-if ($typeid) {
- $sql .= " AND t.fk_typepayment=".$typeid;
-}
$sql .= $db->order($sortfield, $sortorder);
-$totalnboflines = 0;
-$result = $db->query($sql);
-if ($result)
-{
- $totalnboflines = $db->num_rows($result);
+
+$nbtotalofrecords = '';
+if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
+ $result = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($result);
+
+ // if total resultset is smaller then paging size (filtering), goto and load page 0
+ if (($page * $limit) > $nbtotalofrecords) {
+ $page = 0;
+ $offset = 0;
+ }
}
+
$sql .= $db->plimit($limit + 1, $offset);
$result = $db->query($sql);
-if ($result)
+if (!$result)
{
- $num = $db->num_rows($result);
- $i = 0;
- $total = 0;
-
- $param = '';
- if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
- if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
- if ($typeid) $param .= '&typeid='.$typeid;
-
- $url = DOL_URL_ROOT.'/compta/tva/card.php?action=create';
- if (!empty($socid)) $url .= '&socid='.$socid;
- $newcardbutton = dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer);
-
- print '';
-
- $db->free($result);
-} else {
- dol_print_error($db);
+ dol_print_error($db);
+ llxFooter();
+ $db->close();
+ exit;
}
+$num = $db->num_rows($result);
+
+$param = '';
+if (!empty($contextpage) && $contextpage != $_SERVER['PHP_SELF']) $param .= '&contextpage='.$contextpage;
+if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
+if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
+
+if (!empty($search_ref)) $param .= '&search_ref="'.$search_ref.'"';
+if (!empty($search_label)) $param .= '&search_label="'.$search_label.'"';
+if (!empty($search_dateend_start)) $param .= '&search_dateend_startyear='.GETPOST('search_dateend_startyear', 'int');
+if (!empty($search_dateend_start)) $param .= '&search_dateend_startmonth='.GETPOST('search_dateend_startmonth', 'int');
+if (!empty($search_dateend_start)) $param .= '&search_dateend_startday='.GETPOST('search_dateend_startday', 'int');
+if (!empty($search_dateend_end)) $param .= '&search_dateend_endyear='.GETPOST('search_dateend_endyear', 'int');
+if (!empty($search_dateend_end)) $param .= '&search_dateend_endmonth='.GETPOST('search_dateend_endmonth', 'int');
+if (!empty($search_dateend_end)) $param .= '&search_dateend_endday='.GETPOST('search_dateend_endday', 'int');
+if (!empty($search_datepayment_start)) $param .= '&search_datepayment_startyear='.GETPOST('search_datepayment_startyear', 'int');
+if (!empty($search_datepayment_start)) $param .= '&search_datepayment_startmonth='.GETPOST('search_datepayment_startmonth', 'int');
+if (!empty($search_datepayment_start)) $param .= '&search_datepayment_startday='.GETPOST('search_datepayment_startday', 'int');
+if (!empty($search_datepayment_end)) $param .= '&search_datepayment_endyear='.GETPOST('search_datepayment_endyear', 'int');
+if (!empty($search_datepayment_end)) $param .= '&search_datepayment_endmonth='.GETPOST('search_datepayment_endmonth', 'int');
+if (!empty($search_datepayment_end)) $param .= '&search_datepayment_endday='.GETPOST('search_datepayment_endday', 'int');
+if (!empty($search_type) && $search_type > 0) $param .= '&search_type='.$search_type;
+if (!empty($search_cheque)) $param .= '&search_cheque="'.$search_cheque.'"';
+if (!empty($search_account) && $search_account > 0) $param .= '&search_account='.$search_account;
+if (!empty($search_amount)) $param .= '&search_amount="'.$search_amount.'"';
+
+print '';
+
+$db->free($result);
+
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php
index cee75415eee..219d35e46fb 100644
--- a/htdocs/core/actions_addupdatedelete.inc.php
+++ b/htdocs/core/actions_addupdatedelete.inc.php
@@ -74,7 +74,7 @@ if ($action == 'add' && !empty($permissiontoadd))
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
$value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup
} elseif ($object->fields[$key]['type'] == 'boolean') {
- $value = (GETPOST($key) == 'on' ? 1 : 0);
+ $value = ((GETPOST($key) == '1' || GETPOST($key) == 'on') ? 1 : 0);
} else {
$value = GETPOST($key, 'alphanohtml');
}
diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php
index 3caeeed6678..75633c75585 100644
--- a/htdocs/core/actions_linkedfiles.inc.php
+++ b/htdocs/core/actions_linkedfiles.inc.php
@@ -56,10 +56,10 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC))
if (!empty($upload_dirold) && !empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
{
- $result = dol_add_file_process($upload_dirold, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs);
+ $result = dol_add_file_process($upload_dirold, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs, $object);
} elseif (!empty($upload_dir))
{
- $result = dol_add_file_process($upload_dir, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs);
+ $result = dol_add_file_process($upload_dir, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs, $object);
}
}
}
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 3d6526690a7..ce726265006 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -235,7 +235,7 @@ class Conf
$filesList = explode(":", $this->global->LOCAL_CONSTS_FILES);
foreach ($filesList as $file) {
$file = dol_sanitizeFileName($file);
- include_once DOL_DOCUMENT_ROOT."/".$file."/".$file."_consts.php"; // This file can run code like setting $this->global->XXX vars.
+ dol_include_once($file."/".$file."_consts.php"); // This file can run code like setting $this->global->XXX vars.
}
}
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 63047ed0e7b..55a2fc58d6b 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1506,9 +1506,10 @@ function dol_init_file_process($pathtoscan = '', $trackid = '')
* @param string $link Link to add (to add a link instead of a file)
* @param string $trackid Track id (used to prefix name of session vars to avoid conflict)
* @param int $generatethumbs 1=Generate also thumbs for uploaded image files
+ * @param Object $object Object used to set 'src_object_*' fields
* @return int <=0 if KO, >0 if OK
*/
-function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesession = 0, $varfiles = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1)
+function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesession = 0, $varfiles = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1, $object = null)
{
global $db, $user, $conf, $langs;
@@ -1602,7 +1603,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
// Update index table of files (llx_ecm_files)
if ($donotupdatesession == 1)
{
- $result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', 0);
+ $result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', 0, $object);
if ($result < 0)
{
if ($allowoverwrite) {
@@ -1718,9 +1719,10 @@ function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletef
* @param string $fullpathorig Full path of origin for file (can be '')
* @param string $mode How file was created ('uploaded', 'generated', ...)
* @param int $setsharekey Set also the share key
+ * @param Object $object Object used to set 'src_object_*' fields
* @return int <0 if KO, 0 if nothing done, >0 if OK
*/
-function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uploaded', $setsharekey = 0)
+function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uploaded', $setsharekey = 0, $object = null)
{
global $db, $user;
@@ -1743,6 +1745,12 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
$ecmfile->gen_or_uploaded = $mode;
$ecmfile->description = ''; // indexed content
$ecmfile->keyword = ''; // keyword content
+
+ if (is_object($object) && $object->id > 0) {
+ $ecmfile->src_object_id = $object->id;
+ $ecmfile->src_object_type = $object->element;
+ }
+
if ($setsharekey)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index dfc57313add..8c0253e927c 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -346,6 +346,7 @@ function product_lot_admin_prepare_head()
function show_stats_for_company($product, $socid)
{
global $conf, $langs, $user, $db;
+ $form = new Form($db);
$nblines = 0;
@@ -356,25 +357,7 @@ function show_stats_for_company($product, $socid)
print '| '.$langs->trans("TotalQuantity").' | ';
print ' |
';
- // MO
- if (!empty($conf->mrp->enabled) && $user->rights->mrp->read)
- {
- $nblines++;
- //$ret = $product->load_stats_mo($socid);
- if ($ret < 0) dol_print_error($db);
- $langs->load("orders");
- print '