From f2c8908ca06da547851a22417c79d90a61114115 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Fri, 28 Nov 2008 22:49:44 +0000 Subject: [PATCH] extending the delivery period to avoid early invoice --- purchasing/includes/db/invoice_db.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index 2e35c96..ae19c7e 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -217,7 +217,7 @@ function add_supp_invoice($supp_trans) // do not receive as ref because we chang // always return due to change in currency. $mat_cost = update_average_material_cost(null, $entered_grn->item_code, $diff, $entered_grn->this_quantity_inv, $old_date, true); - $deliveries = get_deliveries_between($entered_grn->item_code, $old_date, $date_); + $deliveries = get_deliveries_between($entered_grn->item_code, $old_date, Today()); // extend the period, if invoice is before any deliveries. if ($deliveries[0] != 0) // have deliveries been done during the period? { $deliveries[1] /= $deliveries[0]; -- 2.30.2