X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fsales_db.inc;h=5c4fffdb763b9d907731d531521448f609101c1e;hb=4c16d92ae1e1032f23e029d7d2f901a65a4223bc;hp=5c9d1142a9b79d475957f4769036236b7a4ab4f4;hpb=a7745dcfcf7cb50ab0e5301785dbd28f44601ea6;p=fa-stable.git diff --git a/sales/includes/sales_db.inc b/sales/includes/sales_db.inc index 5c9d1142..5c4fffdb 100644 --- a/sales/includes/sales_db.inc +++ b/sales/includes/sales_db.inc @@ -52,9 +52,9 @@ function get_price ($stock_id, $currency, $sales_type_id, $factor=null, $date=nu if ($date == null) $date = Today(); - if ($factor == null) + if ($factor === null) { - $myrow = get_sales_type(get_post('sales_type_id')); + $myrow = get_sales_type($sales_type_id); $factor = $myrow['factor']; } @@ -125,7 +125,7 @@ function set_document_parent($cart) if (count($cart->src_docs) == 1) { // if this child document has only one parent - update child link - $del_no = key($cart->src_docs); + $del_no = reset(array_keys($cart->src_docs)); $sql = 'UPDATE '.TB_PREF.'debtor_trans SET trans_link = ' . $del_no . ' WHERE type='.$cart->trans_type.' AND trans_no='. $inv_no ; @@ -169,7 +169,7 @@ function update_parent_line($doc_type, $line_id, $qty_dispatched) { $doc_type = get_parent_type($doc_type); - //echo "update line: $line_id, $doc_type, $qty_dispatch"; +// echo "update line: $line_id, $doc_type, $qty_dispatched"; if ($doc_type==0) return false; else {