From efce6c5aab47d65d23491d60230095c99b3f1acc Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 8 Jan 2024 23:45:26 +0100 Subject: [PATCH 1/8] Fix: fournisseur.commande - add missing argument addline call The call to addline had several missing arguments. Added. --- .../class/fournisseur.commande.class.php | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index fa70a9e0b25..800ef87b319 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1457,8 +1457,12 @@ class CommandeFournisseur extends CommonOrder $line->date_end, $line->array_options, $line->fk_unit, + $line->multicurrency_subprice, // pu_ht_devise + $line->origin, // origin + $line->origin_id, // origin_id + $line->rang, // rang $line->special_code - ); + ); if ($result < 0) { dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); // do not use dol_print_error here as it may be a functionnal error $this->db->rollback(); @@ -1727,31 +1731,31 @@ class CommandeFournisseur extends CommonOrder /** * Add order line * - * @param string $desc Description - * @param float $pu_ht Unit price (used if $price_base_type is 'HT') - * @param float $qty Quantity - * @param float $txtva Taux tva - * @param float $txlocaltax1 Localtax1 tax - * @param float $txlocaltax2 Localtax2 tax - * @param int $fk_product Id product - * @param int $fk_prod_fourn_price Id supplier price - * @param string $ref_supplier Supplier reference price - * @param float $remise_percent Remise - * @param string $price_base_type HT or TTC - * @param float $pu_ttc Unit price TTC (used if $price_base_type is 'TTC') - * @param int $type Type of line (0=product, 1=service) - * @param int $info_bits More information - * @param bool $notrigger Disable triggers - * @param int $date_start Date start of service - * @param int $date_end Date end of service - * @param array $array_options extrafields array - * @param string $fk_unit Code of the unit to use. Null to use the default one - * @param string $pu_ht_devise Amount in currency - * @param string $origin 'order', ... - * @param int $origin_id Id of origin object - * @param int $rang Rank - * @param int $special_code Special code - * @return int <=0 if KO, >0 if OK + * @param string $desc Description + * @param float $pu_ht Unit price (used if $price_base_type is 'HT') + * @param float $qty Quantity + * @param float $txtva VAT Rate + * @param float $txlocaltax1 Localtax1 tax + * @param float $txlocaltax2 Localtax2 tax + * @param int $fk_product Id product + * @param int $fk_prod_fourn_price Id supplier price + * @param string $ref_supplier Supplier reference price + * @param float $remise_percent Remise + * @param string $price_base_type HT or TTC + * @param float $pu_ttc Unit price TTC (used if $price_base_type is 'TTC') + * @param int $type Type of line (0=product, 1=service) + * @param int $info_bits More information + * @param bool $notrigger Disable triggers + * @param int $date_start Date start of service + * @param int $date_end Date end of service + * @param array $array_options extrafields array + * @param string $fk_unit Code of the unit to use. Null to use the default one + * @param string $pu_ht_devise Amount in currency + * @param string $origin 'order', ... + * @param int $origin_id Id of origin object + * @param int $rang Rank + * @param int $special_code Special code + * @return int Return integer <=0 if KO, >0 if OK */ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $fk_prod_fourn_price = 0, $ref_supplier = '', $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $type = 0, $info_bits = 0, $notrigger = false, $date_start = null, $date_end = null, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $origin = '', $origin_id = 0, $rang = -1, $special_code = 0) { @@ -1975,7 +1979,7 @@ class CommandeFournisseur extends CommonOrder // Multicurrency $this->line->fk_multicurrency = $this->fk_multicurrency; $this->line->multicurrency_code = $this->multicurrency_code; - $this->line->multicurrency_subprice = $pu_ht_devise; + $this->line->multicurrency_subprice = $pu_ht_devise; $this->line->multicurrency_total_ht = $multicurrency_total_ht; $this->line->multicurrency_total_tva = $multicurrency_total_tva; $this->line->multicurrency_total_ttc = $multicurrency_total_ttc; From 6d88670eeebdf4d51649ac746115dd17078c80b9 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 9 Jan 2024 00:03:24 +0100 Subject: [PATCH 2/8] Fix: Sitemap generation - fix invalid replacement regex # Fix: Sitemap generation - fix invalid replacement regex The regex is invalid because the delimiters are slashes which are also present in the text to match. Fixed by changing the delimiters. --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 84d408b4f0b..c799e2ce898 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2673,7 +2673,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { // Add the entry Sitemap: into the robot file. $robotcontent = @file_get_contents($filerobot); - $result = preg_replace('/\n/ims', '', $robotcontent); + $result = preg_replace('@\n@ims', '', $robotcontent); if ($result) { $robotcontent = $result; } From 8f7a4800ee7bf05051305647071e7dcc5fc0a066 Mon Sep 17 00:00:00 2001 From: William Mead Date: Tue, 9 Jan 2024 14:49:20 +0100 Subject: [PATCH 3/8] Added notification information on intervention validated confirmation message --- htdocs/fichinter/card.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 349139e69ff..de838f401bf 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1105,6 +1105,12 @@ if ($action == 'create') { $numref = $object->ref; } $text = $langs->trans('ConfirmValidateIntervention', $numref); + if (isModEnabled('notification')) { + require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
'; + $text .= $notify->confirmMessage('FICHINTER_VALIDATE', $object->socid, $object); + } $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate', '', 1, 1); } From 5c434e273ea053dc4c302b86ea74fe3c14960040 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Jan 2024 15:25:16 +0100 Subject: [PATCH 4/8] Update index.php --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index c799e2ce898..fad19c82a61 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2673,7 +2673,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { // Add the entry Sitemap: into the robot file. $robotcontent = @file_get_contents($filerobot); - $result = preg_replace('@\n@ims', '', $robotcontent); + $result = preg_replace('/\n/ims', '', $robotcontent); if ($result) { $robotcontent = $result; } From 72210dc19b92c7f8e31da594d35a3cce4dd590ce Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 10 Jan 2024 16:57:10 +0100 Subject: [PATCH 5/8] Fix: discount - add missing db parameter to dol_print_error (#27337) # Fix: discount - add missing db parameter to dol_print_error dol_print_error requires the db instance to be the first parameter --- htdocs/core/class/discount.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 86fb546be9a..b1cf3fb7749 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -581,7 +581,7 @@ class DiscountAbsolute $sql .= " AND f.type = 3"; } else { $this->error = get_class($this)."::getSumDepositsUsed was called with a bad object as a first parameter"; - dol_print_error($this->error); + dol_print_error($this->db, $this->error); return -1; } @@ -622,7 +622,7 @@ class DiscountAbsolute $sql .= " AND f.type IN (".$this->db->sanitize($invoice::TYPE_STANDARD.", ".$invoice::TYPE_CREDIT_NOTE).")"; // Find discount coming from credit note or excess paid } else { $this->error = get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter"; - dol_print_error($this->error); + dol_print_error($this->db, $this->error); return -1; } @@ -660,7 +660,7 @@ class DiscountAbsolute $sql .= " WHERE rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_source = ".((int) $invoice->id); } else { $this->error = get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter"; - dol_print_error($this->error); + dol_print_error($this->db, $this->error); return -1; } From 77a922a72e457cf25888f6c0d4a760f7260b02c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jan 2024 01:41:13 +0100 Subject: [PATCH 6/8] Debug v19 --- htdocs/modulebuilder/index.php | 3 ++- .../{functionnal => functional}/MyModuleFunctionalTest.php | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename htdocs/modulebuilder/template/test/phpunit/{functionnal => functional}/MyModuleFunctionalTest.php (100%) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index fe5d5f42362..2b5e6ba6fc8 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -280,6 +280,7 @@ if ($dirins && $action == 'initmodule' && $modulename) { } // Delete dir and files that can be generated in sub tabs later if we need them (we want a minimal module first) + dol_delete_dir_recursive($destdir.'/ajax'); dol_delete_dir_recursive($destdir.'/build/doxygen'); dol_delete_dir_recursive($destdir.'/core/modules/mailings'); dol_delete_dir_recursive($destdir.'/core/modules/'.strtolower($modulename)); @@ -311,7 +312,7 @@ if ($dirins && $action == 'initmodule' && $modulename) { dol_delete_file($destdir.'/myobject_agenda.php'); dol_delete_file($destdir.'/myobject_list.php'); dol_delete_file($destdir.'/lib/'.strtolower($modulename).'_myobject.lib.php'); - dol_delete_file($destdir.'/test/phpunit/functionnal/'.$modulename.'FunctionnalTest.php'); + dol_delete_file($destdir.'/test/phpunit/functional/'.$modulename.'FunctionalTest.php'); dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php'); dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.sql'); dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.sql'); diff --git a/htdocs/modulebuilder/template/test/phpunit/functionnal/MyModuleFunctionalTest.php b/htdocs/modulebuilder/template/test/phpunit/functional/MyModuleFunctionalTest.php similarity index 100% rename from htdocs/modulebuilder/template/test/phpunit/functionnal/MyModuleFunctionalTest.php rename to htdocs/modulebuilder/template/test/phpunit/functional/MyModuleFunctionalTest.php From 11f457ddc89d247e677dabd246f6240708728732 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 11 Jan 2024 10:47:05 +0100 Subject: [PATCH 7/8] # Fix: remove parameter in getSelectInvoiceSubtype call (#27314) Parameters were already invalid when this was added in 65b9f4e6defe. See https://github.com/Dolibarr/dolibarr/blob/65b9f4e6defede20d488e62f11083c4c0ef5d20b/htdocs/core/class/html.form.class.php#L10865C59-L10865C59 . --- htdocs/compta/facture/card-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index d4690561632..bb3c6938396 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1006,7 +1006,7 @@ if ($action == 'create') { // Invoice subtype if (getDolGlobalInt('INVOICE_SUBTYPE_ENABLED')) { print "".$langs->trans("InvoiceSubtype").""; - print $form->getSelectInvoiceSubtype(GETPOSTISSET('subtype') ? GETPOST('subtype') : $object->subtype, 'subtype', -1, 0, 0, ''); + print $form->getSelectInvoiceSubtype(GETPOSTISSET('subtype') ? GETPOST('subtype') : $object->subtype, 'subtype', 0, 0, ''); print ""; } From f2669da370beada6023cbbe0ab84f826f29fdfa3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jan 2024 13:41:38 +0100 Subject: [PATCH 8/8] Debug v19 --- htdocs/langs/en_US/stripe.lang | 1 + htdocs/salaries/virement_request.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index 0beab57f2e3..239c1cf0345 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -75,5 +75,6 @@ CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authen STRIPE_CARD_PRESENT=Card Present for Stripe Terminals TERMINAL_LOCATION=Location (address) for Stripe Terminals RequestDirectDebitWithStripe=Request Direct Debit with Stripe +RequesCreditTransferWithStripe=Request Credit Transfer with Stripe STRIPE_SEPA_DIRECT_DEBIT=Enable the Direct Debit payments through Stripe StripeConnect_Mode=Stripe Connect mode \ No newline at end of file diff --git a/htdocs/salaries/virement_request.php b/htdocs/salaries/virement_request.php index f51af45622c..59f82b9880f 100644 --- a/htdocs/salaries/virement_request.php +++ b/htdocs/salaries/virement_request.php @@ -613,7 +613,7 @@ if ($resql) { print $withdrawreceipt->getNomUrl(1); } - if ($type != 'bank-transfer') { + if (!in_array($type, array('bank-transfer', 'salaire', 'salary'))) { if (getDolGlobalString('STRIPE_SEPA_DIRECT_DEBIT')) { $langs->load("stripe"); if ($obj->fk_prelevement_bons > 0) { @@ -627,7 +627,7 @@ if ($resql) { if ($obj->fk_prelevement_bons > 0) { print '   '; } - print 'rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("RequestDirectDebitWithStripe").''; + print 'rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("RequesCreditTransferWithStripe").''; } } print '';