- -$delivery_line->qty_dispatched, $delivery_line->standard_cost,1,
- $line_price, $delivery_line->discount_percent);
+ -$delivery_line->qty_dispatched, $delivery_line->standard_cost,
+ $line_price*(1-$delivery_line->discount_percent));
+
+ $mb_flag = get_mb_flag($delivery_line->stock_id);
+
+ if (is_fixed_asset($mb_flag)) {
+ $sql = "UPDATE ".TB_PREF."stock_master SET inactive=1
+ WHERE stock_id=".db_escape($delivery_line->stock_id);
+ db_query($sql,"The cost details for the fixed asset could not be updated");
+ }