Skip to content

Commit

Permalink
NEW: Add ID of the line in the trigger context for addLine(), updateL…
Browse files Browse the repository at this point in the history
…ine() and deleteLine() on contract
  • Loading branch information
kkhelifa-opendsi committed Jul 10, 2024
1 parent c3d89d8 commit 2331d63
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions htdocs/contrat/class/contrat.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,7 @@ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2,

if (empty($error)) {
// Call trigger
$this->context['line_id'] = $contractlineid;
$result = $this->call_trigger('LINECONTRACT_INSERT', $user);
if ($result < 0) {
$error++;
Expand Down Expand Up @@ -1827,6 +1828,7 @@ public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_star

if (empty($error)) {
// Call trigger
$this->context['line_id'] = $rowid;
$result = $this->call_trigger('LINECONTRACT_MODIFY', $user);
if ($result < 0) {
$this->db->rollback();
Expand Down Expand Up @@ -1861,6 +1863,7 @@ public function deleteLine($idline, User $user)

if ($this->statut >= 0) {
// Call trigger
$this->context['line_id'] = $idline;
$result = $this->call_trigger('LINECONTRACT_DELETE', $user);
if ($result < 0) {
return -1;
Expand Down

0 comments on commit 2331d63

Please sign in to comment.