From 905c94461e959260d1661dc717f58d3301047019 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Mon, 14 Nov 2022 17:44:43 +0100 Subject: [PATCH 1/9] Fix issue in htdocs/don/payment/payment.php --- htdocs/don/payment/payment.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 6a2cc78f128..8d6cf989178 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -95,7 +95,7 @@ if ($action == 'add_payment') { // Create a line of payments $payment = new PaymentDonation($db); $payment->chid = $chid; - $payment->datepaid = $datepaid; + $payment->datep = $datepaid; $payment->amounts = $amounts; // Tableau de montant $payment->paymenttype = GETPOST("paymenttype", 'int'); $payment->num_payment = GETPOST("num_payment", 'alphanohtml'); @@ -192,14 +192,14 @@ if ($action == 'create') { print ''; print ''.$langs->trans("PaymentMode").''; - $form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->paymenttype, "paymenttype"); + $form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->fk_typepayment, "paymenttype"); print "\n"; print ''; print ''; print ''.$langs->trans('AccountToCredit').''; print ''; - $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : $object->accountid, "accountid", 0, '', 2); // Show open bank account list + $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : $object->fk_account, "accountid", 0, '', 2); // Show open bank account list print ''; // Number From ed94d0490adf77d3aa57da711ae1994903dc81fe Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 15 Nov 2022 16:33:00 +0100 Subject: [PATCH 2/9] changin accountid has value 0 --- htdocs/don/payment/payment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 8d6cf989178..358c0b208e9 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -199,7 +199,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans('AccountToCredit').''; print ''; - $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : $object->fk_account, "accountid", 0, '', 2); // Show open bank account list + $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : "0", "accountid", 0, '', 2); // Show open bank account list print ''; // Number From 482775cd38ac3eae08f0f61f3a37e9db3875b7aa Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 17 Nov 2022 10:55:46 +0100 Subject: [PATCH 3/9] Fix issue #22846 --- htdocs/core/tpl/notes.tpl.php | 2 +- htdocs/product/note.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 2a0f3d654d7..c8f1ccd7a34 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -91,7 +91,7 @@ if ($module == 'propal') { } elseif ($module == 'shipping') { $permission = $user->hasRight("expedition", "creer"); } elseif ($module == 'product') { - $permission = $user->hasRight("produit", "creer"); + $permission = $user->hasRight("product", "creer"); } elseif ($module == 'service') { $permission = $user->hasRight("service", "creer"); } elseif ($module == 'ecmfiles') { diff --git a/htdocs/product/note.php b/htdocs/product/note.php index 0d7ad91af5f..ba83e64c401 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -54,13 +54,13 @@ $permissionnote = $user->rights->produit->creer; // Used by the include of actio if ($object->id > 0) { if ($object->type == $object::TYPE_PRODUCT) { - restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + restrictedArea($user, 'product', $object->id, 'product&product', '', ''); } if ($object->type == $object::TYPE_SERVICE) { restrictedArea($user, 'service', $object->id, 'product&product', '', ''); } } else { - restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + restrictedArea($user, 'product|service', $fieldvalue, 'product&product', '', '', $fieldtype); } From a1e546b8f97d3d236a31ff0bdf03570f50435dff Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Thu, 17 Nov 2022 22:01:32 +0100 Subject: [PATCH 4/9] FIX #22893 --- htdocs/core/lib/contact.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 948af4e2868..a089a255a45 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -71,7 +71,7 @@ function contact_prepare_head(Contact $object) $sql .= ' FROM '.MAIN_DB_PREFIX.'projet as n'; $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (n.rowid = cc.element_id)'; $sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id); - $sql .= ' AND cc.fk_c_type_contact IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE element="project" AND source="external")'; + $sql .= ' AND cc.fk_c_type_contact IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE element=\'project\' AND source=\'external\')'; $sql .= ' AND n.entity IN ('.getEntity('project').')'; $resql = $db->query($sql); if ($resql) { @@ -192,7 +192,7 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $ $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (p.rowid = cc.element_id)'; $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_contact as ctc ON (ctc.rowid = cc.fk_c_type_contact)'; $sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id); - $sql .= ' AND ctc.element="project" AND ctc.source="external"'; + $sql .= ' AND ctc.element=\'project\' AND ctc.source=\'external\''; $sql .= ' AND p.entity IN ('.getEntity('project').')'; $sql .= ' ORDER BY p.dateo DESC'; From f5618755ddbd21fc14ddba0c7f0e479f34f71ebb Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Fri, 18 Nov 2022 10:04:02 +0100 Subject: [PATCH 5/9] load correct language file --- htdocs/comm/action/class/actioncomm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 5de2d02bc92..fb78c8d1af5 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -2079,7 +2079,7 @@ class ActionComm extends CommonObject } if ($exportholiday == 1) { - $langs->load("holidays"); + $langs->load("holiday"); $title = $langs->trans("Holidays"); $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.email, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status"; From 3a734a130513943de9ec49218b3550eecbdbc047 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 18 Nov 2022 10:27:49 +0100 Subject: [PATCH 6/9] NEW: add batch lot for reception and squille PDF --- htdocs/reception/class/reception.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 0bff44a13d9..bda9821f993 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -118,6 +118,10 @@ class Reception extends CommonObject public $lines = array(); + // detail of lot and qty = array(id in llx_commande_fournisseur_dispatch, batch, qty) + // We can use this to know warehouse planned to be used for each lot. + public $detail_batch; + const STATUS_DRAFT = 0; const STATUS_VALIDATED = 1; const STATUS_CLOSED = 2; @@ -1209,6 +1213,14 @@ class Reception extends CommonObject $this->total_ttc += $pu_ht + $tva; + if (isModEnabled('productbatch') && !empty($line->batch)) { + $detail_batch = new stdClass(); + $detail_batch->eatby = $line->eatby; + $detail_batch->sellby = $line->sellby; + $detail_batch->batch = $line->batch; + $detail_batch->qty = $line->qty; + $line->detail_batch[] = $detail_batch; + } $this->lines[] = $line; } From 313f622ea87b6e0caa2f026b460c4a8c195e6805 Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 22 Nov 2022 14:15:14 +0100 Subject: [PATCH 7/9] Fix(scrutinizer) https://scrutinizer-ci.com/g/Dolibarr/dolibarr/issues/develop/files/htdocs/don/payment/payment.php?selectedLabels%5B0%5D=9&selectedSeverities%5B0%5D=10&orderField=lastFound&order=desc&honorSelectedPaths=0 --- htdocs/don/payment/payment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 6a2cc78f128..64a80f10ef3 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -95,7 +95,7 @@ if ($action == 'add_payment') { // Create a line of payments $payment = new PaymentDonation($db); $payment->chid = $chid; - $payment->datepaid = $datepaid; + $payment->datep = $datep; $payment->amounts = $amounts; // Tableau de montant $payment->paymenttype = GETPOST("paymenttype", 'int'); $payment->num_payment = GETPOST("num_payment", 'alphanohtml'); @@ -192,7 +192,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans("PaymentMode").''; - $form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->paymenttype, "paymenttype"); + $form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->fk_typepayment, "paymenttype"); print "\n"; print ''; From 1a73f4e9c6d3dbd4b34381b5a6a0ea196ffc067e Mon Sep 17 00:00:00 2001 From: atm-steve Date: Tue, 22 Nov 2022 15:07:33 +0100 Subject: [PATCH 8/9] fix: filter user by hierarchy on task --- htdocs/projet/activity/permonth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 273affc3563..49849b362ba 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -419,7 +419,7 @@ if (!empty($conf->categorie->enabled)) // If the user can view user other than himself $moreforfilter .= '
'; $moreforfilter .= '
'; -$includeonly = 'hierachyme'; +$includeonly = 'hierarchyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } From 5c012a53f8bc10dbee7920f8e1d68c55fcbb5e5d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Nov 2022 21:54:21 +0100 Subject: [PATCH 9/9] Update contact.lib.php --- htdocs/core/lib/contact.lib.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index a089a255a45..ce284636aee 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -70,9 +70,10 @@ function contact_prepare_head(Contact $object) $sql = 'SELECT COUNT(n.rowid) as nb'; $sql .= ' FROM '.MAIN_DB_PREFIX.'projet as n'; $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (n.rowid = cc.element_id)'; - $sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id); - $sql .= ' AND cc.fk_c_type_contact IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE element=\'project\' AND source=\'external\')'; - $sql .= ' AND n.entity IN ('.getEntity('project').')'; + $sql .= " WHERE cc.fk_socpeople = ".((int) $object->id); + $sql .= " AND cc.fk_c_type_contact IN (SELECT rowid FROM ".MAIN_DB_PREFIX."c_type_contact WHERE element='project' AND source='external')"; + $sql .= " AND n.entity IN (".getEntity('project').")"; + $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); @@ -191,10 +192,10 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_lead_status as cls on p.fk_opp_status = cls.rowid'; $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (p.rowid = cc.element_id)'; $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_contact as ctc ON (ctc.rowid = cc.fk_c_type_contact)'; - $sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id); - $sql .= ' AND ctc.element=\'project\' AND ctc.source=\'external\''; - $sql .= ' AND p.entity IN ('.getEntity('project').')'; - $sql .= ' ORDER BY p.dateo DESC'; + $sql .= " WHERE cc.fk_socpeople = ".((int) $object->id); + $sql .= " AND ctc.element='project' AND ctc.source='external'"; + $sql .= " AND p.entity IN (".getEntity('project').")"; + $sql .= " ORDER BY p.dateo DESC"; $result = $db->query($sql); if ($result) {