check tax profile process
This commit is contained in:
@@ -208,8 +208,7 @@ class SalePayment < ApplicationRecord
|
||||
self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f
|
||||
self.payment_status = "paid"
|
||||
payment_method = self.save!
|
||||
sale_update_payment_status(self.received_amount)
|
||||
|
||||
sale_update_payment_status(self.received_amount)
|
||||
return payment_status
|
||||
end
|
||||
|
||||
@@ -325,7 +324,7 @@ class SalePayment < ApplicationRecord
|
||||
sObj = Sale.find(self.sale_id)
|
||||
is_credit = 0
|
||||
is_foc = 0
|
||||
is_cash = false
|
||||
method_status = false
|
||||
sObj.sale_payments.each do |spay|
|
||||
all_received_amount += spay.payment_amount.to_f
|
||||
if spay.payment_method == "creditnote"
|
||||
@@ -334,12 +333,12 @@ class SalePayment < ApplicationRecord
|
||||
if spay.payment_method == "foc"
|
||||
is_foc = 1
|
||||
end
|
||||
if spay.payment_method.to_s == "cash"
|
||||
is_cash = true
|
||||
if spay.payment_method == "cash" || spay.payment_method == "foc" || spay.payment_method == "creditnote"
|
||||
method_status = true
|
||||
end
|
||||
end
|
||||
|
||||
if (self.sale.grand_total <= all_received_amount) && is_cash
|
||||
if (self.sale.grand_total <= all_received_amount) && method_status
|
||||
if is_credit == 0
|
||||
self.sale.payment_status = "paid"
|
||||
else
|
||||
@@ -386,7 +385,7 @@ class SalePayment < ApplicationRecord
|
||||
elsif paid_amount.to_f > 0 #|| paid_amount != "0.0"
|
||||
table_update_status(sObj)
|
||||
update_shift
|
||||
elsif is_cash && paid_amount.to_f == 0
|
||||
elsif method_status && paid_amount.to_f == 0
|
||||
table_update_status(sObj)
|
||||
update_shift
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user