forked from Wavyzz/dolibarr
Qual: Fix phan notices (facture/3 + filefunc.inc) (#33383)
* Qual: Fix PhanMismatchType * Finalize rename of $attrV into $value * Correct getGlobalString into getGlobalInt * Do not require some fields in the 'title' definition of $cols * Qual: Fix phan notices (core/lib) * Qual: Fix phan (contrat) * Qual: Fix phan notices (facture/3 + filefunc.in) --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
* Copyright (C) 2015-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
|
||||
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.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
|
||||
@@ -147,31 +147,30 @@ if (!$sortfield) {
|
||||
}
|
||||
|
||||
$arrayfields = array(
|
||||
'f.titre' => array('label' => "Ref", 'checked' => 1),
|
||||
's.nom' => array('label' => "ThirdParty", 'checked' => 1),
|
||||
'f.total_ht' => array('label' => "AmountHT", 'checked' => 1),
|
||||
'f.total_tva' => array('label' => "AmountVAT", 'checked' => -1),
|
||||
'f.total_ttc' => array('label' => "AmountTTC", 'checked' => 1),
|
||||
'f.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => 0),
|
||||
'f.fk_cond_reglement' => array('label' => "PaymentTerm", 'checked' => 0),
|
||||
'recurring' => array('label' => "RecurringInvoice", 'checked' => 1),
|
||||
'f.frequency' => array('label' => "Frequency", 'checked' => 1),
|
||||
'f.unit_frequency' => array('label' => "FrequencyUnit", 'checked' => 1),
|
||||
'f.nb_gen_done' => array('label' => "NbOfGenerationDoneShort", 'checked' => 1),
|
||||
'f.date_last_gen' => array('label' => "DateLastGenerationShort", 'checked' => 1),
|
||||
'f.date_when' => array('label' => "NextDateToExecutionShort", 'checked' => 1),
|
||||
'f.fk_user_author' => array('label' => "UserCreation", 'checked' => 0, 'position' => 500),
|
||||
'f.fk_user_modif' => array('label' => "UserModification", 'checked' => 0, 'position' => 505),
|
||||
'f.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 520),
|
||||
'f.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 525),
|
||||
'status' => array('label' => "Status", 'checked' => 1, 'position' => 1000),
|
||||
'f.titre' => array('label' => "Ref", 'checked' => '1'),
|
||||
's.nom' => array('label' => "ThirdParty", 'checked' => '1'),
|
||||
'f.total_ht' => array('label' => "AmountHT", 'checked' => '1'),
|
||||
'f.total_tva' => array('label' => "AmountVAT", 'checked' => '-1'),
|
||||
'f.total_ttc' => array('label' => "AmountTTC", 'checked' => '1'),
|
||||
'f.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => '0'),
|
||||
'f.fk_cond_reglement' => array('label' => "PaymentTerm", 'checked' => '0'),
|
||||
'recurring' => array('label' => "RecurringInvoice", 'checked' => '1'),
|
||||
'f.frequency' => array('label' => "Frequency", 'checked' => '1'),
|
||||
'f.unit_frequency' => array('label' => "FrequencyUnit", 'checked' => '1'),
|
||||
'f.nb_gen_done' => array('label' => "NbOfGenerationDoneShort", 'checked' => '1'),
|
||||
'f.date_last_gen' => array('label' => "DateLastGenerationShort", 'checked' => '1'),
|
||||
'f.date_when' => array('label' => "NextDateToExecutionShort", 'checked' => '1'),
|
||||
'f.fk_user_author' => array('label' => "UserCreation", 'checked' => '0', 'position' => 500),
|
||||
'f.fk_user_modif' => array('label' => "UserModification", 'checked' => '0', 'position' => 505),
|
||||
'f.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 520),
|
||||
'f.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 525),
|
||||
'status' => array('label' => "Status", 'checked' => '1', 'position' => 1000),
|
||||
);
|
||||
// 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
|
||||
|
||||
if ($socid > 0) {
|
||||
$tmpthirdparty = new Societe($db);
|
||||
@@ -611,7 +610,7 @@ if (!empty($arrayfields['f.titre']['checked'])) {
|
||||
}
|
||||
// Thirdparty
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td class="liste_titre left"><input class="flat" type="text" size="8" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||
print '<td class="liste_titre left"><input class="flat" type="text" size="8" name="search_societe" value="'.dol_escape_htmltag((string) $search_societe).'"></td>';
|
||||
}
|
||||
if (!empty($arrayfields['f.total_ht']['checked'])) {
|
||||
// Amount net
|
||||
@@ -634,7 +633,7 @@ if (!empty($arrayfields['f.total_ttc']['checked'])) {
|
||||
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
|
||||
// Payment term
|
||||
print '<td class="liste_titre">';
|
||||
print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100');
|
||||
print $form->getSelectConditionsPaiements((int) $search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100');
|
||||
print "</td>";
|
||||
}
|
||||
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
|
||||
@@ -927,7 +926,7 @@ while ($i < $imaxinloop) {
|
||||
// Payment term
|
||||
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
|
||||
print '<td class="tdoverflowmax150">';
|
||||
$form->form_conditions_reglement(0, $objp->fk_cond_reglement, 'none');
|
||||
$form->form_conditions_reglement('0', $objp->fk_cond_reglement, 'none');
|
||||
print '</td>'."\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
Reference in New Issue
Block a user