some wrong in memberdiscount and no pay if any card payment
This commit is contained in:
@@ -145,17 +145,6 @@ class SaleItem < ApplicationRecord
|
||||
return price,type
|
||||
end
|
||||
|
||||
# Check for Card Payment
|
||||
def self.get_sale_payments_by_card(sale_payments)
|
||||
|
||||
# Check for Card Payment
|
||||
sale_payments.each do |sp|
|
||||
if sp.payment_method == "jcb" || sp.payment_method == "mpu" || sp.payment_method == "visa" || sp.payment_method == "master"
|
||||
return true;
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
# def self.get_overall_discount(sale_id)
|
||||
# price = 0.0
|
||||
# item=SaleItem.where("product_code=?", sale_id)
|
||||
|
||||
@@ -155,6 +155,16 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
end
|
||||
|
||||
# Check for Card Payment
|
||||
def self.get_sale_payments_by_card(sale_payments)
|
||||
# Check for Card Payment
|
||||
sale_payments.each do |sp|
|
||||
if sp.payment_method == "jcb" || sp.payment_method == "mpu" || sp.payment_method == "visa" || sp.payment_method == "master"
|
||||
return true;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def cash_payment
|
||||
payment_status = false
|
||||
@@ -497,8 +507,6 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.sale_payment_id = SeedGenerator.generate_id(self.class.name, "SPI")
|
||||
|
||||
Reference in New Issue
Block a user