fix minus addorder.js and void and other origami

This commit is contained in:
Yan
2017-11-26 22:23:37 +06:30
parent 6eb3d9399e
commit 87a27250b7
7 changed files with 111 additions and 99 deletions

View File

@@ -8,12 +8,19 @@ class Origami::VoidController < BaseOrigamiController
sale = Sale.find_by_sale_id(sale_id)
# update count for shift sale
# if(sale.sale_status == "completed")
if(sale.sale_status == "completed")
if sale.shift_sale_id != nil
shift = ShiftSale.find(sale.shift_sale_id)
shift.calculate(sale_id, "void")
end
# end
else
# void before sale payment complete
if sale.shift_sale_id != nil
shift = ShiftSale.find(sale.shift_sale_id)
shift.total_void = shift.total_void + sale.grand_total
shift.save
end
end
sale.payment_status = 'void'
sale.sale_status = 'void'
@@ -95,4 +102,8 @@ class Origami::VoidController < BaseOrigamiController
end
end
def void_before_pay
end
end