X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=sales%2Fincludes%2Fsales_db.inc;h=fc6f290479c1e2b64348969da51b59bab84cf068;hb=2cb57633d2f3e27b0c2b2e7448564f467e21e1fd;hp=7f8b5e21cfb5eef85ab14eb5f663b7d1eb5a074f;hpb=80dd97a37f674cc3691fa04af4c29607067566b2;p=fa-stable.git diff --git a/sales/includes/sales_db.inc b/sales/includes/sales_db.inc index 7f8b5e21..fc6f2904 100644 --- a/sales/includes/sales_db.inc +++ b/sales/includes/sales_db.inc @@ -192,7 +192,7 @@ function set_document_parent($cart) db_query($sql, 'Child document link cannot be updated'); } - if ($cart->trans_type != 10) + if ($cart->trans_type != ST_SALESINVOICE) return 0; // the rest is batch invoice specific @@ -220,7 +220,7 @@ function set_document_parent($cart) //-------------------------------------------------------------------------------------------------- function get_parent_type($type) { - $parent_types = array( 11=>10, 10=>13, 13=>30 ); + $parent_types = array( ST_CUSTCREDIT => ST_SALESINVOICE, ST_SALESINVOICE => ST_CUSTDELIVERY, ST_CUSTDELIVERY => ST_SALESORDER ); return isset($parent_types[$type]) ? $parent_types[$type] : 0; } @@ -233,7 +233,7 @@ function update_parent_line($doc_type, $line_id, $qty_dispatched) if ($doc_type==0) return false; else { - if ($doc_type==30) + if ($doc_type==ST_SALESORDER) $sql = "UPDATE ".TB_PREF."sales_order_details SET qty_sent = qty_sent + $qty_dispatched WHERE id=$line_id";