diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index a0586546b48..ed9c25f55fc 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -481,7 +481,6 @@ class Members extends DolibarrApi } if ($object instanceof AdherentType) { - unset($object->array_options); unset($object->linkedObjectsIds); unset($object->context); unset($object->canvas); @@ -800,7 +799,12 @@ class Members extends DolibarrApi $membertype->context['caller'] = sanitizeVal($request_data['caller'], 'aZ09'); 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 = $this->_checkValForAPI($field, $value, $membertype); diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 21a9b3b77b0..6f2610c0969 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'] = sanitizeVal($request_data['caller'], 'aZ09'); continue; } - + if ($field == 'array_options' && is_array($value)) { + foreach ($value as $index => $val) { + $this->order->array_options[$index] = $this->_checkValForAPI($field, $val, $this->order); + } + continue; + } $this->order->$field = $this->_checkValForAPI($field, $value, $this->order); } 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); 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'); diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index cae608e5c5e..7f473246dfa 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -525,6 +525,12 @@ class Projects extends DolibarrApi $this->project->context['caller'] = sanitizeVal($request_data['caller'], 'aZ09'); continue; } + if ($field == 'array_options' && is_array($value)) { + foreach ($value as $index => $val) { + $this->project->array_options[$index] = $this->_checkValForAPI($field, $val, $this->project); + } + continue; + } $this->project->$field = $this->_checkValForAPI($field, $value, $this->project); } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 15cbe1d4d1f..185cd61f6bf 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'] = sanitizeVal($request_data['caller'], 'aZ09'); 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); }