X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fsales_db.inc;h=fc6f290479c1e2b64348969da51b59bab84cf068;hb=2cb57633d2f3e27b0c2b2e7448564f467e21e1fd;hp=de98c3b0ffbc6d4a97e2f05296b78c72c493a3c0;hpb=4a4e032fdf10fe2eacb0d268b97bed6ff06a3915;p=fa-stable.git diff --git a/sales/includes/sales_db.inc b/sales/includes/sales_db.inc index de98c3b0..fc6f2904 100644 --- a/sales/includes/sales_db.inc +++ b/sales/includes/sales_db.inc @@ -52,7 +52,7 @@ function add_gl_trans_customer($type, $type_no, $date_, $account, $dimension, $d return add_gl_trans($type, $type_no, $date_, $account, $dimension, $dimension2, "", $amount, get_customer_currency($customer_id), - payment_person_types::customer(), $customer_id, $err_msg, $rate); + PT_CUSTOMER, $customer_id, $err_msg, $rate); } //---------------------------------------------------------------------------------------- @@ -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";