Old ineffective sql_trail superseded by new improved db_trail logging only calls...
[fa-stable.git] / sales / includes / db / payment_db.inc
index 766648533351281e718ebcde127902624c4722e8..7eb77dfb2dfcc42d161d692c3ba2f1845f230a3e 100644 (file)
@@ -25,7 +25,7 @@ function write_customer_payment($trans_no, $customer_id, $branch_id, $bank_accou
 {
        global $Refs;
 
-       begin_transaction();
+       begin_transaction(__FUNCTION__, func_get_args());
        $args = func_get_args(); while (count($args) < 12) $args[] = 0;
        $args = (object)array_combine(array('trans_no', 'customer_id', 'branch_id', 'bank_account', 
                'date_', 'ref', 'amount', 'discount', 'memo_','rate','charge', 'bank_amount'), $args);
@@ -78,14 +78,12 @@ function write_customer_payment($trans_no, $customer_id, $branch_id, $bank_accou
        if (($discount + $amount) != 0) {
        /* Now Credit Debtors account with receipts + discounts */
        $total += add_gl_trans_customer(ST_CUSTPAYMENT, $payment_no, $date_,
-               $debtors_account, 0, 0, -($discount + $amount), $customer_id,
-               "Cannot insert a GL transaction for the debtors account credit");
+               $debtors_account, 0, 0, -($discount + $amount), $customer_id);
        }
        if ($discount != 0)     {
                /* Now Debit discount account with discounts allowed*/
                $total += add_gl_trans_customer(ST_CUSTPAYMENT, $payment_no, $date_,
-                       $discount_account, 0, 0, $discount, $customer_id,
-                       "Cannot insert a GL transaction for the payment discount debit");
+                       $discount_account, 0, 0, $discount, $customer_id);
        }
 
        if ($charge != 0)       {
@@ -123,7 +121,7 @@ function write_customer_payment($trans_no, $customer_id, $branch_id, $bank_accou
 
 function void_customer_payment($type, $type_no)
 {
-       begin_transaction();
+       begin_transaction(__FUNCTION__, func_get_args());
 
        hook_db_prevoid($type, $type_no);
        void_bank_trans($type, $type_no, true);