Qual: Fix phan notices (asset..compta/paiement) (#33484)
* Qual: Fix phan notices (accountancy, adherents) * Qual: Fix phan notices (admin) * Qual: Fix phan notices (asset..compta/paiement) --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
9266408dd5
commit
0cc1aa6d80
70 changed files with 378 additions and 420 deletions
|
|
@ -10,17 +10,16 @@
|
|||
return [
|
||||
// # Issue statistics:
|
||||
// PhanUndeclaredProperty : 460+ occurrences
|
||||
// PhanTypeMismatchArgument : 230+ occurrences
|
||||
// PhanTypeMismatchArgument : 150+ occurrences
|
||||
// PhanTypeMismatchProperty : 100+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 100+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 70+ occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 20+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 20+ occurrences
|
||||
// PhanTypeMismatchDimFetch : 15+ occurrences
|
||||
// PhanUndeclaredConstant : 15+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 10+ occurrences
|
||||
// PhanUndeclaredMethod : 9 occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 8 occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 7 occurrences
|
||||
// PhanTypeMismatchArgumentNullableInternal : 7 occurrences
|
||||
// PhanPluginDuplicateExpressionBinaryOp : 6 occurrences
|
||||
// PhanTypeArraySuspiciousNull : 6 occurrences
|
||||
|
|
@ -47,30 +46,18 @@ return [
|
|||
'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset'],
|
||||
'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'],
|
||||
'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/asset/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/asset/model/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/asset/tpl/accountancy_codes_edit.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/asset/tpl/depreciation_options_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/asset/tpl/depreciation_options_edit.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/bom/bom_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/bom/bom_list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/bom/class/bom.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/bom/tpl/linkedobjectblock.tpl.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/bom/tpl/objectline_create.tpl.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/bom/tpl/objectline_edit.tpl.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/bom/tpl/objectline_view.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/bom/bom_card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/bom/tpl/objectline_create.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/bom/tpl/objectline_edit.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/bom/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/bookcal/availabilities_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/bookcal/availabilities_list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/bookcal/booking_list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/bookcal/calendar_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/bookcal/calendar_document.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/bookcal/calendar_list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
|
||||
'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
|
||||
'htdocs/categories/class/categorie.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/categories/photos.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/categories/viewcat.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/categories/viewcat.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/collab/index.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/comm/action/info.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -89,29 +76,15 @@ return [
|
|||
'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'],
|
||||
'htdocs/compta/bank/annuel.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/bankentries_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/bank/categ.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/class/account.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/class/account.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/class/paymentvarious.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/graph.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/line.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/bank/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/releve.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/transfer.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/treso.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/various_payment/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/info.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/deplacement/class/deplacement.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/deplacement/class/deplacementstats.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/deplacement/stats/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/clients.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/facture/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
|
|
@ -122,25 +95,15 @@ return [
|
|||
'htdocs/compta/localtax/clients.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/localtax/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/localtax/list.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch'],
|
||||
'htdocs/compta/paiement/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/paiement/cheque/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/paiement/cheque/class/remisecheque.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement/class/paiement.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement/rapport.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/prelevement/class/rejetprelevement.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/demandes.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/prelevement/line.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/resultat/clientfourn.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/projects.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/result.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/sociales/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/sociales/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/sociales/payments.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/stats/cabyprodserv.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/compta/stats/supplier_turnover_by_prodserv.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -148,7 +111,6 @@ return [
|
|||
'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/tva/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/tva/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal'],
|
||||
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/contact/ajax/contact.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
|
|
@ -279,10 +241,8 @@ return [
|
|||
'htdocs/expensereport/class/expensereportline.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expensereport/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expensereport/payment/card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/expensereport/payment/info.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/expensereport/payment/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/exports/export.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
|
|
@ -292,7 +252,6 @@ return [
|
|||
'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/fichinter/contact.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fichinter/document.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fichinter/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fichinter/note.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fichinter/stats/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -330,7 +289,6 @@ return [
|
|||
'htdocs/mrp/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/multicurrency/class/multicurrency.class.php' => ['PhanTypeExpectedObjectPropAccess'],
|
||||
'htdocs/multicurrency/multicurrency_rate.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/opensurvey/results.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/partnership/class/partnership.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2018-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -680,13 +680,13 @@ while ($i < $imaxinloop) {
|
|||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.((preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) ? ' classfortooltip' : '').'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key) && !in_array($key, array('ref'))) {
|
||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
||||
print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -605,7 +605,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
}
|
||||
|
|
@ -695,7 +695,7 @@ if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords
|
|||
$genallowed = $permissiontoread;
|
||||
$delallowed = $permissiontoadd;
|
||||
|
||||
print $formfile->showdocuments('massfilesarea_asset', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||
print $formfile->showdocuments('massfilesarea_asset', '', $filedir, $urlsource, 0, (int) $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
|
||||
* 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
|
||||
|
|
@ -67,7 +68,7 @@ if ($reshook < 0) {
|
|||
if (empty($reshook)) {
|
||||
foreach ($assetaccountancycodes->accountancy_codes_fields as $mode_key => $mode_info) {
|
||||
//if (empty($object->enabled_modes[$mode_key])) continue;
|
||||
$width = ($mode_key == "economic")? "width50p pull-left" : "width50p";
|
||||
$width = ($mode_key == "economic") ? "width50p pull-left" : "width50p";
|
||||
print '<table class="border '. $width .'" id="block_' . $mode_key . '">';
|
||||
print '<tr><td class="info-box-title">'.$langs->trans($mode_info['label']).'</td></tr>';
|
||||
foreach ($mode_info['fields'] as $field_key => $field_info) {
|
||||
|
|
@ -75,7 +76,7 @@ if (empty($reshook)) {
|
|||
print '<tr><td class="width40p">' . $langs->trans($field_info['label']) . '</td><td>';
|
||||
$accountancy_code = GETPOSTISSET($html_name) ? GETPOST($html_name, 'aZ09') : (!empty($assetaccountancycodes->accountancy_codes[$mode_key][$field_key]) ? $assetaccountancycodes->accountancy_codes[$mode_key][$field_key] : '');
|
||||
if (isModEnabled('accounting')) {
|
||||
print $formaccounting->select_account($accountancy_code, $html_name, 1, null, 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 1);
|
||||
print $formaccounting->select_account($accountancy_code, $html_name, 1, array(), 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', '1');
|
||||
} else {
|
||||
print '<input name="' . $html_name . '" class="maxwidth200 " value="' . dol_escape_htmltag($accountancy_code) . '">';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 José <jose.martinez@pichinov.com>
|
||||
* 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
|
||||
|
|
@ -169,7 +169,7 @@ if (empty($reshook)) {
|
|||
} else {
|
||||
if ($field_key == 'lang') {
|
||||
print img_picto('', 'language', 'class="pictofixedwidth"');
|
||||
print $formadmin->select_language($value, $html_name, 0, null, 1, 0, 0, 'minwidth300', 2);
|
||||
print $formadmin->select_language($value, $html_name, 0, array(), 1, 0, 0, 'minwidth300', 2);
|
||||
} else {
|
||||
print $assetdepreciationoptions->showInputField($field_info, $field_key, $value, '', '', $prefix_html_name, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
|
||||
$result = $object->addLine((int) $idprod, (float) $qty, (float) $qty_frozen, $disable_stock_change, (float) $efficiency, -1, $bom_child_id, null, $fk_unit, $array_options, $fk_default_workstation);
|
||||
$result = $object->addLine((int) $idprod, (float) $qty, $qty_frozen, $disable_stock_change, (float) $efficiency, -1, $bom_child_id, null, (int) $fk_unit, $array_options, $fk_default_workstation);
|
||||
|
||||
if ($result <= 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* 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
|
||||
|
|
@ -761,13 +761,13 @@ while ($i < $imaxinloop) {
|
|||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) {
|
||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
||||
print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2023 Benjamin Falière <benjamin.faliere@altairis.fr>
|
||||
* Copyright (C) 2023 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -432,7 +432,7 @@ class BOM extends CommonObject
|
|||
* Load object lines in memory from the database by type of product
|
||||
*
|
||||
* @param int<0,1> $typeproduct 0 type product, 1 type service
|
||||
|
||||
*
|
||||
* @return int<-1,1> Return integer <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetchLinesbytypeproduct($typeproduct = 0)
|
||||
|
|
@ -580,7 +580,7 @@ class BOM extends CommonObject
|
|||
*
|
||||
* @param int $fk_product Id of product
|
||||
* @param float $qty Quantity
|
||||
* @param int<0,1> $qty_frozen If the qty is Frozen
|
||||
* @param int<0,1> $qty_frozen If the qty is Frozen
|
||||
* @param int $disable_stock_change Disable stock change on using in MO
|
||||
* @param float $efficiency Efficiency in MO
|
||||
* @param int<-1,max> $position Position of BOM-Line in BOM-Lines
|
||||
|
|
@ -1455,7 +1455,7 @@ class BOM extends CommonObject
|
|||
$this->total_cost += $line->total_cost;
|
||||
} else {
|
||||
$bom_child = new BOM($this->db);
|
||||
$res = $bom_child->fetch($line->fk_bom_child);
|
||||
$res = $bom_child->fetch((int) $line->fk_bom_child);
|
||||
if ($res > 0) {
|
||||
$bom_child->calculateCosts();
|
||||
$line->childBom[] = $bom_child;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013-2020 Charlene BENKE <charlie@patas-monkey.com>
|
||||
* 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
|
||||
|
|
@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
|||
echo '<tr class="'.$trclass.'" >';
|
||||
echo '<td class="linkedcol-element tdoverflowmax100">'.$langs->trans("Bom");
|
||||
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
|
||||
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&action=selectlines&token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
|
||||
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, '1').'&action=selectlines&token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td class="linkedcol-name tdoverflowmax150" >'.$objectlink->getNomUrl(1).'</td>';
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2024 Vincent Maury <vmaury@timgroup.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
|
||||
|
|
@ -146,9 +146,9 @@ if (isModEnabled("product") || isModEnabled("service")) {
|
|||
$statustoshow = -1;
|
||||
if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
|
||||
// hide products in closed warehouse, but show products for internal transfer
|
||||
print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), 0, $statustoshow, 2, '', 1, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, 'warehouseopen,warehouseinternal', GETPOSTINT('combinations'), 1);
|
||||
print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), 0, $statustoshow, 2, '', 1, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, 'warehouseopen,warehouseinternal', (string) GETPOSTINT('combinations'), 1);
|
||||
} else {
|
||||
print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), 0, $statustoshow, 2, '', 1, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOSTINT('combinations'), 1);
|
||||
print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), 0, $statustoshow, 2, '', 1, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', (string) GETPOSTINT('combinations'), 1);
|
||||
}
|
||||
$urltocreateproduct = DOL_URL_ROOT.'/product/card.php?action=create'.(($filtertype == 1) ? '&leftmenu=service&type=1' : '&leftmenu=product&type=0').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
print '<a href="'.$urltocreateproduct.'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProduct").'"></span></a>';
|
||||
|
|
@ -157,11 +157,11 @@ if (isModEnabled("product") || isModEnabled("service")) {
|
|||
}
|
||||
if (getDolGlobalString('BOM_SUB_BOM') && $filtertype != 1) {
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("or").'</span><br>'.$langs->trans("BOM");
|
||||
print $form->select_bom('', 'bom_id', 0, 1, 0, '1', '', 1);
|
||||
print $form->select_bom('', 'bom_id', 0, 1, 0, '1', '', '1');
|
||||
}
|
||||
|
||||
if (is_object($objectline)) {
|
||||
$temps = $objectline->showOptionals($extrafields, 'create', array(), '', '', 1, 'line');
|
||||
$temps = $objectline->showOptionals($extrafields, 'create', array(), '', '', '1', 'line');
|
||||
|
||||
if (!empty($temps)) {
|
||||
print '<div style="padding-top: 10px" id="extrafield_lines_area_create" name="extrafield_lines_area_create">';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 Vincent Maury <vmaury@timgroup.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
|
||||
|
|
@ -120,7 +120,7 @@ if (is_object($hookmanager)) {
|
|||
|
||||
//Line extrafield
|
||||
if (is_object($objectline) && !empty($extrafields)) {
|
||||
$temps = $line->showOptionals($extrafields, 'edit', array('class' => 'tredited'), '', '', 1, 'line');
|
||||
$temps = $line->showOptionals($extrafields, 'edit', array('class' => 'tredited'), '', '', '1', 'line');
|
||||
if (!empty($temps)) {
|
||||
print '<div style="padding-top: 10px" id="extrafield_lines_area_edit" name="extrafield_lines_area_edit">';
|
||||
print $temps;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -119,7 +119,7 @@ $coldisplay++;
|
|||
$tmpproduct = new Product($object->db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
$tmpbom = new BOM($object->db);
|
||||
$res = $tmpbom->fetch($line->fk_bom_child);
|
||||
$res = $tmpbom->fetch((int) $line->fk_bom_child);
|
||||
if ($tmpbom->id > 0) {
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
print ' '.$langs->trans("or").' ';
|
||||
|
|
@ -134,7 +134,7 @@ if ($tmpbom->id > 0) {
|
|||
|
||||
// Line extrafield
|
||||
if (!empty($extrafields)) {
|
||||
$temps = $line->showOptionals($extrafields, 'view', array(), '', '', 1, 'line');
|
||||
$temps = $line->showOptionals($extrafields, 'view', array(), '', '', '1', 'line');
|
||||
if (!empty($temps)) {
|
||||
print '<div style="padding-top: 10px" id="extrafield_lines_area_'.$line->id.'" name="extrafield_lines_area_'.$line->id.'">';
|
||||
print $temps;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -725,13 +725,13 @@ while ($i < $imaxinloop) {
|
|||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
|
||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
||||
print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2023-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
|
||||
|
|
@ -236,7 +236,7 @@ if ($object->id > 0) {
|
|||
|
||||
// Link to make payment now
|
||||
print '<td class="minwidth75">';
|
||||
print $tmpcontact->getNomUrl(1, -1);
|
||||
print $tmpcontact->getNomUrl(1, '-1');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2023 Alice Adminson <aadminson@example.com>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -77,7 +77,7 @@ $diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user-
|
|||
$hookmanager->initHooks(array('calendardocument', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$upload_dir = null;
|
||||
$upload_dir = '';
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2023 Alice Adminson <aadminson@example.com>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -704,13 +704,13 @@ while ($i < $imaxinloop) {
|
|||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
|
||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
||||
print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2022-2023 Solution Libre SAS <contact@solution-libre.fr>
|
||||
* Copyright (C) 2023-2024 Benjamin Falière <benjamin.faliere@altairis.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -576,7 +576,7 @@ class Categorie extends CommonObject
|
|||
if (getDolGlobalString('CATEGORY_ASSIGNED_TO_A_CUSTOMER')) {
|
||||
$sql .= ($this->socid > 0 ? $this->socid : 'null').", ";
|
||||
}
|
||||
$sql .= "'".$this->db->escape($this->visible)."', ";
|
||||
$sql .= "'".$this->db->escape((string) $this->visible)."', ";
|
||||
$sql .= ((int) $type).", ";
|
||||
$sql .= (!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : 'null').", ";
|
||||
$sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : 'null').", ";
|
||||
|
|
@ -1543,15 +1543,15 @@ class Categorie extends CommonObject
|
|||
}
|
||||
|
||||
if ($url == '') {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.((int) $cat->id).'&type='.urlencode($cat->type).'" class="'.($i < count($way) ? 'small ': '').$forced_color.'">';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.((int) $cat->id).'&type='.urlencode($cat->type).'" class="'.($i < count($way) ? 'small ' : '').$forced_color.'">';
|
||||
$linkend = '</a>';
|
||||
$w[] = $link.(($addpicto && $i == 1) ? img_object('', 'category', 'class="paddingright"') : '').$cat->label.$linkend;
|
||||
} elseif ($url == 'none') {
|
||||
$link = '<span class="'.($i < count($way) ? 'small ': '').$forced_color.'">';
|
||||
$link = '<span class="'.($i < count($way) ? 'small ' : '').$forced_color.'">';
|
||||
$linkend = '</span>';
|
||||
$w[] = $link.(($addpicto && $i == 1) ? img_object('', 'category', 'class="paddingright"') : '').$cat->label.$linkend;
|
||||
} else {
|
||||
$w[] = '<a class="'.($i < count($way) ? 'small ': '').$forced_color.'" href="'.DOL_URL_ROOT.'/'.$url.'?catid='.((int) $cat->id).'">'.($addpicto ? img_object('', 'category') : '').$cat->label.'</a>';
|
||||
$w[] = '<a class="'.($i < count($way) ? 'small ' : '').$forced_color.'" href="'.DOL_URL_ROOT.'/'.$url.'?catid='.((int) $cat->id).'">'.($addpicto ? img_object('', 'category') : '').$cat->label.'</a>';
|
||||
}
|
||||
}
|
||||
$newcategwithpath = preg_replace('/colortoreplace/', $forced_color, implode('<span class="inline-block valignmiddle paddingleft paddingright '.$forced_color.'">'.$sep.'</span>', $w));
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -202,7 +202,7 @@ if ($object->id) {
|
|||
if ($action == 'ajout_photo' && $user->hasRight('categorie', 'creer') && getDolGlobalString('MAIN_UPLOAD_DOC')) {
|
||||
// Affiche formulaire upload
|
||||
$formfile = new FormFile($db);
|
||||
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&type='.$type, $langs->trans("AddPhoto"), 1, 0, $user->hasRight('categorie', 'creer'), 50, $object, '', false, '', 0);
|
||||
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&type='.$type, $langs->trans("AddPhoto"), 1, 0, $user->hasRight('categorie', 'creer'), 50, $object, '', 0, '', 0);
|
||||
}
|
||||
|
||||
// Affiche photos
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2022-2023 Solution Libre SAS <contact@solution-libre.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>
|
||||
* Copyright (C) 2024-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2023-2024 Charlene Benke <charlene@patas-monkey.com>
|
||||
|
|
@ -189,11 +189,15 @@ if ($id > 0 && $removeelem > 0 && $action == 'unlink') { // Test on permission n
|
|||
$elementtype = 'supplier_order';
|
||||
} else {
|
||||
dol_print_error(null, "Not supported value of type = ".$type);
|
||||
$result = -100;
|
||||
}
|
||||
|
||||
$result = $object->del_type($tmpobject, $elementtype);
|
||||
if ($result < 0) {
|
||||
dol_print_error(null, $object->error);
|
||||
if ($tmpobject !== null) {
|
||||
// also enter here when item was not found to report error
|
||||
$result = $object->del_type($tmpobject, $elementtype);
|
||||
if ($result < 0) {
|
||||
dol_print_error(null, $object->error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -273,8 +277,10 @@ if ($elemid && $action == 'addintocategory') { // Test on permission not require
|
|||
$result = $newobject->fetch($elemid);
|
||||
}
|
||||
|
||||
// Add into category
|
||||
$result = $object->add_type($newobject, $elementtype);
|
||||
if ($result >= 0 && $newobject !== null) {
|
||||
// Add into category
|
||||
$result = $object->add_type($newobject, $elementtype);
|
||||
}
|
||||
if ($result >= 0) {
|
||||
setEventMessages($langs->trans("WasAddedSuccessfully", $newobject->ref), null, 'mesgs');
|
||||
} else {
|
||||
|
|
@ -1015,7 +1021,7 @@ if ($type == Categorie::TYPE_ACCOUNT) {
|
|||
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap tdtop">';
|
||||
print $account->getNomUrl(1, 0);
|
||||
print $account->getNomUrl(1, '0');
|
||||
print "</td>\n";
|
||||
print '<td class="tdtop">'.$account->bank."</td>\n";
|
||||
print '<td class="tdtop">'.$account->number."</td>\n";
|
||||
|
|
@ -1409,7 +1415,9 @@ if ($type == Categorie::TYPE_FICHINTER) {
|
|||
$i = 0;
|
||||
foreach ($fichinters as $fichinter) {
|
||||
$i++;
|
||||
if ($i > $limit) break;
|
||||
if ($i > $limit) {
|
||||
break;
|
||||
}
|
||||
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap tdtop">';
|
||||
|
|
@ -1477,7 +1485,10 @@ if ($type == Categorie::TYPE_ORDER) {
|
|||
print '<input type="hidden" name="action" value="list">';
|
||||
|
||||
print '<br>';
|
||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = '';
|
||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type;
|
||||
$num = count($objects);
|
||||
$nbtotalofrecords = '';
|
||||
$newcardbutton = '';
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
print_barre_liste($langs->trans("Orders"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bill', 0, $newcardbutton, '', $limit);
|
||||
|
|
@ -1555,7 +1566,10 @@ if ($type == Categorie::TYPE_INVOICE) {
|
|||
print '<input type="hidden" name="action" value="list">';
|
||||
|
||||
print '<br>';
|
||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = '';
|
||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type;
|
||||
$num = count($objects);
|
||||
$nbtotalofrecords = '';
|
||||
$newcardbutton = '';
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
print_barre_liste($langs->trans("BillsCustomers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bill', 0, $newcardbutton, '', $limit);
|
||||
|
|
@ -1606,7 +1620,8 @@ if ($type == Categorie::TYPE_SUPPLIER_ORDER) {
|
|||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
// Form to add record into a category
|
||||
$showclassifyform = $user->hasRight('fournisseur', 'commande', 'creer');;
|
||||
$showclassifyform = $user->hasRight('fournisseur', 'commande', 'creer');
|
||||
;
|
||||
if ($showclassifyform) {
|
||||
print '<br>';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
|
@ -1633,7 +1648,10 @@ if ($type == Categorie::TYPE_SUPPLIER_ORDER) {
|
|||
print '<input type="hidden" name="action" value="list">';
|
||||
|
||||
print '<br>';
|
||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = '';
|
||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type;
|
||||
$num = count($objects);
|
||||
$nbtotalofrecords = '';
|
||||
$newcardbutton = '';
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'supplier_order', 0, $newcardbutton, '', $limit);
|
||||
|
|
|
|||
|
|
@ -1309,7 +1309,6 @@ if ($resql) {
|
|||
if (!empty($arrayfields['rowid']['checked'])) {
|
||||
// @phan-suppress-next-line PhanTypeInvalidDimOffset
|
||||
print_liste_field_titre($arrayfields['rowid']['label'], $_SERVER["PHP_SELF"], 'rowid', '', $param, '', $sortfield, $sortorder);
|
||||
'@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 (!empty($arrayfields['pr.ref']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['pr.ref']['label'], $_SERVER["PHP_SELF"], 'pr.ref', '', $param, '', $sortfield, $sortorder);
|
||||
|
|
@ -1474,8 +1473,9 @@ if ($resql) {
|
|||
$total = 0;
|
||||
$subtotal = 0;
|
||||
$productstat_cache = array();
|
||||
'@phan-var-force array<int,array{stats_order_customer?:float|int,stats_order_supplier?:float|int}> $product_sdtat_cache';
|
||||
'@phan-var-force array<int,array{stats_order_customer?:float|int,stats_order_supplier?:float|int}> $product_stat_cache';
|
||||
$productstat_cachevirtual = array();
|
||||
'@phan-var-force array<int,array{stats_order_customer?:float|int,stats_order_supplier?:float|int}> $product_stat_cachevirtual';
|
||||
$getNomUrl_cache = array();
|
||||
|
||||
$generic_commande = new Commande($db);
|
||||
|
|
|
|||
|
|
@ -840,7 +840,7 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||
} elseif ($data['item'] == 'ExpenseReport') {
|
||||
$expensereport->id = (int) $data['id'];
|
||||
$expensereport->ref = $data['ref'];
|
||||
print $expensereport->getNomUrl(1, 0, 0, 0, 0, 0);
|
||||
print $expensereport->getNomUrl(1, '0', 0, 0, '0', 0);
|
||||
} elseif ($data['item'] == 'SalaryPayment') {
|
||||
$salary_payment->id = (int) $data['id'];
|
||||
$salary_payment->ref = $data['ref'];
|
||||
|
|
@ -852,7 +852,7 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||
} elseif ($data['item'] == 'SocialContributions') {
|
||||
$charge_sociales->id = (int) $data['id'];
|
||||
$charge_sociales->ref = $data['ref'];
|
||||
print $charge_sociales->getNomUrl(1, 0, 0, 0, 0);
|
||||
print $charge_sociales->getNomUrl(1, '0', 0, 0, 0);
|
||||
} elseif ($data['item'] == 'VariousPayment') {
|
||||
$various_payment->id = (int) $data['id'];
|
||||
$various_payment->ref = $data['ref'];
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013-2023 Charlene BENKE <charlene@patas-monkey.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
|
||||
|
|
@ -79,7 +79,7 @@ $error = 0;
|
|||
// Get account information
|
||||
$object = new Account($db);
|
||||
if ($id > 0 && !preg_match('/,/', $id)) { // if for a particular account and not a list
|
||||
$result = $object->fetch($id);
|
||||
$result = $object->fetch((int) $id);
|
||||
$id = $object->id;
|
||||
}
|
||||
if (!empty($ref)) {
|
||||
|
|
@ -169,7 +169,7 @@ if (!empty($id)) {
|
|||
$bankaccount = new Account($db);
|
||||
$listid = explode(',', $id);
|
||||
foreach ($listid as $key => $aId) {
|
||||
$bankaccount->fetch($aId);
|
||||
$bankaccount->fetch((int) $aId);
|
||||
$bankaccount->label = $bankaccount->ref;
|
||||
print $bankaccount->getNomUrl(1);
|
||||
if ($key < (count($listid) - 1)) {
|
||||
|
|
@ -374,7 +374,7 @@ if ($result < 0) {
|
|||
|
||||
$px1 = new DolGraph();
|
||||
$px1->SetData($graph_datas);
|
||||
$px1->SetLegend(array(($year - 2), ($year - 1), $year));
|
||||
$px1->SetLegend(array((string) ($year - 2), (string) ($year - 1), (string) $year));
|
||||
$px1->SetLegendWidthMin(180);
|
||||
$px1->SetMaxValue($px1->GetCeilMaxValue() < 0 ? 0 : $px1->GetCeilMaxValue());
|
||||
$px1->SetMinValue($px1->GetFloorMinValue() > 0 ? 0 : $px1->GetFloorMinValue());
|
||||
|
|
@ -456,7 +456,7 @@ if ($result < 0) {
|
|||
|
||||
$px2 = new DolGraph();
|
||||
$px2->SetData($graph_datas);
|
||||
$px2->SetLegend(array(($year - 2), ($year - 1), $year));
|
||||
$px2->SetLegend(array((string) ($year - 2), (string) ($year - 1), (string) $year));
|
||||
$px2->SetLegendWidthMin(180);
|
||||
$px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue());
|
||||
$px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue());
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2021 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>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -158,21 +158,21 @@ $extrafields->fetch_name_optionals_label($extrafieldsobjectkey);
|
|||
$search_array_options = $extrafields->getOptionalsFromPost($extrafieldsobjectkey, '', 'search_');
|
||||
|
||||
$arrayfields = array(
|
||||
'b.rowid' => array('label' => $langs->trans("Ref"), 'checked' => 1,'position' => 10),
|
||||
'b.label' => array('label' => $langs->trans("Description"), 'checked' => 1,'position' => 20),
|
||||
'b.dateo' => array('label' => $langs->trans("DateOperationShort"), 'checked' => -1,'position' => 30),
|
||||
'b.datev' => array('label' => $langs->trans("DateValueShort"), 'checked' => 1,'position' => 40),
|
||||
'type' => array('label' => $langs->trans("Type"), 'checked' => 1,'position' => 50),
|
||||
'b.num_chq' => array('label' => $langs->trans("Numero"), 'checked' => 0,'position' => 60),
|
||||
'b.fk_bordereau' => array('label' => $langs->trans("ChequeNumber"), 'checked' => 0, 'position' => 65),
|
||||
'bu.label' => array('label' => $langs->trans("ThirdParty").'/'.$langs->trans("User"), 'checked' => 1, 'position' => 70),
|
||||
'ba.ref' => array('label' => $langs->trans("BankAccount"), 'checked' => (($id > 0 || !empty($ref)) ? 0 : 1), 'position' => 80),
|
||||
'b.debit' => array('label' => $langs->trans("Debit"), 'checked' => 1, 'position' => 90),
|
||||
'b.credit' => array('label' => $langs->trans("Credit"), 'checked' => 1, 'position' => 100),
|
||||
'balancebefore' => array('label' => $langs->trans("BalanceBefore"), 'checked' => 0, 'position' => 110),
|
||||
'balance' => array('label' => $langs->trans("Balance"), 'checked' => 1, 'position' => 120),
|
||||
'b.num_releve' => array('label' => $langs->trans("AccountStatement"), 'checked' => 1, 'position' => 130),
|
||||
'b.conciliated' => array('label' => $langs->trans("BankLineReconciled"), 'enabled' => $object->rappro, 'checked' => ($action == 'reconcile' ? 1 : 0), 'position' => 140),
|
||||
'b.rowid' => array('label' => $langs->trans("Ref"), 'checked' => '1','position' => 10),
|
||||
'b.label' => array('label' => $langs->trans("Description"), 'checked' => '1','position' => 20),
|
||||
'b.dateo' => array('label' => $langs->trans("DateOperationShort"), 'checked' => '-1','position' => 30),
|
||||
'b.datev' => array('label' => $langs->trans("DateValueShort"), 'checked' => '1','position' => 40),
|
||||
'type' => array('label' => $langs->trans("Type"), 'checked' => '1','position' => 50),
|
||||
'b.num_chq' => array('label' => $langs->trans("Numero"), 'checked' => '0','position' => 60),
|
||||
'b.fk_bordereau' => array('label' => $langs->trans("ChequeNumber"), 'checked' => '0', 'position' => 65),
|
||||
'bu.label' => array('label' => $langs->trans("ThirdParty").'/'.$langs->trans("User"), 'checked' => '1', 'position' => 70),
|
||||
'ba.ref' => array('label' => $langs->trans("BankAccount"), 'checked' => (($id > 0 || !empty($ref)) ? '0' : '1'), 'position' => 80),
|
||||
'b.debit' => array('label' => $langs->trans("Debit"), 'checked' => '1', 'position' => 90),
|
||||
'b.credit' => array('label' => $langs->trans("Credit"), 'checked' => '1', 'position' => 100),
|
||||
'balancebefore' => array('label' => $langs->trans("BalanceBefore"), 'checked' => '0', 'position' => 110),
|
||||
'balance' => array('label' => $langs->trans("Balance"), 'checked' => '1', 'position' => 120),
|
||||
'b.num_releve' => array('label' => $langs->trans("AccountStatement"), 'checked' => '1', 'position' => 130),
|
||||
'b.conciliated' => array('label' => $langs->trans("BankLineReconciled"), 'enabled' => (string) (int) $object->rappro, 'checked' => ($action == 'reconcile' ? '1' : '0'), 'position' => 140),
|
||||
);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
|
@ -271,7 +271,7 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', '
|
|||
if ($row > 0) {
|
||||
$result = $bankline->fetch($row);
|
||||
$bankline->num_releve = $num_releve; // GETPOST("num_releve");
|
||||
$result = $bankline->update_conciliation($user, GETPOST("cat"), GETPOST('confirm_reconcile', 'alpha') ? 1 : 0); // If we confirm_reconcile, we set flag 'rappro' to 1.
|
||||
$result = $bankline->update_conciliation($user, GETPOSTINT("cat"), GETPOST('confirm_reconcile', 'alpha') ? 1 : 0); // If we confirm_reconcile, we set flag 'rappro' to 1.
|
||||
if ($result < 0) {
|
||||
setEventMessages($bankline->error, $bankline->errors, 'errors');
|
||||
$error++;
|
||||
|
|
@ -391,7 +391,7 @@ if (GETPOST('save') && !$cancel && $user->hasRight('banque', 'modifier')) {
|
|||
if (!$error && getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT')) {
|
||||
$objecttmp = new Account($db);
|
||||
$objecttmp->fetch($bankaccountid);
|
||||
$insertid = $objecttmp->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user, '', '', $search_accountancy_code);
|
||||
$insertid = $objecttmp->addline((int) $dateop, $operation, $label, (float) $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user, '', '', $search_accountancy_code);
|
||||
if ($insertid > 0) {
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER['PHP_SELF'].($id ? "?id=".$id : ''));
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
* 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
|
||||
|
|
@ -80,7 +81,7 @@ if (GETPOST('add')) {
|
|||
if ($categid) {
|
||||
$bankcateg = new BankCateg($db);
|
||||
|
||||
if ($bankcateg->fetch($categid) > 0) {
|
||||
if ($bankcateg->fetch((int) $categid) > 0) {
|
||||
//Update category
|
||||
if (GETPOST('update') && $label) {
|
||||
$bankcateg->label = $label;
|
||||
|
|
|
|||
|
|
@ -686,7 +686,7 @@ class Account extends CommonObject
|
|||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."category_bankline(";
|
||||
$sql .= "lineid, fk_categ";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= ((int) $accline->id).", '".$this->db->escape($categorie)."'";
|
||||
$sql .= ((int) $accline->id).", '".$this->db->escape((string) $categorie)."'";
|
||||
$sql .= ")";
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
|
@ -2327,7 +2327,7 @@ class AccountLine extends CommonObjectLine
|
|||
$sql .= ", ".(empty($this->amount_main_currency) ? "NULL" : price2num($this->amount_main_currency));
|
||||
$sql .= ", ".($this->fk_user_author > 0 ? ((int) $this->fk_user_author) : "null");
|
||||
$sql .= ", ".($this->num_chq ? "'".$this->db->escape($this->num_chq)."'" : "null");
|
||||
$sql .= ", '".$this->db->escape($this->fk_account)."'";
|
||||
$sql .= ", '".$this->db->escape((string) $this->fk_account)."'";
|
||||
$sql .= ", '".$this->db->escape($this->fk_type)."'";
|
||||
$sql .= ", ".($this->emetteur ? "'".$this->db->escape($this->emetteur)."'" : "null");
|
||||
$sql .= ", ".($this->bank_chq ? "'".$this->db->escape($this->bank_chq)."'" : "null");
|
||||
|
|
@ -2364,11 +2364,11 @@ class AccountLine extends CommonObjectLine
|
|||
/**
|
||||
* Delete bank transaction record
|
||||
*
|
||||
* @param ?User $user User object that delete
|
||||
* @param User $user User object that delete
|
||||
* @param int<0,1> $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete($user = null, $notrigger = 0)
|
||||
public function delete($user, $notrigger = 0)
|
||||
{
|
||||
$nbko = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ class PaymentVarious extends CommonObject
|
|||
$sql .= " note='".$this->db->escape($this->note)."',";
|
||||
$sql .= " accountancy_code='".$this->db->escape($this->accountancy_code)."',";
|
||||
$sql .= " subledger_account='".$this->db->escape($this->subledger_account)."',";
|
||||
$sql .= " fk_projet='".$this->db->escape($this->fk_project)."',";
|
||||
$sql .= " fk_projet='".$this->db->escape((string) $this->fk_project)."',";
|
||||
$sql .= " fk_bank=".($this->fk_bank > 0 ? $this->fk_bank : "null").",";
|
||||
$sql .= " fk_user_author=".(int) $this->fk_user_author.",";
|
||||
$sql .= " fk_user_modif=".(int) $this->fk_user_modif;
|
||||
|
|
@ -509,9 +509,9 @@ class PaymentVarious extends CommonObject
|
|||
$sql .= " VALUES (";
|
||||
$sql .= "'".$this->db->idate($this->datep)."'";
|
||||
$sql .= ", '".$this->db->idate($this->datev)."'";
|
||||
$sql .= ", '".$this->db->escape($this->sens)."'";
|
||||
$sql .= ", '".$this->db->escape((string) $this->sens)."'";
|
||||
$sql .= ", ".price2num($this->amount);
|
||||
$sql .= ", '".$this->db->escape($this->type_payment)."'";
|
||||
$sql .= ", '".$this->db->escape((string) $this->type_payment)."'";
|
||||
$sql .= ", '".$this->db->escape($this->num_payment)."'";
|
||||
if ($this->note) {
|
||||
$sql .= ", '".$this->db->escape($this->note)."'";
|
||||
|
|
@ -552,7 +552,7 @@ class PaymentVarious extends CommonObject
|
|||
|
||||
$bank_line_id = $acc->addline(
|
||||
$this->datep,
|
||||
$this->type_payment,
|
||||
(string) $this->type_payment,
|
||||
$this->label,
|
||||
$sign * abs($this->amount),
|
||||
$this->num_payment,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 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
|
||||
|
|
@ -793,7 +793,7 @@ if ($account) {
|
|||
$bankaccount = new Account($db);
|
||||
$listid = explode(',', $account);
|
||||
foreach ($listid as $key => $id) {
|
||||
$bankaccount->fetch($id);
|
||||
$bankaccount->fetch((int) $id);
|
||||
$bankaccount->label = $bankaccount->ref;
|
||||
print $bankaccount->getNomUrl(1);
|
||||
if ($key < (count($listid) - 1)) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* 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>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
|
|
@ -119,25 +119,24 @@ $fieldstosearchall = array(
|
|||
|
||||
$checkedtypetiers = 0;
|
||||
$arrayfields = array(
|
||||
'b.ref' => array('label' => $langs->trans("BankAccounts"), 'checked' => 1, 'position' => 10),
|
||||
'b.label' => array('label' => $langs->trans("Label"), 'checked' => 1, 'position' => 12),
|
||||
'accountype' => array('label' => $langs->trans("Type"), 'checked' => 1, 'position' => 14),
|
||||
'b.number' => array('label' => $langs->trans("AccountIdShort"), 'checked' => 1, 'position' => 16),
|
||||
'b.account_number' => array('label' => $langs->trans("AccountAccounting"), 'checked' => (isModEnabled('accounting')), 'position' => 18),
|
||||
'b.fk_accountancy_journal' => array('label' => $langs->trans("AccountancyJournal"), 'checked' => (isModEnabled('accounting')), 'position' => 20),
|
||||
'toreconcile' => array('label' => $langs->trans("TransactionsToConciliate"), 'checked' => 1, 'position' => 50),
|
||||
'b.currency_code' => array('label' => $langs->trans("Currency"), 'checked' => 0, 'position' => 22),
|
||||
'b.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500),
|
||||
'b.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 500),
|
||||
'b.clos' => array('label' => $langs->trans("Status"), 'checked' => 1, 'position' => 1000),
|
||||
'balance' => array('label' => $langs->trans("Balance"), 'checked' => 1, 'position' => 1010),
|
||||
'b.ref' => array('label' => $langs->trans("BankAccounts"), 'checked' => '1', 'position' => 10),
|
||||
'b.label' => array('label' => $langs->trans("Label"), 'checked' => '1', 'position' => 12),
|
||||
'accountype' => array('label' => $langs->trans("Type"), 'checked' => '1', 'position' => 14),
|
||||
'b.number' => array('label' => $langs->trans("AccountIdShort"), 'checked' => '1', 'position' => 16),
|
||||
'b.account_number' => array('label' => $langs->trans("AccountAccounting"), 'checked' => (string) (int) (isModEnabled('accounting')), 'position' => 18),
|
||||
'b.fk_accountancy_journal' => array('label' => $langs->trans("AccountancyJournal"), 'checked' => (string) (int) (isModEnabled('accounting')), 'position' => 20),
|
||||
'toreconcile' => array('label' => $langs->trans("TransactionsToConciliate"), 'checked' => '1', 'position' => 50),
|
||||
'b.currency_code' => array('label' => $langs->trans("Currency"), 'checked' => '0', 'position' => 22),
|
||||
'b.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => '0', 'position' => 500),
|
||||
'b.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => '0', 'position' => 500),
|
||||
'b.clos' => array('label' => $langs->trans("Status"), 'checked' => '1', 'position' => 1000),
|
||||
'balance' => array('label' => $langs->trans("Balance"), 'checked' => '1', 'position' => 1010),
|
||||
);
|
||||
// Extra fields
|
||||
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
|
||||
|
||||
$permissiontoadd = $user->hasRight('banque', 'modifier');
|
||||
$permissiontodelete = $user->hasRight('banque', 'configurer');
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -77,12 +77,12 @@ $hookmanager->initHooks(array('bankaccountstatement', 'globalcard'));
|
|||
|
||||
if ($user->hasRight('banque', 'consolidate') && $action == 'dvnext' && !empty($dvid)) {
|
||||
$al = new AccountLine($db);
|
||||
$al->datev_next($dvid);
|
||||
$al->datev_next((int) $dvid);
|
||||
}
|
||||
|
||||
if ($user->hasRight('banque', 'consolidate') && $action == 'dvprev' && !empty($dvid)) {
|
||||
$al = new AccountLine($db);
|
||||
$al->datev_previous($dvid);
|
||||
$al->datev_previous((int) $dvid);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2023 Maxime Nicolas <maxime@oarces.com>
|
||||
* Copyright (C) 2023 Benjamin GREMBI <benjamin@oarces.com>
|
||||
* 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
|
||||
|
|
@ -173,13 +173,13 @@ if ($action == 'add' && $user->hasRight('banque', 'transfer')) {
|
|||
}
|
||||
|
||||
if (!$error) {
|
||||
$bank_line_id_from = $tmpaccountfrom->addline($dateo[$n], $typefrom, $label[$n], price2num(-1 * (float) $amount[$n]), '', 0, $user);
|
||||
$bank_line_id_from = $tmpaccountfrom->addline($dateo[$n], $typefrom, $label[$n], (float) price2num(-1 * (float) $amount[$n]), '', 0, $user);
|
||||
}
|
||||
if (!($bank_line_id_from > 0)) {
|
||||
$error++;
|
||||
}
|
||||
if (!$error) {
|
||||
$bank_line_id_to = $tmpaccountto->addline($dateo[$n], $typeto, $label[$n], $amountto[$n], '', 0, $user);
|
||||
$bank_line_id_to = $tmpaccountto->addline($dateo[$n], $typeto, $label[$n], (float) $amountto[$n], '', 0, $user);
|
||||
}
|
||||
if (!($bank_line_id_to > 0)) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com
|
||||
* Copyright (C) 2016-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||
|
|
@ -299,7 +299,7 @@ if (GETPOST("account") || GETPOST("ref")) {
|
|||
$socialcontribstatic->ref = $tmpobj->ref;
|
||||
$socialcontribstatic->id = $tmpobj->objid;
|
||||
$socialcontribstatic->label = $tmpobj->type;
|
||||
$ref = $socialcontribstatic->getNomUrl(1, 24);
|
||||
$ref = $socialcontribstatic->getNomUrl(1, '24');
|
||||
|
||||
$totalpayment = -1 * $socialcontribstatic->getSommePaiement(); // Payment already done
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,7 +184,6 @@ $arrayfields = array(
|
|||
);
|
||||
|
||||
$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
|
||||
$socid = GETPOSTINT("socid");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2007-2024 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
|
||||
|
|
@ -117,8 +118,8 @@ foreach ($object->fields as $key => $val) {
|
|||
$visible = (int) dol_eval((string) $val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
'label'=>$val['label'],
|
||||
'checked'=>(($visible < 0) ? 0 : 1),
|
||||
'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
|
||||
'checked'=>(($visible < 0) ? '0' : '1'),
|
||||
'enabled'=>(string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
|
||||
'position'=>$val['position'],
|
||||
'help'=> isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
|
|
@ -595,7 +596,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||
|
||||
$object->posmodule = $obj->posmodule;
|
||||
$object->cash = $obj->cash;
|
||||
$object->cheque = $obj->cheque;
|
||||
$object->cheque = (float) $obj->cheque;
|
||||
$object->card = $obj->card;
|
||||
$object->opening = $obj->opening;
|
||||
$object->year_close = $obj->year_close;
|
||||
|
|
@ -653,13 +654,13 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
|
||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
||||
print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021 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 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -167,7 +167,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
|
|||
$sql .= ")";
|
||||
}
|
||||
if (preg_match('/^(cs?|pct?)\./', (string) $sortfield)) {
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
$sql .= $db->order((string) $sortfield, (string) $sortorder);
|
||||
}
|
||||
//$sql.= $db->plimit($limit+1,$offset);
|
||||
//print $sql;
|
||||
|
|
@ -311,7 +311,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
|
|||
$sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
|
||||
}
|
||||
if (preg_match('/^(pv|ptva)\./', (string) $sortfield)) {
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
$sql .= $db->order((string) $sortfield, (string) $sortorder);
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
|
@ -466,7 +466,7 @@ while ($j < $numlt) {
|
|||
$sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
|
||||
}
|
||||
if (preg_match('/^pv/', (string) $sortfield)) {
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
$sql .= $db->order((string) $sortfield, (string) $sortorder);
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* 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
|
||||
|
|
@ -71,6 +72,7 @@ if (!$sortorder) {
|
|||
$sortorder = "ASC";
|
||||
}
|
||||
|
||||
$sql = null;
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
|
|
@ -89,7 +91,7 @@ llxHeader();
|
|||
|
||||
$thirdpartystatic = new Societe($db);
|
||||
|
||||
if ($mode == 'search') {
|
||||
if ($mode == 'search' && $sql !== null) {
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
if ($db->num_rows($resql) == 1) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* 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
|
||||
|
|
@ -248,7 +248,7 @@ class Deplacement extends CommonObject
|
|||
$sql .= " SET km = ".((float) $this->km); // This is a distance or amount
|
||||
$sql .= " , dated = '".$this->db->idate($this->date)."'";
|
||||
$sql .= " , type = '".$this->db->escape($this->type)."'";
|
||||
$sql .= " , fk_statut = '".$this->db->escape($this->statut)."'";
|
||||
$sql .= " , fk_statut = '".$this->db->escape((string) $this->statut)."'";
|
||||
$sql .= " , fk_user = ".((int) $this->fk_user);
|
||||
$sql .= " , fk_user_modif = ".((int) $user->id);
|
||||
$sql .= " , fk_soc = ".($this->socid > 0 ? $this->socid : 'null');
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (c) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 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>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -140,7 +140,7 @@ class DeplacementStats extends Stats
|
|||
{
|
||||
$sql = "SELECT date_format(dated,'%m') as dm, sum(".$this->field.")";
|
||||
$sql .= " FROM ".$this->from;
|
||||
$sql .= " WHERE date_format(dated,'%Y') = '".$this->db->escape($year)."'";
|
||||
$sql .= " WHERE date_format(dated,'%Y') = '".$this->db->escape((string) $year)."'";
|
||||
$sql .= " AND ".$this->where;
|
||||
$sql .= " GROUP BY dm";
|
||||
$sql .= $this->db->order('dm', 'DESC');
|
||||
|
|
@ -160,7 +160,7 @@ class DeplacementStats extends Stats
|
|||
{
|
||||
$sql = "SELECT date_format(dated,'%m') as dm, avg(".$this->field.")";
|
||||
$sql .= " FROM ".$this->from;
|
||||
$sql .= " WHERE date_format(dated,'%Y') = '".$this->db->escape($year)."'";
|
||||
$sql .= " WHERE date_format(dated,'%Y') = '".$this->db->escape((string) $year)."'";
|
||||
$sql .= " AND ".$this->where;
|
||||
$sql .= " GROUP BY dm";
|
||||
$sql .= $this->db->order('dm', 'DESC');
|
||||
|
|
|
|||
|
|
@ -208,7 +208,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);
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ if (empty($reshook)) {
|
|||
|
||||
$formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOST($key));
|
||||
} elseif (substr($key, 0, 21) == 'multicurrency_amount_') {
|
||||
$cursorfacid = substr($key, 21);
|
||||
$cursorfacid = (int) substr($key, 21);
|
||||
$multicurrency_amounts[$cursorfacid] = price2num(GETPOST($key));
|
||||
$multicurrency_totalpayment += (float) $multicurrency_amounts[$cursorfacid];
|
||||
if (!empty($multicurrency_amounts[$cursorfacid])) {
|
||||
|
|
@ -248,7 +248,7 @@ if (empty($reshook)) {
|
|||
|
||||
foreach ($multicurrency_amounts as $key => $value) { // How payment is dispatched
|
||||
$tmpinvoice = new Facture($db);
|
||||
$tmpinvoice->fetch($key);
|
||||
$tmpinvoice->fetch((int) $key);
|
||||
if ($tmpinvoice->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
$newvalue = price2num($value, 'MT');
|
||||
$multicurrency_amounts[$key] = - abs((float) $newvalue);
|
||||
|
|
@ -922,10 +922,10 @@ if ($result >= 0) {
|
|||
print '<br>';
|
||||
$text = '';
|
||||
if (!empty($totalpayment)) {
|
||||
$text = $langs->trans('ConfirmCustomerPayment', $totalpayment, $langs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$text = $langs->trans('ConfirmCustomerPayment', (string) $totalpayment, $langs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
}
|
||||
if (!empty($multicurrency_totalpayment)) {
|
||||
$text .= '<br>'.$langs->trans('ConfirmCustomerPayment', $multicurrency_totalpayment, $langs->transnoentitiesnoconv("paymentInInvoiceCurrency"));
|
||||
$text .= '<br>'.$langs->trans('ConfirmCustomerPayment', (string) $multicurrency_totalpayment, $langs->transnoentitiesnoconv("paymentInInvoiceCurrency"));
|
||||
}
|
||||
if (GETPOST('closepaidinvoices')) {
|
||||
$text .= '<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");
|
||||
|
|
|
|||
|
|
@ -771,7 +771,7 @@ class RemiseCheque extends CommonObject
|
|||
global $db, $user;
|
||||
|
||||
$payment = new Paiement($db);
|
||||
$payment->fetch(0, 0, $bank_id);
|
||||
$payment->fetch(0, '0', $bank_id);
|
||||
|
||||
$bankline = new AccountLine($db);
|
||||
$bankline->fetch($bank_id);
|
||||
|
|
@ -877,16 +877,16 @@ class RemiseCheque extends CommonObject
|
|||
/**
|
||||
* Set the ref of bordereau
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @param int $ref ref of bordereau
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
* @param User $user Object user
|
||||
* @param int|string $ref ref of bordereau
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function set_number($user, $ref)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($user->hasRight('banque', 'cheque')) {
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||
$sql .= " SET ref = '".$this->db->escape($ref)."'";
|
||||
$sql .= " SET ref = '".$this->db->escape((string) $ref)."'";
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog("RemiseCheque::set_number", LOG_DEBUG);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* 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
|
||||
|
|
@ -94,16 +94,15 @@ foreach ($arrayofpaymentmodetomanage as $key => $val) {
|
|||
}
|
||||
|
||||
$arrayfields = array(
|
||||
'bc.ref' => array('label' => "Ref", 'checked' => 1, 'position' => 10),
|
||||
'bc.type' => array('label' => "Type", 'checked' => 1, 'position' => 20),
|
||||
'bc.date_bordereau' => array('label' => "DateCreation", 'checked' => 1, 'position' => 30),
|
||||
'ba.label' => array('label' => "BankAccount", 'checked' => 1, 'position' => 40),
|
||||
'bc.nbcheque' => array('label' => "NbOfCheques", 'checked' => 1, 'position' => 50),
|
||||
'bc.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 60),
|
||||
'bc.statut' => array('label' => "Status", 'checked' => 1, 'position' => 70)
|
||||
'bc.ref' => array('label' => "Ref", 'checked' => '1', 'position' => 10),
|
||||
'bc.type' => array('label' => "Type", 'checked' => '1', 'position' => 20),
|
||||
'bc.date_bordereau' => array('label' => "DateCreation", 'checked' => '1', 'position' => 30),
|
||||
'ba.label' => array('label' => "BankAccount", 'checked' => '1', 'position' => 40),
|
||||
'bc.nbcheque' => array('label' => "NbOfCheques", 'checked' => '1', 'position' => 50),
|
||||
'bc.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 60),
|
||||
'bc.statut' => array('label' => "Status", 'checked' => '1', 'position' => 70)
|
||||
);
|
||||
$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
|
||||
|
||||
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
|
||||
$hookmanager->initHooks(array('chequelist'));
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
* Copyright (C) 2021 OpenDsi <support@open-dsi.fr>
|
||||
* Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com>
|
||||
* Copyright (C) 2023 Sylvain Legrand <technique@infras.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
|
||||
|
|
@ -74,7 +74,7 @@ class Paiement extends CommonObject
|
|||
public $datepaye;
|
||||
|
||||
/**
|
||||
* @var int|string same than $datepaye
|
||||
* @var int|string same than `$datepaye`
|
||||
*/
|
||||
public $date;
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ class Paiement extends CommonObject
|
|||
public $type_label;
|
||||
|
||||
/**
|
||||
* @var string Type of payment code (seems duplicate with $paiementcode);
|
||||
* @var string Type of payment code (seems duplicate with);
|
||||
*/
|
||||
public $type_code;
|
||||
|
||||
|
|
@ -852,7 +852,7 @@ class Paiement extends CommonObject
|
|||
$accountancycode,
|
||||
0,
|
||||
'',
|
||||
$totalamount_main_currency
|
||||
(float) $totalamount_main_currency
|
||||
);
|
||||
|
||||
// Mise a jour fk_bank dans llx_paiement
|
||||
|
|
@ -895,7 +895,7 @@ class Paiement extends CommonObject
|
|||
$bank_line_id,
|
||||
$fac->thirdparty->id,
|
||||
DOL_URL_ROOT.'/comm/card.php?socid=',
|
||||
$fac->thirdparty->name,
|
||||
(string) $fac->thirdparty->name,
|
||||
'company'
|
||||
);
|
||||
if ($result <= 0) {
|
||||
|
|
@ -913,7 +913,7 @@ class Paiement extends CommonObject
|
|||
$bank_line_id,
|
||||
$fac->thirdparty->id,
|
||||
DOL_URL_ROOT.'/fourn/card.php?socid=',
|
||||
$fac->thirdparty->name,
|
||||
(string) $fac->thirdparty->name,
|
||||
'company'
|
||||
);
|
||||
if ($result <= 0) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* Copyright (C) 2018-2021 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.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
|
||||
|
|
@ -111,19 +111,18 @@ $fieldstosearchall = array(
|
|||
);
|
||||
|
||||
$arrayfields = array(
|
||||
'p.ref' => array('label' => "RefPayment", 'checked' => 1, 'position' => 10),
|
||||
'p.datep' => array('label' => "Date", 'checked' => 1, 'position' => 20),
|
||||
's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 30),
|
||||
'c.libelle' => array('label' => "Type", 'checked' => 1, 'position' => 40),
|
||||
'transaction' => array('label' => "BankTransactionLine", 'checked' => 1, 'position' => 50, 'enabled' => (isModEnabled("bank"))),
|
||||
'ba.label' => array('label' => "BankAccount", 'checked' => 1, 'position' => 60, 'enabled' => (isModEnabled("bank"))),
|
||||
'p.num_paiement' => array('label' => "Numero", 'checked' => 1, 'position' => 70, 'tooltip' => "ChequeOrTransferNumber"),
|
||||
'p.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 80),
|
||||
'p.note' => array('label' => "Comment", 'checked' => -1, 'position' => 85),
|
||||
'p.statut' => array('label' => "Status", 'checked' => 1, 'position' => 90, 'enabled' => (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION'))),
|
||||
'p.ref' => array('label' => "RefPayment", 'checked' => '1', 'position' => 10),
|
||||
'p.datep' => array('label' => "Date", 'checked' => '1', 'position' => 20),
|
||||
's.nom' => array('label' => "ThirdParty", 'checked' => '1', 'position' => 30),
|
||||
'c.libelle' => array('label' => "Type", 'checked' => '1', 'position' => 40),
|
||||
'transaction' => array('label' => "BankTransactionLine", 'checked' => '1', 'position' => 50, 'enabled' => (string) (int) (isModEnabled("bank"))),
|
||||
'ba.label' => array('label' => "BankAccount", 'checked' => '1', 'position' => 60, 'enabled' => (string) (int) (isModEnabled("bank"))),
|
||||
'p.num_paiement' => array('label' => "Numero", 'checked' => '1', 'position' => 70, 'tooltip' => "ChequeOrTransferNumber"),
|
||||
'p.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 80),
|
||||
'p.note' => array('label' => "Comment", 'checked' => '-1', 'position' => 85),
|
||||
'p.statut' => array('label' => "Status", 'checked' => '1', 'position' => 90, 'enabled' => (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION'))),
|
||||
);
|
||||
$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
|
||||
|
||||
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
|
||||
$hookmanager->initHooks(array('paymentlist'));
|
||||
|
|
|
|||
|
|
@ -1543,11 +1543,11 @@ class BonPrelevement extends CommonObject
|
|||
/**
|
||||
* Get object and lines from database
|
||||
*
|
||||
* @param ?User $user Object user that delete
|
||||
* @param User $user Object user that delete
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
public function delete($user = null, $notrigger = 0)
|
||||
public function delete($user, $notrigger = 0)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2021 OpenDsi <support@open-dsi.fr>
|
||||
* Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* 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
|
||||
|
|
@ -114,7 +114,7 @@ class RejetPrelevement
|
|||
*
|
||||
* @param User $user User object
|
||||
* @param int $id Id
|
||||
* @param string $motif Motif
|
||||
* @param int $motif Motif
|
||||
* @param int $date_rejet Date reject
|
||||
* @param int $bonid Bon id
|
||||
* @param int<0,1> $facturation 1=Bill the reject
|
||||
|
|
@ -131,7 +131,7 @@ class RejetPrelevement
|
|||
|
||||
dol_syslog("RejetPrelevement::Create id ".$id);
|
||||
|
||||
$bankaccount = ($this->type == 'bank-transfer' ? getDolGlobalString('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalString('PRELEVEMENT_ID_BANKACCOUNT'));
|
||||
$bankaccount = ($this->type == 'bank-transfer' ? getDolGlobalInt('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalInt('PRELEVEMENT_ID_BANKACCOUNT'));
|
||||
$facs = $this->getListInvoices(1);
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
|
||||
|
|
@ -317,7 +317,7 @@ class RejetPrelevement
|
|||
* Retrieve the list of invoices
|
||||
*
|
||||
* @param int<0,1> $amounts If you want to get the amount of the order for each invoice
|
||||
|
||||
*
|
||||
* @return array<int|array{0:int,1:float}> Array List of invoices related to the withdrawal line
|
||||
* @todo A withdrawal line is today linked to one and only one invoice. So the function should return only one object ?
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -315,7 +315,7 @@ $userstatic = new User($db);
|
|||
$salarystatic = new Salary($db);
|
||||
|
||||
$i = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
while ($i < min($num, $limit) && $resql !== null) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) {
|
||||
break; // Should not happen
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018-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
|
||||
|
|
@ -118,7 +118,7 @@ if ($action == 'confirm_rejet' && $permissiontoadd) {
|
|||
if ($lipre->fetch($id) == 0) {
|
||||
$rej = new RejetPrelevement($db, $user, $type);
|
||||
|
||||
$result = $rej->create($user, $id, GETPOSTINT('motif'), $daterej, $lipre->bon_rowid, GETPOSTINT('facturer'));
|
||||
$result = $rej->create($user, $id, GETPOSTINT('motif'), (int) $daterej, $lipre->bon_rowid, GETPOSTINT('facturer'));
|
||||
|
||||
if ($result > 0) {
|
||||
header("Location: line.php?id=".urlencode((string) ($id)).'&type='.urlencode((string) ($type)));
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||
|
|
@ -383,7 +383,7 @@ if ($modecompta == 'BOOKKEEPING') {
|
|||
$cpts = $AccCat->getCptsCat(0, $tmppredefinedgroupwhere);
|
||||
|
||||
foreach ($cpts as $j => $cpt) {
|
||||
$return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, (empty($cpt['dc']) ? 0 : $cpt['dc']));
|
||||
$return = $AccCat->getSumDebitCredit((int) $cpt['account_number'], $date_start, $date_end, (empty($cpt['dc']) ? 0 : $cpt['dc']));
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultN = 0;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2016-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2020 Laurent Destailleur <eldy@destailleur.fr>
|
||||
* Copyright (C) 2018-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
|
||||
|
|
@ -491,7 +491,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||
}
|
||||
|
||||
// Set $cpts with array of accounts in the category/group
|
||||
$cpts = $AccCat->getCptsCat($cat['rowid']);
|
||||
$cpts = $AccCat->getCptsCat((int) $cat['rowid']);
|
||||
// We should loop over empty $cpts array, else the category _code_ is used in the formula, which leads to wrong result if the code is a number.
|
||||
if (empty($cpts)) {
|
||||
$cpts[] = array();
|
||||
|
|
@ -546,7 +546,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||
|
||||
//var_dump($monthtoprocess.'_'.$yeartoprocess);
|
||||
if (isset($cpt['account_number'])) {
|
||||
$return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, empty($cat['dc']) ? 0 : $cat['dc'], 'nofilter', $monthtoprocess, $yeartoprocess);
|
||||
$return = $AccCat->getSumDebitCredit((int) $cpt['account_number'], $date_start, $date_end, empty($cat['dc']) ? 0 : $cat['dc'], 'nofilter', $monthtoprocess, $yeartoprocess);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultM = 0;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* 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
|
||||
|
|
@ -106,16 +106,16 @@ if (!$sortorder) {
|
|||
$filtre = GETPOSTINT("filtre");
|
||||
|
||||
$arrayfields = array(
|
||||
'cs.rowid' => array('label' => "Ref", 'checked' => 1, 'position' => 10),
|
||||
'cs.libelle' => array('label' => "Label", 'checked' => 1, 'position' => 20),
|
||||
'cs.fk_type' => array('label' => "Type", 'checked' => 1, 'position' => 30),
|
||||
'cs.date_ech' => array('label' => "Date", 'checked' => 1, 'position' => 40),
|
||||
'cs.periode' => array('label' => "PeriodEndDate", 'checked' => 1, 'position' => 50),
|
||||
'p.ref' => array('label' => "ProjectRef", 'checked' => 1, 'position' => 60, 'enabled' => (isModEnabled('project'))),
|
||||
'cs.fk_user' => array('label' => "Employee", 'checked' => 1, 'position' => 70),
|
||||
'cs.fk_mode_reglement' => array('checked' => -1, 'position' => 80, 'label' => "DefaultPaymentMode"),
|
||||
'cs.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 100),
|
||||
'cs.paye' => array('label' => "Status", 'checked' => 1, 'position' => 110),
|
||||
'cs.rowid' => array('label' => "Ref", 'checked' => '1', 'position' => 10),
|
||||
'cs.libelle' => array('label' => "Label", 'checked' => '1', 'position' => 20),
|
||||
'cs.fk_type' => array('label' => "Type", 'checked' => '1', 'position' => 30),
|
||||
'cs.date_ech' => array('label' => "Date", 'checked' => '1', 'position' => 40),
|
||||
'cs.periode' => array('label' => "PeriodEndDate", 'checked' => '1', 'position' => 50),
|
||||
'p.ref' => array('label' => "ProjectRef", 'checked' => '1', 'position' => 60, 'enabled' => (string) (int) (isModEnabled('project'))),
|
||||
'cs.fk_user' => array('label' => "Employee", 'checked' => '1', 'position' => 70),
|
||||
'cs.fk_mode_reglement' => array('checked' => '-1', 'position' => 80, 'label' => "DefaultPaymentMode"),
|
||||
'cs.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 100),
|
||||
'cs.paye' => array('label' => "Status", 'checked' => '1', 'position' => 110),
|
||||
);
|
||||
|
||||
if (isModEnabled("bank")) {
|
||||
|
|
@ -123,7 +123,6 @@ if (isModEnabled("bank")) {
|
|||
}
|
||||
|
||||
$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
|
||||
|
||||
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
|
||||
$hookmanager->initHooks(array('sclist'));
|
||||
|
|
@ -484,7 +483,7 @@ if (!empty($arrayfields['cs.rowid']['checked'])) {
|
|||
// Filter: Type
|
||||
if (!empty($arrayfields['cs.fk_type']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
$formsocialcontrib->select_type_socialcontrib($search_typeid, 'search_typeid', 1, 0, 0, 'maxwidth150', 1);
|
||||
$formsocialcontrib->select_type_socialcontrib((int) $search_typeid, 'search_typeid', 1, 0, 0, 'maxwidth150', 1);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2011-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2021 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 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -92,21 +92,20 @@ if (!$sortorder) {
|
|||
}
|
||||
|
||||
$arrayfields = array(
|
||||
't.rowid' => array('checked' => 1, 'position' => 10, 'label' => "Ref",),
|
||||
't.label' => array('checked' => 1, 'position' => 20, 'label' => "Label"),
|
||||
't.datev' => array('checked' => 1, 'position' => 30, 'label' => "PeriodEndDate"),
|
||||
't.fk_typepayment' => array('checked' => 1, 'position' => 50, 'label' => "DefaultPaymentMode"),
|
||||
't.amount' => array('checked' => 1, 'position' => 90, 'label' => "Amount"),
|
||||
't.datec' => array('checked' => 1, 'position' => 91, 'label' => "DateCreation"),
|
||||
't.status' => array('checked' => 1, 'position' => 92, 'label' => "Status"),
|
||||
't.rowid' => array('checked' => '1', 'position' => 10, 'label' => "Ref",),
|
||||
't.label' => array('checked' => '1', 'position' => 20, 'label' => "Label"),
|
||||
't.datev' => array('checked' => '1', 'position' => 30, 'label' => "PeriodEndDate"),
|
||||
't.fk_typepayment' => array('checked' => '1', 'position' => 50, 'label' => "DefaultPaymentMode"),
|
||||
't.amount' => array('checked' => '1', 'position' => 90, 'label' => "Amount"),
|
||||
't.datec' => array('checked' => '1', 'position' => 91, 'label' => "DateCreation"),
|
||||
't.status' => array('checked' => '1', 'position' => 92, 'label' => "Status"),
|
||||
);
|
||||
|
||||
if (isModEnabled("bank")) {
|
||||
$arrayfields['t.fk_account'] = array('checked' => 1, 'position' => 60, 'label' => "DefaultBankAccount");
|
||||
$arrayfields['t.fk_account'] = array('checked' => '1', 'position' => 60, 'label' => "DefaultBankAccount");
|
||||
}
|
||||
|
||||
$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
|
||||
|
||||
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
|
||||
$hookmanager->initHooks(array('salestaxeslist'));
|
||||
|
|
|
|||
|
|
@ -237,8 +237,8 @@ foreach ($object->fields as $key => $val) {
|
|||
$visible = (int) dol_eval((string) $val['visible'], 1);
|
||||
$arrayfields['p.'.$key] = array(
|
||||
'label' => $val['label'],
|
||||
'checked' => (($visible < 0) ? 0 : 1),
|
||||
'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
|
||||
'checked' => (($visible < 0) ? '0' : '1'),
|
||||
'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
|
||||
'position' => $val['position'],
|
||||
'help' => isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
|
|
@ -246,16 +246,16 @@ foreach ($object->fields as $key => $val) {
|
|||
}
|
||||
|
||||
// Add none object fields to fields for list
|
||||
$arrayfields['country.code_iso'] = array('label' => "Country", 'position' => 66, 'checked' => 0);
|
||||
$arrayfields['country.code_iso'] = array('label' => "Country", 'position' => 66, 'checked' => '0');
|
||||
if (!getDolGlobalString('SOCIETE_DISABLE_CONTACTS')) {
|
||||
$arrayfields['s.nom'] = array('label' => "ThirdParty", 'position' => 113, 'checked' => 1);
|
||||
$arrayfields['s.name_alias'] = array('label' => "AliasNameShort", 'position' => 114, 'checked' => 1);
|
||||
$arrayfields['s.nom'] = array('label' => "ThirdParty", 'position' => 113, 'checked' => '1');
|
||||
$arrayfields['s.name_alias'] = array('label' => "AliasNameShort", 'position' => 114, 'checked' => '1');
|
||||
}
|
||||
|
||||
$arrayfields['unsubscribed'] = array(
|
||||
'label' => 'No_Email',
|
||||
'checked' => 0,
|
||||
'enabled' => (isModEnabled('mailing')),
|
||||
'checked' => '0',
|
||||
'enabled' => (string) (int) (isModEnabled('mailing')),
|
||||
'position' => 111);
|
||||
|
||||
if (isModEnabled('socialnetworks')) {
|
||||
|
|
@ -263,7 +263,7 @@ if (isModEnabled('socialnetworks')) {
|
|||
if ($value['active']) {
|
||||
$arrayfields['p.'.$key] = array(
|
||||
'label' => $value['label'],
|
||||
'checked' => 0,
|
||||
'checked' => '0',
|
||||
'position' => 299
|
||||
);
|
||||
}
|
||||
|
|
@ -276,7 +276,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
|
||||
|
||||
|
||||
if (($id > 0 || !empty($ref)) && $action != 'add') {
|
||||
|
|
|
|||
|
|
@ -2678,7 +2678,7 @@ class Form
|
|||
* 'warehouseopen' = count products from open warehouses,
|
||||
* 'warehouseclosed' = count products from closed warehouses,
|
||||
* 'warehouseinternal' = count products from warehouses for internal correct/transfer only
|
||||
* @param ?mixed[] $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
|
||||
* @param ?array<string,mixed> $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
|
||||
* @param int<0,1> $nooutput No print if 1, return the output into a string
|
||||
* @param int<-1,1> $status_purchase Purchase status: -1=No filter on purchase status, 0=Products not on purchase, 1=Products on purchase
|
||||
* @param int $warehouseId Filter by Warehouses Id where there is real stock
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
// TODO: Note, supposing $arrayfields is already set
|
||||
'
|
||||
@phan-var-force array $arrayfields;
|
||||
@phan-var-force array<string,array{label:string,checked?:string,position?:int,help?:string,enabled?:string}> $arrayfields
|
||||
';
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
|
|
@ -36,9 +36,9 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
|
|||
$arrayfields[$extrafieldsobjectprefix.$key] = array(
|
||||
'label' => $extrafields->attributes[$extrafieldsobjectkey]['label'][$key],
|
||||
'type' => $extrafields->attributes[$extrafieldsobjectkey]['type'][$key],
|
||||
'checked' => (((int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1') <= 0) ? 0 : 1),
|
||||
'checked' => (((int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1') <= 0) ? '0' : '1'),
|
||||
'position' => $extrafields->attributes[$extrafieldsobjectkey]['pos'][$key],
|
||||
'enabled' => (abs((int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1)) != 3 && (int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1')),
|
||||
'enabled' => (string) (int) (abs((int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1)) != 3 && (int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1')),
|
||||
'langfile' => $extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key],
|
||||
'help' => $extrafields->attributes[$extrafieldsobjectkey]['help'][$key],
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -104,12 +104,11 @@ $arrayfields = array(
|
|||
's.nom' => array('label' => "ThirdParty", 'checked' => '1', 'position' => 30),
|
||||
'c.code' => array('label' => "Type", 'checked' => '1', 'position' => 40),
|
||||
'pd.num_paiement' => array('label' => "Numero", 'checked' => '1', 'position' => 50, 'tooltip' => "ChequeOrTransferNumber"),
|
||||
'transaction' => array('label' => "BankTransactionLine", 'checked' => '1', 'position' => 60, 'enabled' => (string) (isModEnabled("bank"))),
|
||||
'ba.label' => array('label' => "BankAccount", 'checked' => '1', 'position' => 70, 'enabled' => (string) (isModEnabled("bank"))),
|
||||
'transaction' => array('label' => "BankTransactionLine", 'checked' => '1', 'position' => 60, 'enabled' => (string) (int) (isModEnabled("bank"))),
|
||||
'ba.label' => array('label' => "BankAccount", 'checked' => '1', 'position' => 70, 'enabled' => (string) (int) (isModEnabled("bank"))),
|
||||
'pd.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 80),
|
||||
);
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
'@phan-var-force array<string,array{label:string,checked:string,position?:int,help?:string,enabled?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$moreforfilter = GETPOST('moreforfilter', 'alpha');
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2023 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Benjamin Falière <benjamin.faliere@altairis.fr>
|
||||
* Copyright (C) 2024 Vincent Maury <vmaury@timgroup.fr>
|
||||
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
|
||||
|
|
@ -135,30 +135,30 @@ if (empty($user->socid)) {
|
|||
$fieldstosearchall["e.note_private"] = "NotePrivate";
|
||||
}
|
||||
|
||||
$checkedtypetiers = 0;
|
||||
$checkedtypetiers = '0';
|
||||
$arrayfields = array(
|
||||
'e.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1, 'position' => 1),
|
||||
'e.ref_customer' => array('label' => $langs->trans("RefCustomer"), 'checked' => 1, 'position' => 2),
|
||||
's.nom' => array('label' => $langs->trans("ThirdParty"), 'checked' => 1, 'position' => 3),
|
||||
's.town' => array('label' => $langs->trans("Town"), 'checked' => 1, 'position' => 4),
|
||||
's.zip' => array('label' => $langs->trans("Zip"), 'checked' => -1, 'position' => 5),
|
||||
'state.nom' => array('label' => $langs->trans("StateShort"), 'checked' => 0, 'position' => 6),
|
||||
'country.code_iso' => array('label' => $langs->trans("Country"), 'checked' => 0, 'position' => 7),
|
||||
'e.ref' => array('label' => $langs->trans("Ref"), 'checked' => '1', 'position' => 1),
|
||||
'e.ref_customer' => array('label' => $langs->trans("RefCustomer"), 'checked' => '1', 'position' => 2),
|
||||
's.nom' => array('label' => $langs->trans("ThirdParty"), 'checked' => '1', 'position' => 3),
|
||||
's.town' => array('label' => $langs->trans("Town"), 'checked' => '1', 'position' => 4),
|
||||
's.zip' => array('label' => $langs->trans("Zip"), 'checked' => '-1', 'position' => 5),
|
||||
'state.nom' => array('label' => $langs->trans("StateShort"), 'checked' => '0', 'position' => 6),
|
||||
'country.code_iso' => array('label' => $langs->trans("Country"), 'checked' => '0', 'position' => 7),
|
||||
'typent.code' => array('label' => $langs->trans("ThirdPartyType"), 'checked' => $checkedtypetiers, 'position' => 8),
|
||||
'e.date_delivery' => array('label' => $langs->trans("DateDeliveryPlanned"), 'checked' => 1, 'position' => 9),
|
||||
'e.date_expedition' => array('label' => $langs->trans("DateShipping"), 'checked' => 1, 'position' => 10),
|
||||
'e.fk_shipping_method' => array('label' => $langs->trans('SendingMethod'), 'checked' => 1, 'position' => 11),
|
||||
'e.tracking_number' => array('label' => $langs->trans("TrackingNumber"), 'checked' => 1, 'position' => 12),
|
||||
'e.weight' => array('label' => $langs->trans("Weight"), 'checked' => 0, 'position' => 13),
|
||||
'e.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500),
|
||||
'e.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 500),
|
||||
'e.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1, 'position' => 1000),
|
||||
'e.signed_status' => array('label' => 'Signed status', 'checked' => 0, 'position' => 1001),
|
||||
'l.ref' => array('label' => $langs->trans("DeliveryRef"), 'checked' => 1, 'position' => 1010, 'enabled' => (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)),
|
||||
'l.date_delivery' => array('label' => $langs->trans("DateReceived"), 'position' => 1020, 'checked' => 1, 'enabled' => (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)),
|
||||
'e.billed' => array('label' => $langs->trans("Billed"), 'checked' => 1, 'position' => 1100, 'enabled' => 'getDolGlobalString("WORKFLOW_BILL_ON_SHIPMENT") !== "0"'),
|
||||
'e.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'enabled' => (empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position' => 135),
|
||||
'e.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'enabled' => (empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position' => 140),
|
||||
'e.date_delivery' => array('label' => $langs->trans("DateDeliveryPlanned"), 'checked' => '1', 'position' => 9),
|
||||
'e.date_expedition' => array('label' => $langs->trans("DateShipping"), 'checked' => '1', 'position' => 10),
|
||||
'e.fk_shipping_method' => array('label' => $langs->trans('SendingMethod'), 'checked' => '1', 'position' => 11),
|
||||
'e.tracking_number' => array('label' => $langs->trans("TrackingNumber"), 'checked' => '1', 'position' => 12),
|
||||
'e.weight' => array('label' => $langs->trans("Weight"), 'checked' => '0', 'position' => 13),
|
||||
'e.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => '0', 'position' => 500),
|
||||
'e.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => '0', 'position' => 500),
|
||||
'e.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => '1', 'position' => 1000),
|
||||
'e.signed_status' => array('label' => 'Signed status', 'checked' => '0', 'position' => 1001),
|
||||
'l.ref' => array('label' => $langs->trans("DeliveryRef"), 'checked' => '1', 'position' => 1010, 'enabled' => (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? '1' : '0')),
|
||||
'l.date_delivery' => array('label' => $langs->trans("DateReceived"), 'position' => 1020, 'checked' => '1', 'enabled' => (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? '1' : '0')),
|
||||
'e.billed' => array('label' => $langs->trans("Billed"), 'checked' => '1', 'position' => 1100, 'enabled' => 'getDolGlobalString("WORKFLOW_BILL_ON_SHIPMENT") !== "0"'),
|
||||
'e.note_public' => array('label' => 'NotePublic', 'checked' => '0', 'enabled' => (string) (int) (empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position' => 135),
|
||||
'e.note_private' => array('label' => 'NotePrivate', 'checked' => '0', 'enabled' => (string) (int) (empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position' => 140),
|
||||
);
|
||||
|
||||
// Extra fields
|
||||
|
|
@ -166,7 +166,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
|
||||
|
||||
// Security check
|
||||
$expeditionid = GETPOSTINT('id');
|
||||
|
|
|
|||
|
|
@ -170,18 +170,18 @@ if (empty($user->socid)) {
|
|||
}
|
||||
|
||||
$arrayfields = array(
|
||||
'd.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1),
|
||||
'user' => array('label' => $langs->trans("User"), 'checked' => 1),
|
||||
'd.date_debut' => array('label' => $langs->trans("DateStart"), 'checked' => 1),
|
||||
'd.date_fin' => array('label' => $langs->trans("DateEnd"), 'checked' => 1),
|
||||
'd.date_valid' => array('label' => $langs->trans("DateValidation"), 'checked' => 1),
|
||||
'd.date_approve' => array('label' => $langs->trans("DateApprove"), 'checked' => 1),
|
||||
'd.total_ht' => array('label' => $langs->trans("AmountHT"), 'checked' => 1),
|
||||
'd.total_vat' => array('label' => $langs->trans("AmountVAT"), 'checked' => -1),
|
||||
'd.total_ttc' => array('label' => $langs->trans("AmountTTC"), 'checked' => 1),
|
||||
'd.date_create' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500),
|
||||
'd.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 500),
|
||||
'd.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1, 'position' => 1000),
|
||||
'd.ref' => array('label' => $langs->trans("Ref"), 'checked' => '1'),
|
||||
'user' => array('label' => $langs->trans("User"), 'checked' => '1'),
|
||||
'd.date_debut' => array('label' => $langs->trans("DateStart"), 'checked' => '1'),
|
||||
'd.date_fin' => array('label' => $langs->trans("DateEnd"), 'checked' => '1'),
|
||||
'd.date_valid' => array('label' => $langs->trans("DateValidation"), 'checked' => '1'),
|
||||
'd.date_approve' => array('label' => $langs->trans("DateApprove"), 'checked' => '1'),
|
||||
'd.total_ht' => array('label' => $langs->trans("AmountHT"), 'checked' => '1'),
|
||||
'd.total_vat' => array('label' => $langs->trans("AmountVAT"), 'checked' => '-1'),
|
||||
'd.total_ttc' => array('label' => $langs->trans("AmountTTC"), 'checked' => '1'),
|
||||
'd.date_create' => array('label' => $langs->trans("DateCreation"), 'checked' => '0', 'position' => 500),
|
||||
'd.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => '0', 'position' => 500),
|
||||
'd.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => '1', 'position' => 1000),
|
||||
);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
|
||||
* 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
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
/**
|
||||
* \file htdocs/expensereport/payment/list.php
|
||||
* \ingroup expensereport
|
||||
* \ingroup expensereport
|
||||
* \brief Payment list for expense reports
|
||||
*/
|
||||
|
||||
|
|
@ -111,16 +111,15 @@ $fieldstosearchall = array(
|
|||
);
|
||||
|
||||
$arrayfields = array(
|
||||
'pndf.rowid' => array('label' => "RefPayment", 'checked' => 1, 'position' => 10),
|
||||
'pndf.datep' => array('label' => "Date", 'checked' => 1, 'position' => 20),
|
||||
'u.login' => array('label' => "User", 'checked' => 1, 'position' => 30),
|
||||
'c.libelle' => array('label' => "Type", 'checked' => 1, 'position' => 40),
|
||||
'pndf.num_payment' => array('label' => "Numero", 'checked' => 1, 'position' => 50, 'tooltip' => "ChequeOrTransferNumber"),
|
||||
'ba.label' => array('label' => "BankAccount", 'checked' => 1, 'position' => 60, 'enable' => (isModEnabled("bank"))),
|
||||
'pndf.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 70),
|
||||
'pndf.rowid' => array('label' => "RefPayment", 'checked' => '1', 'position' => 10),
|
||||
'pndf.datep' => array('label' => "Date", 'checked' => '1', 'position' => 20),
|
||||
'u.login' => array('label' => "User", 'checked' => '1', 'position' => 30),
|
||||
'c.libelle' => array('label' => "Type", 'checked' => '1', 'position' => 40),
|
||||
'pndf.num_payment' => array('label' => "Numero", 'checked' => '1', 'position' => 50, 'tooltip' => "ChequeOrTransferNumber"),
|
||||
'ba.label' => array('label' => "BankAccount", 'checked' => '1', 'position' => 60, 'enabled' => (string) (int) (isModEnabled("bank"))),
|
||||
'pndf.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 70),
|
||||
);
|
||||
$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
|
||||
|
||||
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
|
||||
$hookmanager->initHooks(array('paymentexpensereportlist'));
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2022 Charlène Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Benjamin Falière <benjamin.faliere@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -155,13 +155,11 @@ $arrayfields = array(
|
|||
'fd.date' => array('label' => 'DateOfLine', 'checked' => '1', 'enabled' => getDolGlobalString('FICHINTER_DISABLE_DETAILS') != '1' ? '1' : '0'),
|
||||
'fd.duree' => array('label' => 'DurationOfLine', 'type' => 'duration', 'checked' => '1', 'enabled' => !getDolGlobalString('FICHINTER_DISABLE_DETAILS') ? '1' : '0'), //type duration is here because in database, column 'duree' is double
|
||||
);
|
||||
'@phan-var-force array{label:string,type?:string,checked:string,position?:int,enabled?:string,langfile?:string,help:string} $arrayfields';
|
||||
// Extra fields
|
||||
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{label:string,type?:string,checked:string,position?:int,enabled?:string,langfile?:string,help:string} $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
// Security check
|
||||
$id = GETPOSTINT('id');
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* Copyright (C) 2018-2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2019 Nicolas Zabouri <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021-2023 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024-2025 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
|
||||
|
|
@ -196,21 +196,21 @@ if (empty($user->socid)) {
|
|||
$fieldstosearchall["cf.note_private"] = "NotePrivate";
|
||||
}
|
||||
|
||||
$checkedtypetiers = 0;
|
||||
$enabledtypetiers = 0;
|
||||
|
||||
// Definition of array of fields for columns
|
||||
$arrayfields = array(
|
||||
'u.login' => array('label' => "AuthorRequest", 'enabled' => 1, 'position' => 41),
|
||||
's.name_alias' => array('label' => "AliasNameShort", 'position' => 51, 'checked' => 0),
|
||||
's.town' => array('label' => "Town", 'enabled' => 1, 'position' => 55, 'checked' => 1),
|
||||
's.zip' => array('label' => "Zip", 'enabled' => 1, 'position' => 56, 'checked' => 1),
|
||||
'state.nom' => array('label' => "StateShort", 'enabled' => 1, 'position' => 57),
|
||||
'country.code_iso' => array('label' => "Country", 'enabled' => 1, 'position' => 58),
|
||||
'typent.code' => array('label' => "ThirdPartyType", 'enabled' => $checkedtypetiers, 'position' => 59),
|
||||
'cf.total_localtax1' => array('label' => $langs->transcountry("AmountLT1", $mysoc->country_code), 'checked' => 0, 'enabled' => ($mysoc->localtax1_assuj == "1"), 'position' => 140),
|
||||
'cf.total_localtax2' => array('label' => $langs->transcountry("AmountLT2", $mysoc->country_code), 'checked' => 0, 'enabled' => ($mysoc->localtax2_assuj == "1"), 'position' => 145),
|
||||
'cf.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position' => 750),
|
||||
'cf.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position' => 760),
|
||||
'u.login' => array('label' => "AuthorRequest", 'enabled' => '1', 'position' => 41),
|
||||
's.name_alias' => array('label' => "AliasNameShort", 'position' => 51, 'checked' => '0'),
|
||||
's.town' => array('label' => "Town", 'enabled' => '1', 'position' => 55, 'checked' => '1'),
|
||||
's.zip' => array('label' => "Zip", 'enabled' => '1', 'position' => 56, 'checked' => '1'),
|
||||
'state.nom' => array('label' => "StateShort", 'enabled' => '1', 'position' => 57),
|
||||
'country.code_iso' => array('label' => "Country", 'enabled' => '1', 'position' => 58),
|
||||
'typent.code' => array('label' => "ThirdPartyType", 'enabled' => $enabledtypetiers, 'position' => 59),
|
||||
'cf.total_localtax1' => array('label' => $langs->transcountry("AmountLT1", $mysoc->country_code), 'checked' => '0', 'enabled' => (string) (int) ($mysoc->localtax1_assuj == "1"), 'position' => 140),
|
||||
'cf.total_localtax2' => array('label' => $langs->transcountry("AmountLT2", $mysoc->country_code), 'checked' => '0', 'enabled' => (string) (int) ($mysoc->localtax2_assuj == "1"), 'position' => 145),
|
||||
'cf.note_public' => array('label' => 'NotePublic', 'checked' => '0', 'enabled' => (string) (int) (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position' => 750),
|
||||
'cf.note_private' => array('label' => 'NotePrivate', 'checked' => '0', 'enabled' => (string) (int) (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position' => 760),
|
||||
);
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
|
|
@ -219,7 +219,7 @@ foreach ($object->fields as $key => $val) {
|
|||
$arrayfields['cf.'.$key] = array(
|
||||
'label' => $val['label'],
|
||||
'checked' => (($visible < 0) ? '0' : '1'),
|
||||
'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
|
||||
'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
|
||||
'position' => $val['position'],
|
||||
'help' => isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
|
|
@ -230,7 +230,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?:string,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,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?:string,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
if ($socid > 0) {
|
||||
$tmpthirdparty = new Societe($db);
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ if (empty($user->socid)) {
|
|||
$fieldstosearchall["f.note_private"] = "NotePrivate";
|
||||
}
|
||||
|
||||
$checkedtypetiers = 0;
|
||||
$checkedtypetiers = '0';
|
||||
$arrayfields = array(
|
||||
'f.ref' => array('label' => "Ref", 'checked' => '1', 'position' => 5),
|
||||
'f.ref_supplier' => array('label' => "RefSupplier", 'checked' => '1', 'position' => 7),
|
||||
|
|
@ -198,18 +198,18 @@ $arrayfields = array(
|
|||
'f.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => '1', 'position' => 50),
|
||||
'f.total_ht' => array('label' => "AmountHT", 'checked' => '1', 'position' => 105),
|
||||
'f.total_vat' => array('label' => "AmountVAT", 'checked' => '0', 'position' => 110),
|
||||
'f.total_localtax1' => array('label' => $langs->transcountry("AmountLT1", $mysoc->country_code), 'checked' => '0', 'enabled' => $mysoc->localtax1_assuj == "1", 'position' => 95),
|
||||
'f.total_localtax2' => array('label' => $langs->transcountry("AmountLT2", $mysoc->country_code), 'checked' => '0', 'enabled' => $mysoc->localtax2_assuj == "1", 'position' => 100),
|
||||
'f.total_localtax1' => array('label' => $langs->transcountry("AmountLT1", $mysoc->country_code), 'checked' => '0', 'enabled' => (string) (int) ($mysoc->localtax1_assuj == "1"), 'position' => 95),
|
||||
'f.total_localtax2' => array('label' => $langs->transcountry("AmountLT2", $mysoc->country_code), 'checked' => '0', 'enabled' => (string) (int) ($mysoc->localtax2_assuj == "1"), 'position' => 100),
|
||||
'f.total_ttc' => array('label' => "AmountTTC", 'checked' => '1', 'position' => 115),
|
||||
'dynamount_payed' => array('label' => "Paid", 'checked' => '0', 'position' => 116),
|
||||
'rtp' => array('label' => "Rest", 'checked' => '0', 'position' => 117),
|
||||
'f.multicurrency_code' => array('label' => 'Currency', 'checked' => '0', 'position' => 205, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'f.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => '0', 'position' => 206, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'f.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'position' => 207, 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'f.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'position' => 208, 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'f.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'position' => 209, 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'multicurrency_dynamount_payed' => array('label' => 'MulticurrencyAlreadyPaid', 'position' => 210, 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'multicurrency_rtp' => array('label' => 'MulticurrencyRemainderToPay', 'checked' => '0', 'position' => 211, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), // Not enabled by default because slow
|
||||
'f.multicurrency_code' => array('label' => 'Currency', 'checked' => '0', 'position' => 205, 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')),
|
||||
'f.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => '0', 'position' => 206, 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')),
|
||||
'f.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'position' => 207, 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')),
|
||||
'f.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'position' => 208, 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')),
|
||||
'f.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'position' => 209, 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')),
|
||||
'multicurrency_dynamount_payed' => array('label' => 'MulticurrencyAlreadyPaid', 'position' => 210, 'checked' => '0', 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')),
|
||||
'multicurrency_rtp' => array('label' => 'MulticurrencyRemainderToPay', 'checked' => '0', 'position' => 211, 'enabled' => (!isModEnabled("multicurrency") ? '0' : '1')), // Not enabled by default because slow
|
||||
'u.login' => array('label' => "Author", 'checked' => '-1', 'position' => 500),
|
||||
'f.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 501),
|
||||
'f.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 502),
|
||||
|
|
@ -226,7 +226,6 @@ if (empty($subtypearray)) {
|
|||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
'@phan-var-force array<string,array{label:string,checked?:string,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
if (!isModEnabled('supplier_invoice')) {
|
||||
accessforbidden();
|
||||
|
|
|
|||
|
|
@ -112,11 +112,10 @@ $arrayfields = array(
|
|||
's.nom' => array('label' => "ThirdParty", 'checked' => '1', 'position' => 30),
|
||||
'c.libelle' => array('label' => "Type", 'checked' => '1', 'position' => 40),
|
||||
'p.num_paiement' => array('label' => "Numero", 'checked' => '1', 'position' => 50, 'tooltip' => "ChequeOrTransferNumber"),
|
||||
'ba.label' => array('label' => "BankAccount", 'checked' => '1', 'position' => 60, 'enable' => (isModEnabled("bank"))),
|
||||
'ba.label' => array('label' => "BankAccount", 'checked' => '1', 'position' => 60, 'enabled' => (string) (int) (isModEnabled("bank"))),
|
||||
'p.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 70),
|
||||
);
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
'@phan-var-force array<string,array{label:string,checked?:string,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
|
||||
$hookmanager->initHooks(array('paymentsupplierlist'));
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@ $arrayfields = array(
|
|||
|
||||
$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
|
||||
|
||||
// Access control
|
||||
// TODO Open this page to a given permission so a sale representative can modify change rates. Permission should be added into module multicurrency.
|
||||
|
|
|
|||
|
|
@ -239,67 +239,67 @@ $alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')
|
|||
$arraypricelevel = array();
|
||||
// Definition of array of fields for columns
|
||||
$arrayfields = array(
|
||||
'p.rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'),
|
||||
'p.ref' => array('label' => 'ProductRef', 'checked' => 1, 'position' => 5),
|
||||
'p.ref_ext' => array('label' => 'RefExt', 'checked' => 1, 'position' => 6, 'visible' => getDolGlobalInt('MAIN_LIST_SHOW_REF_EXT')),
|
||||
'p.rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'),
|
||||
'p.ref' => array('label' => 'ProductRef', 'checked' => '1', 'position' => 5),
|
||||
'p.ref_ext' => array('label' => 'RefExt', 'checked' => '1', 'position' => 6, 'visible' => getDolGlobalInt('MAIN_LIST_SHOW_REF_EXT')),
|
||||
//'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))),
|
||||
'thumbnail' => array('label' => 'Photo', 'checked' => 0, 'position' => 10),
|
||||
'p.description' => array('label' => 'Description', 'checked' => 0, 'position' => 10),
|
||||
'p.label' => array('label' => "Label", 'checked' => 1, 'position' => 10),
|
||||
'p.fk_product_type' => array('label' => "Type", 'checked' => 0, 'enabled' => (isModEnabled("product") && isModEnabled("service")), 'position' => 11),
|
||||
'p.barcode' => array('label' => "Gencod", 'checked' => 1, 'enabled' => (isModEnabled('barcode')), 'position' => 12),
|
||||
'p.duration' => array('label' => "Duration", 'checked' => ($contextpage != 'productlist'), 'enabled' => (isModEnabled("service") && (string) $type == '1'), 'position' => 13),
|
||||
'pac.fk_product_parent' => array('label' => "ParentProductOfVariant", 'checked' => -1, 'enabled' => (isModEnabled('variants')), 'position' => 14),
|
||||
'p.finished' => array('label' => "Nature", 'checked' => 0, 'enabled' => (isModEnabled("product") && $type != '1'), 'position' => 19),
|
||||
'p.weight' => array('label' => 'Weight', 'checked' => 0, 'enabled' => (isModEnabled("product") && $type != '1'), 'position' => 20),
|
||||
'p.weight_units' => array('label' => 'WeightUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && $type != '1'), 'position' => 21),
|
||||
'p.length' => array('label' => 'Length', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 22),
|
||||
'p.length_units' => array('label' => 'LengthUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 23),
|
||||
'p.width' => array('label' => 'Width', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 24),
|
||||
'p.width_units' => array('label' => 'WidthUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 25),
|
||||
'p.height' => array('label' => 'Height', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 26),
|
||||
'p.height_units' => array('label' => 'HeightUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 27),
|
||||
'p.surface' => array('label' => 'Surface', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SURFACE') && $type != '1'), 'position' => 28),
|
||||
'p.surface_units' => array('label' => 'SurfaceUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SURFACE') && $type != '1'), 'position' => 29),
|
||||
'p.volume' => array('label' => 'Volume', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_VOLUME') && $type != '1'), 'position' => 30),
|
||||
'p.volume_units' => array('label' => 'VolumeUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_VOLUME') && $type != '1'), 'position' => 31),
|
||||
'cu.label' => array('label' => "DefaultUnitToShow", 'checked' => 0, 'enabled' => (isModEnabled("product") && getDolGlobalString('PRODUCT_USE_UNITS')), 'position' => 32),
|
||||
'p.fk_default_workstation' => array('label' => 'DefaultWorkstation', 'checked' => 0, 'enabled' => isModEnabled('workstation') && $type == 1, 'position' => 33),
|
||||
'p.sellprice' => array('label' => "SellingPrice", 'checked' => 1, 'enabled' => !getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => 40),
|
||||
'p.tva_tx' => array('label' => "VATRate", 'checked' => 0, 'enabled' => !getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => 41),
|
||||
'p.minbuyprice' => array('label' => "BuyingPriceMinShort", 'checked' => 1, 'enabled' => ($user->hasRight('fournisseur', 'lire')), 'position' => 42),
|
||||
'p.numbuyprice' => array('label' => "BuyingPriceNumShort", 'checked' => 0, 'enabled' => ($user->hasRight('fournisseur', 'lire')), 'position' => 43),
|
||||
'p.pmp' => array('label' => "PMPValueShort", 'checked' => 0, 'enabled' => ($user->hasRight('fournisseur', 'lire')), 'position' => 44),
|
||||
'p.cost_price' => array('label' => "CostPrice", 'checked' => 0, 'enabled' => ($user->hasRight('fournisseur', 'lire')), 'position' => 45),
|
||||
'p.seuil_stock_alerte' => array('label' => "StockLimit", 'checked' => 0, 'enabled' => (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position' => 50),
|
||||
'p.desiredstock' => array('label' => "DesiredStock", 'checked' => 1, 'enabled' => (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position' => 51),
|
||||
'p.stock' => array('label' => "PhysicalStock", 'checked' => 1, 'enabled' => (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position' => 52),
|
||||
'stock_virtual' => array('label' => "VirtualStock", 'checked' => 1, 'enabled' => (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) && $virtualdiffersfromphysical), 'position' => 53),
|
||||
'p.tobatch' => array('label' => "ManageLotSerial", 'checked' => 0, 'enabled' => (isModEnabled('productbatch')), 'position' => 60),
|
||||
'p.fk_country' => array('label' => "Country", 'checked' => 0, 'position' => 100),
|
||||
'p.fk_state' => array('label' => "State", 'checked' => 0, 'position' => 101),
|
||||
$alias_product_perentity . '.accountancy_code_sell' => array('label' => "ProductAccountancySellCode", 'checked' => 0, 'enabled' => !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 400),
|
||||
$alias_product_perentity . '.accountancy_code_sell_intra' => array('label' => "ProductAccountancySellIntraCode", 'checked' => 0, 'enabled' => $isInEEC && !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 401),
|
||||
$alias_product_perentity . '.accountancy_code_sell_export' => array('label' => "ProductAccountancySellExportCode", 'checked' => 0, 'enabled' => !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 402),
|
||||
$alias_product_perentity . '.accountancy_code_buy' => array('label' => "ProductAccountancyBuyCode", 'checked' => 0, 'enabled' => !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 403),
|
||||
$alias_product_perentity . '.accountancy_code_buy_intra' => array('label' => "ProductAccountancyBuyIntraCode", 'checked' => 0, 'enabled' => $isInEEC && !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 404),
|
||||
$alias_product_perentity . '.accountancy_code_buy_export' => array('label' => "ProductAccountancyBuyExportCode", 'checked' => 0, 'enabled' => !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 405),
|
||||
'p.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500),
|
||||
'p.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500),
|
||||
'p.tosell' => array('label' => $langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Sell").')', 'checked' => 1, 'position' => 1000),
|
||||
'p.tobuy' => array('label' => $langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Buy").')', 'checked' => 1, 'position' => 1000),
|
||||
'p.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'checked' => -1, 'position' => 1100),
|
||||
'thumbnail' => array('label' => 'Photo', 'checked' => '0', 'position' => 10),
|
||||
'p.description' => array('label' => 'Description', 'checked' => '0', 'position' => 10),
|
||||
'p.label' => array('label' => "Label", 'checked' => '1', 'position' => 10),
|
||||
'p.fk_product_type' => array('label' => "Type", 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && isModEnabled("service")), 'position' => 11),
|
||||
'p.barcode' => array('label' => "Gencod", 'checked' => '1', 'enabled' => (string) (int) (isModEnabled('barcode')), 'position' => 12),
|
||||
'p.duration' => array('label' => "Duration", 'checked' => ($contextpage != 'productlist'), 'enabled' => (string) (int) (isModEnabled("service") && (string) $type == '1'), 'position' => 13),
|
||||
'pac.fk_product_parent' => array('label' => "ParentProductOfVariant", 'checked' => '-1', 'enabled' => (string) (int) (isModEnabled('variants')), 'position' => 14),
|
||||
'p.finished' => array('label' => "Nature", 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && $type != '1'), 'position' => 19),
|
||||
'p.weight' => array('label' => 'Weight', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && $type != '1'), 'position' => 20),
|
||||
'p.weight_units' => array('label' => 'WeightUnits', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && $type != '1'), 'position' => 21),
|
||||
'p.length' => array('label' => 'Length', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 22),
|
||||
'p.length_units' => array('label' => 'LengthUnits', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 23),
|
||||
'p.width' => array('label' => 'Width', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 24),
|
||||
'p.width_units' => array('label' => 'WidthUnits', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 25),
|
||||
'p.height' => array('label' => 'Height', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 26),
|
||||
'p.height_units' => array('label' => 'HeightUnits', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 27),
|
||||
'p.surface' => array('label' => 'Surface', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SURFACE') && $type != '1'), 'position' => 28),
|
||||
'p.surface_units' => array('label' => 'SurfaceUnits', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SURFACE') && $type != '1'), 'position' => 29),
|
||||
'p.volume' => array('label' => 'Volume', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_VOLUME') && $type != '1'), 'position' => 30),
|
||||
'p.volume_units' => array('label' => 'VolumeUnits', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_VOLUME') && $type != '1'), 'position' => 31),
|
||||
'cu.label' => array('label' => "DefaultUnitToShow", 'checked' => '0', 'enabled' => (string) (int) (isModEnabled("product") && getDolGlobalString('PRODUCT_USE_UNITS')), 'position' => 32),
|
||||
'p.fk_default_workstation' => array('label' => 'DefaultWorkstation', 'checked' => '0', 'enabled' => (string) (int) (isModEnabled('workstation') && $type == 1), 'position' => 33),
|
||||
'p.sellprice' => array('label' => "SellingPrice", 'checked' => '1', 'enabled' => (string) (int) !getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => 40),
|
||||
'p.tva_tx' => array('label' => "VATRate", 'checked' => '0', 'enabled' => (string) (int) !getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => 41),
|
||||
'p.minbuyprice' => array('label' => "BuyingPriceMinShort", 'checked' => '1', 'enabled' => (string) (int) ($user->hasRight('fournisseur', 'lire')), 'position' => 42),
|
||||
'p.numbuyprice' => array('label' => "BuyingPriceNumShort", 'checked' => '0', 'enabled' => (string) (int) ($user->hasRight('fournisseur', 'lire')), 'position' => 43),
|
||||
'p.pmp' => array('label' => "PMPValueShort", 'checked' => '0', 'enabled' => (string) (int) ($user->hasRight('fournisseur', 'lire')), 'position' => 44),
|
||||
'p.cost_price' => array('label' => "CostPrice", 'checked' => '0', 'enabled' => (string) (int) ($user->hasRight('fournisseur', 'lire')), 'position' => 45),
|
||||
'p.seuil_stock_alerte' => array('label' => "StockLimit", 'checked' => '0', 'enabled' => (string) (int) (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position' => 50),
|
||||
'p.desiredstock' => array('label' => "DesiredStock", 'checked' => '1', 'enabled' => (string) (int) (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position' => 51),
|
||||
'p.stock' => array('label' => "PhysicalStock", 'checked' => '1', 'enabled' => (string) (int) (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position' => 52),
|
||||
'stock_virtual' => array('label' => "VirtualStock", 'checked' => '1', 'enabled' => (string) (int) (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) && $virtualdiffersfromphysical), 'position' => 53),
|
||||
'p.tobatch' => array('label' => "ManageLotSerial", 'checked' => '0', 'enabled' => (string) (int) (isModEnabled('productbatch')), 'position' => 60),
|
||||
'p.fk_country' => array('label' => "Country", 'checked' => '0', 'position' => 100),
|
||||
'p.fk_state' => array('label' => "State", 'checked' => '0', 'position' => 101),
|
||||
$alias_product_perentity . '.accountancy_code_sell' => array('label' => "ProductAccountancySellCode", 'checked' => '0', 'enabled' => (string) (int) !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 400),
|
||||
$alias_product_perentity . '.accountancy_code_sell_intra' => array('label' => "ProductAccountancySellIntraCode", 'checked' => '0', 'enabled' => (string) (int) ($isInEEC && !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING')), 'position' => 401),
|
||||
$alias_product_perentity . '.accountancy_code_sell_export' => array('label' => "ProductAccountancySellExportCode", 'checked' => '0', 'enabled' => (string) (int) !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 402),
|
||||
$alias_product_perentity . '.accountancy_code_buy' => array('label' => "ProductAccountancyBuyCode", 'checked' => '0', 'enabled' => (string) (int) !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 403),
|
||||
$alias_product_perentity . '.accountancy_code_buy_intra' => array('label' => "ProductAccountancyBuyIntraCode", 'checked' => '0', 'enabled' => (string) (int) ($isInEEC && !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING')), 'position' => 404),
|
||||
$alias_product_perentity . '.accountancy_code_buy_export' => array('label' => "ProductAccountancyBuyExportCode", 'checked' => '0', 'enabled' => (string) (int) !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 405),
|
||||
'p.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 500),
|
||||
'p.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 500),
|
||||
'p.tosell' => array('label' => $langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Sell").')', 'checked' => '1', 'position' => 1000),
|
||||
'p.tobuy' => array('label' => $langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Buy").')', 'checked' => '1', 'position' => 1000),
|
||||
'p.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'visible' => -2, 'notnull' => -1, 'index' => 0, 'checked' => '-1', 'position' => 1100),
|
||||
);
|
||||
|
||||
if (! empty($conf->stock->enabled)) {
|
||||
// service
|
||||
if ($type == 1) {
|
||||
if (! empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||
$arrayfields['p.stockable_product'] = array('label' => $langs->trans('StockableProduct'), 'checked' => 0, 'position' => 1001);
|
||||
$arrayfields['p.stockable_product'] = array('label' => $langs->trans('StockableProduct'), 'checked' => '0', 'position' => 1001);
|
||||
}
|
||||
} else {
|
||||
//product
|
||||
$arrayfields['p.stockable_product'] = array('label' => $langs->trans('StockableProduct'), 'checked' => 0, 'position' => 1001);
|
||||
$arrayfields['p.stockable_product'] = array('label' => $langs->trans('StockableProduct'), 'checked' => '0', 'position' => 1001);
|
||||
}
|
||||
}
|
||||
/*foreach ($object->fields as $key => $val) {
|
||||
|
|
@ -308,7 +308,7 @@ if (! empty($conf->stock->enabled)) {
|
|||
$visible = dol_eval($val['visible'], 1, 1, '1');
|
||||
$arrayfields['p.'.$key] = array(
|
||||
'label'=>$val['label'],
|
||||
'checked'=>(($visible < 0) ? 0 : 1),
|
||||
'checked'=>(($visible < 0) ? '0' : '1'),
|
||||
'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
|
||||
'position'=>$val['position']
|
||||
);
|
||||
|
|
@ -337,7 +337,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');
|
||||
// Note: forcing int for position, but in reality it is a float here.
|
||||
'@phan-var-force array<string,array{label:string,checked?:string,position?:int,enabled?:string,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
// Security check
|
||||
if ($search_type == '0') {
|
||||
|
|
@ -1231,7 +1230,7 @@ if (!empty($arrayfields['p.seuil_stock_alerte']['checked'])) {
|
|||
print '</td>';
|
||||
}
|
||||
// Managed_in_stock
|
||||
$array = array('-1'=>' ', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes'));
|
||||
$array = array('-1' => ' ', '0' => $langs->trans('No'), '1' => $langs->trans('Yes'));
|
||||
if (!empty($arrayfields['p.stockable_product']['checked'])) {
|
||||
print '<td class="liste_titre center">'.Form::selectarray('search_stockable_product', $array, $search_stockable_product).'</td>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ foreach ($object->fields as $key => $val) {
|
|||
$arrayfields['p.'.$key] = array(
|
||||
'label' => $val['label'],
|
||||
'checked' => (($visible < 0) ? '0' : '1'),
|
||||
'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
|
||||
'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
|
||||
'position' => $val['position'],
|
||||
'help' => isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
|
|
@ -298,7 +298,6 @@ if ($contextpage == 'lead') {
|
|||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
// '@phan-var-force array<string,array{label:string,checked?:string,enabled?:string,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
// Add a groupby field. Set $groupby and $groupbyvalues.
|
||||
// TODO Move this into a inc file
|
||||
|
|
|
|||
|
|
@ -199,7 +199,6 @@ $extrafieldsobjectprefix = 'efpt.';
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$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
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,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
|
||||
|
||||
$permissiontoread = $user->hasRight('projet', 'lire');
|
||||
$permissiontocreate = $user->hasRight('projet', 'creer');
|
||||
|
|
|
|||
|
|
@ -1304,7 +1304,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$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
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
|
|
|
|||
|
|
@ -152,7 +152,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
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue