X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fdb%2Finvoice_db.inc;h=83e9f7f83a4dfa6c1453f8d2b4aa6f8f251187f5;hb=0120b8a14201e37a62cac64070a2ece2014f9682;hp=cc5b5cb875345ac33a207ccdb0082ced35a02eb3;hpb=28e5f95d81850e496e1b0387126e7bb836da61c5;p=fa-stable.git diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index cc5b5cb8..83e9f7f8 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -124,6 +124,8 @@ function add_supp_invoice($supp_trans, $invoice_no=0) // do not receive as ref b $supplier = get_supplier($supp_trans->supplier_id); + add_new_exchange_rate($supplier['curr_code'], $supp_trans->tran_date, $supp_trans->ex_rate); + foreach ($taxes as $n => $taxitem) { $taxes[$n]['Value'] = round2($taxitem['Value'], user_price_dec()); @@ -137,7 +139,7 @@ function add_supp_invoice($supp_trans, $invoice_no=0) // do not receive as ref b { $taxes = $supp_trans->get_taxes($supp_trans->tax_group_id); foreach ($taxes as $n => $taxitem) - $item_added_tax += isset($taxitem['Override']) ? $taxitem['Override'] : round2($taxitem['Value'], $dec); + $item_added_tax += isset($taxitem['Override']) ? $taxitem['Override'] : round2($taxitem['Value'], user_price_dec()); } $trans_type = $supp_trans->trans_type;