add dinga payment and new payment type in report
This commit is contained in:
@@ -27,6 +27,7 @@ _MPU_ = "/ MPU PAYMENT";
|
||||
_ALIPAY_ = "/ Alipay";
|
||||
_JUNCTIONPAY_ = "/ JunctionPay";
|
||||
_PAYMAL_ = "/ PAYMAL";
|
||||
_DINGA_ = "/ DINGA PAYMENT";
|
||||
_OTHER_CHARGES_ = "/ CHARGES";
|
||||
_OTHER_PAYMENTS_ = "/ OTHER PAYMENT";
|
||||
_PAYMENTS_ = "/ PAYMENT";
|
||||
|
||||
@@ -122,7 +122,7 @@ class HomeController < ApplicationController
|
||||
|
||||
if !@total_payment_methods.nil?
|
||||
@total_payment_methods.each do |payment|
|
||||
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" || payment.payment_method == "unionpay"
|
||||
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" || payment.payment_method == "unionpay" || payment.payment_method == "alipay" || payment.payment_method == "paymal" || payment.payment_method == "dinga" || payment.payment_method == "JunctionPay"
|
||||
pay = Sale.payment_sale('card', today, current_user,@from,@to,@from_time,@to_time)
|
||||
@sale_data.push({'card' => pay.payment_amount})
|
||||
else
|
||||
|
||||
102
app/controllers/origami/dinga_controller.rb
Normal file
102
app/controllers/origami/dinga_controller.rb
Normal file
@@ -0,0 +1,102 @@
|
||||
class Origami::DingaController < BaseOrigamiController
|
||||
def index
|
||||
@sale_id = params[:sale_id]
|
||||
payment_method = params[:payment_method]
|
||||
@cashier_type = params[:type]
|
||||
@membership_rebate_balance=0
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
|
||||
@shop = Shop::ShopDetail
|
||||
# if @shop.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
# else
|
||||
# new_total = sale_data.grand_total
|
||||
# end
|
||||
# @rounding_adj = new_total-sale_data.grand_total
|
||||
@rounding_adj = sale_data.rounding_adjustment
|
||||
|
||||
@payparcount = 0
|
||||
others = 0
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "paypar"
|
||||
@payparcount = @payparcount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
@payment_prices = sale_data.grand_total - @payparcount -others
|
||||
|
||||
|
||||
if sale_data
|
||||
if sale_data.customer_id
|
||||
customer_data= Customer.find_by_customer_id(sale_data.customer_id)
|
||||
if customer_data
|
||||
@membership_id = customer_data.membership_id
|
||||
if !@membership_id.nil?
|
||||
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
if membership_setting.gateway_url
|
||||
member_actions =MembershipAction.find_by_membership_type("get_account_balance")
|
||||
if member_actions.gateway_url
|
||||
@campaign_type_id = nil
|
||||
url = membership_setting.gateway_url.to_s + member_actions.gateway_url.to_s
|
||||
merchant_uid= member_actions.merchant_account_id
|
||||
auth_token = member_actions.auth_token.to_s
|
||||
membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid,auth_token)
|
||||
if membership_data["status"]==true
|
||||
@membership_rebate_balance=membership_data["balance"]
|
||||
@out = true, @membership_rebate_balance,@membership_id
|
||||
end
|
||||
else
|
||||
@out =false,0
|
||||
end
|
||||
else
|
||||
@out = false,0
|
||||
end
|
||||
|
||||
|
||||
else
|
||||
@out = false, 0
|
||||
end
|
||||
else
|
||||
@out = false, 0
|
||||
end
|
||||
else
|
||||
@out = false, 0
|
||||
end
|
||||
else
|
||||
@out = false, 0
|
||||
end
|
||||
@out = false, 0
|
||||
end
|
||||
|
||||
def create
|
||||
cash = params[:payment_amount]
|
||||
sale_id = params[:sale_id]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
shop_details = Shop::ShopDetail
|
||||
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
# rounding_adj = new_total-saleObj.grand_total
|
||||
# saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
||||
# end
|
||||
|
||||
# saleObj = Sale.find(sale_id)
|
||||
sale_payment = SalePayment.new
|
||||
status, @sale = sale_payment.process_payment(saleObj, @user, cash, "dinga")
|
||||
if status == true
|
||||
@out = true, "Success!"
|
||||
else
|
||||
@out =false, "Please try again payment!"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
@@ -65,7 +65,7 @@ class Origami::MpuController < BaseOrigamiController
|
||||
|
||||
# saleObj = Sale.find(sale_id)
|
||||
sale_payment = SalePayment.new
|
||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "alipay",ref_no)
|
||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu",ref_no)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -230,11 +230,13 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
@junctionpaycount = 0.0
|
||||
@credit = 0.0
|
||||
@paymalcount = 0.0
|
||||
@dingacount = 0.0
|
||||
@sale_data = Sale.find_by_sale_id(sale_id)
|
||||
@balance = 0
|
||||
@accountable_type = ''
|
||||
@table_no = ''
|
||||
@dining = ''
|
||||
@other_payment = 0.0
|
||||
|
||||
@shop = Shop::ShopDetail #show shop info
|
||||
|
||||
@@ -332,26 +334,29 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
if spay.payment_method == "cash"
|
||||
@cash = spay.payment_amount
|
||||
end
|
||||
if spay.payment_method == "mpu"
|
||||
@other += spay.payment_amount
|
||||
elsif spay.payment_method == "paypar"
|
||||
@ppamount += spay.payment_amount
|
||||
elsif spay.payment_method == "visa"
|
||||
@visacount += spay.payment_amount
|
||||
elsif spay.payment_method == "jcb"
|
||||
@jcbcount += spay.payment_amount
|
||||
elsif spay.payment_method == "master"
|
||||
@mastercount += spay.payment_amount
|
||||
elsif spay.payment_method == "unionpay"
|
||||
@unionpaycount += spay.payment_amount
|
||||
elsif spay.payment_method == "JunctionPay"
|
||||
@junctionpaycount += spay.payment_amount
|
||||
elsif spay.payment_method == "creditnote"
|
||||
@credit += spay.payment_amount
|
||||
elsif spay.payment_method == "paymal"
|
||||
@paymalcount += spay.payment_amount
|
||||
elsif spay.payment_method == "alipay"
|
||||
@alipaycount += spay.payment_amount
|
||||
@other_payment += spay.payment_amount
|
||||
if spay.payment_method == "mpu"
|
||||
@other += spay.payment_amount
|
||||
elsif spay.payment_method == "paypar"
|
||||
@ppamount += spay.payment_amount
|
||||
elsif spay.payment_method == "visa"
|
||||
@visacount += spay.payment_amount
|
||||
elsif spay.payment_method == "jcb"
|
||||
@jcbcount += spay.payment_amount
|
||||
elsif spay.payment_method == "master"
|
||||
@mastercount += spay.payment_amount
|
||||
elsif spay.payment_method == "unionpay"
|
||||
@unionpaycount += spay.payment_amount
|
||||
elsif spay.payment_method == "JunctionPay"
|
||||
@junctionpaycount += spay.payment_amount
|
||||
elsif spay.payment_method == "creditnote"
|
||||
@credit += spay.payment_amount
|
||||
elsif spay.payment_method == "paymal"
|
||||
@paymalcount += spay.payment_amount
|
||||
elsif spay.payment_method == "alipay"
|
||||
@alipaycount += spay.payment_amount
|
||||
elsif spay.payment_method == "dinga"
|
||||
@dingacount += spay.payment_amount
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,9 @@ class Reports::PaymentMethodController < BaseReportController
|
||||
|
||||
@payments = [["All Payment",''],["Cash Payment","cash"], ["Credit Payment","creditnote"],
|
||||
["FOC Payment","foc"], ["MPU Payment","mpu"], ["Visa Payment","visa"],
|
||||
["Master Payment","master"], ["JCB Payment","jcb"], ["Redeem Payment","paypar"]]
|
||||
["Master Payment","master"], ["JCB Payment","jcb"],["UnionPay Payment","unionpay"],
|
||||
["Alipay Payment","alipay"],["Paymal Payment", "paymal"],["Dinga Payment","dinga"],
|
||||
["JunctionPay","junctionpay"],["Redeem Payment","paypar"]]
|
||||
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
|
||||
@@ -687,6 +687,10 @@ def self.daily_sales_list(from,to)
|
||||
SUM(case when (sale_payments.payment_method='jcb') then sale_payments.payment_amount else 0 end) as jcb_amount,
|
||||
SUM(case when (sale_payments.payment_method='paypar') then sale_payments.payment_amount else 0 end) as paypar_amount,
|
||||
SUM(case when (sale_payments.payment_method='unionpay') then sale_payments.payment_amount else 0 end) as unionpay_amount,
|
||||
SUM(case when (sale_payments.payment_method='alipay') then sale_payments.payment_amount else 0 end) as alipay_amount,
|
||||
SUM(case when (sale_payments.payment_method='paymal') then sale_payments.payment_amount else 0 end) as paymal_amount,
|
||||
SUM(case when (sale_payments.payment_method='dinga') then sale_payments.payment_amount else 0 end) as dinga_amount,
|
||||
SUM(case when (sale_payments.payment_method='JunctionPay') then sale_payments.payment_amount else 0 end) as junctionpay_amount,
|
||||
SUM(case when (sale_payments.payment_method='cash') then sale_payments.payment_amount else 0 end) as cash_amount,
|
||||
SUM(case when (sale_payments.payment_method='creditnote') then sale_payments.payment_amount else 0 end) as credit_amount,
|
||||
SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount")
|
||||
@@ -724,6 +728,10 @@ def self.daily_sales_list(from,to)
|
||||
:jcb_amount => pay.jcb_amount,
|
||||
:paypar_amount => pay.paypar_amount,
|
||||
:unionpay_amount => pay.unionpay_amount,
|
||||
:alipay_amount => pay.alipay_amount,
|
||||
:paymal_amount => pay.paymal_amount,
|
||||
:dinga_amount => pay.dinga_amount,
|
||||
:junctionpay_amount => pay.junctionpay_amount,
|
||||
:cash_amount => pay.cash_amount,
|
||||
:credit_amount => pay.credit_amount,
|
||||
:foc_amount => pay.foc_amount,
|
||||
@@ -882,7 +890,7 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status,type)
|
||||
other_charges = other_charges.where("sales.shift_sale_id IN (?) and sale_status='completed'",shift.to_a)
|
||||
discount_query = Sale.where("sales.shift_sale_id in (?) and sale_status= 'completed' ", shift.to_a).sum(:total_discount)
|
||||
change_amount = Sale.where("sales.shift_sale_id in (?) and sale_status= 'completed' ", shift.to_a).sum(:amount_changed)
|
||||
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method ='mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar' or sale_payments.payment_method = 'unionpay') then (sale_payments.payment_amount) else 0 end) as card_amount,
|
||||
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method ='mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar' or sale_payments.payment_method = 'unionpay' or sale_payments.payment_method = 'alipay' or sale_payments.payment_method = 'paymal' or sale_payments.payment_method = 'dinga' or sale_payments.payment_method = 'JunctionPay') then (sale_payments.payment_amount) else 0 end) as card_amount,
|
||||
SUM(case when (sale_payments.payment_method='cash') then (sale_payments.payment_amount) else 0 end) as cash_amount,
|
||||
SUM(case when (sale_payments.payment_method='creditnote') then (sale_payments.payment_amount) else 0 end) as credit_amount,
|
||||
SUM(case when (sale_payments.payment_method='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount")
|
||||
@@ -902,7 +910,7 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status,type)
|
||||
other_charges = other_charges.where("sales.shift_sale_id IN (?) and sale_status='completed'",shift_sale_range.to_a)
|
||||
discount_query = Sale.where("sales.shift_sale_id IN (?) and sale_status ='completed'", shift_sale_range.to_a).sum(:total_discount)
|
||||
change_amount = Sale.where("sales.shift_sale_id IN (?) and sale_status ='completed'", shift_sale_range.to_a).sum(:amount_changed)
|
||||
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar' or sale_payments.payment_method = 'unionpay') then (sale_payments.payment_amount) else 0 end) as card_amount,
|
||||
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar' or sale_payments.payment_method = 'unionpay' or sale_payments.payment_method = 'alipay' sale_payments.payment_method = 'paymal' or sale_payments.payment_method = 'dinga' or sale_payments.payment_method = 'JunctionPay') then (sale_payments.payment_amount) else 0 end) as card_amount,
|
||||
SUM(case when (sale_payments.payment_method='cash') then (sale_payments.payment_amount) else 0 end) as cash_amount,
|
||||
SUM(case when (sale_payments.payment_method='creditnote') then (sale_payments.payment_amount) else 0 end) as credit_amount,
|
||||
SUM(case when (sale_payments.payment_method='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount")
|
||||
@@ -922,7 +930,7 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status,type)
|
||||
other_charges = other_charges.where("sales.receipt_date between ? and ? and sale_status='completed'",from,to)
|
||||
discount_query = Sale.where("sales.receipt_date between ? and ? and sale_status ='completed'", from,to).sum(:total_discount)
|
||||
change_amount = Sale.where("sales.receipt_date between ? and ? and sale_status ='completed'", from,to).sum(:amount_changed)
|
||||
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar' or sale_payments.payment_method = 'unionpay') then (sale_payments.payment_amount) else 0 end) as card_amount,
|
||||
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar' or sale_payments.payment_method = 'unionpay' or sale_payments.payment_method = 'alipay' or sale_payments.payment_method = 'paymal' or sale_payments.payment_method = 'dinga' or sale_payments.payment_method = 'JunctionPay') then (sale_payments.payment_amount) else 0 end) as card_amount,
|
||||
SUM(case when (sale_payments.payment_method='cash') then (sale_payments.payment_amount) else 0 end) as cash_amount,
|
||||
SUM(case when (sale_payments.payment_method='creditnote') then (sale_payments.payment_amount) else 0 end) as credit_amount,
|
||||
SUM(case when (sale_payments.payment_method='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount")
|
||||
@@ -970,7 +978,7 @@ def self.get_shift_sales_by_receipt_no(shift_sale_range,shift,from,to,payment_ty
|
||||
payment_type = ''
|
||||
else
|
||||
if payment_type == 'card'
|
||||
payment_type = " and sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar' or sale_payments.payment_method = 'unionpay'"
|
||||
payment_type = " and sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar' or sale_payments.payment_method = 'unionpay' or sale_payments.payment_method = 'alipay' or sale_payments.payment_method = 'paymal' or sale_payments.payment_method = 'dinga' or sale_payments.payment_method = 'JunctionPay'"
|
||||
else
|
||||
payment_type = " and sale_payments.payment_method = '#{payment_type}'"
|
||||
end
|
||||
@@ -1034,7 +1042,7 @@ def self.get_separate_tax(shift_sale_range=nil,shift,from,to,payment_type)
|
||||
# payment_type = ''
|
||||
# else
|
||||
# if payment_type == 'card'
|
||||
# payment_type = " and sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar'"
|
||||
# payment_type = " and sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar' or sale_payments.payment_method = 'unionpay' or sale_payments.payment_method = 'alipay' or sale_payments.payment_method = 'paymal' or sale_payments.payment_method = 'dinga' or sale_payments.payment_method = 'JunctionPay'"
|
||||
# else
|
||||
# payment_type = " and sale_payments.payment_method = '#{payment_type}'"
|
||||
# end
|
||||
@@ -1075,6 +1083,10 @@ def self.get_payment_method_by_shift(shift_sale_range,shift,from,to,payment_type
|
||||
SUM(case when (sale_payments.payment_method='jcb') then sale_payments.payment_amount else 0 end) as jcb_amount,
|
||||
SUM(case when (sale_payments.payment_method='paypar') then sale_payments.payment_amount else 0 end) as paypar_amount,
|
||||
SUM(case when (sale_payments.payment_method='unionpay') then sale_payments.payment_amount else 0 end) as unionpay_amount,
|
||||
SUM(case when (sale_payments.payment_method='alipay') then sale_payments.payment_amount else 0 end) as alipay_amount,
|
||||
SUM(case when (sale_payments.payment_method='paymal') then sale_payments.payment_amount else 0 end) as paymal_amount,
|
||||
SUM(case when (sale_payments.payment_method='dinga') then sale_payments.payment_amount else 0 end) as dinga_amount,
|
||||
SUM(case when (sale_payments.payment_method='JunctionPay') then sale_payments.payment_amount else 0 end) as junctionpay_amount,
|
||||
SUM(case when (sale_payments.payment_method='cash') then sale_payments.payment_amount else 0 end) as cash_amount,
|
||||
SUM(case when (sale_payments.payment_method='cash') then sales.amount_changed else 0 end) as total_change_amount,
|
||||
SUM(case when (sale_payments.payment_method='creditnote') then sale_payments.payment_amount else 0 end) as credit_amount,
|
||||
@@ -1413,7 +1425,7 @@ end
|
||||
else
|
||||
query = query.where("sales.payment_status='paid' and sales.sale_status = 'completed' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between '#{from}' and '#{to}'")
|
||||
end
|
||||
query = query.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
query = query.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay' or sp.payment_method='alipay' or sp.payment_method='paymal' or sp.payment_method='dinga' or sp.payment_method='JunctionPay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
.order("e.name")
|
||||
else
|
||||
if current_user.role == 'administrator' || current_user.role == 'manager'
|
||||
@@ -1424,7 +1436,7 @@ end
|
||||
else
|
||||
query = query.where("sales.payment_status='paid' and sales.sale_status = 'completed' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between '#{from}' and '#{to}'")
|
||||
end
|
||||
query = query.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
query = query.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay' or sp.payment_method='alipay' or sp.payment_method='paymal' or sp.payment_method='dinga' or sp.payment_method='JunctionPay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
.order("e.name")
|
||||
else
|
||||
shift = ShiftSale.current_open_shift(current_user.id)
|
||||
@@ -1436,7 +1448,7 @@ end
|
||||
else
|
||||
query = query.where("sales.payment_status='paid' and sales.sale_status = 'completed' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,'+00:00','+06:30'),'%Y-%m-%d') between '#{from}' and '#{to}' and shift_sale_id='#{shift.id}'")
|
||||
end
|
||||
query = query.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
query = query.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay' or sp.payment_method='alipay' or sp.payment_method='paymal' or sp.payment_method='dinga' or sp.payment_method='JunctionPay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
.order("e.name")
|
||||
end
|
||||
end
|
||||
@@ -1446,14 +1458,14 @@ end
|
||||
query = Sale.joins("JOIN employees as e on e.id=sales.cashier_id")
|
||||
.joins("JOIN sale_payments as sp on sp.sale_id=sales.sale_id")
|
||||
.where("sales.payment_status='paid' and sales.sale_status = 'completed' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = '#{today}'")
|
||||
.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay' or sp.payment_method='alipay' or sp.payment_method='paymal' or sp.payment_method='dinga' or sp.payment_method='JunctionPay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
.order("e.name")
|
||||
else
|
||||
if current_user.role == 'administrator' || current_user.role == 'manager'
|
||||
query = Sale.joins("JOIN employees as e on e.id=sales.cashier_id")
|
||||
.joins("JOIN sale_payments as sp on sp.sale_id=sales.sale_id")
|
||||
.where("sales.payment_status='paid' and sales.sale_status = 'completed' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = '#{today}'")
|
||||
.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay' or sp.payment_method='alipay' or sp.payment_method='paymal' or sp.payment_method='dinga' or sp.payment_method='JunctionPay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
.order("e.name")
|
||||
else
|
||||
shift = ShiftSale.current_open_shift(current_user.id)
|
||||
@@ -1461,7 +1473,7 @@ end
|
||||
query = Sale.joins("JOIN employees as e on e.id=sales.cashier_id")
|
||||
.joins("JOIN sale_payments as sp on sp.sale_id=sales.sale_id")
|
||||
.where("sales.payment_status='paid' and sales.sale_status = 'completed' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = '#{today}' and shift_sale_id='#{shift.id}'")
|
||||
.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
.group("(CASE WHEN (sp.payment_method='mpu' or sp.payment_method='visa' or sp.payment_method='master' or sp.payment_method='jcb' or sp.payment_method='unionpay' or sp.payment_method='alipay' or sp.payment_method='paymal' or sp.payment_method='dinga' or sp.payment_method='JunctionPay') THEN 'card' ELSE sp.payment_method END)","e.name")
|
||||
.order("e.name")
|
||||
end
|
||||
end
|
||||
@@ -1560,22 +1572,22 @@ end
|
||||
if !from.nil? && !to.nil?
|
||||
if current_user.nil?
|
||||
if !from_time.nil? && !to_time.nil?
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',from,to,from_time,to_time)
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay")',from,to,from_time,to_time)
|
||||
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||
.sum("sp.payment_amount")
|
||||
else
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',from,to)
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay")',from,to)
|
||||
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||
.sum("sp.payment_amount")
|
||||
end
|
||||
else
|
||||
if current_user.role == 'administrator' || current_user.role == 'manager'
|
||||
if !from_time.nil? && !to_time.nil?
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',from,to,from_time,to_time)
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay")',from,to,from_time,to_time)
|
||||
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||
.sum("sp.payment_amount")
|
||||
else
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',from,to)
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay")',from,to)
|
||||
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||
.sum("sp.payment_amount")
|
||||
end
|
||||
@@ -1583,11 +1595,11 @@ end
|
||||
shift = ShiftSale.current_open_shift(current_user.id)
|
||||
if !shift.nil?
|
||||
if !from_time.nil? && !to_time.nil?
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay") and shift_sale_id=?',from,to,from_time,to_time,shift.id)
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay") and shift_sale_id=?',from,to,from_time,to_time,shift.id)
|
||||
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||
.sum("sp.payment_amount")
|
||||
else
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay") and shift_sale_id=?',from,to,shift.id)
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date,"+00:00","+06:30"),"%Y-%m-%d") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay") and shift_sale_id=?',from,to,shift.id)
|
||||
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||
.sum("sp.payment_amount")
|
||||
end
|
||||
@@ -1596,18 +1608,18 @@ end
|
||||
end
|
||||
else
|
||||
if current_user.nil?
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',today)
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay")',today)
|
||||
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||
.sum("sp.payment_amount")
|
||||
else
|
||||
if current_user.role == 'administrator' || current_user.role == 'manager'
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',today)
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay")',today)
|
||||
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||
.sum("sp.payment_amount")
|
||||
else
|
||||
shift = ShiftSale.current_open_shift(current_user.id)
|
||||
if !shift.nil?
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay") and shift_sale_id=?',today,shift.id)
|
||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay") and shift_sale_id=?',today,shift.id)
|
||||
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||
.sum("sp.payment_amount")
|
||||
end
|
||||
@@ -1806,7 +1818,7 @@ end
|
||||
if !from_time.nil? && !to_time.nil?
|
||||
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
if payment_method == 'card'
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',from,to,from_time,to_time)
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method="alipay" or sp.payment_method="paymal" or sp.payment_method="dinga" or sp.payment_method="JunctionPay")',from,to,from_time,to_time)
|
||||
else
|
||||
query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, '+00:00', '+06:30'),'%Y-%m-%d') between ? and ? and and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, '+00:00', '+06:30'),'%H:%M') between ? and ?",from,to,from_time,to_time)
|
||||
end
|
||||
@@ -1814,7 +1826,7 @@ end
|
||||
else
|
||||
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
if payment_method == 'card'
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%Y-%m-%d") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',from,to)
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%Y-%m-%d") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay")',from,to)
|
||||
else
|
||||
query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, '+00:00', '+06:30'),'%Y-%m-%d') between ? and ?",from,to)
|
||||
end
|
||||
@@ -1825,7 +1837,7 @@ end
|
||||
if !from_time.nil? && !to_time.nil?
|
||||
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
if payment_method == 'card'
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',from,to,from_time,to_time)
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay")',from,to,from_time,to_time)
|
||||
else
|
||||
query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, '+00:00', '+06:30'),'%Y-%m-%d') between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, '+00:00', '+06:30'),'%H:%M') between ? and ?",from,to,from_time,to_time)
|
||||
end
|
||||
@@ -1845,7 +1857,7 @@ end
|
||||
if !from_time.nil? && !to_time.nil?
|
||||
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
if payment_method == 'card'
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay") and sales.shift_sale_id=?',from,to,from_time,to_time,shift.id)
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%Y-%m-%d") between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%H:%M") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay") and sales.shift_sale_id=?',from,to,from_time,to_time,shift.id)
|
||||
else
|
||||
query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, '+00:00', '+06:30'),'%Y-%m-%d') between ? and ? and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, '+00:00', '+06:30'),'%H:%M') between ? and ? and sales.shift_sale_id=?",from,to,from_time,to_time,shift.id)
|
||||
end
|
||||
@@ -1853,7 +1865,7 @@ end
|
||||
else
|
||||
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
if payment_method == 'card'
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%Y-%m-%d") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay") and sales.shift_sale_id=?',from,to,shift.id)
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, "+00:00", "+06:30"),"%Y-%m-%d") between ? and ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay") and sales.shift_sale_id=?',from,to,shift.id)
|
||||
else
|
||||
query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(CONVERT_TZ(sales.receipt_date, '+00:00', '+06:30'),'%Y-%m-%d') between ? and ? and sales.shift_sale_id=?",from,to,shift.id)
|
||||
end
|
||||
@@ -1866,7 +1878,7 @@ end
|
||||
if current_user.nil?
|
||||
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
if payment_method == 'card'
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',today)
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay")',today)
|
||||
else
|
||||
query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ?",today)
|
||||
end
|
||||
@@ -1875,7 +1887,7 @@ end
|
||||
if current_user.role == 'administrator' || current_user.role == 'manager'
|
||||
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
if payment_method == 'card'
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay")',today)
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay")',today)
|
||||
else
|
||||
query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ?",today)
|
||||
end
|
||||
@@ -1885,7 +1897,7 @@ end
|
||||
if !shift.nil?
|
||||
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
if payment_method == 'card'
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay") and sales.shift_sale_id=?',today,shift.id)
|
||||
query = query.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb" or sp.payment_method = "unionpay" or sp.payment_method = "alipay" or sp.payment_method = "paymal" or sp.payment_method = "dinga" or sp.payment_method = "JunctionPay") and sales.shift_sale_id=?',today,shift.id)
|
||||
else
|
||||
query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ? and sales.shift_sale_id=?",today,shift.id)
|
||||
end
|
||||
@@ -2598,6 +2610,10 @@ end
|
||||
SUM(case when (sale_payments.payment_method='visa') then sale_payments.payment_amount else 0 end) as visa_amount,
|
||||
SUM(case when (sale_payments.payment_method='jcb') then sale_payments.payment_amount else 0 end) as jcb_amount,
|
||||
SUM(case when (sale_payments.payment_method='unionpay') then sale_payments.payment_amount else 0 end) as unionpay_amount,
|
||||
SUM(case when (sale_payments.payment_method='alipay') then sale_payments.payment_amount else 0 end) as alipay_amount,
|
||||
SUM(case when (sale_payments.payment_method='paymal') then sale_payments.payment_amount else 0 end) as paymal_amount,
|
||||
SUM(case when (sale_payments.payment_method='dinga') then sale_payments.payment_amount else 0 end) as dinga_amount,
|
||||
SUM(case when (sale_payments.payment_method='JunctionPay') then sale_payments.payment_amount else 0 end) as junctionpay_amount,
|
||||
SUM(case when (sale_payments.payment_method='creditnote') then sale_payments.payment_amount else 0 end) as credit_amount,
|
||||
SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount,
|
||||
SUM(case when (sale_items.status='foc') then sale_items.price else 0 end) as item_foc,
|
||||
|
||||
@@ -41,6 +41,8 @@ class SalePayment < ApplicationRecord
|
||||
payment_status = external_terminal_card_payment(:mpu)
|
||||
when "unionpay"
|
||||
payment_status = external_terminal_card_payment(:unionpay)
|
||||
when "alipay"
|
||||
payment_status = external_terminal_card_payment(:alipay)
|
||||
when "vochure"
|
||||
payment_status = vochure_payment
|
||||
when "giftcard"
|
||||
@@ -53,8 +55,8 @@ class SalePayment < ApplicationRecord
|
||||
payment_status = paymal_payment
|
||||
when "JunctionPay"
|
||||
payment_status = junction_pay_payment
|
||||
when "alipay"
|
||||
payment_status = external_terminal_card_payment(:alipay)
|
||||
when "dinga"
|
||||
payment_status = dinga_payment
|
||||
else
|
||||
puts "it was something else"
|
||||
end
|
||||
@@ -402,6 +404,35 @@ class SalePayment < ApplicationRecord
|
||||
return payment_status
|
||||
end
|
||||
|
||||
def dinga_payment
|
||||
payment_status = false
|
||||
|
||||
#Next time - validate if the vochure number is valid - within
|
||||
customer_data = Customer.find_by_customer_id(self.sale.customer_id)
|
||||
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
membership_data = SalePayment.create_payment(membership_setting.gateway_url,membership_setting.auth_token,customer_data.membership_id,self.received_amount,self.sale.sale_id)
|
||||
|
||||
#record an payment in sale-audit
|
||||
remark = "#{membership_data} Dinga Payment- for Customer #{self.sale.customer_id} Sale Id [#{self.sale.sale_id}]| pay amount -> #{self.received_amount} "
|
||||
sale_audit = SaleAudit.record_paymal(self.sale.sale_id, remark, 1)
|
||||
|
||||
if membership_data["status"]==true
|
||||
self.payment_method = "dinga"
|
||||
self.payment_amount = self.received_amount
|
||||
self.payment_reference = self.voucher_no
|
||||
self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f
|
||||
self.payment_status = "pending"
|
||||
payment_method = self.save!
|
||||
SalePayment.where(:sale_payment_id => self.sale_payment_id).update_all(:payment_status => 'paid')
|
||||
sale_update_payment_status(self.received_amount.to_f)
|
||||
|
||||
else
|
||||
sale_update_payment_status(0)
|
||||
end
|
||||
|
||||
return payment_status
|
||||
end
|
||||
|
||||
def sale_update_payment_status(paid_amount,check_foc = false)
|
||||
#update amount_outstanding
|
||||
self.sale.amount_received = self.sale.amount_received.to_f + paid_amount.to_f
|
||||
|
||||
2
app/views/origami/dinga/create.json.jbuilder
Normal file
2
app/views/origami/dinga/create.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.set! :status, @out[0]
|
||||
json.set! :message, @out[1]
|
||||
202
app/views/origami/dinga/index.html.erb
Normal file
202
app/views/origami/dinga/index.html.erb
Normal file
@@ -0,0 +1,202 @@
|
||||
<div class="container-fluid">
|
||||
<!-- <div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%=origami_root_path %>"><%= t :home %></a></li>
|
||||
<li class="breadcrumb-item"><a href="/origami/sale/<%=@sale_id %>/payment"><%= t("views.btn.payment") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.right_panel.details.redeem") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/sale/'+@sale_id+'/payment/others_payment'%>
|
||||
</span>
|
||||
</ol>
|
||||
</div> -->
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card m-l-10 m-t-10" style="padding:0px 20px;">
|
||||
<div class="rebate-form">
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="">You can pay up to </label>
|
||||
<%@payment_prices = @payment_prices +@rounding_adj%>
|
||||
<input type="text" name="" id="paymentamt" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%= @payment_prices %>" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% if @payparcount > 0 %>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="">Recent Payment Amount </label>
|
||||
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%= @payparcount %>" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="">Available Balance </label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@membership_rebate_balance%>" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="">Payment Balance</label>
|
||||
<div id="used_amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <% if @payparcount > 0 %>
|
||||
<p class="">Last time rebate amount is <%= @payparcount %></p>
|
||||
<% end %>
|
||||
<p class="">You can rebate upto <span style="color:red;" id="food_prices"><%= @payment_prices %></span></p> -->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<div class="m-t-10 p-l-20">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
<div class="row bottom">
|
||||
<div class="col-md-4 cashier_number border-left" data-value="1" data-type="num">1</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="2" data-type="num">2</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="3" data-type="num">3</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="col-md-4 cashier_number border-left" data-value="4" data-type="num">4</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="5" data-type="num">5</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="6" data-type="num">6</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="col-md-4 cashier_number border-left" data-value="7" data-type="num">7</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="8" data-type="num">8</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="9" data-type="num">9</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="col-md-4 cashier_number border-left" data-value="0" data-type="num">0</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="." data-type="num">.</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="00" data-type="num">00</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="col-md-4 cashier_number green border-left" data-type="nett">Nett</div>
|
||||
<div class="col-md-4 cashier_number red border-left" data-type="del">Del</div>
|
||||
<div class="col-md-4 cashier_number orange border-left" data-type="clr">Clr</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<div class="row bottom m-l-5">
|
||||
<div class="cashier_number long border-left" data-value="1000" data-type="add">1000</div>
|
||||
<div class="cashier_number long left" data-value="3000" data-type="add">3000</div>
|
||||
</div>
|
||||
<div class="row bottom m-l-5">
|
||||
<div class="cashier_number long border-left" data-value="5000" data-type="add">5000</div>
|
||||
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
|
||||
</div>
|
||||
<div class="row bottom m-l-5">
|
||||
<div class="pay purple left" id="dinga_payment">Pay</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn bg-default m-t-10 btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/<%= @cashier_type %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function() {
|
||||
setHeaderBreadCrumb(_DINGA_);
|
||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){}
|
||||
else {
|
||||
$('#paymentamt').attr("value",parseFloat("<%= @payment_prices %>") - parseFloat(localStorage.getItem("cash")));
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.cashier_number', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
if(event.handled !== true) {
|
||||
var original_value;
|
||||
original_value = $('#used_amount').text();
|
||||
|
||||
var input_value = $(this).attr("data-value");
|
||||
|
||||
var input_type = $(this).attr("data-type");
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
if (original_value == "0.0"){
|
||||
$('#used_amount').text(input_value);
|
||||
}else{
|
||||
$('#used_amount').append(input_value);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value) + parseInt(original_value);
|
||||
$('#used_amount').html(amount);
|
||||
|
||||
break;
|
||||
case 'clr':
|
||||
$('#used_amount').html("0.0");
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#used_amount').text();
|
||||
$('#used_amount').text(cash.substr(0,cash.length-1));
|
||||
break;
|
||||
case 'nett':
|
||||
var remain_amount = $('#paymentamt').val();
|
||||
$('#used_amount').text(remain_amount);
|
||||
break;
|
||||
|
||||
}
|
||||
event.handled = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("#dinga_payment").click(function(){
|
||||
valid_amount = $("#valid_amount").val();
|
||||
sale_id = $("#valid_amount").attr('data-value');
|
||||
membership_id = $("#valid_amount").attr('data-member-value');
|
||||
payment_amount = parseFloat($("#used_amount").text());
|
||||
if(payment_amount<=0 ){
|
||||
swal ( "Oops" , "Please type valid amount!" , "warning" );
|
||||
}else if(valid_amount< payment_amount){
|
||||
swal ( "Oops" , "Insufficient Amount!" , "warning" );
|
||||
}else{
|
||||
if(payment_amount <= "<%= @payment_prices %>"){
|
||||
$(this).off("click");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=origami_payment_dinga_path%>",
|
||||
data: {payment_amount:payment_amount,membership_id:membership_id,sale_id:sale_id},
|
||||
success: function(result){
|
||||
if(result.status == true){
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: result.message,
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment"
|
||||
});
|
||||
|
||||
}else{
|
||||
swal ( "Information" , result.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {
|
||||
swal ( "Oops" , "Payment Amount is over!" , "warning" );
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -10,14 +10,12 @@
|
||||
</ol>
|
||||
</div> -->
|
||||
<div class="row">
|
||||
<div class="col-lg-11col-md-11 col-sm-11">
|
||||
<div >
|
||||
<div >
|
||||
<div class="col-lg-11 col-md-11 col-sm-11">
|
||||
<div class="">
|
||||
<span id="receipt_no" class="hidden"><%=@sale_data.receipt_no rescue ' '%></span>
|
||||
<% @payment_method_setting.where("is_active = true").each do |payment_method|%>
|
||||
<div class="purple others-payment bottom left m-l-30 <%= payment_method.payment_method %>" data-type="<%= payment_method.payment_method %>" id="<%= payment_method.payment_method %>" data-url="<%=payment_method.gateway_url%>" data-sale-id="<%= @sale_id%>"><%= payment_method.payment_method %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% @payment_method_setting.where("is_active = true").each do |payment_method|%>
|
||||
<div class="purple others-payment bottom left m-l-30 <%= payment_method.payment_method %>" data-type="<%= payment_method.payment_method %>" id="<%= payment_method.payment_method %>" data-url="<%=payment_method.gateway_url%>" data-sale-id="<%= @sale_id%>"><%= payment_method.payment_method %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 m-t-10">
|
||||
|
||||
@@ -167,25 +167,22 @@
|
||||
<div class="col-md-8">Credit</div>
|
||||
<div class="col-md-4" id="credit"><%= number_with_precision(@credit, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||
</div>
|
||||
<% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0%>
|
||||
<% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0 && @unionpaycount == 0.0 && @alipaycount == 0.0 && @paymalcount == 0.0 && @junctionpaycount == 0.0 && @dingacount == 0.0 %>
|
||||
<div class="row payment other-payment-color" id="card_payment" >
|
||||
<div class="col-md-8">Other Payments</div>
|
||||
<div class="col-md-4" id="others"><%= number_with_precision(@other, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i) %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row payment other-payment-color" id="card_payment" >
|
||||
<div class="col-md-12">Other Payments</div>
|
||||
<div class="col-md-8">Other Payments</div>
|
||||
<div class="col-md-4" id=""><%= number_with_precision(@other_payment, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i) %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title m-l-5 m-r-5">
|
||||
<!-- mpu -->
|
||||
<% if @other != 0.0 %>
|
||||
<div class="row payment others-color">
|
||||
<% else %>
|
||||
<div class="row hidden">
|
||||
<% end %>
|
||||
<div class="row <%= @other!=0.0 ? 'payment others-color' : 'hidden' %>">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">MPU</div>
|
||||
<% if @other != 0.0 %>
|
||||
@@ -194,12 +191,9 @@
|
||||
<div class="col-md-4" id="others"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<!-- paypar -->
|
||||
<% if @ppamount != 0.0 %>
|
||||
<div class="row payment others-color">
|
||||
<% else %>
|
||||
<div class="row hidden">
|
||||
<% end %>
|
||||
<div class="row <%= @ppamount!=0.0 ? 'payment others-color' : 'hidden' %>">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Redeem</div>
|
||||
<% if @ppamount != 0.0 %>
|
||||
@@ -210,11 +204,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Visa -->
|
||||
<% if @visacount != 0.0 %>
|
||||
<div class="row payment others-color">
|
||||
<% else %>
|
||||
<div class="row hidden">
|
||||
<% end %>
|
||||
<div class="row <%= @visacount!=0.0 ? 'payment others-color' : 'hidden' %>">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">VISA</div>
|
||||
<% if @visacount != 0.0 %>
|
||||
@@ -225,11 +215,7 @@
|
||||
</div>
|
||||
|
||||
<!-- JCB -->
|
||||
<% if @jcbcount != 0.0 %>
|
||||
<div class="row payment others-color">
|
||||
<% else %>
|
||||
<div class="row hidden">
|
||||
<% end %>
|
||||
<div class="row <%= @jcbcount!=0.0 ? 'payment others-color' : 'hidden' %>">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">JCB</div>
|
||||
<% if @jcbcount != 0.0 %>
|
||||
@@ -240,11 +226,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Master -->
|
||||
<% if @mastercount != 0.0 %>
|
||||
<div class="row payment others-color">
|
||||
<% else %>
|
||||
<div class="row hidden">
|
||||
<% end %>
|
||||
<div class="row <%= @mastercount!=0.0 ? 'payment others-color' : 'hidden' %>">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">MASTER</div>
|
||||
<% if @mastercount != 0.0 %>
|
||||
@@ -256,11 +238,7 @@
|
||||
<!-- <br> -->
|
||||
|
||||
<!-- UNIONPAY -->
|
||||
<% if @unionpaycount != 0.0 %>
|
||||
<div class="row payment others-color">
|
||||
<% else %>
|
||||
<div class="row hidden">
|
||||
<% end %>
|
||||
<div class="row <%= @unionpaycount!=0.0 ? 'payment others-color' : 'hidden' %>">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">UNIONPAY</div>
|
||||
<% if @unionpaycount != 0.0 %>
|
||||
@@ -271,11 +249,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Alipay -->
|
||||
<% if @alipaycount != 0.0 %>
|
||||
<div class="row payment others-color">
|
||||
<% else %>
|
||||
<div class="row hidden">
|
||||
<% end %>
|
||||
<div class="row <%= @alipaycount!=0.0 ? 'payment others-color' : 'hidden' %>">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Alipay</div>
|
||||
<% if @alipaycount != 0.0 %>
|
||||
@@ -285,7 +259,8 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="row payment <%= @paymalcount!=0.0 ? 'payment others-color' : 'hidden'%>">
|
||||
<!-- PAYMAL -->
|
||||
<div class="row <%= @paymalcount!=0.0 ? 'payment others-color' : 'hidden'%>">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">PAYMAL</div>
|
||||
<% if @paymalcount != 0.0 %>
|
||||
@@ -295,13 +270,19 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<!-- DINGA -->
|
||||
<div class="row <%= @dingacount!=0.0 ? 'payment others-color' : 'hidden'%>">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">DINGA</div>
|
||||
<% if @paymalcount != 0.0 %>
|
||||
<div class="col-md-4 master is_card" id="dingacount"><%= number_with_precision(@dingacount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||
<% else %>
|
||||
<div class="col-md-4" id="dingacount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<!-- Junction Pay -->
|
||||
<% if @junctionpaycount != 0.0 %>
|
||||
<div class="row payment others-color">
|
||||
<% else %>
|
||||
<div class="row hidden">
|
||||
<% end %>
|
||||
<!-- PAYMAL -->
|
||||
<div class="row <%= @junctionpaycount!=0.0 ? 'payment others-color' : 'hidden'%>">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">JUNCTION PAY</div>
|
||||
<% if @junctionpaycount != 0.0 %>
|
||||
@@ -556,7 +537,7 @@ var customer_name = "<%= @customer.name %>";
|
||||
$("#credit_payment").show();
|
||||
}
|
||||
|
||||
if(parseInt(jQuery.inArray("MPU", payment_type)) !=-1 || parseInt(jQuery.inArray("VISA", payment_type)) !=-1 || parseInt(jQuery.inArray("JCB", payment_type)) !=-1 || parseInt(jQuery.inArray("Master", payment_type)) !=-1 || parseInt(jQuery.inArray("UNIONPAY", payment_type)) !=-1 || parseInt(jQuery.inArray("Redeem", payment_type)) !=-1, parseInt(jQuery.inArray("PAYMAL", payment_type)) !=-1 || parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) !=-1 || parseInt(jQuery.inArray("Alipay", payment_type)) !=-1){
|
||||
if(parseInt(jQuery.inArray("MPU", payment_type)) !=-1 || parseInt(jQuery.inArray("VISA", payment_type)) !=-1 || parseInt(jQuery.inArray("JCB", payment_type)) !=-1 || parseInt(jQuery.inArray("Master", payment_type)) !=-1 || parseInt(jQuery.inArray("UNIONPAY", payment_type)) !=-1 || parseInt(jQuery.inArray("Redeem", payment_type)) !=-1, parseInt(jQuery.inArray("PAYMAL", payment_type)) !=-1 || parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) !=-1 || parseInt(jQuery.inArray("Alipay", payment_type)) !=-1 || parseInt(jQuery.inArray("DINGA", payment_type)) !=-1){
|
||||
$("#card_payment").show();
|
||||
} else{
|
||||
$("#card_payment").hide();
|
||||
@@ -629,6 +610,8 @@ var customer_name = "<%= @customer.name %>";
|
||||
swal("Oops","Please Pay with Credit Payment","warning");
|
||||
}else if(payment_type == "PAYMAL" && $('#paymalcount').text()==0 && sub_total != 0.0){
|
||||
swal("Oops","Please Pay with Paymal Payment","warning");
|
||||
}else if(payment_type == "DINGA" && $('#dingacount').text()==0 && sub_total != 0.0){
|
||||
swal("Oops","Please Pay with Dinga Payment","warning");
|
||||
}else{
|
||||
|
||||
$( "#loading_wrapper").show();
|
||||
@@ -881,23 +864,23 @@ var customer_name = "<%= @customer.name %>";
|
||||
}
|
||||
break;
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value) + parseInt(original_value);
|
||||
$('#cash').text(amount);
|
||||
update_balance();
|
||||
break;
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value) + parseInt(original_value);
|
||||
$('#cash').text(amount);
|
||||
update_balance();
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#cash').text();
|
||||
if(cash.length == 1)
|
||||
$('#cash').text("0.0");
|
||||
var cash=$('#cash').text();
|
||||
if(cash.length == 1)
|
||||
$('#cash').text("0.0");
|
||||
else
|
||||
$('#cash').text(cash.substr(0,cash.length-1));
|
||||
update_balance();
|
||||
break;
|
||||
update_balance();
|
||||
break;
|
||||
case 'clr':
|
||||
$('#cash').text("0.0");
|
||||
update_balance();
|
||||
break;
|
||||
$('#cash').text("0.0");
|
||||
update_balance();
|
||||
break;
|
||||
case 'nett':
|
||||
var credit1 = $('#credit').text();
|
||||
var card1 = $('#others').text();
|
||||
@@ -909,7 +892,8 @@ var customer_name = "<%= @customer.name %>";
|
||||
var paymal1 = $('#paymalcount').text();
|
||||
var alipay1 = $('#alipaycount').text();
|
||||
var junctionpay1 = $('#junctionpaycount').text();
|
||||
var othertotal = parseFloat(credit1) + parseFloat(card1) + parseFloat(paypar1) + parseFloat(visa1) + parseFloat(jcb1) + parseFloat(master1) + parseFloat(unionpay1) + parseFloat(alipay1) + parseFloat(junctionpay1) + parseFloat(paymal1);
|
||||
var dingapay1 = $('#dingacount').text();
|
||||
var othertotal = parseFloat(credit1) + parseFloat(card1) + parseFloat(paypar1) + parseFloat(visa1) + parseFloat(jcb1) + parseFloat(master1) + parseFloat(unionpay1) + parseFloat(alipay1) + parseFloat(junctionpay1) + parseFloat(paymal1) + parseFloat(dingapay1);
|
||||
var total = $('#amount_due').text();
|
||||
var amt = 0;
|
||||
<% if precision.to_i > 0 %>;
|
||||
@@ -940,9 +924,11 @@ var customer_name = "<%= @customer.name %>";
|
||||
var paymal = $('#paymalcount').text();
|
||||
var alipay = $('#alipaycount').text();
|
||||
var junctionpay = $('#junctionpaycount').text();
|
||||
var dinga = $('#dingacount').text();
|
||||
var amount_due = $('#amount_due').text();
|
||||
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master) + parseFloat(unionpay) + parseFloat(alipay) + parseFloat(junctionpay) + parseFloat(paymal);
|
||||
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master) + parseFloat(unionpay) + parseFloat(alipay) + parseFloat(junctionpay) + parseFloat(paymal) + parseFloat(dinga);
|
||||
var result = parseFloat(amount_due) - parseFloat(total);
|
||||
|
||||
<% if precision.to_i > 0 %>
|
||||
$('#balance').text(parseFloat(result).toFixed(<%= precision %>));
|
||||
<% else %>
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.master_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.visa_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.jcb_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.unionpay_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.alipay_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.paymal_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.dinga_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.junctionpay_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.redeem_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.cash_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.credit_sales") %></th>
|
||||
@@ -64,6 +69,11 @@
|
||||
<% master = 0 %>
|
||||
<% visa = 0 %>
|
||||
<% jcb = 0 %>
|
||||
<% unionpay = 0 %>
|
||||
<% alipay = 0 %>
|
||||
<% paymal = 0 %>
|
||||
<% dinga = 0 %>
|
||||
<% junctionpay = 0 %>
|
||||
<% paypar = 0 %>
|
||||
<% cash = 0 %>
|
||||
<% credit = 0 %>
|
||||
@@ -79,6 +89,11 @@
|
||||
<% master += sale[:master_amount] %>
|
||||
<% visa += sale[:visa_amount] %>
|
||||
<% jcb += sale[:jcb_amount] %>
|
||||
<% unionpay += sale[:unionpay_amount] %>
|
||||
<% alipay += sale[:alipay_amount] %>
|
||||
<% paymal += sale[:paymal_amount] %>
|
||||
<% dinga += sale[:dinga_amount] %>
|
||||
<% junctionpay += sale[:junctionpay_amount] %>
|
||||
<% paypar += sale[:paypar_amount] %>
|
||||
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
|
||||
<% credit += sale[:credit_amount] %>
|
||||
@@ -96,6 +111,11 @@
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:master_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:visa_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:jcb_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:unionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:alipay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:paymal_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:dinga_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:junctionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:paypar_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:cash_amount]-sale[:total_change_amount], precision:precision.to_i, delimiter: delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:credit_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
@@ -114,6 +134,11 @@
|
||||
<td style='text-align:right;'><%= number_with_precision(master, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(visa, precision:precision,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(jcb, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(unionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(alipay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(paymal, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(dinga, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(junctionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(paypar, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(cash, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
@@ -129,7 +154,7 @@
|
||||
<% @tax.each do |tax| %>
|
||||
<% total_tax += tax.tax_amount.to_f %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="12" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
|
||||
<td colspan="17" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
@@ -137,7 +162,7 @@
|
||||
<% end %>
|
||||
<% net = total - total_tax %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="12" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
|
||||
<td colspan="17" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
@@ -19,6 +19,11 @@
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.master_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.visa_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.jcb_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.unionpay_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.alipay_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.paymal_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.dinga_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.junctionpay_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.redeem_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.cash_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.credit_sales") %></th>
|
||||
@@ -37,6 +42,11 @@
|
||||
<% master = 0 %>
|
||||
<% visa = 0 %>
|
||||
<% jcb = 0 %>
|
||||
<% unionpay = 0 %>
|
||||
<% alipay = 0 %>
|
||||
<% paymal = 0 %>
|
||||
<% dinga = 0 %>
|
||||
<% junctionpay = 0 %>
|
||||
<% paypar = 0 %>
|
||||
<% cash = 0 %>
|
||||
<% credit = 0 %>
|
||||
@@ -52,6 +62,11 @@
|
||||
<% master += sale[:master_amount] %>
|
||||
<% visa += sale[:visa_amount] %>
|
||||
<% jcb += sale[:jcb_amount] %>
|
||||
<% unionpay += sale[:unionpay_amount] %>
|
||||
<% alipay += sale[:alipay_amount] %>
|
||||
<% paymal += sale[:paymal_amount] %>
|
||||
<% dinga += sale[:dinga_amount] %>
|
||||
<% junctionpay += sale[:junctionpay_amount] %>
|
||||
<% paypar += sale[:paypar_amount] %>
|
||||
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
|
||||
<% credit += sale[:credit_amount] %>
|
||||
@@ -69,6 +84,11 @@
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:master_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:visa_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:jcb_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:unionpay_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:alipay_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:paymal_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:dinga_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:junctionpay_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]-sale[:total_change_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
|
||||
@@ -44,6 +44,11 @@
|
||||
<th><%= t("views.right_panel.detail.master_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.visa_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.jcb_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.unionpay_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.alipay_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.paymal_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.dinga_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.junctionpay_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.redeem_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.cash_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.credit_sales") %></th>
|
||||
@@ -70,6 +75,11 @@
|
||||
<td><%= number_with_precision(sale[:master_amount], precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(sale[:visa_amount], precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(sale[:jcb_amount], precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(sale[:unionpay_amount], precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(sale[:alipay_amount], precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(sale[:paymal_amount], precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(sale[:dinga_amount], precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(sale[:junctionpay_amount], precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(sale[:paypar_amount], precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(sale[:cash_amount]-sale[:total_change_amount], precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(sale[:credit_amount] , precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
<th><%= t("views.right_panel.detail.master_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.visa_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.jcb_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.unionpay_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.alipay_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.paymal_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.dinga_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.junctionpay_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.redeem_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.cash_sales") %></th>
|
||||
<th><%= t("views.right_panel.detail.credit_sales") %></th>
|
||||
@@ -38,6 +43,11 @@
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:master_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:visa_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:jcb_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:unionpay_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:alipay_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:paymal_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:dinga_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:junctionpay_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]-sale[:total_change_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
<td><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%></td>
|
||||
|
||||
@@ -411,6 +411,11 @@ en:
|
||||
master_sales: "Master Sales"
|
||||
visa_sales: "Visa Sales"
|
||||
jcb_sales: "JCB Sales"
|
||||
unionpay_sales: "Unionpay Sales"
|
||||
alipay_sales: "Alipay Sales"
|
||||
paymal_sales: "Paymal Sales"
|
||||
dinga_sales: "Dinga Sales"
|
||||
junctionpay_sales: "JunctionPay Sales"
|
||||
redeem_sales: "Redeem Sales"
|
||||
cash_sales: "Cash Sales"
|
||||
credit_sales: "Credit Sales"
|
||||
|
||||
@@ -407,6 +407,10 @@ mm:
|
||||
visa_sales: "Visa ရောင်းရငွေ"
|
||||
jcb_sales: "JCB ရောင်းရငွေ"
|
||||
alipay_sales: "Alipay ရောင်းရငွေ"
|
||||
unionpay_sales: "Unionpay ရောင်းရငွေ"
|
||||
paymal_sales: "Paymal ရောင်းရငွေ"
|
||||
dinga_sales: "Dinga ရောင်းရငွေ"
|
||||
junctionpay_sales: "JunctionPay ရောင်းရငွေ"
|
||||
redeem_sales: "ဆုကြေးပြန်သုံးငွေနှင့် ရောင်းရငွေ"
|
||||
cash_sales: "ငွေသား ရောင်းရငွေ"
|
||||
credit_sales: "အကြွေး ရောင်းရငွေ"
|
||||
|
||||
@@ -184,6 +184,7 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
post 'payment/paymal' => 'paymal#create'
|
||||
post 'payment/alipay' => 'alipay#create'
|
||||
post 'payment/junctionpay' => 'junctionpay#create'
|
||||
post 'payment/dinga' => 'dinga#create'
|
||||
|
||||
get 'sale/:sale_id/:type/payment/credit_payment' => "credit_payments#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment' => "others_payments#index"
|
||||
@@ -197,6 +198,7 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
get 'sale/:sale_id/:type/payment/others_payment/Voucher' => "voucher#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment/JunctionPay' => "junction_pay#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment/Alipay' => "alipay#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment/DINGA' => "dinga#index"
|
||||
|
||||
#---------Void --------------#
|
||||
post 'sale/:sale_id/:type/void' => 'void#overall_void'
|
||||
|
||||
Reference in New Issue
Block a user