Qual: Fix phan notices

This commit is contained in:
MDW
2025-01-05 15:50:20 +01:00
parent 4246215730
commit 694342484d
2 changed files with 62 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2020-2024 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2020-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>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@@ -40,6 +40,11 @@
* @var User $user * @var User $user
*/ */
// Initialise values
$search_xaxis = array();
$search_groupby = array();
$tabfamily = null;
if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) { if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) {
require '../main.inc.php'; require '../main.inc.php';
@@ -56,14 +61,10 @@ if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) {
//$search_xaxis = GETPOST('search_xaxis', 'array'); //$search_xaxis = GETPOST('search_xaxis', 'array');
if (GETPOST('search_xaxis', 'alpha') && GETPOST('search_xaxis', 'alpha') != '-1') { if (GETPOST('search_xaxis', 'alpha') && GETPOST('search_xaxis', 'alpha') != '-1') {
$search_xaxis = array(GETPOST('search_xaxis', 'alpha')); $search_xaxis = array(GETPOST('search_xaxis', 'alpha'));
} else {
$search_xaxis = array();
} }
//$search_groupby = GETPOST('search_groupby', 'array'); //$search_groupby = GETPOST('search_groupby', 'array');
if (GETPOST('search_groupby', 'alpha') && GETPOST('search_groupby', 'alpha') != '-1') { if (GETPOST('search_groupby', 'alpha') && GETPOST('search_groupby', 'alpha') != '-1') {
$search_groupby = array(GETPOST('search_groupby', 'alpha')); $search_groupby = array(GETPOST('search_groupby', 'alpha'));
} else {
$search_groupby = array();
} }
'@phan-var-force string[] $search_groupby'; '@phan-var-force string[] $search_groupby';
@@ -385,11 +386,11 @@ $arrayofmesures = fillArrayOfMeasures($object, 't', $langs->trans($newarrayoftyp
$arrayofmesures = dol_sort_array($arrayofmesures, 'position', 'asc', 0, 0, 1); $arrayofmesures = dol_sort_array($arrayofmesures, 'position', 'asc', 0, 0, 1);
$count = 0; $count = 0;
$arrayofxaxis = fillArrayOfXAxis($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayofxaxis, 0, $count); $arrayofxaxis = fillArrayOfXAxis($object, 't', $label, $arrayofxaxis, 0, $count);
$arrayofxaxis = dol_sort_array($arrayofxaxis, 'position', 'asc', 0, 0, 1); $arrayofxaxis = dol_sort_array($arrayofxaxis, 'position', 'asc', 0, 0, 1);
$count = 0; $count = 0;
$arrayofgroupby = fillArrayOfGroupBy($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayofgroupby, 0, $count); $arrayofgroupby = fillArrayOfGroupBy($object, 't', $label, $arrayofgroupby, 0, $count);
$arrayofgroupby = dol_sort_array($arrayofgroupby, 'position', 'asc', 0, 0, 1); $arrayofgroupby = dol_sort_array($arrayofgroupby, 'position', 'asc', 0, 0, 1);
@@ -548,7 +549,7 @@ if (is_array($search_groupby) && count($search_groupby)) {
*/ */
$labeloffield = $arrayofgroupby[$fieldtocount]['labelnohtml']; $labeloffield = $arrayofgroupby[$fieldtocount]['labelnohtml'];
} else { } else {
$labeloffield = $langs->transnoentitiesnoconv($keyforlabeloffield); $labeloffield = 'FK_ISSUE'; // $langs->transnoentitiesnoconv($keyforlabeloffield);
} }
} else { // This is a common field } else { // This is a common field
$reg = array(); $reg = array();
@@ -585,7 +586,7 @@ if (!defined('MAIN_CUSTOM_REPORT_KEEP_GRAPH_ONLY')) {
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" autocomplete="off">'; print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" autocomplete="off">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="viewgraph">'; print '<input type="hidden" name="action" value="viewgraph">';
print '<input type="hidden" name="tabfamily" value="'.$tabfamily.'">'; print '<input type="hidden" name="tabfamily" value="'.(string) $tabfamily.'">';
$viewmode = ''; $viewmode = '';
@@ -725,9 +726,9 @@ if (!defined('MAIN_CUSTOM_REPORT_KEEP_GRAPH_ONLY')) {
print '</div>'; print '</div>';
} }
if ($mode == 'graph') { //if ($mode == 'graph') {
// //
} //}
print '<div class="divadvancedsearchfield">'; print '<div class="divadvancedsearchfield">';
print '<input type="submit" class="button buttongen button-save nomargintop" value="'.$langs->trans("Refresh").'">'; print '<input type="submit" class="button buttongen button-save nomargintop" value="'.$langs->trans("Refresh").'">';
@@ -1114,7 +1115,7 @@ if ($sql) {
*/ */
foreach ($search_measures as $key => $val) { foreach ($search_measures as $key => $val) {
$gi = 0; $gi = 0;
foreach ($search_groupby as $gkey) { foreach ($search_groupby as $gkey => $gval) {
//var_dump('*** Fetch #'.$ifetch.' for labeltouse='.$labeltouse.' measure number '.$key.' and group g_'.$gi); //var_dump('*** Fetch #'.$ifetch.' for labeltouse='.$labeltouse.' measure number '.$key.' and group g_'.$gi);
//var_dump($arrayofvaluesforgroupby); //var_dump($arrayofvaluesforgroupby);
foreach ($arrayofvaluesforgroupby['g_'.$gi] as $gvaluepossiblekey => $gvaluepossiblelabel) { foreach ($arrayofvaluesforgroupby['g_'.$gi] as $gvaluepossiblekey => $gvaluepossiblelabel) {

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.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 * 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 * it under the terms of the GNU General Public License as published by
@@ -41,21 +41,68 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
*/ */
abstract class ModelePDFCommandes extends CommonDocGenerator abstract class ModelePDFCommandes extends CommonDocGenerator
{ {
/**
* @var float
*/
public $posxpicture; public $posxpicture;
/**
* @var float
*/
public $posxtva; public $posxtva;
/**
* @var float
*/
public $posxup; public $posxup;
/**
* @var float
*/
public $posxqty; public $posxqty;
/**
* @var float
*/
public $posxunit; public $posxunit;
/**
* @var float
*/
public $posxdesc; public $posxdesc;
/**
* @var float
*/
public $posxdiscount; public $posxdiscount;
/**
* @var float
*/
public $postotalht; public $postotalht;
/**
* @var array<string,float>
*/
public $tva; public $tva;
/**
* @var array<string,array{amount:float}>
*/
public $tva_array; public $tva_array;
/**
* Local tax rates Array[tax_type][tax_rate]
*
* @var array<string,array<int,float>>
*/
public $localtax1; public $localtax1;
/**
* Local tax rates Array[tax_type][tax_rate]
*
* @var array<string,array<int,float>>
*/
public $localtax2; public $localtax2;
/**
* @var int<0,1>
*/
public $atleastoneratenotnull = 0; public $atleastoneratenotnull = 0;
/**
* @var int<0,1>
*/
public $atleastonediscount = 0; public $atleastonediscount = 0;