fixed payment methods & license

This commit is contained in:
NyanLinHtut
2020-06-10 18:12:15 +06:30
parent f9db23b500
commit f6a35d214f
23 changed files with 187 additions and 202 deletions

View File

@@ -1,4 +1,7 @@
class SalePayment < ApplicationRecord
CARD = ['mpu', 'visa', 'master', 'jcb', 'unionpay']
self.primary_key = "sale_payment_id"
#primary key - need to be unique generated for multiple shops
@@ -11,7 +14,7 @@ class SalePayment < ApplicationRecord
attr_accessor :received_amount, :card_payment_reference, :voucher_no, :giftcard_no, :customer_id, :external_payment_status,:action_by
scope :credits, -> { where(payment_method: 'creditnote') }
scope :cards, -> { where(payment_method: PaymentMethodSetting.where("is_active='1'").pluck("payment_method")) }
scope :cards, -> { where(payment_method: ['mpu', 'visa', 'master', 'jcb', 'unionpay']) }
def self.sync_sale_payment_records(sale_payments)
if !sale_payments.nil?