diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index f0f1cd22712..5535546dece 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -40,6 +40,11 @@ * @var User $user */ +// Initialise values +$search_xaxis = array(); +$search_groupby = array(); +$tabfamily = null; + if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) { require '../main.inc.php'; @@ -56,14 +61,10 @@ if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) { //$search_xaxis = GETPOST('search_xaxis', 'array'); if (GETPOST('search_xaxis', 'alpha') && GETPOST('search_xaxis', 'alpha') != '-1') { $search_xaxis = array(GETPOST('search_xaxis', 'alpha')); - } else { - $search_xaxis = array(); } //$search_groupby = GETPOST('search_groupby', 'array'); if (GETPOST('search_groupby', 'alpha') && GETPOST('search_groupby', 'alpha') != '-1') { $search_groupby = array(GETPOST('search_groupby', 'alpha')); - } else { - $search_groupby = array(); } '@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); $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); $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); @@ -548,7 +549,7 @@ if (is_array($search_groupby) && count($search_groupby)) { */ $labeloffield = $arrayofgroupby[$fieldtocount]['labelnohtml']; } else { - $labeloffield = $langs->transnoentitiesnoconv($keyforlabeloffield); + $labeloffield = 'FK_ISSUE'; // $langs->transnoentitiesnoconv($keyforlabeloffield); } } else { // This is a common field $reg = array(); @@ -585,7 +586,7 @@ if (!defined('MAIN_CUSTOM_REPORT_KEEP_GRAPH_ONLY')) { print '
'; print ''; print ''; - print ''; + print ''; $viewmode = ''; @@ -725,9 +726,9 @@ if (!defined('MAIN_CUSTOM_REPORT_KEEP_GRAPH_ONLY')) { print ''; } - if ($mode == 'graph') { - // - } + //if ($mode == 'graph') { + // + //} print '
'; print ''; @@ -1114,7 +1115,7 @@ if ($sql) { */ foreach ($search_measures as $key => $val) { $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($arrayofvaluesforgroupby); foreach ($arrayofvaluesforgroupby['g_'.$gi] as $gvaluepossiblekey => $gvaluepossiblelabel) { diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php index a0d1f4eda9e..db65437e38e 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -6,7 +6,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -41,21 +41,68 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; */ abstract class ModelePDFCommandes extends CommonDocGenerator { + /** + * @var float + */ public $posxpicture; + /** + * @var float + */ public $posxtva; + /** + * @var float + */ public $posxup; + /** + * @var float + */ public $posxqty; + /** + * @var float + */ public $posxunit; + /** + * @var float + */ public $posxdesc; + /** + * @var float + */ public $posxdiscount; + /** + * @var float + */ public $postotalht; + /** + * @var array + */ public $tva; + /** + * @var array + */ public $tva_array; + /** + * Local tax rates Array[tax_type][tax_rate] + * + * @var array> + */ public $localtax1; + + /** + * Local tax rates Array[tax_type][tax_rate] + * + * @var array> + */ public $localtax2; + /** + * @var int<0,1> + */ public $atleastoneratenotnull = 0; + /** + * @var int<0,1> + */ public $atleastonediscount = 0;