diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index c56fd81b5d6b0..579e02ceacd53 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -15,7 +15,6 @@ return [ // PhanUndeclaredConstant : 15+ occurrences // PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences // PhanTypeArraySuspiciousNull : 10+ occurrences - // PhanTypeInvalidUnaryOperandNumeric : 8 occurrences // PhanRedefineFunctionInternal : 6 occurrences // PhanPluginUnsafeEval : 5 occurrences // PhanParamSuspiciousOrder : 4 occurrences @@ -39,7 +38,7 @@ return [ 'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected'], 'htdocs/categories/viewcat.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/collab/index.php' => ['PhanParamTooMany'], - 'htdocs/comm/action/index.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidUnaryOperandNumeric'], + 'htdocs/comm/action/index.php' => ['PhanTypeArraySuspiciousNull'], 'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/accounting-files.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'], @@ -71,14 +70,12 @@ return [ 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanParamSignatureMismatch', 'PhanParamSuspiciousOrder'], 'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanParamSignatureMismatch'], 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], - 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/intracommreport/list.php' => ['PhanAccessPropertyStaticAsNonStatic'], 'htdocs/loan/class/paymentloan.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/mrp/class/mo.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/product/admin/product_tools.php' => ['PhanNoopStringLiteral'], 'htdocs/projet/tasks/list.php' => ['PhanTypeArraySuspiciousNull'], - 'htdocs/public/bookcal/index.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/public/opensurvey/index.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/public/payment/paymentok.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/public/recruitment/index.php' => ['PhanPluginSuspiciousParamOrder'], diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 92bd815997605..c995908532f21 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -319,10 +319,10 @@ $next_year = $next['year']; $next_month = $next['month']; - $max_day_in_prev_month = date("t", dol_mktime(12, 0, 0, $prev_month, 1, $prev_year, 'gmt')); // Nb of days in previous month - $max_day_in_month = date("t", dol_mktime(12, 0, 0, $month, 1, $year, 'gmt')); // Nb of days in next month + $max_day_in_prev_month = (int) date("t", dol_mktime(12, 0, 0, $prev_month, 1, $prev_year, 'gmt')); // Nb of days in previous month + $max_day_in_month = (int) date("t", dol_mktime(12, 0, 0, $month, 1, $year, 'gmt')); // Nb of days in next month // tmpday is a negative or null cursor to know how many days before the 1st to show on month view (if tmpday=0, 1st is monday) - $tmpday = -date("w", dol_mktime(12, 0, 0, $month, 1, $year, 'gmt')) + 2; // date('w') is 0 for sunday + $tmpday = - (int) date("w", dol_mktime(12, 0, 0, $month, 1, $year, 'gmt')) + 2; // date('w') is 0 for sunday $tmpday += ((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1) - 1); if ($tmpday >= 1) { $tmpday -= 7; // If tmpday is 0 we start with sunday, if -6, we start with monday of previous week. diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index bb4b30474b77e..05351d41713a8 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -5,6 +5,7 @@ * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2022-2024 Alexandre Spangaro + * Copyright (C) 2024 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 @@ -96,15 +97,15 @@ $arrayfields = array( - 'type'=>array('label'=>"Type", 'checked'=>1), - 'date'=>array('label'=>"Date", 'checked'=>1), - 'date_due'=>array('label'=>"DateDue", 'checked'=>1), - 'ref'=>array('label'=>"Ref", 'checked'=>1), - 'documents'=>array('label'=>"Documents", 'checked'=>1), - 'paid'=>array('label'=>"Paid", 'checked'=>1), - 'total_ht'=>array('label'=>"TotalHT", 'checked'=>1), - 'total_ttc'=>array('label'=>"TotalTTC", 'checked'=>1), - 'total_vat'=>array('label'=>"TotalVAT", 'checked'=>1), + 'type' => array('label' => "Type", 'checked' => 1), + 'date' => array('label' => "Date", 'checked' => 1), + 'date_due' => array('label' => "DateDue", 'checked' => 1), + 'ref' => array('label' => "Ref", 'checked' => 1), + 'documents' => array('label' => "Documents", 'checked' => 1), + 'paid' => array('label' => "Paid", 'checked' => 1), + 'total_ht' => array('label' => "TotalHT", 'checked' => 1), + 'total_ttc' => array('label' => "TotalTTC", 'checked' => 1), + 'total_vat' => array('label' => "TotalVAT", 'checked' => 1), //... ); @@ -135,14 +136,14 @@ $error = 0; $listofchoices = array( - 'selectinvoices'=>array('label'=>'Invoices', 'picto'=>'bill', 'lang'=>'bills', 'enabled' => isModEnabled('invoice'), 'perms' => $user->hasRight('facture', 'lire')), - 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'picto'=>'supplier_invoice', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => $user->hasRight('fournisseur', 'facture', 'lire')), - 'selectexpensereports'=>array('label'=>'ExpenseReports', 'picto'=>'expensereport', 'lang'=>'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => $user->hasRight('expensereport', 'lire')), - 'selectdonations'=>array('label'=>'Donations', 'picto'=>'donation', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('don', 'lire')), - 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'picto'=>'bill', 'enabled' => isModEnabled('tax'), 'perms' => $user->hasRight('tax', 'charges', 'lire')), - 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'picto'=>'salary', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => $user->hasRight('salaries', 'read')), - 'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('bank'), 'perms' => $user->hasRight('banque', 'lire')), - 'selectloanspayment'=>array('label'=>'PaymentLoan','picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('loan', 'read')), + 'selectinvoices' => array('label' => 'Invoices', 'picto' => 'bill', 'lang' => 'bills', 'enabled' => isModEnabled('invoice'), 'perms' => $user->hasRight('facture', 'lire')), + 'selectsupplierinvoices' => array('label' => 'BillsSuppliers', 'picto' => 'supplier_invoice', 'lang' => 'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => $user->hasRight('fournisseur', 'facture', 'lire')), + 'selectexpensereports' => array('label' => 'ExpenseReports', 'picto' => 'expensereport', 'lang' => 'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => $user->hasRight('expensereport', 'lire')), + 'selectdonations' => array('label' => 'Donations', 'picto' => 'donation', 'lang' => 'donation', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('don', 'lire')), + 'selectsocialcontributions' => array('label' => 'SocialContributions', 'picto' => 'bill', 'enabled' => isModEnabled('tax'), 'perms' => $user->hasRight('tax', 'charges', 'lire')), + 'selectpaymentsofsalaries' => array('label' => 'SalariesPayments', 'picto' => 'salary', 'lang' => 'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => $user->hasRight('salaries', 'read')), + 'selectvariouspayment' => array('label' => 'VariousPayment', 'picto' => 'payment', 'enabled' => isModEnabled('bank'), 'perms' => $user->hasRight('banque', 'lire')), + 'selectloanspayment' => array('label' => 'PaymentLoan','picto' => 'loan', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('loan', 'read')), ); @@ -157,6 +158,9 @@ //if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $filesarray = array(); + +'@phan-var-force array $filesarray'; + $result = false; if (($action == 'searchfiles' || $action == 'dl')) { if (empty($date_start)) { @@ -411,6 +415,7 @@ $nofile['link'] = ''; $nofile['name'] = ''; + $filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile; } else { foreach ($files as $key => $file) { @@ -446,8 +451,8 @@ } $filesarray[$file['item'].'_'.$file['id']]['files'][] = array( 'link' => $link.urlencode($file['name']), - 'name'=>$file['name'], - 'ref'=>$file['ref'], + 'name' => $file['name'], + 'ref' => $file['ref'], 'fullname' => $file['fullname'], 'relpath' => '/'.$file['name'], 'relpathnamelang' => $langs->trans($file['item']).'/'.$file['name'], @@ -522,7 +527,7 @@ $zipname .= '_'.$project->ref; } } - $zipname .='_export.zip'; + $zipname .= '_export.zip'; dol_delete_file($zipname); @@ -689,6 +694,7 @@ } $TData = dol_sort_array($filesarray, $sortfield, $sortorder); + '@phan-var-force array $TData'; $filename = dol_print_date($date_start, 'dayrfc', 'tzuserrel')."-".dol_print_date($date_stop, 'dayrfc', 'tzuserrel').'_export.zip'; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 2a724f56d42ab..6713da39db7cf 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2022 Alexandre Spangaro * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 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 @@ -82,12 +83,19 @@ class PaymentSocialContribution extends CommonObject public $bank_line; /** - * @deprecated + * @deprecated Use $amount instead. * @see $amount + * @var float|int */ public $total; + /** + * @var float|int + */ public $amount; // Total amount of payment + /** + * @var array + */ public $amounts = array(); // Array of amounts /** @@ -97,7 +105,7 @@ class PaymentSocialContribution extends CommonObject /** * @var string - * @deprecated + * @deprecated Use $num_payment instead * @see $num_payment */ public $num_paiement; @@ -318,8 +326,10 @@ public function fetch($id) $this->tms = $this->db->jdate($obj->tms); $this->datep = $this->db->jdate($obj->datep); $this->amount = $obj->amount; + $this->total = $obj->amount; $this->fk_typepaiement = $obj->fk_typepaiement; $this->num_payment = $obj->num_payment; + $this->num_paiement = $obj->num_payment; $this->note_private = $obj->note; $this->fk_bank = $obj->fk_bank; $this->fk_user_creat = $obj->fk_user_creat; @@ -577,7 +587,7 @@ public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom $acc = new Account($this->db); $acc->fetch($accountid); - $total = $this->total; + $total = $this->amount; if ($mode == 'payment_sc') { $total = -$total; } diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php index f45cc80e909d7..c5fbf39666748 100644 --- a/htdocs/compta/tva/class/paymentvat.class.php +++ b/htdocs/compta/tva/class/paymentvat.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 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 @@ -58,12 +59,20 @@ class PaymentVAT extends CommonObject public $datep = ''; /** - * @deprecated + * @deprecated Use $amount instead * @see $amount + * @var float|int */ public $total; + /** + * @var float|int + */ public $amount; // Total amount of payment + + /** + * @var array + */ public $amounts = array(); // Array of amounts /** @@ -73,7 +82,7 @@ class PaymentVAT extends CommonObject /** * @var string - * @deprecated + * @deprecated Use $num_payment instead * @see $num_payment */ public $num_paiement; @@ -578,7 +587,7 @@ public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom $acc = new Account($this->db); $acc->fetch($accountid); - $total = $this->total; + $total = $this->amount; if ($mode == 'payment_vat') { $total = -$total; } diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index a9fb094ed588d..b06415364a68a 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -137,10 +137,12 @@ function init_typeoffields(type) }); /* Autofill the code with label */ + jQuery("#label").keyup(function() { console.log("Update new field"); - $("#attrname").val( $(this).val().replace(/[^a-zA-Z0-9_]/g, '').toLowerCase() ); + $("#attrname").val( $(this).val().normalize('NFD').replace(/\s/g, "_").replace(/[^a-zA-Z0-9_]/g, '').toLowerCase() ); }); + }); diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index f480854dad800..8763f965a90d0 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 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 @@ -65,7 +66,13 @@ class PaymentExpenseReport extends CommonObject * @var int|string */ public $datep = ''; + /** + * @var float|int + */ public $amount; // Total amount of payment + /** + * @var array + */ public $amounts = array(); // Array of amounts /** @@ -94,7 +101,14 @@ class PaymentExpenseReport extends CommonObject */ public $fk_user_modif; + /** + * @var string + */ public $type_code; + + /** + * @var string + */ public $type_label; /** @@ -693,7 +707,7 @@ public function getNomUrl($withpicto = 0, $maxlen = 0) } global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index d896cae320cf5..871030cb77464 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -164,7 +164,7 @@ static function ($arg) { /** * Previx option with '-' for single characters and -- for more than single characters * @param string $arg - * @return straing + * @return string */ static function ($arg) { if (strlen($arg) > 1) { diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 93bf150de1737..dbdc58acdcb60 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -437,3 +437,4 @@ AllowStockMovementVariantParent=Also records stock movements on parent products AllowStockMovementVariantParentHelp=By default, a parent of a variant is a virtual product, so no stock is managed for it. By enabling this option, a stock will be managed for parent products and each time a stock quantity is modified for a variant product, the same quantity will be modified for the parent product. You should not need this option, except if you are using variant to manage the same product than parent (but with different descriptions, prices...) ConfirmSetToDraftInventory=Are you sure you want to go back to Draft status?
The quantities currently set in the inventory will be reset. WarningLineProductNotToSell=Product or service "%s" is not to sell and was cloned +PriceLabel=Price label diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index b794cbde41897..a939cc392ba05 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -436,3 +436,4 @@ WarningConvertFromBatchToSerial=Si vous disposez actuellement d'une quantité su AllowStockMovementVariantParent=Enregistre également les mouvements de stock sur les produits parent des produits variants AllowStockMovementVariantParentHelp=Par défaut, un parent d'une variante est un produit virtuel, donc aucun stock n'est géré pour celui-ci. En activant cette option, un stock sera géré pour les produits parents et à chaque fois qu'une quantité de stock est modifiée pour une variante de produit, la même quantité sera modifiée pour le produit parent. Vous ne devriez pas avoir besoin de cette option, sauf si vous utilisez une variante pour gérer le même produit que le parent (mais avec des descriptions, des prix différents...) ConfirmSetToDraftInventory=Êtes-vous sûr de vouloir revenir à l'état de brouillon ?
Les quantités actuellement définies dans l'inventaire seront réinitialisées. +PriceLabel=Libellé du prix diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index f095f480a04bd..28a1d9f4060b0 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2020 Maxime DEMAREST + * Copyright (C) 2024 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 @@ -62,14 +63,23 @@ class PaymentLoan extends CommonObject public $datep = ''; /** - * @var array Array of amounts + * @var array Array of amounts */ public $amounts = array(); - public $amount_capital; // Total amount of payment + /** + * @var float|int Total amount of payment + */ + public $amount_capital; + /** + * @var float|int + */ public $amount_insurance; + /** + * @var float|int + */ public $amount_interest; /** @@ -98,10 +108,22 @@ class PaymentLoan extends CommonObject */ public $fk_user_modif; + /** + * @var string + */ public $type_code; + /** + * @var string + */ public $type_label; public $chid; + /** + * @var string + */ public $label; + /** + * @var string + */ public $paymenttype; public $bank_account; public $bank_line; @@ -666,7 +688,7 @@ public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $moretitl global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5c59e925394df..c4b70c7a1f8f4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -184,6 +184,7 @@ class Product extends CommonObject * @var string */ public $price_base_type; + public $price_label; //! Arrays for multiprices public $multiprices = array(); @@ -684,6 +685,7 @@ public function create($user, $notrigger = 0) $this->price = (float) price2num($this->price); $this->price_min_ttc = (float) price2num($this->price_min_ttc); $this->price_min = (float) price2num($this->price_min); + $this->price_label = trim($this->price_label); if (empty($this->tva_tx)) { $this->tva_tx = 0; } @@ -826,6 +828,7 @@ public function create($user, $notrigger = 0) $sql .= ", price"; $sql .= ", price_ttc"; $sql .= ", price_base_type"; + $sql .= ", price_label"; $sql .= ", tobuy"; $sql .= ", tosell"; if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { @@ -853,6 +856,7 @@ public function create($user, $notrigger = 0) $sql .= ", ".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null"); $sql .= ", ".((int) $user->id); $sql .= ", ".((int) $this->type); + $sql .= ", ".(!empty($this->price_label) ? "'".$this->db->escape($this->price_label)."'" : "null"); $sql .= ", ".price2num($price_ht, 'MT'); $sql .= ", ".price2num($price_ttc, 'MT'); $sql .= ", '".$this->db->escape($this->price_base_type)."'"; @@ -1965,9 +1969,9 @@ private function _log_price($user, $level = 0) } // Add new price - $sql = "INSERT INTO ".$this->db->prefix()."product_price(price_level,date_price, fk_product, fk_user_author, price, price_ttc, price_base_type,tosell, tva_tx, default_vat_code, recuperableonly,"; + $sql = "INSERT INTO ".$this->db->prefix()."product_price(price_level,date_price, fk_product, fk_user_author, price_label, price, price_ttc, price_base_type,tosell, tva_tx, default_vat_code, recuperableonly,"; $sql .= " localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, price_min,price_min_ttc,price_by_qty,entity,fk_price_expression) "; - $sql .= " VALUES(".($level ? ((int) $level) : 1).", '".$this->db->idate($now)."', ".((int) $this->id).", ".((int) $user->id).", ".((float) price2num($this->price)).", ".((float) price2num($this->price_ttc)).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".((float) price2num($this->tva_tx)).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).","; + $sql .= " VALUES(".($level ? ((int) $level) : 1).", '".$this->db->idate($now)."', ".((int) $this->id).", ".((int) $user->id).", ".(empty($this->price_label)?"null":"'".$this->db->escape($this->price_label)."'").", ".((float) price2num($this->price)).", ".((float) price2num($this->price_ttc)).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".((float) price2num($this->tva_tx)).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).","; $sql .= " ".price2num($this->localtax1_tx).", ".price2num($this->localtax2_tx).", '".$this->db->escape($this->localtax1_type)."', '".$this->db->escape($this->localtax2_type)."', ".price2num($this->price_min).", ".price2num($this->price_min_ttc).", ".price2num($this->price_by_qty).", ".((int) $conf->entity).",".($this->fk_price_expression > 0 ? ((int) $this->fk_price_expression) : 'null'); $sql .= ")"; @@ -2312,10 +2316,11 @@ public function get_buyprice($prodfournprice, $qty, $product_id = 0, $fourn_ref * @param int $ignore_autogen Used to avoid infinite loops * @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function). * @param string $newdefaultvatcode Default vat code + * @param string $price_label Price Label * @param int $notrigger Disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newminprice = 0, $level = 0, $newnpr = 0, $newpbq = 0, $ignore_autogen = 0, $localtaxes_array = array(), $newdefaultvatcode = '', $notrigger = 0) + public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newminprice = 0, $level = 0, $newnpr = 0, $newpbq = 0, $ignore_autogen = 0, $localtaxes_array = array(), $newdefaultvatcode = '', $price_label = '', $notrigger = 0) { global $conf, $langs; @@ -2439,6 +2444,7 @@ public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newm $sql .= " localtax1_type = ".($localtaxtype1 != '' ? "'".$this->db->escape($localtaxtype1)."'" : "'0'").","; $sql .= " localtax2_type = ".($localtaxtype2 != '' ? "'".$this->db->escape($localtaxtype2)."'" : "'0'").","; $sql .= " default_vat_code = ".($newdefaultvatcode ? "'".$this->db->escape($newdefaultvatcode)."'" : "null").","; + $sql .= " price_label = ".(!empty($price_label) ? "'".$this->db->escape($price_label)."'" : "null").","; $sql .= " tva_tx = ".(float) price2num($newvat).","; $sql .= " recuperableonly = '".$this->db->escape($newnpr)."'"; $sql .= " WHERE rowid = ".((int) $id); @@ -2456,6 +2462,7 @@ public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newm $this->multiprices_recuperableonly[$level] = $newnpr; $this->price = $price; + $this->price_label = $price_label; $this->price_ttc = $price_ttc; $this->price_min = $price_min; $this->price_min_ttc = $price_min_ttc; @@ -2463,6 +2470,7 @@ public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newm $this->default_vat_code = $newdefaultvatcode; $this->tva_tx = $newvat; $this->tva_npr = $newnpr; + //Local taxes $this->localtax1_tx = $localtax1; $this->localtax2_tx = $localtax2; @@ -2580,6 +2588,7 @@ public function fetch($id = 0, $ref = '', $ref_ext = '', $barcode = '', $ignore_ } $sql .= " p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.sell_or_eat_by_mandatory, p.batch_mask, p.fk_unit,"; $sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf,"; + $sql .= " p.price_label,"; if ($separatedStock) { $sql .= " SUM(sp.reel) as stock"; } else { @@ -2623,6 +2632,7 @@ public function fetch($id = 0, $ref = '', $ref_ext = '', $barcode = '', $ignore_ } $sql .= " p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.sell_or_eat_by_mandatory, p.batch_mask, p.fk_unit,"; $sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf"; + $sql .= " ,p.price_label"; if (!$separatedStock) { $sql .= ", p.stock"; } @@ -2646,6 +2656,7 @@ public function fetch($id = 0, $ref = '', $ref_ext = '', $barcode = '', $ignore_ $this->note = $obj->note_private; // deprecated $this->type = $obj->fk_product_type; + $this->price_label = $obj->price_label; $this->status = $obj->tosell; $this->status_buy = $obj->tobuy; $this->status_batch = $obj->tobatch; @@ -2742,6 +2753,7 @@ public function fetch($id = 0, $ref = '', $ref_ext = '', $barcode = '', $ignore_ for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { $sql = "SELECT price, price_ttc, price_min, price_min_ttc,"; $sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly"; + $sql .= " ,price_label"; $sql .= " FROM ".$this->db->prefix()."product_price"; $sql .= " WHERE entity IN (".getEntity('productprice').")"; $sql .= " AND price_level=".((int) $i); @@ -4817,6 +4829,7 @@ public function clone_price($fromId, $toId) $sql .= ", price_min"; $sql .= ", price_min_ttc"; $sql .= ", price_base_type"; + $sql .= ", price_label"; $sql .= ", default_vat_code"; $sql .= ", tva_tx"; $sql .= ", recuperableonly"; @@ -4844,6 +4857,7 @@ public function clone_price($fromId, $toId) $sql .= ", price_min"; $sql .= ", price_min_ttc"; $sql .= ", price_base_type"; + $sql .= ", price_label"; $sql .= ", default_vat_code"; $sql .= ", tva_tx"; $sql .= ", recuperableonly"; diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 7120d9b3434b4..8a02380b629f3 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -44,6 +44,7 @@ class ProductCustomerPrice extends CommonObject 'price_ttc' => array('type' => 'decimal(20,6)', 'label' => 'TTC', 'enabled' => 1, 'visible' => 1, 'position' => 8, 'notnull' => -1, 'comment' => 'Price TTC'), 'price_min' => array('type' => 'decimal(20,6)', 'label' => 'MinPriceHT', 'enabled' => 1, 'visible' => 1, 'position' => 9, 'notnull' => -1, 'comment' => 'Minimum Price'), 'price_min_ttc' => array('type' => 'decimal(20,6)', 'label' => 'MinPriceTTC', 'enabled' => 1, 'visible' => 1, 'position' => 10, 'notnull' => -1, 'comment' => 'Minimum Price TTC'), + 'price_label' => array('type' => 'varchar(255)', 'label' => 'PriceLabel', 'enabled' => 1, 'visible' => 1, 'position' => 20, 'notnull' => -1, 'comment' => 'Price Label'), 'fk_user' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => 1, 'position' => 510, 'notnull' => 1, 'foreignkey' => 'user.rowid', 'csslist' => 'tdoverflowmax100'), ); @@ -91,6 +92,7 @@ class ProductCustomerPrice extends CommonObject public $localtax1_tx; public $localtax2_type; public $localtax2_tx; + public $price_label; /** * @var int User ID @@ -170,6 +172,9 @@ public function create($user, $notrigger = 0, $forceupdateaffiliate = 0) if (isset($this->fk_user)) { $this->fk_user = (int) $this->fk_user; } + if (isset($this->price_label)) { + $this->price_label = trim($this->price_label); + } if (isset($this->import_key)) { $this->import_key = trim($this->import_key); } @@ -228,6 +233,7 @@ public function create($user, $notrigger = 0, $forceupdateaffiliate = 0) $sql .= "localtax2_type,"; $sql .= "localtax2_tx,"; $sql .= "fk_user,"; + $sql .= "price_label,"; $sql .= "import_key"; $sql .= ") VALUES ("; $sql .= " ".((int) $conf->entity).","; @@ -248,6 +254,7 @@ public function create($user, $notrigger = 0, $forceupdateaffiliate = 0) $sql .= " ".(empty($this->localtax2_type) ? "'0'" : "'".$this->db->escape($this->localtax2_type)."'").","; $sql .= " ".(!isset($this->localtax2_tx) ? 'NULL' : (empty($this->localtax2_tx) ? 0 : $this->localtax2_tx)).","; $sql .= " ".((int) $user->id).","; + $sql .= " ".(!isset($this->price_label) ? 'NULL' : "'".$this->db->escape($this->price_label)."'").","; $sql .= " ".(!isset($this->import_key) ? 'NULL' : "'".$this->db->escape($this->import_key)."'"); $sql .= ")"; @@ -321,6 +328,7 @@ public function fetch($id) $sql .= " t.localtax1_tx,"; $sql .= " t.localtax2_tx,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key"; $sql .= " FROM ".$this->db->prefix()."product_customer_price as t"; $sql .= " WHERE t.rowid = ".((int) $id); @@ -350,6 +358,7 @@ public function fetch($id) $this->localtax1_tx = $obj->localtax1_tx; $this->localtax2_tx = $obj->localtax2_tx; $this->fk_user = $obj->fk_user; + $this->price_label = $obj->price_label; $this->import_key = $obj->import_key; $this->db->free($resql); @@ -407,6 +416,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sql .= " t.localtax1_type,"; $sql .= " t.localtax2_type,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key,"; $sql .= " soc.nom as socname,"; $sql .= " prod.ref as prodref"; @@ -483,6 +493,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $line->localtax1_type = $obj->localtax1_type; $line->localtax2_type = $obj->localtax2_type; $line->fk_user = $obj->fk_user; + $line->price_label = $obj->price_label; $line->import_key = $obj->import_key; $line->socname = $obj->socname; $line->prodref = $obj->prodref; @@ -535,6 +546,7 @@ public function fetchAllLog($sortorder, $sortfield, $limit, $offset, $filter = a $sql .= " t.localtax1_tx,"; $sql .= " t.localtax2_tx,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key,"; $sql .= " soc.nom as socname,"; $sql .= " prod.ref as prodref"; @@ -590,6 +602,7 @@ public function fetchAllLog($sortorder, $sortfield, $limit, $offset, $filter = a $line->localtax1_tx = $obj->localtax1_tx; $line->localtax2_tx = $obj->localtax2_tx; $line->fk_user = $obj->fk_user; + $line->price_label = $obj->price_label; $line->import_key = $obj->import_key; $line->socname = $obj->socname; $line->prodref = $obj->prodref; @@ -662,6 +675,9 @@ public function update(User $user, $notrigger = 0, $forceupdateaffiliate = 0) if (isset($this->fk_user)) { $this->fk_user = (int) $this->fk_user; } + if (isset($this->price_label)) { + $this->price_label = trim($this->price_label); + } if (isset($this->import_key)) { $this->import_key = trim($this->import_key); } @@ -722,6 +738,7 @@ public function update(User $user, $notrigger = 0, $forceupdateaffiliate = 0) $sql .= "localtax1_type,"; $sql .= "localtax2_type,"; $sql .= "fk_user,"; + $sql .= "price_label,"; $sql .= "import_key"; $sql .= ") "; @@ -745,6 +762,7 @@ public function update(User $user, $notrigger = 0, $forceupdateaffiliate = 0) $sql .= " t.localtax1_type,"; $sql .= " t.localtax2_type,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key"; $sql .= " FROM ".$this->db->prefix()."product_customer_price as t"; @@ -780,6 +798,7 @@ public function update(User $user, $notrigger = 0, $forceupdateaffiliate = 0) $sql .= " localtax1_type=".(!empty($this->localtax1_type) ? "'".$this->db->escape($this->localtax1_type)."'" : "'0'").","; $sql .= " localtax2_type=".(!empty($this->localtax2_type) ? "'".$this->db->escape($this->localtax2_type)."'" : "'0'").","; $sql .= " fk_user=".$user->id.","; + $sql .= " price_label=".(isset($this->price_label) ? "'".$this->db->escape($this->price_label)."'" : "null").","; $sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null"); $sql .= " WHERE rowid=".((int) $this->id); @@ -876,6 +895,7 @@ public function setPriceOnAffiliateThirdparty($user, $forceupdateaffiliate) $prodsocpriceupd->price_base_type = $this->price_base_type; $prodsocpriceupd->tva_tx = $this->tva_tx; $prodsocpriceupd->recuperableonly = $this->recuperableonly; + $prodsocpriceupd->price_label = $this->price_label; $resultupd = $prodsocpriceupd->update($user, 0, $forceupdateaffiliate); if ($resultupd < 0) { @@ -894,6 +914,7 @@ public function setPriceOnAffiliateThirdparty($user, $forceupdateaffiliate) $prodsocpricenew->price_base_type = $this->price_base_type; $prodsocpricenew->tva_tx = $this->tva_tx; $prodsocpricenew->recuperableonly = $this->recuperableonly; + $prodsocpricenew->price_label = $this->price_label; $resultupd = $prodsocpricenew->create($user, 0, $forceupdateaffiliate); if ($resultupd < 0) { @@ -1039,6 +1060,7 @@ public function initAsSpecimen() $this->localtax1_tx = ''; $this->localtax2_tx = ''; $this->fk_user = 0; + $this->price_label = ''; $this->import_key = ''; return 1; @@ -1093,6 +1115,7 @@ class PriceByCustomerLine * @var int User ID */ public $fk_user; + public $price_label; public $import_key; public $socname; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 747604f0f706d..40bbfdecd51c0 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -123,6 +123,8 @@ if (($action == 'update_vat') && !$cancel && ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer'))) { $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)' + $price_label = GETPOST('price_label', 'alpha'); + // We must define tva_tx, npr and local taxes $tva_tx = $tva_tx_txt; $reg = array(); @@ -190,6 +192,7 @@ $object->localtax2_tx = $localtax2; $object->localtax1_type = $localtax1_type; $object->localtax2_type = $localtax2_type; + $object->price_label = $price_label; $db->begin(); @@ -216,7 +219,7 @@ //$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2); $localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them. $level = $i; - $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode); + $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode, $price_label); if ($ret < 0) { $error++; @@ -238,7 +241,7 @@ //$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2); $localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them when required. $level = 0; - $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode); + $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode, $price_label); if ($ret < 0) { $error++; @@ -382,6 +385,7 @@ $newprice_min = price2num(GETPOST('price_min', 'alpha'), '', 2); $newpricebase = GETPOST('price_base_type', 'alpha'); $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)' + $price_label = GETPOST('price_label', 'alpha'); $tva_tx = $tva_tx_txt; $vatratecode = ''; @@ -447,6 +451,7 @@ $pricestoupdate[0] = array( 'price' => $newprice, + 'price_label' => $price_label, 'price_min' => $newprice_min, 'price_base_type' => $newpricebase, 'default_vat_code' => $vatratecode, @@ -478,7 +483,7 @@ // If price has changed, we update it if (!array_key_exists($key, $object->multiprices) || $object->multiprices[$key] != $newprice || $object->multiprices_min[$key] != $newprice_min || $object->multiprices_base_type[$key] != $val['price_base_type'] || $object->multiprices_tva_tx[$key] != $newvattx) { - $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code']); + $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code'], $val['price_label']); } else { $res = 0; } @@ -638,6 +643,7 @@ $prodcustprice->price = price2num(GETPOST("price"), 'MU'); $prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU'); $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); + $prodcustprice->price_label = GETPOST("price_label", 'alpha'); $tva_tx_txt = GETPOST("tva_tx", 'alpha'); @@ -761,6 +767,7 @@ $prodcustprice->price = price2num(GETPOST("price"), 'MU'); $prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU'); $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); + $prodcustprice->price_label = GETPOST("price_label", 'alpha'); $tva_tx_txt = GETPOST("tva_tx"); @@ -1234,7 +1241,11 @@ print ' - ' . price($object->price_min_ttc).' '.$langs->trans('TTC') . ''; } } + print ''; + // Price Label + print ''.$langs->trans("PriceLabel").''; + print $object->price_label; print ''; // Price by quantity @@ -1521,6 +1532,14 @@ function on_change() { print ''; print ''; + // Price Label + print ''; + print $langs->trans('PriceLabel'); + print ''; + print ''; + print ''; + print ''; + $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -1661,6 +1680,7 @@ function on_change() { $sql = "SELECT p.rowid, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.recuperableonly, p.localtax1_tx, p.localtax1_type, p.localtax2_tx, p.localtax2_type,"; $sql .= " p.price_level, p.price_min, p.price_min_ttc,p.price_by_qty,"; $sql .= " p.date_price as dp, p.fk_price_expression, u.rowid as user_id, u.login"; + $sql .= " ,p.price_label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_price as p,"; $sql .= " ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE fk_product = ".((int) $object->id); @@ -1740,6 +1760,7 @@ function on_change() { } print ''.$langs->trans("MinPrice").' '.$langs->trans("HT").''; print ''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''; + print ''.$langs->trans("Label").''; print ''.$langs->trans("ChangedBy").''; if ($user->hasRight('produit', 'supprimer')) { print ' '; @@ -1869,6 +1890,11 @@ function on_change() { } print ''; + // Price Label + print ''; + print $objp->price_label; + print ''; + // User print ''; if ($objp->user_id > 0) { @@ -1878,6 +1904,7 @@ function on_change() { } print ''; + // Action if ($user->hasRight('produit', 'supprimer')) { $candelete = 0; @@ -2014,6 +2041,14 @@ function on_change() { } print ''; + // Price Label + print ''; + print $langs->trans('PriceLabel'); + print ''; + print ''; + print ''; + print ''; + print ''; print ''; @@ -2101,6 +2136,16 @@ function on_change() { } print ''; + + + // Price Label + print ''; + print $langs->trans('PriceLabel'); + print ''; + print ''; + print ''; + print ''; + print ''; @@ -2164,6 +2209,7 @@ function on_change() { } print ''.$langs->trans("MinPrice").' '.$langs->trans("HT").''; print ''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''; + print ''.$langs->trans("PriceLabel").''; print ''.$langs->trans("ChangedBy").''; print ' '; print ''; @@ -2228,6 +2274,7 @@ function on_change() { print ''.price($line->price_min).''; print ''.price($line->price_min_ttc).''; + print ''.$line->price_label.''; // User $userstatic = new User($db); @@ -2272,7 +2319,7 @@ function on_change() { print ''."\n"; if (count($prodcustprice->lines) > 0 || $search_soc) { - $colspan = 9; + $colspan = 10; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") { $colspan++; } @@ -2301,6 +2348,7 @@ function on_change() { } print ''; print ''; + print ''; print ''; print ''; print ''; @@ -2360,6 +2408,7 @@ function on_change() { print ''; print ''; + print ''; print ''; if ($user->hasRight('produit', 'supprimer') || $user->hasRight('service', 'supprimer')) { @@ -2438,6 +2487,7 @@ function on_change() { print ''; print ''; + print ''; // User $userstatic = new User($db); diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php index e0630108c1aaa..e6515fa6c7dac 100644 --- a/htdocs/public/bookcal/index.php +++ b/htdocs/public/bookcal/index.php @@ -3,6 +3,7 @@ * Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2023 anthony Berton + * Copyright (C) 2024 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 @@ -94,7 +95,7 @@ $max_day_in_prev_month = date("t", dol_mktime(0, 0, 0, $prev_month, 1, $prev_year, 'gmt')); // Nb of days in previous month $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year)); // Nb of days in next month // tmpday is a negative or null cursor to know how many days before the 1st to show on month view (if tmpday=0, 1st is monday) -$tmpday = -date("w", dol_mktime(12, 0, 0, $month, 1, $year, 'gmt')) + 2; // date('w') is 0 for sunday +$tmpday = - (int) date("w", dol_mktime(12, 0, 0, $month, 1, $year, 'gmt')) + 2; // date('w') is 0 for sunday $tmpday += ((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1) - 1); if ($tmpday >= 1) { $tmpday -= 7; // If tmpday is 0 we start with sunday, if -6, we start with monday of previous week. @@ -398,13 +399,13 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ $numdayinweek = (($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7); if (!empty($conf->dol_optimize_smallscreen)) { print ' '."\n"; } else { print ' '."\n"; }
'.$langs->trans("MinPrice").' '.$langs->trans("HT").''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''.$langs->trans("PriceLabel").''.$langs->trans("ChangedBy").'
'.price($object->price_min).''.price($object->price_min_ttc).''.$object->price_label.''; print ''.price($line->price_min).''.price($line->price_min_ttc).''.$line->price_label.''; - $labelshort = array(0=>'SundayMin', 1=>'MondayMin', 2=>'TuesdayMin', 3=>'WednesdayMin', 4=>'ThursdayMin', 5=>'FridayMin', 6=>'SaturdayMin'); + $labelshort = array(0 => 'SundayMin', 1 => 'MondayMin', 2 => 'TuesdayMin', 3 => 'WednesdayMin', 4 => 'ThursdayMin', 5 => 'FridayMin', 6 => 'SaturdayMin'); print $langs->trans($labelshort[$numdayinweek]); print ' '; //$labelshort = array(0=>'SundayMin', 1=>'MondayMin', 2=>'TuesdayMin', 3=>'WednesdayMin', 4=>'ThursdayMin', 5=>'FridayMin', 6=>'SaturdayMin'); - $labelshort = array(0=>'Sunday', 1=>'Monday', 2=>'Tuesday', 3=>'Wednesday', 4=>'Thursday', 5=>'Friday', 6=>'Saturday'); + $labelshort = array(0 => 'Sunday', 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday'); print $langs->trans($labelshort[$numdayinweek]); print '