feat: update invoice and invoice line on time spend #24102

This commit is contained in:
Florian HENRY 2023-03-03 12:07:46 +01:00
parent a2a4078b04
commit dbbb860fb4
2 changed files with 8 additions and 1 deletions

View File

@ -128,6 +128,8 @@ class Task extends CommonObjectLine
public $timespent_thm;
public $timespent_note;
public $timespent_fk_product;
public $timespent_invoiceid;
public $timespent_invoicelineid;
public $comments = array();
@ -1736,6 +1738,8 @@ class Task extends CommonObjectLine
$sql .= " task_duration = ".((int) $this->timespent_duration).",";
$sql .= " fk_user = ".((int) $this->timespent_fk_user).",";
$sql .= " fk_product = ".((int) $this->timespent_fk_product).",";
$sql .= " invoice_id = ".((int) $this->timespent_invoiceid).",";
$sql .= " invoice_line_id = ".((int) $this->timespent_invoicelineid).",";
$sql .= " note = ".(isset($this->timespent_note) ? "'".$this->db->escape($this->timespent_note)."'" : "null");
$sql .= " WHERE rowid = ".((int) $this->timespent_id);

View File

@ -309,6 +309,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
}
$object->timespent_fk_user = GETPOST("userid_line", 'int');
$object->timespent_fk_product = GETPOST("fk_product", 'int');
$object->timespent_fk_product = GETPOST("fk_product", 'int');
$result = 0;
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
@ -336,8 +337,10 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
}
$object->timespent_fk_user = GETPOST("userid_line", 'int');
$object->timespent_fk_product = GETPOST("fk_product", 'int');
$object->timespent_invoiceid = GETPOST("invoiceid", 'int');
$object->timespent_invoicelineid = GETPOST("invoicelineid", 'int');
$result = 0;
if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) {
$result = $object->updateTimeSpent($user);