From cbc530c566977a8d37d154eda5ca068c5790c69f Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Mon, 1 Apr 2024 11:13:10 +0200 Subject: [PATCH 1/7] will allow updating 1 supplier order single Complementary Attribute without specifying complementary attributes that we don't want to change. Similar to # 29115 but just for supplier orders --- htdocs/fourn/class/api_supplier_orders.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 156b395c377..85016147a41 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -285,7 +285,12 @@ class SupplierOrders extends DolibarrApi $this->order->context['caller'] = $request_data['caller']; continue; } - + if ($field == 'array_options' && is_array($value)) { + foreach ($value as $index => $val) { + $this->order->array_options[$index] = $val; + } + continue; + } $this->order->$field = $this->_checkValForAPI($field, $value, $this->order); } From 1084dfec2fe6b8ae14f1b7c509c6b80c506dd660 Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Mon, 1 Apr 2024 11:29:03 +0200 Subject: [PATCH 2/7] will allow updating 1 project single Complementary Attribute without specifying complementary attributes that we don't want to change. Similar to # 29115 but just for a project --- htdocs/projet/class/api_projects.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index b3637643169..1c0036e7e26 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -465,7 +465,12 @@ class Projects extends DolibarrApi $this->project->context['caller'] = $request_data['caller']; continue; } - + if ($field == 'array_options' && is_array($value)) { + foreach ($value as $index => $val) { + $this->project->array_options[$index] = $val; + } + continue; + } $this->project->$field = $value; } From bc56e8f1e7cee5bb3055cfd87f7f8f499cdf48cf Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Mon, 1 Apr 2024 19:11:16 +0200 Subject: [PATCH 3/7] double fix: do not remove array_options from json + allowing single option_ update without nullifying the other options_ --- htdocs/adherents/class/api_members.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 941a685d326..07f09c7dd30 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -476,7 +476,6 @@ class Members extends DolibarrApi } if ($object instanceof AdherentType) { - unset($object->array_options); unset($object->linkedObjectsIds); unset($object->context); unset($object->canvas); @@ -795,7 +794,12 @@ class Members extends DolibarrApi $membertype->context['caller'] = $request_data['caller']; continue; } - + if ($field == 'array_options' && is_array($value)) { + foreach ($value as $index => $val) { + $membertype->array_options[$index] = $val; + } + continue; + } // Process the status separately because it must be updated using // the validate(), resiliate() and exclude() methods of the class AdherentType. $membertype->$field = $value; From 3b418c5c9252b7c1862c23b07e0b6c4815b4d9b8 Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Mon, 1 Apr 2024 23:05:49 +0200 Subject: [PATCH 4/7] will allow updating single complementary attribute using the put api --- htdocs/societe/class/api_thirdparties.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 1735efc4f7f..d6d89d1f50e 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -304,7 +304,12 @@ class Thirdparties extends DolibarrApi $this->company->context['caller'] = $request_data['caller']; continue; } - + if ($field == 'array_options' && is_array($value)) { + foreach ($value as $index => $val) { + $this->company->array_options[$index] = $val; + } + continue; + } $this->company->$field = $this->_checkValForAPI($field, $value, $this->company); } From 2316d26de4f646f33fc135a9fe7a1964ae5362bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Apr 2024 14:52:03 +0200 Subject: [PATCH 5/7] Update api_supplier_orders.class.php --- htdocs/fourn/class/api_supplier_orders.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index b6a697e2fda..b7eae02ab7c 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -287,7 +287,7 @@ class SupplierOrders extends DolibarrApi } if ($field == 'array_options' && is_array($value)) { foreach ($value as $index => $val) { - $this->order->array_options[$index] = $val; + $this->order->array_options[$index] = $this->_checkValForAPI($field, $val, $this->order); } continue; } From b15a0685e7e204fb97cd4ba9c51f5253bcffb90f Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Wed, 3 Apr 2024 03:17:19 +0300 Subject: [PATCH 6/7] fix list default search parameters --- htdocs/fourn/facture/list-rec.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index cfa3fbdc457..c0642f3728f 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -8,7 +8,8 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015-2021 Alexandre Spangaro * Copyright (C) 2016 Meziane Sof - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,7 +92,7 @@ $search_date_when_endmonth = GETPOSTINT('search_date_when_endmonth'); $search_date_when_endyear = GETPOSTINT('search_date_when_endyear'); $search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver $search_date_when_end = dol_mktime(23, 59, 59, $search_date_when_endmonth, $search_date_when_endday, $search_date_when_endyear); -$search_recurring = GETPOSTINT('search_recurring'); +$search_recurring = GETPOST('search_recurring', 'intcomma'); $search_frequency = GETPOST('search_frequency', 'alpha'); $search_unit_frequency = GETPOST('search_unit_frequency', 'alpha'); $search_nb_gen_done = GETPOST('search_nb_gen_done', 'alpha'); From 7534e7bbd9d42999aecda943da463a5547f274a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 3 Apr 2024 08:57:41 +0200 Subject: [PATCH 7/7] fix Property SupplierInvoiceLine::$localtax1_type (float) does not accept string --- htdocs/fourn/class/fournisseur.facture.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 2f8dd59bdfd..9dee26413e9 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2247,8 +2247,8 @@ class FactureFournisseur extends CommonInvoice $supplierinvoiceline->tva_tx = $txtva; $supplierinvoiceline->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0); $supplierinvoiceline->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0); - $supplierinvoiceline->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; - $supplierinvoiceline->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; + $supplierinvoiceline->localtax1_type = empty($localtaxes_type[0]) ? 0 : $localtaxes_type[0]; + $supplierinvoiceline->localtax2_type = empty($localtaxes_type[2]) ? 0 : $localtaxes_type[2]; $supplierinvoiceline->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative $supplierinvoiceline->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_tva) : $total_tva); // For credit note and if qty is negative, total is negative @@ -2455,8 +2455,8 @@ class FactureFournisseur extends CommonInvoice $line->tva_tx = $vatrate; $line->localtax1_tx = $txlocaltax1; $line->localtax2_tx = $txlocaltax2; - $line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; - $line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; + $line->localtax1_type = empty($localtaxes_type[0]) ? 0 : $localtaxes_type[0]; + $line->localtax2_type = empty($localtaxes_type[2]) ? 0 : $localtaxes_type[2]; $line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_ht) : $total_ht); $line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_tva) : $total_tva);