2
0
forked from Wavyzz/dolibarr

fix (scrutinizer) replace datepaid by datep and in payment replacement of the variable that receives the value

This commit is contained in:
FLIO
2023-01-31 22:55:04 +01:00
parent fadc50b152
commit dbe7f659cc
2 changed files with 3 additions and 4 deletions

View File

@@ -111,7 +111,6 @@ class PaymentExpenseReport extends CommonObject
$error = 0;
$now = dol_now();
// Validate parameters
if (!$this->datep) {
$this->error = 'ErrorBadValueForParameterCreatePaymentExpenseReport';
@@ -170,7 +169,7 @@ class PaymentExpenseReport extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_expensereport (fk_expensereport, datec, datep, amount,";
$sql .= " fk_typepayment, num_payment, note, fk_user_creat, fk_bank)";
$sql .= " VALUES ($this->fk_expensereport, '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->datepaid)."',";
$sql .= " '".$this->db->idate($this->datep)."',";
$sql .= " ".price2num($totalamount).",";
$sql .= " ".((int) $this->fk_typepayment).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".((int) $user->id).",";
$sql .= " 0)"; // fk_bank is ID of transaction into ll_bank

View File

@@ -107,8 +107,8 @@ if ($action == 'add_payment') {
// Create a line of payments
$payment = new PaymentExpenseReport($db);
$payment->fk_expensereport = $expensereport->id;
$payment->datepaid = $datepaid;
$payment->amounts = $amounts; // Tableau de montant
$payment->datep = $datepaid;
$payment->amounts = $amounts; // Tableau de montant
$payment->total = $total;
$payment->fk_typepayment = GETPOST("fk_typepayment", 'int');
$payment->num_payment = GETPOST("num_payment", 'alphanothtml');