X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fdb%2Fgrn_db.inc;h=24e421a6c3078c37b7e5bac16b8d2b7da2dc065a;hb=d6cbf4c364cbdf94409597e87bea9b555ae86451;hp=df35e23db60577bda56800421bfbcc337bf679e1;hpb=2f85dd59adb080270e39d0e52edc8af9a60175b1;p=fa-stable.git diff --git a/purchasing/includes/db/grn_db.inc b/purchasing/includes/db/grn_db.inc index df35e23d..24e421a6 100644 --- a/purchasing/includes/db/grn_db.inc +++ b/purchasing/includes/db/grn_db.inc @@ -117,8 +117,8 @@ function add_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->receive_qty * $order_line->taxfree_charge_price($po), $po->supplier_id); - update_average_material_cost($po->supplier_id, $order_line->stock_id, $order_line->taxfree_charge_price($po), + $order_line->receive_qty * $order_line->taxfree_charge_price($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->receive_qty, $date_); } //---------------------------------------------------------------------------------------------------------------- @@ -143,7 +143,7 @@ function add_grn(&$po) /* Update location stock records - NB a po cannot be entered for a service/kit parts done automatically */ add_stock_move(ST_SUPPRECEIVE, $order_line->stock_id, $grn, $po->Location, $date_, "", $order_line->receive_qty, $order_line->standard_cost, - $po->supplier_id, 1, $order_line->price); + $po->supplier_id, 1, $order_line->taxfree_charge_price($po)); } /*quantity received is != 0 */ } /*end of order_line loop */ @@ -364,7 +364,7 @@ function read_grn($grn_batch, &$order) $order->trans_type = ST_SUPPRECEIVE; $order->orig_order_date = sql2date($row["delivery_date"]); - $order->location = $row["loc_code"]; + $order->Location = $row["loc_code"]; $order->reference = $row["reference"]; read_grn_items_to_order($grn_batch, $order);