X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fdb%2Fsales_credit_db.inc;h=d5be9c44b0b16a4a00d7b7e9637ac43f038d6187;hb=1e4cd218cd0b7e1093b4b63d6636f5360b3c7958;hp=ce1cb17f14ae5fd9097cc7ab5476eaf530a4fa37;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git diff --git a/sales/includes/db/sales_credit_db.inc b/sales/includes/db/sales_credit_db.inc index ce1cb17f..d5be9c44 100644 --- a/sales/includes/db/sales_credit_db.inc +++ b/sales/includes/db/sales_credit_db.inc @@ -171,10 +171,14 @@ function write_credit_note(&$credit_note, $write_off_acc) // Insert a stock movement coming back in to show the credit note and // a reversing stock movement to show the write off // + 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 "; @@ -188,20 +192,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); + +} //----------------------------------------------------------------------------------------