From e0c3cf8360a03d7c1ed1705a7b1c02840893821d Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 3 May 2019 10:24:49 +0200 Subject: [PATCH 1/5] fix project link for stock correction --- htdocs/product/stock/tpl/stockcorrection.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 3d2e1c99e9b..4a9f23301a8 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -100,7 +100,7 @@ if (empty($conf) || ! is_object($conf)) { print ''.$langs->trans('Project').''; print ''; - $formproject->select_projects(0, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300'); + $formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300'); print ''; } print ''; From 99b068b625a9118a80bb7fcd6b026c8cfe3441cb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 5 May 2019 21:46:56 +0200 Subject: [PATCH 2/5] FIX sortfield on lettering function --- .../thirdparty_lettering_customer.php | 15 ++++++++++----- .../thirdparty_lettering_supplier.php | 18 ++++++++++++------ htdocs/societe/consumption.php | 2 +- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 87377a189a6..7d10acfa4cd 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -37,11 +37,12 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // Load translation files required by the page $langs->loadLangs(array("compta","accountancy")); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); -$confirm = GETPOST('confirm', 'alpha'); -$toselect = GETPOST('toselect', 'array'); +$confirm = GETPOST('confirm', 'alpha'); +$toselect = GETPOST('toselect', 'array'); +$socid = GETPOST('socid','int')?GETPOST('socid','int'):GETPOST('id','int'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -186,21 +187,25 @@ if (! $resql) { exit(); } +$param=''; +$param.="&socid=".urlencode($socid); + $num = $db->num_rows($resql); dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_customer.php", LOG_DEBUG); if ($resql) { $i = 0; + $param="&socid=".$socid; print '
'; print ''; $letteringbutton = ''; - //$letteringbutton = '' . $langs->trans("Lettering") . ''; print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit); - print ""; + print '
'; + print '
'."\n"; /* print ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index fab30066982..b7902efa3e6 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -37,11 +37,12 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // Load translation files required by the page $langs->loadLangs(array("compta","accountancy")); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); -$confirm = GETPOST('confirm', 'alpha'); -$toselect = GETPOST('toselect', 'array'); +$confirm = GETPOST('confirm', 'alpha'); +$toselect = GETPOST('toselect', 'array'); +$socid = GETPOST('socid','int')?GETPOST('socid','int'):GETPOST('id','int'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -178,7 +179,7 @@ while ($obj = $db->fetch_object($resql)) { $sql.= $db->plimit($limit+1, $offset); -dol_syslog ( "/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG ); +dol_syslog ( "/accountancy/bookkeeping/thirdparty_lettering_supplier.php", LOG_DEBUG ); $resql = $db->query($sql); if (! $resql) { @@ -186,14 +187,18 @@ if (! $resql) exit; } +$param=''; +$param.="&socid=".urlencode($socid); + $num = $db->num_rows($resql); -dol_syslog ( "/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG ); +dol_syslog ( "/accountancy/bookkeeping/thirdparty_lettering_supplier.php", LOG_DEBUG ); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; + $param="&socid=".$socid; print ''; print ''; @@ -201,7 +206,8 @@ if ($resql) { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit); - print "
"; + print '
'; + print '
'."\n"; /* print ''; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 3a3fb8507c9..dc8dbcbdba2 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -22,7 +22,7 @@ /** * \file htdocs/societe/consumption.php * \ingroup societe - * \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty + * \brief Add a tab on thirddarty view to list all products/services bought or sells by thirdparty */ require "../main.inc.php"; From c86318ea66f26a1c216c8bab34380322b2875703 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 5 May 2019 21:49:04 +0200 Subject: [PATCH 3/5] fix --- htdocs/societe/consumption.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index dc8dbcbdba2..ed8b3e41d4b 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -22,7 +22,7 @@ /** * \file htdocs/societe/consumption.php * \ingroup societe - * \brief Add a tab on thirddarty view to list all products/services bought or sells by thirdparty + * \brief Add a tab on thirdparty view to list all products/services bought or sells by thirdparty */ require "../main.inc.php"; From 12409e944c265bd5e3d0a0d8105360810f8f5414 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 May 2019 22:57:27 +0200 Subject: [PATCH 4/5] Fix duplicate error message --- htdocs/expedition/card.php | 2 +- htdocs/expedition/class/expedition.class.php | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index b2d45e11a6f..9cf79ba3f18 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -442,7 +442,7 @@ if (empty($reshook)) if ($result < 0) { $langs->load("errors"); - setEventMessages($langs->trans($object->error), null, 'errors'); + setEventMessages($langs->trans($object->error), $object->errors, 'errors'); } else { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index e68eecbca81..3e9175c95e3 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -757,7 +757,7 @@ class Expedition extends CommonObject $result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref)); if ($result < 0) { $error++; - $this->errors[]=$mouvS->error; + $this->error = $mouvS->error; $this->errors = array_merge($this->errors, $mouvS->errors); break; } @@ -771,7 +771,7 @@ class Expedition extends CommonObject $result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock); if ($result < 0) { $error++; - $this->errors[]=$mouvS->error; + $this->error = $mouvS->error; $this->errors = array_merge($this->errors, $mouvS->errors); break; } @@ -851,11 +851,6 @@ class Expedition extends CommonObject } else { - foreach($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::valid ".$errmsg, LOG_ERR); - $this->error.=($this->error?', '.$errmsg:$errmsg); - } $this->db->rollback(); return -1*$error; } From f2e24ed96ee533f19b258d06271ee52e2e7bf8c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 May 2019 18:19:26 +0200 Subject: [PATCH 5/5] Fix bad contact used --- htdocs/core/class/commonobject.class.php | 2 +- .../modules/supplier_order/pdf/pdf_muscadet.modules.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9b2db295296..de6bdcceef6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1192,7 +1192,7 @@ abstract class CommonObject $sql.= " AND ec.fk_c_type_contact = tc.rowid"; $sql.= " AND tc.element = '".$element."'"; $sql.= " AND tc.source = '".$source."'"; - $sql.= " AND tc.code = '".$code."'"; + if ($code) $sql.= " AND tc.code = '".$code."'"; $sql.= " AND tc.active = 1"; if ($status) $sql.= " AND ec.statut = ".$status; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 06cf28daaed..e0546fd61aa 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -110,7 +110,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Issuer - * @var Company object that emits + * @var Societe object that emits */ public $emetteur; @@ -1306,9 +1306,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders - // If BILLING contact defined on order, we use it + // If CUSTOMER contact defined on order, we use it. Note: Even if this is a supplier object, the code for external contat that follow object is 'CUSTOMER' $usecontact=false; - $arrayidcontact=$object->getIdContact('external','BILLING'); + $arrayidcontact=$object->getIdContact('external','CUSTOMER'); if (count($arrayidcontact) > 0) { $usecontact=true;