Fix PhanTypeInvalidUnaryOperandNumeric & remove from exceptions
# Fix PhanTypeInvalidUnaryOperandNumeric & remove from exceptions Fix by casting result of date() or by adding typing hints. (This notification indicates a unary '-' or similar is performed on a value that may not be a number).
This commit is contained in:
parent
b6b4acf5f9
commit
69be3bbca6
8 changed files with 99 additions and 44 deletions
|
|
@ -14,7 +14,6 @@ return [
|
|||
// PhanUndeclaredConstant : 15+ occurrences
|
||||
// PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences
|
||||
// PhanTypeArraySuspiciousNull : 10+ occurrences
|
||||
// PhanTypeInvalidUnaryOperandNumeric : 8 occurrences
|
||||
// PhanRedefineFunctionInternal : 6 occurrences
|
||||
// PhanPluginUnsafeEval : 5 occurrences
|
||||
// PhanParamSuspiciousOrder : 4 occurrences
|
||||
|
|
@ -39,11 +38,10 @@ return [
|
|||
'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected'],
|
||||
'htdocs/categories/viewcat.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/collab/index.php' => ['PhanParamTooMany'],
|
||||
'htdocs/comm/action/index.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeArraySuspiciousNull', 'PhanTypeInvalidUnaryOperandNumeric'],
|
||||
'htdocs/comm/action/index.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeArraySuspiciousNull'],
|
||||
'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/comm/mailing/cibles.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/comm/mailing/info.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/accounting-files.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
|
||||
'htdocs/compta/bank/various_payment/card.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
|
|
@ -52,11 +50,9 @@ return [
|
|||
'htdocs/compta/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanParamTooMany'],
|
||||
'htdocs/compta/prelevement/create.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/sociales/class/paymentsocialcontribution.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
|
||||
'htdocs/compta/sociales/document.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/sociales/info.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/sociales/note.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
|
||||
'htdocs/compta/tva/document.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/actions_massactions.inc.php' => ['PhanPluginSuspiciousParamOrder'],
|
||||
'htdocs/core/class/commondocgenerator.class.php' => ['PhanTypeArraySuspiciousNull'],
|
||||
|
|
@ -85,12 +81,10 @@ 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/fourn/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/intracommreport/list.php' => ['PhanAccessPropertyStaticAsNonStatic'],
|
||||
'htdocs/loan/card.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/loan/class/paymentloan.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
|
||||
'htdocs/loan/document.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/loan/info.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/loan/note.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
|
|
@ -100,7 +94,6 @@ return [
|
|||
'htdocs/product/admin/product_tools.php' => ['PhanNoopStringLiteral'],
|
||||
'htdocs/product/card.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'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'],
|
||||
|
|
|
|||
|
|
@ -319,10 +319,10 @@ if (empty($mode) || $mode == 'show_month') {
|
|||
$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.
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2022-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2024 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
|
||||
|
|
@ -96,15 +97,15 @@ if (!$sortorder) {
|
|||
|
||||
|
||||
$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 @@ if (empty($entity)) {
|
|||
$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 @@ $listofchoices = array(
|
|||
//if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
$filesarray = array();
|
||||
|
||||
'@phan-var-force array<string,array{id:string,entity:string,date:string,date_due:string,paid:float|int,amount_ht:float|int,amount_ttc:float|int,amount_vat:float|int,amount_localtax1:float|int,amount_localtax2:float|int,amount_revenuestamp:float|int,ref:string,fk:string,item:string,thirdparty_name:string,thirdparty_code:string,country_code:string,vatnum:string,sens:string,currency:string,line?:string,name?:string,files?:mixed}> $filesarray';
|
||||
|
||||
$result = false;
|
||||
if (($action == 'searchfiles' || $action == 'dl')) {
|
||||
if (empty($date_start)) {
|
||||
|
|
@ -411,6 +415,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
|
|||
$nofile['link'] = '';
|
||||
$nofile['name'] = '';
|
||||
|
||||
|
||||
$filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile;
|
||||
} else {
|
||||
foreach ($files as $key => $file) {
|
||||
|
|
@ -446,8 +451,8 @@ if (($action == 'searchfiles' || $action == 'dl')) {
|
|||
}
|
||||
$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 @@ if ($result && $action == "dl" && !$error) {
|
|||
$zipname .= '_'.$project->ref;
|
||||
}
|
||||
}
|
||||
$zipname .='_export.zip';
|
||||
$zipname .= '_export.zip';
|
||||
|
||||
dol_delete_file($zipname);
|
||||
|
||||
|
|
@ -689,6 +694,7 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||
}
|
||||
|
||||
$TData = dol_sort_array($filesarray, $sortfield, $sortorder);
|
||||
'@phan-var-force array<string,array{id:string,entity:string,date:string,date_due:string,paid:float|int,amount_ht:float|int,amount_ttc:float|int,amount_vat:float|int,amount_localtax1:float|int,amount_localtax2:float|int,amount_revenuestamp:float|int,ref:string,fk:string,item:string,thirdparty_name:string,thirdparty_code:string,country_code:string,vatnum:string,sens:string,currency:string,line?:string,name?:string,files?:mixed}> $TData';
|
||||
|
||||
|
||||
$filename = dol_print_date($date_start, 'dayrfc', 'tzuserrel')."-".dol_print_date($date_stop, 'dayrfc', 'tzuserrel').'_export.zip';
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* 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>
|
||||
*
|
||||
* 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<float|int>
|
||||
*/
|
||||
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 @@ class PaymentSocialContribution extends CommonObject
|
|||
$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 @@ class PaymentSocialContribution extends CommonObject
|
|||
$acc = new Account($this->db);
|
||||
$acc->fetch($accountid);
|
||||
|
||||
$total = $this->total;
|
||||
$total = $this->amount;
|
||||
if ($mode == 'payment_sc') {
|
||||
$total = -$total;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 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
|
||||
|
|
@ -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<float|int>
|
||||
*/
|
||||
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 @@ class PaymentVAT extends CommonObject
|
|||
$acc = new Account($this->db);
|
||||
$acc->fetch($accountid);
|
||||
|
||||
$total = $this->total;
|
||||
$total = $this->amount;
|
||||
if ($mode == 'payment_vat') {
|
||||
$total = -$total;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 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
|
||||
|
|
@ -65,7 +66,13 @@ class PaymentExpenseReport extends CommonObject
|
|||
* @var int|string
|
||||
*/
|
||||
public $datep = '';
|
||||
/**
|
||||
* @var float|int
|
||||
*/
|
||||
public $amount; // Total amount of payment
|
||||
/**
|
||||
* @var array<float|int>
|
||||
*/
|
||||
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 @@ class PaymentExpenseReport extends CommonObject
|
|||
}
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2014-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
* Copyright (C) 2024 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
|
||||
|
|
@ -62,14 +63,23 @@ class PaymentLoan extends CommonObject
|
|||
public $datep = '';
|
||||
|
||||
/**
|
||||
* @var array Array of amounts
|
||||
* @var array<float|int> 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 @@ class PaymentLoan extends CommonObject
|
|||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2023 anthony Berton <anthony.berton@bb2a.fr>
|
||||
* Copyright (C) 2024 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
|
||||
|
|
@ -94,7 +95,7 @@ $next_month = $next['month'];
|
|||
$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 @@ if ($action == 'afteradd') {
|
|||
$numdayinweek = (($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7);
|
||||
if (!empty($conf->dol_optimize_smallscreen)) {
|
||||
print ' <td class="center bold uppercase tdfordaytitle'.($i == 0 ? ' borderleft' : '').'">';
|
||||
$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 ' </td>'."\n";
|
||||
} else {
|
||||
print ' <td class="center minwidth75 bold uppercase small tdoverflowmax50 tdfordaytitle'.($i == 0 ? ' borderleft' : '').'">';
|
||||
//$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 ' </td>'."\n";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue