Fix paymentsalary undef (#26636)

* nom (deprecated) -> name

* fix phpstan undef propertties

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Eric 2023-11-18 16:32:02 +01:00 committed by GitHub
parent 3b252e50a3
commit 47702c0cfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -114,6 +114,25 @@ class PaymentSalary extends CommonObject
public $fk_user_modif;
/**
* @var int Types paiement
*/
public $type_code;
/**
* @var int Paiement label
*/
public $type_label;
/**
* @var bank_account description]
*/
public $bank_account;
/**
* @var validation date
*/
public $datev = '';
* @var int chid
* @deprecated
* @see $id from CommonObject
@ -195,10 +214,10 @@ class PaymentSalary extends CommonObject
if ($totalamount != 0) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_salary (entity, fk_salary, datec, datep, amount,";
$sql .= " fk_typepayment, num_payment, note, fk_user_author, fk_bank)";
$sql .= " VALUES (".((int) $conf->entity).", ".((int) $this->id).", '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->datepaye)."',";
$sql .= " VALUES (".((int) $conf->entity).", ".((int) $this->fk_salary).", '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->datep)."',";
$sql .= " ".price2num($totalamount).",";
$sql .= " ".((int) $this->paiementtype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".((int) $user->id).",";
$sql .= " ".((int) $this->fk_typepayment).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".((int) $user->id).",";
$sql .= " 0)";
$resql = $this->db->query($sql);
@ -535,8 +554,8 @@ class PaymentSalary extends CommonObject
// Insert payment into llx_bank
$bank_line_id = $acc->addline(
$this->datepaye,
$this->paiementtype, // Payment mode id or code ("CHQ or VIR for example")
$this->datep,
$this->fk_typepayment, // Payment mode id or code ("CHQ or VIR for example")
$label,
-$total,
$this->num_payment,