From: Joe Date: Sat, 24 Jan 2015 09:25:32 +0000 (+0100) Subject: Fixed Delivery note bug : Parent constraints not working if sales order line deleted... X-Git-Tag: 2.3-final~74 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=ad37f5bcbd52fa5e7429719eac1a5526aa378b05 Fixed Delivery note bug : Parent constraints not working if sales order line deleted after delivery --- diff --git a/sales/includes/cart_class.inc b/sales/includes/cart_class.inc index a363562e..8a4e11e6 100644 --- a/sales/includes/cart_class.inc +++ b/sales/includes/cart_class.inc @@ -168,6 +168,11 @@ class cart while (($line_no < count($this->line_items)) && ($srcline = db_fetch($srcdetails))) { $line = &$this->line_items[$line_no]; $src_docs[] = $src_type == ST_SALESORDER ? $srcline['order_no'] : $srcline['debtor_trans_no']; + while($srcline['id'] != $line->src_id) // Logic : This will increment the line_items array till sales_order line is matched. + { // 0002259: Fixes Delivery note bug : Parent constraints not working if sales order line deleted after delivery + $line_no++; + $line = &$this->line_items[$line_no]; + } if ($srcline['id'] == $line->src_id) { if ($this->trans_type == ST_SALESINVOICE) $line->src_no = $srcline['debtor_trans_no'];