X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fdb%2Finvoice_db.inc;h=11ce9f931ca33d0c4835a8c9184c5600055ab0fa;hb=9a1b3abd5371ad7f6315db1d56f8356587444314;hp=94748d514958aca17fc820bcf9885a140cd64fa3;hpb=e39803c300ad0071a20d0c1977b5db6d79aa91c4;p=fa-stable.git diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index 94748d51..11ce9f93 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -119,7 +119,7 @@ function get_diff_in_home_currency($supplier, $old_date, $date, $amount1, $amoun } //---------------------------------------------------------------------------------------- -function add_supp_invoice(&$supp_trans) // do not receive as ref because we change locally +function add_supp_invoice(&$supp_trans) { global $Refs; @@ -308,7 +308,7 @@ function add_supp_invoice(&$supp_trans) // do not receive as ref because we chan $currency = get_supplier_currency($supp_trans->supplier_id); $total += add_gl_trans_supplier($trans_type, $invoice_id, $date_, $iv_act, - $dim, $dim2, $entered_grn->this_quantity_inv * $old_price, $supp_trans->supplier_id, "", $ex_rate); + $dim, $dim2, $old_value, $supp_trans->supplier_id, "", $ex_rate); $diff = get_diff_in_home_currency($supp_trans->supplier_id, $old_date, $date_, $old_value, $taxfree_line); @@ -597,7 +597,7 @@ function void_supp_invoice($type, $type_no) //Chaitanya : Post a journal entry $id = get_next_trans_no(ST_JOURNAL); - $ref = $Refs->get_next(ST_JOURNAL); + $ref = $Refs->get_next(ST_JOURNAL, null, $date_); add_journal(ST_JOURNAL, $id, $details_row["quantity"] * $diff, $old_date, get_company_currency(), $ref); $stock_id = $details_row["stock_id"]; $stock_gl_code = get_stock_gl_code($stock_id); @@ -675,7 +675,7 @@ function remove_not_invoice_item($id) $price = get_tax_free_price_for_item($myrow['item_code'], $myrow['unit_price'], $supp['tax_group_id'], $supp['tax_included']); add_stock_move(ST_SUPPRECEIVE, $myrow["item_code"], $myrow['grn_batch_id'], $grn['loc_code'], sql2date($grn["delivery_date"]), "", - -$myrow["QtyOstdg"], $myrow['std_cost_unit'], $grn["supplier_id"], 1, $price); + -$myrow["QtyOstdg"], $myrow['std_cost_unit'], $price); $clearing_act = get_company_pref('grn_clearing_act'); if ($clearing_act) { // otherwise GRN clearing account is not used