FIX : num_payment on llx_salary is useless
This commit is contained in:
parent
ca8d2a671d
commit
ff97a41386
@ -148,7 +148,6 @@ if ($action == 'add' && empty($cancel))
|
|||||||
$object->dateep = $dateep;
|
$object->dateep = $dateep;
|
||||||
$object->note = GETPOST("note", 'none');
|
$object->note = GETPOST("note", 'none');
|
||||||
$object->type_payment = ($type_payment > 0 ? $type_payment : 0);
|
$object->type_payment = ($type_payment > 0 ? $type_payment : 0);
|
||||||
$object->num_payment = GETPOST("num_payment", 'alphanohtml');
|
|
||||||
$object->fk_user_author = $user->id;
|
$object->fk_user_author = $user->id;
|
||||||
$object->fk_project = $projectid;
|
$object->fk_project = $projectid;
|
||||||
|
|
||||||
|
|||||||
@ -64,7 +64,6 @@ class Salary extends CommonObject
|
|||||||
public $fk_project;
|
public $fk_project;
|
||||||
|
|
||||||
public $type_payment;
|
public $type_payment;
|
||||||
public $num_payment;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string salary payments label
|
* @var string salary payments label
|
||||||
@ -142,7 +141,6 @@ class Salary extends CommonObject
|
|||||||
$sql .= " amount=".price2num($this->amount).",";
|
$sql .= " amount=".price2num($this->amount).",";
|
||||||
$sql .= " fk_projet=".((int) $this->fk_project).",";
|
$sql .= " fk_projet=".((int) $this->fk_project).",";
|
||||||
$sql .= " fk_typepayment=".$this->type_payment.",";
|
$sql .= " fk_typepayment=".$this->type_payment.",";
|
||||||
$sql .= " num_payment='".$this->db->escape($this->num_payment)."',";
|
|
||||||
$sql .= " label='".$this->db->escape($this->label)."',";
|
$sql .= " label='".$this->db->escape($this->label)."',";
|
||||||
$sql .= " datesp='".$this->db->idate($this->datesp)."',";
|
$sql .= " datesp='".$this->db->idate($this->datesp)."',";
|
||||||
$sql .= " dateep='".$this->db->idate($this->dateep)."',";
|
$sql .= " dateep='".$this->db->idate($this->dateep)."',";
|
||||||
@ -215,7 +213,6 @@ class Salary extends CommonObject
|
|||||||
$sql .= " s.amount,";
|
$sql .= " s.amount,";
|
||||||
$sql .= " s.fk_projet as fk_project,";
|
$sql .= " s.fk_projet as fk_project,";
|
||||||
$sql .= " s.fk_typepayment,";
|
$sql .= " s.fk_typepayment,";
|
||||||
$sql .= " s.num_payment,";
|
|
||||||
$sql .= " s.label,";
|
$sql .= " s.label,";
|
||||||
$sql .= " s.datesp,";
|
$sql .= " s.datesp,";
|
||||||
$sql .= " s.dateep,";
|
$sql .= " s.dateep,";
|
||||||
@ -249,7 +246,6 @@ class Salary extends CommonObject
|
|||||||
$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->num_payment = $obj->num_payment;
|
|
||||||
$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);
|
||||||
@ -410,7 +406,6 @@ class Salary extends CommonObject
|
|||||||
$sql .= ", salary";
|
$sql .= ", salary";
|
||||||
$sql .= ", fk_typepayment";
|
$sql .= ", fk_typepayment";
|
||||||
$sql .= ", fk_account";
|
$sql .= ", fk_account";
|
||||||
$sql .= ", num_payment";
|
|
||||||
if ($this->note) $sql .= ", note";
|
if ($this->note) $sql .= ", note";
|
||||||
$sql .= ", label";
|
$sql .= ", label";
|
||||||
$sql .= ", datesp";
|
$sql .= ", datesp";
|
||||||
@ -429,7 +424,6 @@ class Salary extends CommonObject
|
|||||||
$sql .= ", ".($this->salary > 0 ? $this->salary : "null");
|
$sql .= ", ".($this->salary > 0 ? $this->salary : "null");
|
||||||
$sql .= ", ".($this->type_payment > 0 ? $this->type_payment : 0);
|
$sql .= ", ".($this->type_payment > 0 ? $this->type_payment : 0);
|
||||||
$sql .= ", ".($this->accountid > 0 ? $this->accountid : "null");
|
$sql .= ", ".($this->accountid > 0 ? $this->accountid : "null");
|
||||||
$sql .= ", '".$this->db->escape($this->num_payment)."'";
|
|
||||||
if ($this->note) $sql .= ", '".$this->db->escape($this->note)."'";
|
if ($this->note) $sql .= ", '".$this->db->escape($this->note)."'";
|
||||||
$sql .= ", '".$this->db->escape($this->label)."'";
|
$sql .= ", '".$this->db->escape($this->label)."'";
|
||||||
$sql .= ", '".$this->db->idate($this->datesp)."'";
|
$sql .= ", '".$this->db->idate($this->datesp)."'";
|
||||||
@ -450,13 +444,6 @@ class Salary extends CommonObject
|
|||||||
{
|
{
|
||||||
if (!empty($conf->banque->enabled) && !empty($this->amount))
|
if (!empty($conf->banque->enabled) && !empty($this->amount))
|
||||||
{
|
{
|
||||||
// Insert into llx_bank
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
|
||||||
|
|
||||||
$acc = new Account($this->db);
|
|
||||||
$result = $acc->fetch($this->accountid);
|
|
||||||
if ($result <= 0) dol_print_error($this->db);
|
|
||||||
|
|
||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (!$error)
|
if (!$error)
|
||||||
|
|||||||
@ -112,7 +112,7 @@ $userstatic = new User($db);
|
|||||||
$accountstatic = new Account($db);
|
$accountstatic = new Account($db);
|
||||||
|
|
||||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,";
|
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,";
|
||||||
$sql .= " s.rowid, s.fk_account, s.paye, s.fk_user, s.amount, s.salary, s.label, s.datesp as datesp, s.dateep as dateep, s.fk_typepayment as type, s.num_payment, s.fk_bank,";
|
$sql .= " s.rowid, s.fk_account, s.paye, s.fk_user, s.amount, s.salary, s.label, s.datesp as datesp, s.dateep as dateep, s.fk_typepayment as type, s.fk_bank,";
|
||||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel,";
|
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel,";
|
||||||
$sql .= " pst.code as payment_code,";
|
$sql .= " pst.code as payment_code,";
|
||||||
$sql .= " SUM(ps.amount) as alreadypayed";
|
$sql .= " SUM(ps.amount) as alreadypayed";
|
||||||
@ -310,7 +310,7 @@ if ($result)
|
|||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
// Account
|
// Account
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user