New tax system implementation.
[fa-stable.git] / purchasing / includes / db / grn_db.inc
index 740ef18ca4713c06480b085f330781324a5ae86d..886e05fc5f5c2b3cb6082d740a06b0ab0c284172 100644 (file)
@@ -25,7 +25,8 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date,
                $currency = null;
 
        if ($supp['tax_included'])
-               $price = get_tax_free_price_for_item($stock_id, $price, $supp['tax_group_id'],
+               $price = get_tax_free_price_for_item(ST_SUPPINVOICE, // ?
+               $stock_id, $price, $supp['tax_group_id'],
                        $supp['tax_included']);
 
        if ($currency != null)
@@ -85,7 +86,7 @@ function write_grn(&$po)
 {
        global $Refs;
 
-       $date_ = $po->orig_order_date;
+       $date_ = $po->tran_date;
        $grn = $po->grn_id;
 
        begin_transaction();
@@ -404,7 +405,7 @@ function read_grn($grn_batch, &$order)
        {
 
                $order->trans_type = ST_SUPPRECEIVE;
-               $order->orig_order_date = sql2date($row["delivery_date"]);
+               $order->tran_date = sql2date($row["delivery_date"]);
                $order->Location = $row["loc_code"];
                $order->reference = $row["reference"];
                $order->grn_id = $grn_batch;