osaka menu update and void tax calc fix

This commit is contained in:
Yan
2017-07-21 14:56:40 +06:30
parent 13e274eefb
commit 2e8c866761
4 changed files with 30 additions and 10 deletions

View File

@@ -21,6 +21,10 @@ class Origami::SaleEditController < BaseOrigamiController
@newsaleitem.is_taxable = 1
@newsaleitem.product_name = saleitemObj.product_name + " - void"
@newsaleitem.save
# re-calc tax
saleObj = Sale.find(saleitemObj.sale_id)
saleObj.compute_without_void
end
# def item_edit
@@ -56,6 +60,10 @@ class Origami::SaleEditController < BaseOrigamiController
# saleitemObj.remark = 'edit'
saleitemObj.product_name = saleitemObj.product_name + " - updated"
saleitemObj.save
# re-calc tax
saleObj = Sale.find(saleitemObj.sale_id)
saleObj.compute_without_void
end
@@ -71,6 +79,10 @@ class Origami::SaleEditController < BaseOrigamiController
end
end
saleitemObj.destroy
# re-calc tax
saleObj = Sale.find(saleitemObj.sale_id)
saleObj.compute_without_void
end
# remove all void items
@@ -85,6 +97,9 @@ class Origami::SaleEditController < BaseOrigamiController
end
item.save
end
# re-calc tax
saleObj.compute_without_void
end
def apply_void