// 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 ";
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);
+
+}
//----------------------------------------------------------------------------------------