kbzpay
This commit is contained in:
@@ -102,7 +102,6 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
|
||||
|
||||
#TODO :: KBZPAY ( QR )
|
||||
# On/Off setting ( show or not qr )
|
||||
# qrCode = "00020101021202021110500346KBZ005ab0ed5c1ed09d1c4585ff1313170389160831435294600062000040732kp1e78f7efddca190042638341afb88d50200006KBZPay0106KBZPay5303MMK5802MM62170813PAY_BY_QRCODE64060002my6304FBBD"
|
||||
@@ -169,8 +168,8 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
# salePayment = SalePayment.find(sale_payment_id)
|
||||
# salePayment.process_kbz_payment(salePayment.sale_id, sale_data.grand_total, cash, 'paid')
|
||||
# else
|
||||
# sp = SalePayment.where('sale_id=? and payment_method=? and payment_status=?', sale_id, 'kbzpay', 'paid').last
|
||||
if sp.nil? #is_kbz
|
||||
sp = SalePayment.where('sale_id=? and payment_method=? and payment_status=?', sale_id, 'kbzpay', 'paid').last
|
||||
if is_kbz == 'false'
|
||||
Rails.logger.info '################ CASH PAYMENT #################'
|
||||
sale_payment = SalePayment.new
|
||||
if path.include? ("credit_payment")
|
||||
|
||||
@@ -31,7 +31,7 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
def self.get_kbz_pay_amount(sale_id, current_user)
|
||||
amount = 0
|
||||
sale_payment = SalePayment.where('sale_id=? and payment_status!=?', sale_id, 'dead').last
|
||||
sale_payment = SalePayment.where('sale_id=? and payment_method=? and payment_status!=?', sale_id, KbzPay::KBZ_PAY, 'dead').last
|
||||
if !sale_payment.nil?
|
||||
if sale_payment.payment_status == 'pending'
|
||||
amount = KbzPay.query(sale_payment.id, current_user)
|
||||
@@ -631,6 +631,7 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
def sale_update_payment_status(paid_amount,check_foc = false)
|
||||
#update amount_outstanding
|
||||
Rails.logger.info '####### SALE UPDATE PAYMENT STATUS #######'
|
||||
self.sale.amount_received = self.sale.amount_received.to_f + paid_amount.to_f
|
||||
self.sale.save!
|
||||
self.sale.amount_changed = self.sale.amount_received.to_f - self.sale.grand_total.to_f
|
||||
@@ -656,6 +657,10 @@ class SalePayment < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
Rails.logger.info self.sale.grand_total
|
||||
Rails.logger.info all_received_amount
|
||||
Rails.logger.info '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
|
||||
|
||||
if (self.sale.grand_total <= all_received_amount) && method_status
|
||||
if is_credit == 0
|
||||
self.sale.payment_status = "paid"
|
||||
@@ -669,7 +674,7 @@ class SalePayment < ApplicationRecord
|
||||
self.sale.payment_status = "foc"
|
||||
end
|
||||
|
||||
if is_kbz_pay > 0
|
||||
if is_kbz_pay == 1
|
||||
self.sale.payment_status = 'paid'
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
application_path="#{File.expand_path("../..", __FILE__)}"
|
||||
directory application_path
|
||||
environment ENV.fetch("RAILS_ENV") { "production" }
|
||||
#environment ENV.fetch("RAILS_ENV") { "production" }
|
||||
environment "production"
|
||||
pidfile "#{application_path}/tmp/puma/pid"
|
||||
state_path "#{application_path}/tmp/puma/state"
|
||||
|
||||
Reference in New Issue
Block a user