From 0fa7e2267c1e7326c392e1155eda67a5a9775015 Mon Sep 17 00:00:00 2001 From: Xacobo Freire Date: Thu, 6 Jun 2019 16:00:38 +0200 Subject: [PATCH] Error when transferring ticket --- inc/ticket.class.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/inc/ticket.class.php b/inc/ticket.class.php index 6615947..81843de 100644 --- a/inc/ticket.class.php +++ b/inc/ticket.class.php @@ -59,10 +59,24 @@ static function deleteOldCosts($ID) { static function generateCosts($item) { global $DB; - if ($item->input['status']==5) { + $addcost=true; + if (!array_key_exists('status', $item->input)) { + if($item->fields['status']==5){ + $entities_id=$item->input['entities_id']; + }else{ + $addcost=false; + } + }else{ + if ($item->input['status']==5) { + $entities_id=$item->fields['entities_id']; + }else{ + $addcost=false; + } + } + + if ($addcost) { $ticket_id=$item->input['id']; - $entities_id=$item->fields['entities_id']; self::deleteOldCosts($ticket_id);