This commit is contained in:
Alexandre SPANGARO 2022-06-20 03:56:09 +02:00
parent e792b07154
commit 295bda4806

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr> /* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr> * Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -94,6 +94,10 @@ class Salary extends CommonObject
*/ */
public $user; public $user;
/**
* 1 if salary paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code)
*/
public $paye;
const STATUS_UNPAID = 0; const STATUS_UNPAID = 0;
const STATUS_PAID = 1; const STATUS_PAID = 1;
@ -218,8 +222,6 @@ class Salary extends CommonObject
$sql .= " s.fk_user_author,"; $sql .= " s.fk_user_author,";
$sql .= " s.fk_user_modif,"; $sql .= " s.fk_user_modif,";
$sql .= " s.fk_account"; $sql .= " s.fk_account";
/*$sql .= " b.fk_type,";
$sql .= " b.rappro";*/
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s"; $sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
@ -231,28 +233,26 @@ class Salary extends CommonObject
if ($this->db->num_rows($resql)) { if ($this->db->num_rows($resql)) {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->tms = $this->db->jdate($obj->tms); $this->tms = $this->db->jdate($obj->tms);
$this->fk_user = $obj->fk_user; $this->fk_user = $obj->fk_user;
$this->datep = $this->db->jdate($obj->datep); $this->datep = $this->db->jdate($obj->datep);
$this->datev = $this->db->jdate($obj->datev); $this->datev = $this->db->jdate($obj->datev);
$this->amount = $obj->amount; $this->amount = $obj->amount;
$this->fk_project = $obj->fk_project; $this->fk_project = $obj->fk_project;
$this->type_payment = $obj->fk_typepayment; $this->type_payment = $obj->fk_typepayment;
$this->label = $obj->label; $this->label = $obj->label;
$this->datesp = $this->db->jdate($obj->datesp); $this->datesp = $this->db->jdate($obj->datesp);
$this->dateep = $this->db->jdate($obj->dateep); $this->dateep = $this->db->jdate($obj->dateep);
$this->note = $obj->note; $this->note = $obj->note;
$this->paye = $obj->paye; $this->paye = $obj->paye;
$this->fk_bank = $obj->fk_bank; $this->fk_bank = $obj->fk_bank;
$this->fk_user_author = $obj->fk_user_author; $this->fk_user_author = $obj->fk_user_author;
$this->fk_user_modif = $obj->fk_user_modif; $this->fk_user_modif = $obj->fk_user_modif;
$this->fk_account = $this->accountid = $obj->fk_account; $this->fk_account = $this->accountid = $obj->fk_account;
$this->fk_type = $obj->fk_type;
$this->rappro = $obj->rappro;
// Retreive all extrafield // Retrieve all extrafield
// fetch optionals attributes and labels // fetch optionals attributes and labels
$this->fetch_optionals(); $this->fetch_optionals();
} }