foc pdf fixed
This commit is contained in:
@@ -142,9 +142,6 @@ class SalePayment < ApplicationRecord
|
||||
remark = "#{self.sale_payment_id}||#{shift_sale_id} -> #{remark}"
|
||||
|
||||
sale_audit = SaleAudit.record_payment(invoice.id, remark, action_by.name)
|
||||
if payment_method == "cash"
|
||||
update_shift_for_credit_payment
|
||||
end
|
||||
else
|
||||
sale_audit = SaleAudit.record_payment(invoice.id, remark, action_by.name)
|
||||
end
|
||||
@@ -377,12 +374,8 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
private
|
||||
def cash_payment(payment_for=false)
|
||||
status = false
|
||||
|
||||
sale_payments_data = SalePayment.find_by_sale_id(self.sale_id)
|
||||
if sale_payments_data.nil?
|
||||
status = true
|
||||
end
|
||||
|
||||
payment_status = false
|
||||
|
||||
self.payment_method = "cash"
|
||||
@@ -397,8 +390,11 @@ class SalePayment < ApplicationRecord
|
||||
self.payment_status = "paid"
|
||||
payment_status = self.save!
|
||||
if !payment_for
|
||||
sale_update_payment_status(self.received_amount,status)
|
||||
sale_update_payment_status(self.received_amount)
|
||||
else
|
||||
update_shift_for_credit_payment()
|
||||
end
|
||||
|
||||
balance_amount =0.0
|
||||
outstanding_amount =0.0
|
||||
if self.sale.grand_total.to_f > self.received_amount.to_f
|
||||
|
||||
Reference in New Issue
Block a user