From 20a29dd033237c2329c6ca3152cb17135e6c4f66 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Sat, 27 Jun 2009 17:44:09 +0000 Subject: [PATCH] AVG matr price again again --- purchasing/includes/db/invoice_db.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index e55fd1df..a7a7cba4 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -405,6 +405,8 @@ function void_supp_invoice($type, $type_no) { begin_transaction(); + $trans = get_supp_trans($type_no, $type); + void_bank_trans($type, $type_no, true); void_gl_trans($type, $type_no, true); @@ -447,7 +449,7 @@ function void_supp_invoice($type, $type_no) } else { - $diff = get_diff_in_home_currency($grn["supplier_id"], $old_date, $old_date_, $old[2], + $diff = get_diff_in_home_currency($grn["supplier_id"], $old_date, sql2date($trans['tran_date']), $old[2], $details_row["FullUnitPrice"]); // Only adjust the avg for the diff $mat_cost = update_average_material_cost(null, $details_row["stock_id"], -- 2.30.2