[0004904] Customer Credit Note: fixed invalid inventory GL postings for service items.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 29 Jan 2020 07:49:29 +0000 (08:49 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 29 Jan 2020 07:49:29 +0000 (08:49 +0100)
sales/includes/db/sales_credit_db.inc

index 5f0382a6ad82d38358324e3ca5e87726c3dcdf2e..171c0a7e86a78711039b5c73443d8237966a8998 100644 (file)
@@ -211,7 +211,8 @@ function add_gl_trans_credit_costs($order, $order_line, $credit_no, $date_,
        $total = 0;
        /* insert gl_trans to credit stock and debit cost of sales at standard cost*/
        $unit_cost = get_unit_cost($order_line->stock_id);
-       if ($unit_cost != 0) {
+
+       if ($stock_gl_codes['mb_flag'] != 'D' && $unit_cost != 0) {
                /*first the cost of sales entry*/
 
                $total += add_gl_trans_std_cost(ST_CUSTCREDIT, $credit_no, $date_, $stock_gl_codes["cogs_account"],