From: Janusz Dobrowolski Date: Fri, 12 Jul 2019 19:48:58 +0000 (+0200) Subject: Passing error message parameter err_msg to low level db functions from caller does... X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=2917915beba9540193b520f1de59de9e6a33be56 Passing error message parameter err_msg to low level db functions from caller does not help in debugging, removed. --- diff --git a/gl/includes/db/gl_db_bank_trans.inc b/gl/includes/db/gl_db_bank_trans.inc index 8c63f645..1bea79a3 100644 --- a/gl/includes/db/gl_db_bank_trans.inc +++ b/gl/includes/db/gl_db_bank_trans.inc @@ -16,7 +16,7 @@ // $date_ is display date (non-sql) function add_bank_trans($type, $trans_no, $bank_act, $ref, $date_, - $amount, $person_type_id, $person_id, $currency="", $err_msg="", $rate=0) + $amount, $person_type_id, $person_id, $currency="", $rate=0) { $sqlDate = date2sql($date_); @@ -41,10 +41,7 @@ function add_bank_trans($type, $trans_no, $bank_act, $ref, $date_, ".db_escape($amount_bank).", ".db_escape($person_type_id) .", ". db_escape($person_id).")"; - if ($err_msg == "") - $err_msg = "The bank transaction could not be inserted"; - - db_query($sql, $err_msg); + db_query($sql, "The bank transaction could not be inserted"); } //---------------------------------------------------------------------------------------- diff --git a/gl/includes/db/gl_db_banking.inc b/gl/includes/db/gl_db_banking.inc index a7ad5576..a2cf9f78 100644 --- a/gl/includes/db/gl_db_banking.inc +++ b/gl/includes/db/gl_db_banking.inc @@ -237,8 +237,7 @@ function add_bank_transfer($from_account, $to_account, $date_, add_bank_trans($trans_type, $trans_no, $from_account, $ref, $date_, -($amount + $charge), - PT_MISC, $person_id, $currency, - "Cannot insert a source bank transaction"); + PT_MISC, $person_id, $currency); if ($SysPrefs->auto_currency_revaluation()) { $trans_no1 = get_next_trans_no(ST_JOURNAL); @@ -270,8 +269,7 @@ function add_bank_transfer($from_account, $to_account, $date_, 0, 0, _("Exchange Variance"), -$total); add_bank_trans($trans_type, $trans_no, $to_account, $ref, - $date_, $to_amount, PT_MISC, $person_id, - $to_currency, "Cannot insert a destination bank transaction"); + $date_, $to_amount, PT_MISC, $person_id); if ($SysPrefs->auto_currency_revaluation()) { @@ -467,8 +465,7 @@ function write_bank_transaction($trans_type, $trans_no, $from_account, $items, $ add_bank_trans($trans_type, $trans_no, $from_account, $ref, $date_, -$total_amount, $person_type_id, $person_id, - $currency, - "Cannot insert a source bank transaction"); + $currency); $total = 0; foreach ($items->gl_items as $gl_item) { @@ -489,8 +486,7 @@ function write_bank_transaction($trans_type, $trans_no, $from_account, $items, $ { add_bank_trans($trans_type, $trans_no, $is_bank_to, $ref, $date_, $gl_item->amount, - $person_type_id, $person_id, $currency, - "Cannot insert a destination bank transaction"); + $person_type_id, $person_id, $currency); if ($do_exchange_variance) { add_exchange_variation($trans_no1, $date_, $is_bank_to, $gl_item->code_id, diff --git a/gl/includes/db/gl_db_trans.inc b/gl/includes/db/gl_db_trans.inc index 55d1ccc4..229ba2d1 100644 --- a/gl/includes/db/gl_db_trans.inc +++ b/gl/includes/db/gl_db_trans.inc @@ -17,7 +17,7 @@ // if $currency is not set, then defaults to no conversion function add_gl_trans($type, $trans_id, $date_, $account, $dimension, $dimension2, $memo_, - $amount, $currency=null, $person_type_id=null, $person_id=null, $err_msg="", $rate=0) + $amount, $currency=null, $person_type_id=null, $person_id=null, $rate=0) { global $SysPrefs; @@ -63,10 +63,7 @@ function add_gl_trans($type, $trans_id, $date_, $account, $dimension, $dimension $sql .= ") "; - if ($err_msg == "") - $err_msg = "The GL transaction could not be inserted"; - - db_query($sql, $err_msg); + db_query($sql, "The GL transaction could not be inserted"); return $amount_in_home_currency; } @@ -77,12 +74,12 @@ function add_gl_trans($type, $trans_id, $date_, $account, $dimension, $dimension // $amount is in HOME currency function add_gl_trans_std_cost($type, $trans_id, $date_, $account, $dimension, $dimension2, - $memo_, $amount, $person_type_id=null, $person_id=null, $err_msg="") + $memo_, $amount, $person_type_id=null, $person_id=null) { if ($amount != 0) return add_gl_trans($type, $trans_id, $date_, $account, $dimension, $dimension2, $memo_, - $amount, null, $person_type_id, $person_id, $err_msg); + $amount, null, $person_type_id, $person_id); else return 0; } @@ -96,7 +93,7 @@ function add_gl_balance($type, $trans_id, $date_, $amount, $person_type_id=null, { error_log(sprintf( _("Rounding error %s encountered for trans_type:%s,trans_no:%s"), $amount, $type, $trans_id)); return add_gl_trans($type, $trans_id, $date_, get_company_pref('exchange_diff_act'), 0, 0, "", - $amount, null, $person_type_id, $person_id, "The balanced GL transaction could not be inserted"); + $amount, null, $person_type_id, $person_id); } else return 0; } diff --git a/includes/ui/items_cart.inc b/includes/ui/items_cart.inc index 416719e1..a9bcc579 100644 --- a/includes/ui/items_cart.inc +++ b/includes/ui/items_cart.inc @@ -367,7 +367,7 @@ class items_cart $gl->date = $this->tran_date; $total_gl += add_gl_trans($this->trans_type, $this->order_id, $gl->date, $gl->code_id, $gl->dimension_id, $gl->dimension2_id, - $gl->reference, $gl->amount, $this->currency, $gl->person_type_id, $gl->person_id, "", $this->rate); + $gl->reference, $gl->amount, $this->currency, $gl->person_type_id, $gl->person_id, $this->rate); // post to first found bank account using given gl acount code. $is_bank_to = is_bank_account($gl->code_id); @@ -397,8 +397,7 @@ class items_cart // update bank ledger if used foreach($bank_trans as $bank_id => $amount) add_bank_trans($this->trans_type, $this->order_id, $bank_id, $this->reference, - $this->tran_date, $amount, 0, "", $this->currency, - "Cannot insert a destination bank transaction"); + $this->tran_date, $amount, 0, "", $this->currency); // add AP/AR for journal transaction if ($this->trans_type == ST_JOURNAL) diff --git a/manufacturing/includes/db/work_order_costing_db.inc b/manufacturing/includes/db/work_order_costing_db.inc index 99cd1a5c..3641d8f7 100644 --- a/manufacturing/includes/db/work_order_costing_db.inc +++ b/manufacturing/includes/db/work_order_costing_db.inc @@ -135,8 +135,7 @@ function add_wo_costs_journal($wo_id, $amount, $cost_type, $cr_acc, $date, $dim1 if ($is_bank_to) { add_bank_trans(ST_JOURNAL, $journal_id, $is_bank_to, "", - $date, -$amount, PT_WORKORDER, $wo_id, get_company_currency(), - "Cannot insert a destination bank transaction"); + $date, -$amount, PT_WORKORDER, $wo_id, get_company_currency()); } add_journal(ST_JOURNAL, $journal_id, $amount, $date, get_company_currency(), $ref, '', 1, $date, $date); diff --git a/purchasing/includes/db/grn_db.inc b/purchasing/includes/db/grn_db.inc index 886e05fc..948f2c06 100644 --- a/purchasing/includes/db/grn_db.inc +++ b/purchasing/includes/db/grn_db.inc @@ -129,7 +129,7 @@ function write_grn(&$po) if ($clearing_act) $total += add_gl_trans_supplier(ST_SUPPRECEIVE, $grn, $date_, $stock_gl_code["inventory_account"], $stock_gl_code['dimension_id'], $stock_gl_code['dimension2_id'], - $order_line->taxfree_charge_value($po), $po->supplier_id, '', 0, $order_line->stock_id); + $order_line->taxfree_charge_value($po), $po->supplier_id, 0, $order_line->stock_id); update_average_material_cost($po->supplier_id, $order_line->stock_id, $order_line->price, $order_line->quantity, $date_); } diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index e2da684c..de085139 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -151,7 +151,7 @@ function add_supp_invoice(&$supp_trans) //, $already_voided=false, $allocs=null // store basic transaction info $invoice_id = write_supp_trans($trans_type, 0, $supp_trans->supplier_id, $supp_trans->tran_date, $supp_trans->due_date, - $supp_trans->reference, $supp_trans->supp_reference, 0, 0, 0, "", $supp_trans->ex_rate, $supp_trans->tax_included); + $supp_trans->reference, $supp_trans->supp_reference, 0, 0, 0, $supp_trans->ex_rate, $supp_trans->tax_included); if ($trans_no) move_trans_attachments($trans_type, $trans_no, $invoice_id); diff --git a/purchasing/includes/db/supp_payment_db.inc b/purchasing/includes/db/supp_payment_db.inc index 8cbc4413..40bafa3f 100644 --- a/purchasing/includes/db/supp_payment_db.inc +++ b/purchasing/includes/db/supp_payment_db.inc @@ -44,20 +44,20 @@ function write_supp_payment($trans_no, $supplier_id, $bank_account, /* Create a supp_trans entry for the supplier payment */ $payment_id = write_supp_trans(ST_SUPPAYMENT, 0, $supplier_id, $date_, $date_, - $ref, "", -$supp_amount, 0, -$supp_discount, "", $rate); + $ref, "", -$supp_amount, 0, -$supp_discount, $rate); // Now debit creditors account with payment + discount $total = 0; $supplier_accounts = get_supplier_accounts($supplier_id); $total += add_gl_trans_supplier(ST_SUPPAYMENT, $payment_id, $date_, $supplier_accounts["payable_account"], 0, 0, - $supp_amount + $supp_discount, $supplier_id, "", $rate); + $supp_amount + $supp_discount, $supplier_id, $rate); // Now credit discount received account with discounts if ($supp_discount != 0) { $total += add_gl_trans_supplier(ST_SUPPAYMENT, $payment_id, $date_, $supplier_accounts["payment_discount_account"], 0, 0, - -$supp_discount, $supplier_id, "", $rate); + -$supp_discount, $supplier_id, $rate); } if ($bank_charge != 0) diff --git a/purchasing/includes/db/supp_trans_db.inc b/purchasing/includes/db/supp_trans_db.inc index 618ddeeb..f9781392 100644 --- a/purchasing/includes/db/supp_trans_db.inc +++ b/purchasing/includes/db/supp_trans_db.inc @@ -14,7 +14,7 @@ // FIXME - this should be revised for transaction update case. // function write_supp_trans($type, $trans_no, $supplier_id, $date_, $due_date, $reference, $supp_reference, - $amount, $amount_tax, $discount, $err_msg="", $rate=0, $included=0) + $amount, $amount_tax, $discount, $rate=0, $included=0) { $new = $trans_no==0; $date = date2sql($date_); @@ -39,10 +39,7 @@ function write_supp_trans($type, $trans_no, $supplier_id, $date_, $due_date, $re ".db_escape($reference).", ".db_escape($supp_reference).", ".db_escape($amount) .", ".db_escape($amount_tax).", ".db_escape($rate).", ".db_escape($discount).", ".db_escape($included).")"; - if ($err_msg == "") - $err_msg = "Cannot insert a supplier transaction record"; - - db_query($sql, $err_msg); + db_query($sql, "Cannot insert a supplier transaction record"); add_audit_trail($type, $trans_no, $date_); return $trans_no; diff --git a/purchasing/includes/purchasing_db.inc b/purchasing/includes/purchasing_db.inc index 745b175b..cffd2210 100644 --- a/purchasing/includes/purchasing_db.inc +++ b/purchasing/includes/purchasing_db.inc @@ -33,14 +33,11 @@ include_once($path_to_root . "/purchasing/includes/db/suppliers_db.inc"); // $amount is in SUPPLIERS'S currency function add_gl_trans_supplier($type, $type_no, $date_, $account, $dimension, $dimension2, - $amount, $supplier_id, $err_msg="", $rate=0, $memo="") + $amount, $supplier_id, $rate=0, $memo="") { - if ($err_msg == "") - $err_msg = "The supplier GL transaction could not be inserted"; - return add_gl_trans($type, $type_no, $date_, $account, $dimension, $dimension2, $memo, $amount, get_supplier_currency($supplier_id), - PT_SUPPLIER, $supplier_id, $err_msg, $rate); + PT_SUPPLIER, $supplier_id, $rate); } //---------------------------------------------------------------------------------------- diff --git a/sales/includes/db/payment_db.inc b/sales/includes/db/payment_db.inc index 76664853..9560179f 100644 --- a/sales/includes/db/payment_db.inc +++ b/sales/includes/db/payment_db.inc @@ -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) { diff --git a/sales/includes/db/sales_credit_db.inc b/sales/includes/db/sales_credit_db.inc index 6c3a8f28..43b6e308 100644 --- a/sales/includes/db/sales_credit_db.inc +++ b/sales/includes/db/sales_credit_db.inc @@ -136,14 +136,12 @@ function write_credit_note(&$credit_note, $write_off_acc) $total += add_gl_trans_customer(ST_CUSTCREDIT, $credit_no, $credit_date, $branch_data["receivables_account"], 0, 0, -($credit_note_total + $credit_note->freight_cost + $items_added_tax + $freight_added_tax), - $credit_note->customer_id, - "The total debtor GL posting for the credit note could not be inserted"); + $credit_note->customer_id); } if ($credit_note->freight_cost != 0) { $total += add_gl_trans_customer(ST_CUSTCREDIT, $credit_no, $credit_date, $company_data["freight_act"], 0, 0, - $credit_note->get_tax_free_shipping(), $credit_note->customer_id, - "The freight GL posting for this credit note could not be inserted"); + $credit_note->get_tax_free_shipping(), $credit_note->customer_id); } foreach ($taxes as $taxitem) { @@ -156,8 +154,7 @@ function write_credit_note(&$credit_note, $write_off_acc) $credit_note->document_date, $credit_note->reference, TR_OUTPUT, $credit_note->tax_group_id); $total += add_gl_trans_customer(ST_CUSTCREDIT, $credit_no, $credit_date, $taxitem['sales_gl_code'], 0, 0, - $taxitem['Value'], $credit_note->customer_id, - "A tax GL posting for this credit note could not be inserted"); + $taxitem['Value'], $credit_note->customer_id); } } /*Post a balance post if $total != 0 */ @@ -216,8 +213,7 @@ function add_gl_trans_credit_costs($order, $order_line, $credit_no, $date_, $total += add_gl_trans_std_cost(ST_CUSTCREDIT, $credit_no, $date_, $stock_gl_codes["cogs_account"], $dim, $dim2, "", -($unit_cost * $order_line->qty_dispatched), - PT_CUSTOMER, $order->customer_id, - "The cost of sales GL posting could not be inserted"); + PT_CUSTOMER, $order->customer_id); /*now the stock entry*/ if ($credit_type == "WriteOff") { @@ -229,8 +225,7 @@ function add_gl_trans_credit_costs($order, $order_line, $credit_no, $date_, $total += add_gl_trans_std_cost(ST_CUSTCREDIT, $credit_no, $date_, $stock_entry_account, 0, 0, "", ($unit_cost * $order_line->qty_dispatched), - PT_CUSTOMER, $order->customer_id, - "The stock side (or write off) of the cost of sales GL posting could not be inserted"); + PT_CUSTOMER, $order->customer_id); } /* end of if GL and stock integrated and standard cost !=0 */ @@ -253,15 +248,13 @@ function add_gl_trans_credit_costs($order, $order_line, $credit_no, $date_, else $sales_account = $stock_gl_codes['sales_account']; $total += add_gl_trans_customer(ST_CUSTCREDIT, $credit_no, $date_, $sales_account, $dim, $dim2, - ($line_taxfree_price * $order_line->qty_dispatched), $order->customer_id, - "The credit note GL posting could not be inserted"); + ($line_taxfree_price * $order_line->qty_dispatched), $order->customer_id); if ($order_line->discount_percent != 0) { $total += add_gl_trans_customer(ST_CUSTCREDIT, $credit_no, $date_, $branch_data["sales_discount_account"], $dim, $dim2, -($line_taxfree_price * $order_line->qty_dispatched * $order_line->discount_percent), - $order->customer_id, - "The credit note discount GL posting could not be inserted"); + $order->customer_id); } /*end of if discount !=0 */ } /*if line_price!=0 */ diff --git a/sales/includes/db/sales_delivery_db.inc b/sales/includes/db/sales_delivery_db.inc index f1ae7a8a..18faa0be 100644 --- a/sales/includes/db/sales_delivery_db.inc +++ b/sales/includes/db/sales_delivery_db.inc @@ -120,7 +120,7 @@ function write_sales_delivery(&$delivery,$bo_policy) $sales_account = ($branch_data['sales_account'] != "" ? $branch_data['sales_account'] : $stock_gl_code['sales_account']); $total += add_gl_trans_customer(ST_CUSTDELIVERY, $delivery_no, $delivery->document_date, $sales_account, $dim, $dim2, - -$line_taxfree_price, $delivery->customer_id, "The sales price GL posting could not be inserted"); + -$line_taxfree_price, $delivery->customer_id); } /* insert gl_trans to credit stock and debit cost of sales at standard cost*/ @@ -133,20 +133,17 @@ function write_sales_delivery(&$delivery,$bo_policy) add_gl_trans_std_cost(ST_CUSTDELIVERY, $delivery_no, $delivery->document_date, $stock_gl_code["adjustment_account"], $dim, $dim2, "", $fa_depreciation, - PT_CUSTOMER, $delivery->customer_id, - "The cost of sales GL posting could not be inserted"); + PT_CUSTOMER, $delivery->customer_id); /*then remove asset*/ add_gl_trans_std_cost(ST_CUSTDELIVERY, $delivery_no, $delivery->document_date, $stock_gl_code["inventory_account"], 0, 0, "", -$fa_purchase_cost, - PT_CUSTOMER, $delivery->customer_id, - "The stock side of the cost of sales GL posting could not be inserted"); + PT_CUSTOMER, $delivery->customer_id); /*finally adjust sales account with the remaining*/ add_gl_trans_std_cost(ST_CUSTDELIVERY, $delivery_no, $delivery->document_date, $stock_gl_code["cogs_account"], 0, 0, "", ($fa_purchase_cost - $fa_depreciation), - PT_CUSTOMER, $delivery->customer_id, - "The stock side of the cost of sales GL posting could not be inserted"); + PT_CUSTOMER, $delivery->customer_id); } // Invetory Items else if ($delivery_line->unit_cost != 0) { @@ -154,15 +151,13 @@ function write_sales_delivery(&$delivery,$bo_policy) add_gl_trans_std_cost(ST_CUSTDELIVERY, $delivery_no, $delivery->document_date, $stock_gl_code["cogs_account"], $dim, $dim2, "", $delivery_line->unit_cost * $delivery_line->qty_dispatched, - PT_CUSTOMER, $delivery->customer_id, - "The cost of sales GL posting could not be inserted"); + PT_CUSTOMER, $delivery->customer_id); /*now the stock entry*/ add_gl_trans_std_cost(ST_CUSTDELIVERY, $delivery_no, $delivery->document_date, $stock_gl_code["inventory_account"], 0, 0, "", (-$delivery_line->unit_cost * $delivery_line->qty_dispatched), - PT_CUSTOMER, $delivery->customer_id, - "The stock side of the cost of sales GL posting could not be inserted"); + PT_CUSTOMER, $delivery->customer_id); } } /* end of if GL and stock integrated and standard cost !=0 */ @@ -174,7 +169,7 @@ function write_sales_delivery(&$delivery,$bo_policy) { $deferred_act = get_company_pref('deferred_income_act'); add_gl_trans_customer(ST_CUSTDELIVERY, $delivery_no, $delivery->document_date, $deferred_act, 0, 0, - -$total, $delivery->customer_id, "The deferred income GL posting could not be inserted"); + -$total, $delivery->customer_id); } if ($bo_policy == 0) { diff --git a/sales/includes/db/sales_invoice_db.inc b/sales/includes/db/sales_invoice_db.inc index 376a6c84..96ba23a6 100644 --- a/sales/includes/db/sales_invoice_db.inc +++ b/sales/includes/db/sales_invoice_db.inc @@ -143,15 +143,13 @@ function write_sales_invoice(&$invoice) $dim2 = ($invoice->dimension2_id != $customer['dimension2_id'] ? $invoice->dimension2_id : ($customer['dimension2_id'] != 0 ? $customer["dimension2_id"] : $stock_gl_code["dimension2_id"])); $total += add_gl_trans_customer(ST_SALESINVOICE, $invoice_no, $date_, $sales_account, $dim, $dim2, - -$line_taxfree_price*$prepaid_factor, - $invoice->customer_id, "The sales price GL posting could not be inserted"); + -$line_taxfree_price*$prepaid_factor, $invoice->customer_id); if ($invoice_line->discount_percent != 0) { $total += add_gl_trans_customer(ST_SALESINVOICE, $invoice_no, $date_, $branch_data["sales_discount_account"], $dim, $dim2, - ($line_taxfree_price * $invoice_line->discount_percent)*$prepaid_factor, - $invoice->customer_id, "The sales discount GL posting could not be inserted"); + ($line_taxfree_price * $invoice_line->discount_percent)*$prepaid_factor, $invoice->customer_id); } /*end of if discount !=0 */ } } /*quantity dispatched is more than 0 */ @@ -159,15 +157,13 @@ function write_sales_invoice(&$invoice) if (($items_total + $charge_shipping) != 0) { $total += add_gl_trans_customer(ST_SALESINVOICE, $invoice_no, $date_, $branch_data["receivables_account"], 0, 0, - ($items_total + $charge_shipping + $items_added_tax + $freight_added_tax)*$prepaid_factor, - $invoice->customer_id, "The total debtor GL posting could not be inserted"); + ($items_total + $charge_shipping + $items_added_tax + $freight_added_tax)*$prepaid_factor, $invoice->customer_id); } $to_allocate = ($items_total + $charge_shipping + $items_added_tax + $freight_added_tax); if ($charge_shipping != 0) { $total += add_gl_trans_customer(ST_SALESINVOICE, $invoice_no, $date_, $company_data["freight_act"], 0, 0, - -$invoice->get_tax_free_shipping()*$prepaid_factor, $invoice->customer_id, - "The freight GL posting could not be inserted"); + -$invoice->get_tax_free_shipping()*$prepaid_factor, $invoice->customer_id); } // post all taxes foreach ($taxes as $taxitem) { @@ -178,8 +174,7 @@ function write_sales_invoice(&$invoice) $taxitem['Net'], $ex_rate, $date_, $invoice->reference, TR_OUTPUT, $invoice->tax_group_id); if (isset($taxitem['sales_gl_code']) && !empty($taxitem['sales_gl_code']) && $taxitem['Value'] != 0) $total += add_gl_trans_customer(ST_SALESINVOICE, $invoice_no, $date_, $taxitem['sales_gl_code'], 0, 0, - (-$taxitem['Value'])*$prepaid_factor, $invoice->customer_id, - "A tax GL posting could not be inserted"); + (-$taxitem['Value'])*$prepaid_factor, $invoice->customer_id); } } diff --git a/sales/includes/sales_db.inc b/sales/includes/sales_db.inc index d1cabba5..7f0a752f 100644 --- a/sales/includes/sales_db.inc +++ b/sales/includes/sales_db.inc @@ -33,14 +33,11 @@ include_once($path_to_root . "/sales/includes/db/customers_db.inc"); // $amount is in CUSTOMER'S currency function add_gl_trans_customer($type, $type_no, $date_, $account, $dimension, $dimension2, - $amount, $customer_id, $err_msg="", $rate=0) + $amount, $customer_id, $rate=0) { - if ($err_msg == "") - $err_msg = "The customer GL transaction could not be inserted"; - return add_gl_trans($type, $type_no, $date_, $account, $dimension, $dimension2, "", $amount, get_customer_currency($customer_id), - PT_CUSTOMER, $customer_id, $err_msg, $rate); + PT_CUSTOMER, $customer_id, $rate); } //----------------------------------------------------------------------------------------