From 6768697497420f8cdb8b426b0581319b187c6a80 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Sat, 26 Nov 2022 00:13:15 +0100 Subject: [PATCH 1/7] Fix #21357 --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c0ff43083eb..d1cd74099ae 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3505,7 +3505,7 @@ if ($action == 'create') { } print ''; print ''; - print ''.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).' '; + print ''.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($multicurrency_resteapayer, 'MT')).' '; } } else // Credit note { From b98eaa4d45a615ac1700cd2af2cc57a4ea342d21 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Sat, 26 Nov 2022 01:01:22 +0100 Subject: [PATCH 2/7] #FIX: #22509 default value on integer fields don't retrieve by setSaveQuery --- htdocs/core/class/commonobject.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0fb5bcedae0..3e10ea82eaa 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8829,7 +8829,11 @@ abstract class CommonObject // $this->{$field} may be null, '', 0, '0', 123, '123' if ((isset($this->{$field}) && $this->{$field} != '') || !empty($info['notnull'])) { if (!isset($this->{$field})) { - $queryarray[$field] = 0; + if (!empty($info['default'])) { + $queryarray[$field] = $info['default']; + } else { + $queryarray[$field] = 0; + } } else { $queryarray[$field] = (int) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1 } From b15fda8d9a761fec13f177bf9646ab318e9b2f5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Nov 2022 14:38:25 +0100 Subject: [PATCH 3/7] Debug edit actioncomm --- htdocs/comm/action/card.php | 2 ++ htdocs/comm/action/class/actioncomm.class.php | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 63647e9d308..0b169d846e9 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -550,7 +550,9 @@ if (empty($reshook) && $action == 'update') { } } else { $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); + $object->type_code = GETPOST("actioncode", 'aZ09'); } + $object->label = GETPOST("label", "alphanohtml"); $object->datep = $datep; $object->datef = $datef; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index e31e6023210..7947afa71ab 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1150,12 +1150,8 @@ class ActionComm extends CommonObject $userownerid = ($this->userownerid ? $this->userownerid : 0); $userdoneid = ($this->userdoneid ? $this->userdoneid : 0); - $this->db->begin(); - - $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; - $sql .= " SET percent = '".$this->db->escape($this->percentage)."'"; + // If a type_id is set, we must also have the type_code set if ($this->type_id > 0) { - $sql .= ", fk_action = ".(int) $this->type_id; if (empty($this->type_code)) { $cactioncomm = new CActionComm($this->db); $result = $cactioncomm->fetch($this->type_id); @@ -1164,7 +1160,18 @@ class ActionComm extends CommonObject } } } - $sql .= ", code = " . (isset($this->type_code)? "'".$this->db->escape($this->type_code) . "'":"null"); + + $code = $this->code; + if (empty($code) || (!empty($this->oldcopy) && $this->oldcopy->type_code != $this->type_code)) { // If code unknown or if change the type, we reset $code too + $code = $this->type_code; + } + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; + $sql .= " SET percent = '".$this->db->escape($this->percentage)."'"; + $sql .= ", fk_action = ".(int) $this->type_id; + $sql .= ", code = " . ($code ? "'".$this->db->escape($code)."'" : "null"); $sql .= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "null"); $sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null'); From 2d29e0839e4e9880f0f7643190eeb8a9edc4d4d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Nov 2022 14:41:45 +0100 Subject: [PATCH 4/7] Prepare 16.0.3 --- ChangeLog | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index 321d6a29276..1abc487eff1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,33 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 16.0.3 compared to 16.0.2 ***** + +FIX: $sign is useless +FIX: #18304 Member subscription confirmation email sent even if mandatory fields are missing +FIX: #19828 +FIX: #19877 +FIX: #22509 default value on integer fields don't retrieve by setSaveQuery +FIX: #22786 +FIX: #22813 +FIX: #22824 Accountancy - Journal - Search on subledger when list of subledger is disabled +FIX: Backup using the low memory mode +FIX: Bankaccounts API fetch with 'id' and 'socid' +FIX: base64_decode should be forbiden in dol_eval +FIX: Broken Permissions check, $object is null. +FIX: compute next value when year is on one digit for reset counter +FIX: copy same behaviour in other accountancy files +FIX: Fix the position of the verification condition of the test field in case of multi entities +FIX: for #22882 +FIX: for #22952 +FIX: merge errors on mailing card +FIX: PaymentBankTransfer Type page management with Select and Input on create.php +FIX: remove not initialized variable +FIX: SQL request parenthesis +FIX: Use the Hook addMoreActionsButtons resPrint +FIX: Wrong Extrafields Element For Assets + ***** ChangeLog for 16.0.2 compared to 16.0.1 ***** FIX: 16.0 - computed extrafields are not displayed if the object has no other extrafields From f7676788db9a7f275e440177606561f6edbb8385 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Nov 2022 18:21:01 +0100 Subject: [PATCH 5/7] Work with gzip for debian package instead of xz --- build/debian/source/options | 6 +++--- build/makepack-dolibarr.pl | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build/debian/source/options b/build/debian/source/options index 4918d029b84..8d8fd181896 100644 --- a/build/debian/source/options +++ b/build/debian/source/options @@ -1,3 +1,3 @@ -# Use bzip2 instead of gzip -compression = "bzip2" -compression-level = 9 +# Force use of gzip compression by dpkg-buildpackage +compression = "gzip" +#compression-level = 9 diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index b2381db6ba3..f65ba302be5 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -678,7 +678,7 @@ if ($nboftargetok) { mkdir($DESTI.'/standard'); if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } } - + print "Remove target $FILENAMETGZ.tgz...\n"; unlink("$NEWDESTI/$FILENAMETGZ.tgz"); @@ -1064,7 +1064,8 @@ if ($nboftargetok) { $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`; - $ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; + #$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option + $ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`; next; } From 35a30e0f8b6c548e0b75cb5e417951a3ee4b1224 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Nov 2022 18:31:43 +0100 Subject: [PATCH 6/7] Work with gzip for debian package instead of xz --- build/makepack-dolibarr.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index f65ba302be5..5d958787243 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -1147,7 +1147,8 @@ if ($nboftargetok) { "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)', "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'none', # none means it won't be published on SF "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'none', # none means it won't be published on SF - "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'none', # none means it won't be published on SF + #"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'none', # none means it won't be published on SF + "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'none', # none means it won't be published on SF "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none', # none means it won't be published on SF "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)', "$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM', From f08870d91ef4fcd8f067323674d414c91d9907ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Nov 2022 16:51:07 +0100 Subject: [PATCH 7/7] Fix label of some fields in dictionaries --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 3dec2565701..ed5e4c06b3d 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1965,7 +1965,7 @@ if ($id > 0) { $valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country); } } elseif ($value == 'recuperableonly' || $value == 'deductible' || $value == 'category_type') { - $valuetoshow = yn($valuetoshow); + $valuetoshow = yn($valuetoshow ? 1 : 0); $class = "center"; } elseif ($value == 'type_cdr') { if (empty($valuetoshow)) {