X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fdb%2Finvoice_db.inc;h=008e27cb31a68fe2e9a2c4da4d38c9a64b4668fe;hb=00e2b370d611a95a8deb43f2859edd5cc6792713;hp=3bd100302c7860aacad78f9f08bd9be0a400a049;hpb=f44132511cc91b83f20f91af0625d4b112b4c26e;p=fa-stable.git diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index 3bd10030..008e27cb 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -354,7 +354,7 @@ function add_supp_invoice(&$supp_trans) } add_or_update_purchase_data($supp_trans->supplier_id, $entered_grn->item_code, $entered_grn->chg_price); } - + update_purchase_value($entered_grn->item_code, $entered_grn->chg_price * $ex_rate); add_supp_invoice_item($trans_type, $invoice_id, $entered_grn->item_code, $entered_grn->item_description, 0, $entered_grn->chg_price, $line_tax/$entered_grn->this_quantity_inv, $entered_grn->this_quantity_inv, $entered_grn->id, $entered_grn->po_detail_item, ""); @@ -367,8 +367,9 @@ function add_supp_invoice(&$supp_trans) $Refs->save($trans_type, $invoice_id, $supp_trans->reference); - if ($supp_trans->src_docs) + if (count($supp_trans->src_docs) == 1) { + $invoice_no = key($supp_trans->src_docs); $invoice_alloc_balance = get_supp_trans_allocation_balance(ST_SUPPINVOICE, $supp_trans->src_docs); if ($invoice_alloc_balance > 0) { //the invoice is not already fully allocated @@ -495,7 +496,8 @@ function read_supp_invoice($trans_no, $trans_type, &$supp_trans) } else { - $supp_trans->add_gl_codes_to_trans($details_row["gl_code"], get_gl_account_name($details_row["gl_code"]), 0, 0, + $supp_trans->add_gl_codes_to_trans($details_row["gl_code"], get_gl_account_name($details_row["gl_code"]), + $details_row["dimension_id"], $details_row["dimension2_id"], $details_row["FullUnitPrice"], $details_row["memo_"], $details_row["dimension_id"], $details_row["dimension2_id"]); } }