shift
This commit is contained in:
@@ -131,7 +131,6 @@ class SalePayment < ApplicationRecord
|
||||
self.payment_status = "paid"
|
||||
payment_method = self.save!
|
||||
sale_update_payment_status(self.received_amount)
|
||||
|
||||
return payment_status
|
||||
end
|
||||
|
||||
@@ -146,7 +145,6 @@ class SalePayment < ApplicationRecord
|
||||
payment_method = self.save!
|
||||
|
||||
sale_update_payment_status(self.received_amount)
|
||||
|
||||
return payment_status
|
||||
end
|
||||
|
||||
@@ -161,7 +159,6 @@ class SalePayment < ApplicationRecord
|
||||
payment_method = self.save!
|
||||
|
||||
sale_update_payment_status(self.received_amount)
|
||||
|
||||
return payment_status
|
||||
end
|
||||
|
||||
@@ -175,7 +172,6 @@ class SalePayment < ApplicationRecord
|
||||
self.outstanding_amount = self.sale.grand_total- self.received_amount
|
||||
self.payment_status = "paid"
|
||||
payment_method = self.save!
|
||||
|
||||
sale_update_payment_status(self.received_amount)
|
||||
|
||||
return payment_status
|
||||
@@ -192,7 +188,6 @@ class SalePayment < ApplicationRecord
|
||||
self.outstanding_amount = self.sale.grand_total- self.received_amount
|
||||
self.payment_status = "paid"
|
||||
payment_method = self.save!
|
||||
|
||||
sale_update_payment_status(self.received_amount)
|
||||
|
||||
return payment_status
|
||||
@@ -220,7 +215,6 @@ class SalePayment < ApplicationRecord
|
||||
else
|
||||
sale_update_payment_status(0)
|
||||
end
|
||||
|
||||
return payment_status
|
||||
|
||||
end
|
||||
@@ -249,16 +243,20 @@ class SalePayment < ApplicationRecord
|
||||
self.sale.save!
|
||||
table_update_status(sObj)
|
||||
rebat(sObj)
|
||||
shift = ShiftSale.current_open_shift(self.sale.cashier_id)
|
||||
puts shift
|
||||
if !shift.nil?
|
||||
puts ">>>> shift >>>>>>"
|
||||
shift.update(self.sale)
|
||||
if paid_amount != "0.0"
|
||||
update_shift
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def update_shift
|
||||
shift = ShiftSale.current_open_shift(self.sale.cashier_id)
|
||||
if !shift.nil?
|
||||
shift.update(self.sale)
|
||||
end
|
||||
end
|
||||
|
||||
def table_update_status(sale_obj)
|
||||
status = true
|
||||
booking = Booking.find_by_sale_id(sale_obj.id)
|
||||
@@ -321,6 +319,8 @@ class SalePayment < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.sale_payment_id = SeedGenerator.generate_id(self.class.name, "SPI")
|
||||
|
||||
Reference in New Issue
Block a user