Qual: Fix phan notices for commande

This commit is contained in:
MDW 2025-03-04 18:02:29 +01:00
parent b91f457afb
commit 4096d0ee2f
No known key found for this signature in database
13 changed files with 126 additions and 131 deletions

View file

@ -180,18 +180,12 @@ return [
'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/remise.php' => ['PhanTypeMismatchArgument'],
'htdocs/comm/remx.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/agenda.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/card.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/class/api_orders.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
'htdocs/commande/class/commande.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
'htdocs/commande/class/orderline.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/contact.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/customer.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/commande/document.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
'htdocs/commande/list_det.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/commande/note.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/stats/index.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/list.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/list_det.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/accounting-files.php' => ['PhanTypeMismatchArgument'],
'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'],
@ -300,7 +294,7 @@ return [
'htdocs/core/ajax/ajaxstatusprospect.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/ajax/contacts.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/ajax/loadinplace.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/ajax/saveinplace.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/core/ajax/saveinplace.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/ajax/selectobject.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/core/class/CMailFile.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'],
@ -370,7 +364,6 @@ return [
'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/commande/mod_commande_saphir.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -166,7 +167,7 @@ if ($object->id > 0) {
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);

View file

@ -1136,7 +1136,7 @@ if (empty($reshook)) {
$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
// Margin
$fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOSTINT('fournprice'.$predef) : '');
$fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOSTINT('fournprice'.$predef) : 0);
$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value
// Prepare a price equivalent for minimum price check

View file

@ -1019,14 +1019,14 @@ class Commande extends CommonOrder
$sql .= " VALUES ('(PROV)', ".((int) $this->socid).", '".$this->db->idate($now)."', ".((int) $user->id);
$sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : "null");
$sql .= ", '".$this->db->idate($date)."'";
$sql .= ", ".($this->source >= 0 && $this->source != '' ? $this->db->escape($this->source) : 'null');
$sql .= ", ".($this->source >= 0 && $this->source != '' ? $this->db->escape((string) $this->source) : 'null');
$sql .= ", '".$this->db->escape($this->note_private)."'";
$sql .= ", '".$this->db->escape($this->note_public)."'";
$sql .= ", ".($this->ref_ext ? "'".$this->db->escape($this->ref_ext)."'" : "null");
$sql .= ", ".($this->ref_client ? "'".$this->db->escape($this->ref_client)."'" : "null");
$sql .= ", '".$this->db->escape($this->model_pdf)."'";
$sql .= ", ".($this->cond_reglement_id > 0 ? ((int) $this->cond_reglement_id) : "null");
$sql .= ", ".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null");
$sql .= ", ".(!empty($this->deposit_percent) ? "'".$this->db->escape((string) $this->deposit_percent)."'" : "null");
$sql .= ", ".($this->mode_reglement_id > 0 ? ((int) $this->mode_reglement_id) : "null");
$sql .= ", ".($this->fk_account > 0 ? ((int) $this->fk_account) : 'NULL');
$sql .= ", ".($this->availability_id > 0 ? ((int) $this->availability_id) : "null");
@ -1114,7 +1114,7 @@ class Commande extends CommonOrder
$line->label,
$line->array_options,
$line->fk_unit,
$origintype,
(string) $origintype,
$originid,
0,
$line->ref_ext,
@ -1680,7 +1680,7 @@ class Commande extends CommonOrder
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise);
$tabprice = calcul_price_total($qty, (float) $pu, $remise_percent, $txtva, (float) $txlocaltax1, (float) $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, (float) $pu_ht_devise);
/*var_dump($txlocaltax1);
var_dump($txlocaltax2);
@ -3140,7 +3140,7 @@ class Commande extends CommonOrder
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise);
$tabprice = calcul_price_total($qty, (float) $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, (float) $pu_ht_devise);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];

View file

@ -13,7 +13,7 @@
* Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -425,7 +425,7 @@ class OrderLine extends CommonOrderLine
$sql .= ' fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc';
$sql .= ')';
$sql .= " VALUES (".$this->fk_commande.",";
$sql .= " ".($this->fk_parent_line > 0 ? "'".$this->db->escape($this->fk_parent_line)."'" : "null").",";
$sql .= " ".($this->fk_parent_line > 0 ? "'".$this->db->escape((string) $this->fk_parent_line)."'" : "null").",";
$sql .= " ".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null").",";
$sql .= " '".$this->db->escape($this->desc)."',";
$sql .= " '".price2num($this->qty)."',";
@ -437,7 +437,7 @@ class OrderLine extends CommonOrderLine
$sql .= " '".$this->db->escape($this->localtax1_type)."',";
$sql .= " '".$this->db->escape($this->localtax2_type)."',";
$sql .= ' '.((!empty($this->fk_product) && $this->fk_product > 0) ? $this->fk_product : "null").',';
$sql .= " '".$this->db->escape($this->product_type)."',";
$sql .= " '".$this->db->escape((string) $this->product_type)."',";
$sql .= " '".price2num($this->remise_percent)."',";
$sql .= " ".(price2num($this->subprice) !== '' ? price2num($this->subprice) : "null").",";
$sql .= " ".($this->price != '' ? "'".price2num($this->price)."'" : "null").",";

View file

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2022 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -66,7 +67,7 @@ $object = new Commande($db);
* Actions
*/
$parameters = array('id'=>$id);
$parameters = array('id' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -161,7 +162,7 @@ if ($id > 0 || !empty($ref)) {
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);

View file

@ -6,6 +6,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -154,7 +155,7 @@ if ($id > 0 || !empty($ref)) {
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);

View file

@ -12,7 +12,7 @@
* Copyright (C) 2016-2023 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2023 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2021-2024 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Noé Cendrier <noe.cendrier@altairis.fr>
* Copyright (C) 2024 Benjamin Falière <benjamin.faliere@altairis.fr>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
@ -200,49 +200,49 @@ if (empty($user->socid)) {
$checkedtypetiers = 0;
$arrayfields = array(
'c.rowid' => array('label' => "ID", 'checked' => 1, 'enabled' => getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID'), 'position' => 1),
'c.ref' => array('label' => "Ref", 'checked' => 1, 'position' => 5, 'searchall' => 1),
'c.ref_ext' => array('label' => "RefExt", 'checked' => 1, 'position' => 5, 'visible' => 0, 'searchall' => 1),
'c.ref_client' => array('label' => "RefCustomerOrder", 'checked' => -1, 'position' => 10, 'searchall' => 1),
'p.ref' => array('label' => "ProjectRef", 'checked' => -1, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 20),
'p.title' => array('label' => "ProjectLabel", 'checked' => 0, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 25),
's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 30, 'searchall' => 1),
's.name_alias' => array('label' => "AliasNameShort", 'checked' => -1, 'position' => 31, 'searchall' => 1),
's2.nom' => array('label' => 'ParentCompany', 'position' => 32, 'checked' => 0),
's.town' => array('label' => "Town", 'checked' => -1, 'position' => 35, 'searchall' => 1),
's.zip' => array('label' => "Zip", 'checked' => -1, 'position' => 40, 'searchall' => 1),
'state.nom' => array('label' => "StateShort", 'checked' => 0, 'position' => 45),
'country.code_iso' => array('label' => "Country", 'checked' => 0, 'position' => 50),
'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers, 'position' => 55),
'c.date_commande' => array('label' => "OrderDateShort", 'checked' => 1, 'position' => 60, 'csslist' => 'nowraponall'),
'c.delivery_date' => array('label' => "DateDeliveryPlanned", 'checked' => 1, 'enabled' => !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65, 'csslist' => 'nowraponall'),
'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66 , 'enabled' => isModEnabled("shipping")),
'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => -1, 'position' => 67),
'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => -1, 'position' => 68),
'c.fk_input_reason' => array('label' => "Origin", 'checked' => -1, 'position' => 69),
'c.total_ht' => array('label' => "AmountHT", 'checked' => 1, 'position' => 75),
'c.total_vat' => array('label' => "AmountVAT", 'checked' => 0, 'position' => 80),
'c.total_ttc' => array('label' => "AmountTTC", 'checked' => 0, 'position' => 85),
'c.multicurrency_code' => array('label' => 'Currency', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1), 'position' => 90),
'c.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1), 'position' => 95),
'c.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1), 'position' => 100),
'c.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1), 'position' => 105),
'c.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1), 'position' => 110),
'u.login' => array('label' => "Author", 'checked' => -1, 'position' => 115),
'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => 0, 'position' => 116),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || !getDolGlobalString('DISPLAY_MARK_RATES') ? 0 : 1)),
'c.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 120),
'c.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 125),
'c.date_cloture' => array('label' => "DateClosing", 'checked' => 0, 'position' => 130),
'c.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position' => 135, 'searchall' => 1),
'c.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position' => 140),
'shippable' => array('label' => "Shippable", 'checked' => 1,'enabled' => (isModEnabled("shipping")), 'position' => 990),
'c.facture' => array('label' => "Billed", 'checked' => 1, 'enabled' => (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995),
'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 999),
'c.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000)
'c.rowid' => array('label' => "ID", 'checked' => '1', 'enabled' => (string) getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID'), 'position' => 1),
'c.ref' => array('label' => "Ref", 'checked' => '1', 'position' => 5, 'searchall' => 1),
'c.ref_ext' => array('label' => "RefExt", 'checked' => '1', 'position' => 5, 'visible' => 0, 'searchall' => 1),
'c.ref_client' => array('label' => "RefCustomerOrder", 'checked' => '-1', 'position' => 10, 'searchall' => 1),
'p.ref' => array('label' => "ProjectRef", 'checked' => '-1', 'enabled' => (!isModEnabled('project') ? '0' : '1'), 'position' => 20),
'p.title' => array('label' => "ProjectLabel", 'checked' => '0', 'enabled' => (!isModEnabled('project') ? '0' : '1'), 'position' => 25),
's.nom' => array('label' => "ThirdParty", 'checked' => '1', 'position' => 30, 'searchall' => 1),
's.name_alias' => array('label' => "AliasNameShort", 'checked' => '-1', 'position' => 31, 'searchall' => 1),
's2.nom' => array('label' => 'ParentCompany', 'position' => 32, 'checked' => '0'),
's.town' => array('label' => "Town", 'checked' => '-1', 'position' => 35, 'searchall' => 1),
's.zip' => array('label' => "Zip", 'checked' => '-1', 'position' => 40, 'searchall' => 1),
'state.nom' => array('label' => "StateShort", 'checked' => '0', 'position' => 45),
'country.code_iso' => array('label' => "Country", 'checked' => '0', 'position' => 50),
'typent.code' => array('label' => "ThirdPartyType", 'checked' => (string) $checkedtypetiers, 'position' => 55),
'c.date_commande' => array('label' => "OrderDateShort", 'checked' => '1', 'position' => 60, 'csslist' => 'nowraponall'),
'c.delivery_date' => array('label' => "DateDeliveryPlanned", 'checked' => '1', 'enabled' => (string) (int) !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65, 'csslist' => 'nowraponall'),
'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => '-1', 'position' => 66 , 'enabled' => (string) (int) isModEnabled("shipping")),
'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => '-1', 'position' => 67),
'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => '-1', 'position' => 68),
'c.fk_input_reason' => array('label' => "Origin", 'checked' => '-1', 'position' => 69),
'c.total_ht' => array('label' => "AmountHT", 'checked' => '1', 'position' => 75),
'c.total_vat' => array('label' => "AmountVAT", 'checked' => '0', 'position' => 80),
'c.total_ttc' => array('label' => "AmountTTC", 'checked' => '0', 'position' => 85),
'c.multicurrency_code' => array('label' => 'Currency', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1'), 'position' => 90),
'c.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1'), 'position' => 95),
'c.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1'), 'position' => 100),
'c.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1'), 'position' => 105),
'c.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1'), 'position' => 110),
'u.login' => array('label' => "Author", 'checked' => '-1', 'position' => 115),
'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => '0', 'position' => 116),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => '0', 'position' => 300, 'enabled' => (string) (int) (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => '0', 'position' => 301, 'enabled' => (string) (int) (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => '0', 'position' => 302, 'enabled' => (string) (int) (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => '0', 'position' => 303, 'enabled' => (string) (int) (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || !getDolGlobalString('DISPLAY_MARK_RATES') ? 0 : 1)),
'c.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 120),
'c.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 125),
'c.date_cloture' => array('label' => "DateClosing", 'checked' => '0', 'position' => 130),
'c.note_public' => array('label' => 'NotePublic', 'checked' => '0', 'enabled' => (string) (int) (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position' => 135, 'searchall' => 1),
'c.note_private' => array('label' => 'NotePrivate', 'checked' => '0', 'enabled' => (string) (int) (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position' => 140),
'shippable' => array('label' => "Shippable", 'checked' => '1','enabled' => (string) (int) (isModEnabled("shipping")), 'position' => 990),
'c.facture' => array('label' => "Billed", 'checked' => '1', 'enabled' => (string) (int) (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995),
'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'visible' => -2, 'position' => 999),
'c.fk_statut' => array('label' => "Status", 'checked' => '1', 'position' => 1000)
);
$parameters = array('fieldstosearchall' => $fieldstosearchall);
@ -259,7 +259,6 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
$arrayfields = dol_sort_array($arrayfields, 'position');
'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
// Security check
@ -1575,7 +1574,7 @@ if ($user->hasRight("user", "user", "lire")) {
if ($user->hasRight("user", "user", "lire")) {
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('LinkedToSpecificUsers');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
$moreforfilter .= '</div>';
}
@ -1585,7 +1584,7 @@ if (isModEnabled('category') && $user->hasRight("categorie", "lire") && ($user->
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag');
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 0, array(), 1);
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1);
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, '', 'maxwidth300 widthcentpercentminusx', 1);
$moreforfilter .= '</div>';
}
// If Categories are enabled & user has rights to see
@ -1685,7 +1684,7 @@ if (!empty($arrayfields['p.title']['checked'])) {
// Thirpdarty
if (!empty($arrayfields['s.nom']['checked'])) {
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth100" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'"'.(!empty($user->socid) ? " disabled" : "").'>';
print '<input class="flat maxwidth100" type="text" name="search_company" value="'.dol_escape_htmltag((string) $search_company).'"'.(!empty($user->socid) ? " disabled" : "").'>';
print '</td>';
}
// Alias
@ -1756,7 +1755,7 @@ if (!empty($arrayfields['c.fk_shipping_method']['checked'])) {
// Payment term
if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) {
print '<td class="liste_titre">';
print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1);
print $form->getSelectConditionsPaiements((int) $search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1);
print '</td>';
}
// Payment mode

View file

@ -12,7 +12,7 @@
* Copyright (C) 2016-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2023 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2021-2023 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
* This program is free software; you can redistribute it and/or modify
@ -191,51 +191,51 @@ if (empty($user->socid)) {
$checkedtypetiers = 0;
$arrayfields = array(
// Détail commande
'rowid' => array('label' => 'TechnicalID', 'checked' => 1, 'position' => 1, 'enabled' => (getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0)),
'pr.ref' => array('label' => 'ProductRef', 'checked' => 1, 'position' => 1),
'pr.desc' => array('label' => 'ProductDescription', 'checked' => -1, 'position' => 1),
'cdet.qty' => array('label' => 'QtyOrdered', 'checked' => 1, 'position' => 1),
'c.ref' => array('label' => "Ref", 'checked' => 1, 'position' => 5),
'c.ref_client' => array('label' => "RefCustomerOrder", 'checked' => -1, 'position' => 10),
'p.ref' => array('label' => "ProjectRef", 'checked' => -1, 'enabled' => (empty($conf->project->enabled) ? 0 : 1), 'position' => 20),
'p.title' => array('label' => "ProjectLabel", 'checked' => 0, 'enabled' => (empty($conf->project->enabled) ? 0 : 1), 'position' => 25),
's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 30),
's.name_alias' => array('label' => "AliasNameShort", 'checked' => -1, 'position' => 31),
's.town' => array('label' => "Town", 'checked' => -1, 'position' => 35),
's.zip' => array('label' => "Zip", 'checked' => -1, 'position' => 40),
'state.nom' => array('label' => "StateShort", 'checked' => 0, 'position' => 45),
'country.code_iso' => array('label' => "Country", 'checked' => 0, 'position' => 50),
'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers, 'position' => 55),
'c.date_commande' => array('label' => "OrderDateShort", 'checked' => 1, 'position' => 60),
'c.delivery_date' => array('label' => "DateDeliveryPlanned", 'checked' => 1, 'enabled' => !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65),
'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66 , 'enabled' => isModEnabled('shipping')),
'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => -1, 'position' => 67),
'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => -1, 'position' => 68),
'c.fk_input_reason' => array('label' => "Channel", 'checked' => -1, 'position' => 69),
'cdet.total_ht' => array('label' => "AmountHT", 'checked' => 1, 'position' => 75),
'c.total_vat' => array('label' => "AmountVAT", 'checked' => 0, 'position' => 80),
'cdet.total_ttc' => array('label' => "AmountTTC", 'checked' => 0, 'position' => 85),
'c.multicurrency_code' => array('label' => 'Currency', 'checked' => 0, 'enabled' => (empty($conf->multicurrency->enabled) ? 0 : 1), 'position' => 90),
'c.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => 0, 'enabled' => (empty($conf->multicurrency->enabled) ? 0 : 1), 'position' => 95),
'c.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => 0, 'enabled' => (empty($conf->multicurrency->enabled) ? 0 : 1), 'position' => 100),
'c.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'checked' => 0, 'enabled' => (empty($conf->multicurrency->enabled) ? 0 : 1), 'position' => 105),
'c.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => 0, 'enabled' => (empty($conf->multicurrency->enabled) ? 0 : 1), 'position' => 110),
'c.fk_warehouse' => array('label' => 'Warehouse', 'checked' => 0, 'enabled' => (!isModEnabled('stock') && !getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') ? 0 : 1), 'position' => 110),
'u.login' => array('label' => "Author", 'checked' => 1, 'position' => 115),
'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => 0, 'position' => 116),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARK_RATES') ? 0 : 1)),
'c.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 120),
'c.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 125),
'c.date_cloture' => array('label' => "DateClosing", 'checked' => 0, 'position' => 130),
'c.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'enabled' => (!getDolGlobalString('MAIN_LIST_ALLOW_PUBLIC_NOTES')), 'position' => 135),
'c.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'enabled' => (!getDolGlobalString('MAIN_LIST_ALLOW_PRIVATE_NOTES')), 'position' => 140),
'shippable' => array('label' => "Shippable", 'checked' => 1,'enabled' => (isModEnabled('shipping')), 'position' => 990),
'c.facture' => array('label' => "Billed", 'checked' => 1, 'enabled' => (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995),
'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 999),
'c.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000)
'rowid' => array('label' => 'TechnicalID', 'checked' => '1', 'position' => 1, 'enabled' => (getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') ? '1' : '0')),
'pr.ref' => array('label' => 'ProductRef', 'checked' => '1', 'position' => 1),
'pr.desc' => array('label' => 'ProductDescription', 'checked' => '-1', 'position' => 1),
'cdet.qty' => array('label' => 'QtyOrdered', 'checked' => '1', 'position' => 1),
'c.ref' => array('label' => "Ref", 'checked' => '1', 'position' => 5),
'c.ref_client' => array('label' => "RefCustomerOrder", 'checked' => '-1', 'position' => 10),
'p.ref' => array('label' => "ProjectRef", 'checked' => '-1', 'enabled' => (empty($conf->project->enabled) ? '0' : '1'), 'position' => 20),
'p.title' => array('label' => "ProjectLabel", 'checked' => '0', 'enabled' => (empty($conf->project->enabled) ? '0' : '1'), 'position' => 25),
's.nom' => array('label' => "ThirdParty", 'checked' => '1', 'position' => 30),
's.name_alias' => array('label' => "AliasNameShort", 'checked' => '-1', 'position' => 31),
's.town' => array('label' => "Town", 'checked' => '-1', 'position' => 35),
's.zip' => array('label' => "Zip", 'checked' => '-1', 'position' => 40),
'state.nom' => array('label' => "StateShort", 'checked' => '0', 'position' => 45),
'country.code_iso' => array('label' => "Country", 'checked' => '0', 'position' => 50),
'typent.code' => array('label' => "ThirdPartyType", 'checked' => (string) $checkedtypetiers, 'position' => 55),
'c.date_commande' => array('label' => "OrderDateShort", 'checked' => '1', 'position' => 60),
'c.delivery_date' => array('label' => "DateDeliveryPlanned", 'checked' => '1', 'enabled' => (string) (int) !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65),
'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => '-1', 'position' => 66 , 'enabled' => (string) (int) isModEnabled('shipping')),
'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => '-1', 'position' => 67),
'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => '-1', 'position' => 68),
'c.fk_input_reason' => array('label' => "Channel", 'checked' => '-1', 'position' => 69),
'cdet.total_ht' => array('label' => "AmountHT", 'checked' => '1', 'position' => 75),
'c.total_vat' => array('label' => "AmountVAT", 'checked' => '0', 'position' => 80),
'cdet.total_ttc' => array('label' => "AmountTTC", 'checked' => '0', 'position' => 85),
'c.multicurrency_code' => array('label' => 'Currency', 'checked' => '0', 'enabled' => (empty($conf->multicurrency->enabled) ? '0' : '1'), 'position' => 90),
'c.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => '0', 'enabled' => (empty($conf->multicurrency->enabled) ? '0' : '1'), 'position' => 95),
'c.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => '0', 'enabled' => (empty($conf->multicurrency->enabled) ? '0' : '1'), 'position' => 100),
'c.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'checked' => '0', 'enabled' => (empty($conf->multicurrency->enabled) ? '0' : '1'), 'position' => 105),
'c.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => '0', 'enabled' => (empty($conf->multicurrency->enabled) ? '0' : '1'), 'position' => 110),
'c.fk_warehouse' => array('label' => 'Warehouse', 'checked' => '0', 'enabled' => (string) (int) (!isModEnabled('stock') && !getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') ? '0' : '1'), 'position' => 110),
'u.login' => array('label' => "Author", 'checked' => '1', 'position' => 115),
'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => '0', 'position' => 116),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => '0', 'position' => 300, 'enabled' => (string) (int) (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? '0' : '1')),
'total_margin' => array('label' => 'Margin', 'checked' => '0', 'position' => 301, 'enabled' => (string) (int) (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? '0' : '1')),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => '0', 'position' => 302, 'enabled' => (string) (int) (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? '0' : '1')),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => '0', 'position' => 303, 'enabled' => (string) (int) (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARK_RATES') ? '0' : '1')),
'c.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 120),
'c.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 125),
'c.date_cloture' => array('label' => "DateClosing", 'checked' => '0', 'position' => 130),
'c.note_public' => array('label' => 'NotePublic', 'checked' => '0', 'enabled' => (string) (int) (!getDolGlobalString('MAIN_LIST_ALLOW_PUBLIC_NOTES')), 'position' => 135),
'c.note_private' => array('label' => 'NotePrivate', 'checked' => '0', 'enabled' => (string) (int) (!getDolGlobalString('MAIN_LIST_ALLOW_PRIVATE_NOTES')), 'position' => 140),
'shippable' => array('label' => "Shippable", 'checked' => '1','enabled' => (string) (int) (isModEnabled('shipping')), 'position' => 990),
'c.facture' => array('label' => "Billed", 'checked' => '1', 'enabled' => (string) (int) (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995),
'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'visible' => -2, 'position' => 999),
'c.fk_statut' => array('label' => "Status", 'checked' => '1', 'position' => 1000)
);
// Extra fields
@ -243,7 +243,6 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
if (!$user->hasRight('societe', 'client', 'voir')) {
$search_sale = $user->id;
@ -946,7 +945,7 @@ if ($resql) {
if ($user->hasRight('user', 'user', 'lire')) {
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('LinkedToSpecificUsers');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
$moreforfilter .= '</div>';
}
// Filter on categories
@ -1057,7 +1056,7 @@ if ($resql) {
// Thirpdarty
if (!empty($arrayfields['s.nom']['checked'])) {
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth100" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
print '<input class="flat maxwidth100" type="text" name="search_company" value="'.dol_escape_htmltag((string) $search_company).'">';
print '</td>';
}
// Alias
@ -1782,7 +1781,7 @@ if ($resql) {
}
// Plannned date of delivery
if (!empty($arrayfields['c.delivery_date']['checked'])) {
print '<td class="center" title="'.$langs->trans($arrayfields['c.delivery_date']['label']).': '.dol_print_date($db->jdate($obj->delivery_date), 'dayhour').'">';
print '<td class="center" title="'.$langs->trans((string) $arrayfields['c.delivery_date']['label']).': '.dol_print_date($db->jdate($obj->delivery_date), 'dayhour').'">';
print dol_print_date($db->jdate($obj->delivery_date), 'day');
print '</td>';
if (!$i) {

View file

@ -5,6 +5,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -123,7 +124,7 @@ if ($id > 0 || !empty($ref)) {
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);

View file

@ -5,7 +5,7 @@
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -272,7 +272,7 @@ if (!$mesg) {
$px3->SetLegend($legend);
$px3->SetYLabel($langs->trans("AmountAverage"));
$px3->SetMaxValue($px3->GetCeilMaxValue());
$px3->SetMinValue($px3->GetFloorMinValue());
$px3->SetMinValue((int) $px3->GetFloorMinValue());
$px3->SetWidth($WIDTH);
$px3->SetHeight($HEIGHT);
$px3->SetShading(3);
@ -363,7 +363,7 @@ print '</td></tr>';
// User
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
print img_picto('', 'user', 'class="pictofixedwidth"');
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300');
print $form->select_dolusers($userid, 'userid', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300');
// Status
print '<tr><td>'.$langs->trans("Status").'</td><td>';
if ($mode == 'customer') {

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2011-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -164,7 +164,7 @@ if (!empty($field) && !empty($element) && !empty($table_element) && !empty($fk_e
}
//var_dump(GETPOST('action','aZ09'));
//var_dump($newelement.'-'.$subelement."-".$feature."-".$object_id);
$check_access = restrictedArea($user, $feature, $object_id, '', $feature2);
$check_access = restrictedArea($user, $feature, $object_id, '', (string) $feature2);
//var_dump($user->rights);
/*
if (!empty($user->rights->$newelement->creer) || !empty($user->rights->$newelement->create) || !empty($user->rights->$newelement->write)

View file

@ -4,7 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -150,7 +150,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
$date = dol_now();
}
$numFinal = get_next_value($db, $mask, 'commande', 'ref', '', $objsoc, $date, 'next', false, null, $entity);
$numFinal = get_next_value($db, $mask, 'commande', 'ref', '', $objsoc, (int) $date, 'next', false, null, $entity);
return $numFinal;
}