X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fpurchasing_db.inc;h=eb4a1ac47057284908b04e82a7e4f79c7e3a7be8;hb=5a7ef37131354aabdcf04c639a903e5876b743e4;hp=745b175b2ec375260be392d531303f1f5aa253db;hpb=71d682a4c6063256396a3d8fe15f0c534b4cf46f;p=fa-stable.git diff --git a/purchasing/includes/purchasing_db.inc b/purchasing/includes/purchasing_db.inc index 745b175b..eb4a1ac4 100644 --- a/purchasing/includes/purchasing_db.inc +++ b/purchasing/includes/purchasing_db.inc @@ -33,14 +33,11 @@ include_once($path_to_root . "/purchasing/includes/db/suppliers_db.inc"); // $amount is in SUPPLIERS'S currency function add_gl_trans_supplier($type, $type_no, $date_, $account, $dimension, $dimension2, - $amount, $supplier_id, $err_msg="", $rate=0, $memo="") + $amount, $supplier_id, $rate=0, $memo="") { - if ($err_msg == "") - $err_msg = "The supplier GL transaction could not be inserted"; - return add_gl_trans($type, $type_no, $date_, $account, $dimension, $dimension2, $memo, $amount, get_supplier_currency($supplier_id), - PT_SUPPLIER, $supplier_id, $err_msg, $rate); + PT_SUPPLIER, $supplier_id, $rate); } //---------------------------------------------------------------------------------------- @@ -194,14 +191,15 @@ function add_direct_supp_trans($cart) $inv->ov_amount = $inv->ov_gst = $inv->ov_discount = 0; $total = 0; foreach($cart->line_items as $key => $line) { - $inv->add_grn_to_trans($line->grn_item_id, $line->po_detail_rec, $line->stock_id, + $inv->add_grn_to_trans($line->grn_item_id, $line->po_item_id, $line->stock_id, $line->item_description, $line->quantity, 0, $line->quantity, $line->price, $line->price, true, get_unit_cost($line->stock_id), ''); + $total += round2(($line->quantity * $line->price), user_price_dec()); } $inv->tax_overrides = $cart->tax_overrides; if (!$inv->tax_included) { - $taxes = $inv->get_taxes($inv->tax_group_id, 0, false); + $taxes = $inv->get_taxes(); foreach( $taxes as $taxitem) { $total += isset($taxitem['Override']) ? $taxitem['Override'] : $taxitem['Value']; }