From 55298317e389bb7e87796c608d64666b4197203c Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Mon, 20 Jul 2020 16:22:48 +0200 Subject: [PATCH 1/9] FIX : wrong link to third invoice templates --- htdocs/comm/card.php | 2 +- htdocs/compta/facture/invoicetemplate_list.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 9130efabeeb..37c19525afa 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1065,7 +1065,7 @@ if ($object->id > 0) print ''; print ''; - print '
'; + print ''; print ''; } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 661f9604500..c030d0d5464 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -53,6 +53,8 @@ $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'invoicetemplatelist'; // To manage different context of search +$socid = GETPOST('socid', 'int'); + // Security check $id=(GETPOST('facid', 'int')?GETPOST('facid', 'int'):GETPOST('id', 'int')); $lineid=GETPOST('lineid', 'int'); @@ -141,6 +143,11 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab } } +if ($socid > 0) { + $tmpthirdparty = new Societe($db); + $res = $tmpthirdparty->fetch($socid); + if ($res > 0) $search_societe = $tmpthirdparty->name; +} /* * Actions From e2592d90490b46ac251b767197a65ed5cc95971f Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 22 Jul 2020 11:44:26 +0200 Subject: [PATCH 2/9] Update card_presend.tpl.php Add hidden options for specific sender email-adress for Invoices, Shipments and Order-confirmations --- htdocs/core/tpl/card_presend.tpl.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index a8594ec1b62..aac72ce774f 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -131,6 +131,21 @@ if ($action == 'presend') { $formmail->fromid = $user->id; } + if ($object->element === 'facture' && !empty($conf->global->INVOICE_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->INVOICE_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } + if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } + if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } $formmail->trackid=$trackid; if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set { From 94498b191bb7c584be3df5a5adb0a827a35f877c Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Fri, 24 Jul 2020 10:37:19 +0200 Subject: [PATCH 3/9] Update card_presend.tpl.php --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index aac72ce774f..67de56e16fa 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -139,7 +139,7 @@ if ($action == 'presend') if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; $formmail->fromname = ''; - $formmail->fromtype = 'special'; + $formmail->fromtype = 'special'; } if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; From 8273dbcd4948b79baac12f2d5d0f9adc95a8bf33 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 24 Jul 2020 08:39:09 +0000 Subject: [PATCH 4/9] Fixing style errors. --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 67de56e16fa..aac72ce774f 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -139,7 +139,7 @@ if ($action == 'presend') if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; $formmail->fromname = ''; - $formmail->fromtype = 'special'; + $formmail->fromtype = 'special'; } if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; From 25994e61bce5d8d165dd5fd91fcd9d5113b8b6da Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Mon, 27 Jul 2020 16:04:21 +0200 Subject: [PATCH 5/9] FIX : We need to see unit line on PDF even though it's an option --- htdocs/core/lib/pdf.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index af1da161dc7..1d9d218f7af 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1826,7 +1826,6 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag } if (empty($reshook)) { - if ($object->lines[$i]->special_code == 3) return ''; if (empty($hidedetails) || $hidedetails > 1) $result.=$langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short')); } return $result; From ee55b82a8d7449b53f649417102ffb43e2e9e5cb Mon Sep 17 00:00:00 2001 From: Marc DLL <68746600@users.noreply.github.com> Date: Mon, 27 Jul 2020 23:27:44 +0200 Subject: [PATCH 6/9] FIX: shipping creation: checks not done on weight and sizes --- htdocs/expedition/class/expedition.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b623ea9c629..8417ddb9bfb 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -321,10 +321,10 @@ class Expedition extends CommonObject $sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:"null"); $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:"null"); $sql.= ", '".$this->db->escape($this->tracking_number)."'"; - $sql.= ", ".$this->weight; - $sql.= ", ".$this->sizeS; // TODO Should use this->trueDepth - $sql.= ", ".$this->sizeW; // TODO Should use this->trueWidth - $sql.= ", ".$this->sizeH; // TODO Should use this->trueHeight + $sql.= ", ".(is_numeric($this->weight)?$this->weight:'NULL'); + $sql.= ", ".(is_numeric($this->sizeS)?$this->sizeS:'NULL'); // TODO Should use this->trueDepth + $sql.= ", ".(is_numeric($this->sizeW)?$this->sizeW:'NULL'); // TODO Should use this->trueWidth + $sql.= ", ".(is_numeric($this->sizeH)?$this->sizeH:'NULL'); // TODO Should use this->trueHeight $sql.= ", ".($this->weight_units != '' ? (int) $this->weight_units : 'NULL'); $sql.= ", ".($this->size_units != '' ? (int) $this->size_units : 'NULL'); $sql.= ", ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); From d214dbb5fd4f99216466265254d84e6c1148965a Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Tue, 28 Jul 2020 15:42:54 +0200 Subject: [PATCH 7/9] FIX : Order by amount in product propal stats must be done on d.total_ht and not p.total --- htdocs/product/stats/propal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 208ff49e158..52f0510cb80 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -208,7 +208,7 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); print_liste_field_titre("DatePropal", $_SERVER["PHP_SELF"], "p.datep", "", $option, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "p.total", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "p.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; From 8ee5b16e895f39b3126a553a61ace03cbe29b14b Mon Sep 17 00:00:00 2001 From: lvessiller Date: Wed, 29 Jul 2020 12:00:22 +0200 Subject: [PATCH 8/9] FIX redirect on contact card from main search --- htdocs/contact/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index b0db8b0affb..b8f9d3d14a4 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -389,8 +389,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->plimit($limit+1, $offset); -$result = $db->query($sql); -if (! $result) +$resql = $db->query($sql); +if (! $resql) { dol_print_error($db); exit; @@ -763,7 +763,7 @@ $i = 0; $totalarray=array(); while ($i < min($num, $limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); print ''; @@ -980,7 +980,7 @@ while ($i < min($num, $limit)) $i++; } -$db->free($result); +$db->free($resql); $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook From 4a291f181fadca23d9843e1043ec15112d5dbf38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Jul 2020 13:47:04 +0200 Subject: [PATCH 9/9] Fix regression --- htdocs/contact/list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index bb8f9497969..dbdc9388404 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -365,8 +365,8 @@ else $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 { $page = 0; @@ -376,18 +376,18 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->plimit($limit+1, $offset); -$result = $db->query($sql); -if (! $result) +$resql = $db->query($sql); +if (! $resql) { dol_print_error($db); exit; } -$num = $db->num_rows($result); +$num = $db->num_rows($resql); $arrayofselected=is_array($toselect)?$toselect:array(); -if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $seearch_cti != '')) +if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $search_cti != '')) { $obj = $db->fetch_object($resql); $id = $obj->rowid; @@ -715,7 +715,7 @@ $i = 0; $totalarray=array(); while ($i < min($num,$limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); print ''; @@ -914,7 +914,7 @@ while ($i < min($num,$limit)) $i++; } -$db->free($result); +$db->free($resql); $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").' '.$num.''; print '
'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").' '.$num.'