X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fdb%2Fsales_credit_db.inc;h=0fb76057b1d9e059dbfe548be44132032e73545f;hb=9a98bb3bc7a94f1a8e47f8dab45a87c8b4212080;hp=869dc538accd3e148b33764763cc5ce5ff607be8;hpb=d23fa06617d0ea628c14a02d08e8b85d711444a5;p=fa-stable.git diff --git a/sales/includes/db/sales_credit_db.inc b/sales/includes/db/sales_credit_db.inc index 869dc538..0fb76057 100644 --- a/sales/includes/db/sales_credit_db.inc +++ b/sales/includes/db/sales_credit_db.inc @@ -180,6 +180,9 @@ function add_credit_movements_item(&$credit_note, &$credit_line, $credit_type, $price, $credited_invoice=0) { + //Chaitanya : Stamp current cost in stock moves $credit_line does not fetch cost + $curr_std_cost = get_standard_cost($credit_line->stock_id); + if ($credit_type == "Return") { $reference = "Return "; @@ -193,20 +196,20 @@ function add_credit_movements_item(&$credit_note, &$credit_line, if ($credited_invoice) $reference .= "Ex Inv: " . $credited_invoice; - add_stock_move_customer(ST_CUSTCREDIT, $credit_line->stock_id, - key($credit_note->trans_no), $credit_note->Location, - $credit_note->document_date, $reference, -$credit_line->qty_dispatched, - $credit_line->standard_cost, 0, $price, - $credit_line->discount_percent); - - } - add_stock_move_customer(ST_CUSTCREDIT, $credit_line->stock_id, - key($credit_note->trans_no), $credit_note->Location, - $credit_note->document_date, $reference, $credit_line->qty_dispatched, - $credit_line->standard_cost, 0, $price, - $credit_line->discount_percent); + add_stock_move_customer(ST_CUSTCREDIT, $credit_line->stock_id, + key($credit_note->trans_no), $credit_note->Location, + $credit_note->document_date, $reference, -$credit_line->qty_dispatched, + $curr_std_cost, 0, $price, + $credit_line->discount_percent); } + add_stock_move_customer(ST_CUSTCREDIT, $credit_line->stock_id, + key($credit_note->trans_no), $credit_note->Location, + $credit_note->document_date, $reference, $credit_line->qty_dispatched, + $curr_std_cost, 0, $price, + $credit_line->discount_percent); + +} //----------------------------------------------------------------------------------------