Allow splits to be grouped back.
WHERE expiry_date is null";
$ok &= db_query($sql, $sql);
+ // Set ref to ref order. Usefull to track detail history (if move from orders)
+ $sql = "UPDATE ".TB_PREF."sales_order_details
+ NATURAL JOIN ".TB_PREF."sales_orders
+ SET ref = reference
+ WHERE ref is null";
+ $ok &= db_query($sql);
+
return $ok;
}
, hold_until_date
, required_date
, expiry_date
- ,comment";
+ ,comment
+ ,ref";
$from = TB_PREF."sales_order_details sod
JOIN ".TB_PREF."sales_orders so ON (so.order_no = sod.order_no
AND so.trans_type = sod.trans_type
->add($detail['stk_code'], 'stk_code')
->add($detail['description'], 'description')
->add($detail['unit_price'], 'unit_price', false)
- ->add($detail['discount_percent'], 'discount_percent', false);
+ ->add($detail['discount_percent'], 'discount_percent', false)
+ ->add($detail['ref'].":split:".$detail['id'], 'ref')
+ ;
foreach($splits as $split) {
$set = new SqlSet($common_set);
,_("Require By") => array('fun' => 'input_required_date_details', 'ord' => '')
,_("Expiry Date") => array('fun' => 'input_expiry_date_details', 'ord' => '')
,_("Comment") => array('fun' => 'input_comment_details', 'ord' => '')
+ ,_("Reference") => array( 'ord' => '')
,'<input id="checkAll" type="checkbox">' => array('fun' => 'input_check_details')
);
}