if (is_array($trans_no)) $trans_no = key($trans_no);
begin_transaction();
+ $delivery->bo_policy = $bo_policy;
+ hook_db_prewrite($delivery, ST_CUSTDELIVERY);
$customer = get_customer($delivery->customer_id);
$delivery_items_total = $delivery->get_items_total_dispatch();
$stock_gl_code = get_stock_gl_code($delivery_line->stock_id);
/* insert gl_trans to credit stock and debit cost of sales at standard cost*/
- if ($delivery_line->standard_cost != 0) {
+ if (is_inventory_item($delivery_line->stock_id) && $delivery_line->standard_cost != 0) {
/*first the cost of sales entry*/
// 2008-08-01. If there is a Customer Dimension, then override with this,
$Refs->save(ST_CUSTDELIVERY, $delivery_no, $delivery->reference);
}
+ hook_db_postwrite($delivery, ST_CUSTDELIVERY);
commit_transaction();
return $delivery_no;
if ($transactions)
begin_transaction();
+ hook_db_prevoid($type, $type_no);
+
void_gl_trans($type, $type_no, true);
// reverse all the changes in the sales order