POS Promotion Flow (promotion by multiple items) _______________________________ - clear existing promotion items - loop item_details and push 'item_id' and 'quantity' to item_arr[] - sent ajax request to 'AjaxPosPromotionTrait.php' which include datetime, customer_id, item_arr AjaxPosPromotionTrait.php - query available promotions. - loop available promotion with item_arr. - if the promotion is match , add item to 'match_items[]' and add promotion value & match_items[] to '$this-promotions[]'. - return '$this->promotions[]' . ########################### SO > INV > GIN Flow _______________________________ regarding this flow,there will be 2 ways to create. - 1 SO > 1 or multi GIN > 1 or multi INV - Multi SO > 1 or multi GIN > multi INV - I created one more table to record SO_items 'good_issue_note_item_detail'. - for duplicated so items, i saved in good_issue_note_items table group by item_id. eg . SO-22/0001 (ItemA - 30qty) , SO-22/0002 (ItemA - 20qty) , SO-22/0003 (ItemA - 10qty) if user create above SOs in same time (multiple SO), i recored below. - good_issue_note_items >> ItemA - 60 quantity - good_issue_notoe_item_detail >> Item A , 30qty , so_id , so_detail_id >> Item A , 20qty , so_id , so_detail_id >> Item A , 10qty , so_id , so_detail_id User will see Item A - 60 quantity when create GIN . If he fill up GIN QTY , gin_qty will fill up in both 'good_issue_note_items' and 'good_issue_notoe_item_detail'. With that way, We can process SO multiple flow. ########################### Need to watch _______________________________ - ItemTransaction (sometime itemtransaction not recorded properly. I fixed it and hope everything fine. But still need to watch). - GLTransaction (sometime GLTransaction not recorded properly according to wrong user input).