check payment method
This commit is contained in:
@@ -323,7 +323,7 @@ function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amoun
|
|||||||
if(jobj.STATUS == "Approved"){
|
if(jobj.STATUS == "Approved"){
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
url: "/origami/payment/"+payment_type,
|
url: "/origami/payment/"+payment_type,
|
||||||
data: "amount="+ bnk_bill_amount + "&sale_id="+ sale_id,
|
data: "amount="+ bnk_bill_amount + "&sale_id="+ sale_id + "&ref_no=" + jobj.REFNUM,
|
||||||
success:function(result){
|
success:function(result){
|
||||||
if(result){
|
if(result){
|
||||||
swal({
|
swal({
|
||||||
|
|||||||
@@ -84,6 +84,17 @@ class Api::PaymentsController < ActionController::API
|
|||||||
sale_payment.payment_reference = params[:payment_reference]
|
sale_payment.payment_reference = params[:payment_reference]
|
||||||
#TODO: implement paypar implementation
|
#TODO: implement paypar implementation
|
||||||
@status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name)
|
@status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name)
|
||||||
|
when "JunctionPay"
|
||||||
|
sale_payment.payment_method = "JunctionPay"
|
||||||
|
sale_payment.received_amount = params[:amount]
|
||||||
|
sale_payment.customer_id = params[:customer_id]
|
||||||
|
sale_payment.payment_reference = params[:vochure_no]
|
||||||
|
@status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name)
|
||||||
|
when "alipay"
|
||||||
|
sale_payment.payment_method = "alipay"
|
||||||
|
sale_payment.received_amount = params[:amount]
|
||||||
|
sale_payment.payment_reference = params[:payment_reference]
|
||||||
|
@status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
77
app/controllers/origami/alipay_controller.rb
Normal file
77
app/controllers/origami/alipay_controller.rb
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
class Origami::AlipayController < BaseOrigamiController
|
||||||
|
def index
|
||||||
|
@sale_id = params[:sale_id]
|
||||||
|
@cashier_type = params[:type]
|
||||||
|
# limit alipay_amount
|
||||||
|
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||||
|
total = 0
|
||||||
|
@alipaycount = 0
|
||||||
|
@shop = Shop::ShopDetail
|
||||||
|
@rounding_adj = 0
|
||||||
|
@can_alipay = 0
|
||||||
|
@member_discount = 0
|
||||||
|
@sub_total = 0
|
||||||
|
@membership_id = nil
|
||||||
|
@receipt_no = nil
|
||||||
|
if !sale_data.nil?
|
||||||
|
total = sale_data.grand_total
|
||||||
|
|
||||||
|
others = 0
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
sale_data.sale_payments.each do |sale_payment|
|
||||||
|
if sale_payment.payment_method == "alipay"
|
||||||
|
@alipaycount = @alipaycount + sale_payment.payment_amount
|
||||||
|
else
|
||||||
|
others = others + sale_payment.payment_amount
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@can_alipay = total - @alipaycount - others
|
||||||
|
|
||||||
|
@member_discount = MembershipSetting.find_by_discount(1)
|
||||||
|
@sub_total = sale_data.total_amount
|
||||||
|
@membership_id = sale_data.customer.membership_id
|
||||||
|
#for bank integration
|
||||||
|
@receipt_no = sale_data.receipt_no
|
||||||
|
end
|
||||||
|
|
||||||
|
bank_integration = Lookup.collection_of('bank_integration')
|
||||||
|
@bank_integration = 0
|
||||||
|
if !bank_integration[0].nil?
|
||||||
|
@bank_integration = bank_integration[0][1]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
cash = params[:amount]
|
||||||
|
sale_id = params[:sale_id]
|
||||||
|
ref_no = params[:ref_no]
|
||||||
|
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, "alipay",ref_no)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#Shop Name in Navbor
|
||||||
|
helper_method :shop_detail
|
||||||
|
def shop_detail
|
||||||
|
@shop = Shop.first
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -52,6 +52,7 @@ class Origami::JcbController < BaseOrigamiController
|
|||||||
def create
|
def create
|
||||||
cash = params[:amount]
|
cash = params[:amount]
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
|
ref_no = params[:ref_no]
|
||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
shop_details = Shop::ShopDetail
|
shop_details = Shop::ShopDetail
|
||||||
@@ -65,7 +66,7 @@ class Origami::JcbController < BaseOrigamiController
|
|||||||
|
|
||||||
# saleObj = Sale.find(sale_id)
|
# saleObj = Sale.find(sale_id)
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "jcb")
|
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "jcb",ref_no)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ class Origami::MasterController < BaseOrigamiController
|
|||||||
def create
|
def create
|
||||||
cash = params[:amount]
|
cash = params[:amount]
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
|
ref_no = params[:ref_no]
|
||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
shop_details = Shop::ShopDetail
|
shop_details = Shop::ShopDetail
|
||||||
@@ -63,7 +64,7 @@ class Origami::MasterController < BaseOrigamiController
|
|||||||
|
|
||||||
# saleObj = Sale.find(sale_id)
|
# saleObj = Sale.find(sale_id)
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "master")
|
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "master",ref_no)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ class Origami::MpuController < BaseOrigamiController
|
|||||||
def create
|
def create
|
||||||
cash = params[:amount]
|
cash = params[:amount]
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
|
ref_no = params[:ref_no]
|
||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
shop_details = Shop::ShopDetail
|
shop_details = Shop::ShopDetail
|
||||||
@@ -64,7 +65,7 @@ class Origami::MpuController < BaseOrigamiController
|
|||||||
|
|
||||||
# saleObj = Sale.find(sale_id)
|
# saleObj = Sale.find(sale_id)
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu")
|
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "alipay",ref_no)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
@jcbcount= 0.0
|
@jcbcount= 0.0
|
||||||
@mastercount = 0.0
|
@mastercount = 0.0
|
||||||
@unionpaycount = 0.0
|
@unionpaycount = 0.0
|
||||||
|
@alipaycount = 0.0
|
||||||
@junctionpaycount = 0.0
|
@junctionpaycount = 0.0
|
||||||
@credit = 0.0
|
@credit = 0.0
|
||||||
@sale_data = Sale.find_by_sale_id(sale_id)
|
@sale_data = Sale.find_by_sale_id(sale_id)
|
||||||
@@ -346,6 +347,8 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
@junctionpaycount += spay.payment_amount
|
@junctionpaycount += spay.payment_amount
|
||||||
elsif spay.payment_method == "creditnote"
|
elsif spay.payment_method == "creditnote"
|
||||||
@credit += spay.payment_amount
|
@credit += spay.payment_amount
|
||||||
|
elsif spay.payment_method == "alipay"
|
||||||
|
@alipaycount += spay.payment_amount
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class Origami::UnionpayController < BaseOrigamiController
|
|||||||
def create
|
def create
|
||||||
cash = params[:amount]
|
cash = params[:amount]
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
|
ref_no = params[:ref_no]
|
||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
shop_details = Shop::ShopDetail
|
shop_details = Shop::ShopDetail
|
||||||
@@ -62,7 +63,7 @@ class Origami::UnionpayController < BaseOrigamiController
|
|||||||
# saleObj = Sale.find(sale_id)
|
# saleObj = Sale.find(sale_id)
|
||||||
#end rounding adjustment
|
#end rounding adjustment
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "unionpay")
|
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "unionpay",ref_no)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class Origami::VisaController < BaseOrigamiController
|
|||||||
def create
|
def create
|
||||||
cash = params[:amount]
|
cash = params[:amount]
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
|
ref_no = params[:ref_no]
|
||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
shop_details = Shop::ShopDetail
|
shop_details = Shop::ShopDetail
|
||||||
@@ -62,7 +63,7 @@ class Origami::VisaController < BaseOrigamiController
|
|||||||
# saleObj = Sale.find(sale_id)
|
# saleObj = Sale.find(sale_id)
|
||||||
#end rounding adjustment
|
#end rounding adjustment
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "visa")
|
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "visa",ref_no)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ class SalePayment < ApplicationRecord
|
|||||||
payment_status = foc_payment
|
payment_status = foc_payment
|
||||||
when "JunctionPay"
|
when "JunctionPay"
|
||||||
payment_status = junction_pay_payment
|
payment_status = junction_pay_payment
|
||||||
|
when "alipay"
|
||||||
|
payment_status = external_terminal_card_payment(:alipay)
|
||||||
else
|
else
|
||||||
puts "it was something else"
|
puts "it was something else"
|
||||||
end
|
end
|
||||||
@@ -230,7 +232,7 @@ class SalePayment < ApplicationRecord
|
|||||||
payment_status = false
|
payment_status = false
|
||||||
self.payment_method = method
|
self.payment_method = method
|
||||||
self.payment_amount = self.received_amount
|
self.payment_amount = self.received_amount
|
||||||
self.payment_reference = self.card_payment_reference
|
# self.payment_reference = self.card_payment_reference
|
||||||
self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f
|
self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f
|
||||||
self.payment_status = "paid"
|
self.payment_status = "paid"
|
||||||
payment_method = self.save!
|
payment_method = self.save!
|
||||||
|
|||||||
5
app/views/origami/alipay/create.json.jbuilder
Executable file
5
app/views/origami/alipay/create.json.jbuilder
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
if(@status)
|
||||||
|
json.status @status
|
||||||
|
else
|
||||||
|
json.status false
|
||||||
|
end
|
||||||
258
app/views/origami/alipay/index.html.erb
Executable file
258
app/views/origami/alipay/index.html.erb
Executable file
@@ -0,0 +1,258 @@
|
|||||||
|
<div class="container-fluid">
|
||||||
|
<div id="loading_wrapper" style="display:none;">
|
||||||
|
<div id="loading"></div>
|
||||||
|
</div>
|
||||||
|
<!-- <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.btn.alipay") %></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">
|
||||||
|
<span class="hidden" id="membership_id"><%= @membership_id%></span>
|
||||||
|
<span class="hidden" id="member_discount"><%= @member_discount%></span>
|
||||||
|
<span class="hidden" id="sub-total"><%= @sub_total%></span>
|
||||||
|
<div class="card" style="margin-top:10px;padding:20px;">
|
||||||
|
<div class="card-block">
|
||||||
|
<div class="rebate-form">
|
||||||
|
<% if @bank_integration == '1' %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label for="com_port_name">Select Device</label>
|
||||||
|
<select id="com_port_name" name="com_port_name" class="form-control select col-lg-7 col-md-7 col-sm-7">
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label>You can pay up to </label>
|
||||||
|
<%@can_alipay = @can_alipay +@rounding_adj%>
|
||||||
|
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%= @can_alipay %>" data-member-value="">
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% if @alipaycount != 0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label>Recent Alipay paid amount </label>
|
||||||
|
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@alipaycount %>" data-member-value="">
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label>Reference Number</label>
|
||||||
|
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||||
|
<br><span id="reference_no_Err" style="color:red;"></span>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label>Amount</label>
|
||||||
|
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:;">
|
||||||
|
<div class=" m-t-10 p-l-20">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
|
<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 border-left green" 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="alipay_pay">Pay</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1 col-lg-1 col-sm-1">
|
||||||
|
<button type="button" class="btn bg-default 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>
|
||||||
|
var cashier_type = "<%= @cashier_type %>";
|
||||||
|
$(document).ready(function() {
|
||||||
|
var sale_id = "<%= @sale_id %>";
|
||||||
|
var bank_integration = "<%= @bank_integration %>";
|
||||||
|
|
||||||
|
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){}
|
||||||
|
else {
|
||||||
|
$('#validamount').attr("value",parseFloat("<%= @can_alipay %>") - parseFloat(localStorage.getItem("cash")));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(bank_integration == '1'){
|
||||||
|
if(typeof code2lab != 'undefined'){
|
||||||
|
code2lab.getCommPorts(); //get comportlists from jade
|
||||||
|
}else{
|
||||||
|
swal({
|
||||||
|
title: 'Oops',
|
||||||
|
text: 'Alipay is not available in here!',
|
||||||
|
type: 'error',
|
||||||
|
html: true,
|
||||||
|
closeOnConfirm: false,
|
||||||
|
closeOnCancel: false,
|
||||||
|
allowOutsideClick: false
|
||||||
|
}, function () {
|
||||||
|
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+ "/payment/others_payment";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.cashier_number', function(event){
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
if(event.handled !== true) {
|
||||||
|
var original_value;
|
||||||
|
original_value = $('#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"){
|
||||||
|
$('#amount').text(input_value);
|
||||||
|
}else{
|
||||||
|
$('#amount').append(input_value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'add':
|
||||||
|
var input_value = $(this).attr("data-value");
|
||||||
|
amount = parseInt(input_value) + parseInt(original_value);
|
||||||
|
$('#amount').html(amount);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'clr':
|
||||||
|
$('#amount').html("0.0");
|
||||||
|
break;
|
||||||
|
case 'del' :
|
||||||
|
var cash=$('#amount').text();
|
||||||
|
$('#amount').text(cash.substr(0,cash.length-1));
|
||||||
|
break;
|
||||||
|
case 'nett':
|
||||||
|
var remain_amount = $('#validamount').val();
|
||||||
|
$('#amount').text(remain_amount);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
event.handled = true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#alipay_pay').on('click',function(){
|
||||||
|
var amount = $('#amount').text();
|
||||||
|
var reference_no = $('#reference_no').val();
|
||||||
|
var sale_id = "<%= @sale_id %>";
|
||||||
|
var receipt_no = "<%= @receipt_no %>";
|
||||||
|
var bank_integration = "<%= @bank_integration %>";
|
||||||
|
var cashier_type = "<%= @cashier_type %>";
|
||||||
|
$("#reference_no_Err").html("");
|
||||||
|
if(reference_no.length > 0){
|
||||||
|
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||||
|
$(this).off("click");
|
||||||
|
//start member discount 5% by pay card
|
||||||
|
// var sub_total = $('#sub-total').text();
|
||||||
|
// var member_id = $('#membership_id').text();
|
||||||
|
// var member_discount = $('#member_discount').text();
|
||||||
|
// if (member_id && member_discount) {
|
||||||
|
// $.ajax({
|
||||||
|
// type: "POST",
|
||||||
|
// url: "/origami/" + sale_id + "/member_discount",
|
||||||
|
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||||
|
// success:function(result){
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//end member discount
|
||||||
|
if(bank_integration == '1'){
|
||||||
|
pay_withBank("SALE", "alipay", amount, sale_id, receipt_no,cashier_type);
|
||||||
|
}else{
|
||||||
|
$.ajax({type: "POST",
|
||||||
|
url: "<%= origami_payment_alipay_path %>",
|
||||||
|
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||||
|
success:function(result){
|
||||||
|
if(result){
|
||||||
|
swal({
|
||||||
|
title: "Information!",
|
||||||
|
text: "Payment Successfully",
|
||||||
|
html: true,
|
||||||
|
closeOnConfirm: false,
|
||||||
|
closeOnCancel: false,
|
||||||
|
allowOutsideClick: false
|
||||||
|
}, function () {
|
||||||
|
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+ "/payment";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
if (amount>0) {
|
||||||
|
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||||
|
}else{
|
||||||
|
swal ( "Oops" , "Enter Amount!" , "error" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$("#reference_no_Err").html("can't be blank");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -182,103 +182,125 @@
|
|||||||
<div class="card-title m-l-5 m-r-5">
|
<div class="card-title m-l-5 m-r-5">
|
||||||
<!-- mpu -->
|
<!-- mpu -->
|
||||||
<% if @other != 0.0 %>
|
<% if @other != 0.0 %>
|
||||||
<div class="row payment others-color">
|
<div class="row payment others-color">
|
||||||
<div class="col-md-5"></div>
|
|
||||||
<div class="col-md-3">MPU</div>
|
|
||||||
<div class="col-md-4 mpu is_card" id="others"><%= number_with_precision(@other, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="row hidden">
|
<div class="row hidden">
|
||||||
<div class="col-md-5"></div>
|
|
||||||
<div class="col-md-3">MPU</div>
|
|
||||||
<div class="col-md-4" id="others"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div class="col-md-5"></div>
|
||||||
|
<div class="col-md-3">MPU</div>
|
||||||
|
<% if @other != 0.0 %>
|
||||||
|
<div class="col-md-4 mpu is_card" id="others"><%= number_with_precision(@other, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="col-md-4" id="others"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
<!-- paypar -->
|
<!-- paypar -->
|
||||||
<% if @ppamount != 0.0 %>
|
<% if @ppamount != 0.0 %>
|
||||||
<div class="row payment others-color">
|
<div class="row payment others-color">
|
||||||
<div class="col-md-5"></div>
|
|
||||||
<div class="col-md-3">Redeem</div>
|
|
||||||
<div class="col-md-4" id="ppamount"><%= number_with_precision(@ppamount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="row hidden">
|
<div class="row hidden">
|
||||||
|
<% end %>
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">Redeem</div>
|
<div class="col-md-3">Redeem</div>
|
||||||
|
<% if @ppamount != 0.0 %>
|
||||||
|
<div class="col-md-4" id="ppamount"><%= number_with_precision(@ppamount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% else %>
|
||||||
<div class="col-md-4" id="ppamount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
<div class="col-md-4" id="ppamount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
<!-- Visa -->
|
<!-- Visa -->
|
||||||
<% if @visacount != 0.0 %>
|
<% if @visacount != 0.0 %>
|
||||||
<div class="row payment others-color">
|
<div class="row payment others-color">
|
||||||
<div class="col-md-5"></div>
|
|
||||||
<div class="col-md-3">VISA</div>
|
|
||||||
<div class="col-md-4 visa is_card" id="visacount"><%= number_with_precision(@visacount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="row hidden">
|
<div class="row hidden">
|
||||||
|
<% end %>
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">VISA</div>
|
<div class="col-md-3">VISA</div>
|
||||||
<div class="col-md-4" id="visacount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
<% if @visacount != 0.0 %>
|
||||||
|
<div class="col-md-4 visa is_card" id="visacount"><%= number_with_precision(@visacount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="col-md-4" id="visacount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
<!-- JCB -->
|
<!-- JCB -->
|
||||||
<% if @jcbcount != 0.0 %>
|
<% if @jcbcount != 0.0 %>
|
||||||
<div class="row payment others-color">
|
<div class="row payment others-color">
|
||||||
<div class="col-md-5"></div>
|
|
||||||
<div class="col-md-3">JCB</div>
|
|
||||||
<div class="col-md-4 jcb is_card" id="jcbcount"><%= number_with_precision(@jcbcount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="row hidden">
|
<div class="row hidden">
|
||||||
|
<% end %>
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">JCB</div>
|
<div class="col-md-3">JCB</div>
|
||||||
<div class="col-md-4" id="jcbcount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
<% if @jcbcount != 0.0 %>
|
||||||
|
<div class="col-md-4 jcb is_card" id="jcbcount"><%= number_with_precision(@jcbcount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="col-md-4" id="jcbcount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
<!-- Master -->
|
<!-- Master -->
|
||||||
<% if @mastercount != 0.0 %>
|
<% if @mastercount != 0.0 %>
|
||||||
<div class="row payment others-color">
|
<div class="row payment others-color">
|
||||||
<div class="col-md-5"></div>
|
|
||||||
<div class="col-md-3">MASTER</div>
|
|
||||||
<div class="col-md-4 master is_card" id="mastercount"><%= number_with_precision(@mastercount, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="row hidden">
|
<div class="row hidden">
|
||||||
|
<% end %>
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">MASTER</div>
|
<div class="col-md-3">MASTER</div>
|
||||||
<div class="col-md-4" id="mastercount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
<% if @mastercount != 0.0 %>
|
||||||
|
<div class="col-md-4 master is_card" id="mastercount"><%= number_with_precision(@mastercount, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="col-md-4" id="mastercount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
<!-- <br> -->
|
<!-- <br> -->
|
||||||
|
|
||||||
<!-- UNIONPAY -->
|
<!-- UNIONPAY -->
|
||||||
<% if @unionpaycount != 0.0 %>
|
<% if @unionpaycount != 0.0 %>
|
||||||
<div class="row payment others-color">
|
<div class="row payment others-color">
|
||||||
<div class="col-md-5"></div>
|
|
||||||
<div class="col-md-3">UNIONPAY</div>
|
|
||||||
<div class="col-md-4 master is_card" id="unionpaycount"><%= number_with_precision(@unionpaycount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="row hidden">
|
<div class="row hidden">
|
||||||
|
<% end %>
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">UNIONPAY</div>
|
<div class="col-md-3">UNIONPAY</div>
|
||||||
<div class="col-md-4" id="unionpaycount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
<% if @unionpaycount != 0.0 %>
|
||||||
|
<div class="col-md-4 master is_card" id="unionpaycount"><%= number_with_precision(@unionpaycount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="col-md-4" id="unionpaycount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Alipay -->
|
||||||
|
<% if @alipaycount != 0.0 %>
|
||||||
|
<div class="row payment others-color">
|
||||||
|
<% else %>
|
||||||
|
<div class="row hidden">
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div class="col-md-5"></div>
|
||||||
|
<div class="col-md-3">Alipay</div>
|
||||||
|
<% if @alipaycount != 0.0 %>
|
||||||
|
<div class="col-md-4 alipay is_card" id="alipaycount"><%= number_with_precision(@alipaycount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="col-md-4" id="alipaycount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Junction Pay -->
|
<!-- Junction Pay -->
|
||||||
<% if @junctionpaycount != 0.0 %>
|
<% if @junctionpaycount != 0.0 %>
|
||||||
<div class="row payment others-color">
|
<div class="row payment others-color">
|
||||||
<div class="col-md-5"></div>
|
|
||||||
<div class="col-md-3">JUNCTION PAY</div>
|
|
||||||
<div class="col-md-4 master is_card" id="junctionpaycount"><%= number_with_precision(@junctionpaycount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="row hidden">
|
<div class="row hidden">
|
||||||
|
<% end %>
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">JUNCTION PAY</div>
|
<div class="col-md-3">JUNCTION PAY</div>
|
||||||
<div class="col-md-4" id="junctionpaycount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
<% if @junctionpaycount != 0.0 %>
|
||||||
|
<div class="col-md-4 master is_card" id="junctionpaycount"><%= number_with_precision(@junctionpaycount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="col-md-4" id="junctionpaycount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div class="row m-l-5 m-r-5">
|
<div class="row m-l-5 m-r-5">
|
||||||
<div class="col-md-8"><strong>Balance</strong></div>
|
<div class="col-md-8"><strong>Balance</strong></div>
|
||||||
<div class="col-md-4"><strong><span id='balance'><%= number_with_precision(@sale_data.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></span></strong></div>
|
<div class="col-md-4"><strong><span id='balance'><%= number_with_precision(@sale_data.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></span></strong></div>
|
||||||
@@ -584,6 +606,9 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
else if(payment_type == "UNIONPAY" && $('#unionpaycount').text()==0 && sub_total != 0.0){
|
else if(payment_type == "UNIONPAY" && $('#unionpaycount').text()==0 && sub_total != 0.0){
|
||||||
swal("Oops","Please Pay with UNIONPAY Payment","warning");
|
swal("Oops","Please Pay with UNIONPAY Payment","warning");
|
||||||
}
|
}
|
||||||
|
else if(payment_type == "Alipay" && $('#alipaycount').text()==0 && sub_total != 0.0){
|
||||||
|
swal("Oops","Please Pay with Alipay Payment","warning");
|
||||||
|
}
|
||||||
else if(payment_type == "JUNCTIONPAY" && $('#junctionpaycount').text()==0 && sub_total != 0.0){
|
else if(payment_type == "JUNCTIONPAY" && $('#junctionpaycount').text()==0 && sub_total != 0.0){
|
||||||
swal("Oops","Please Pay with JUNCTIONPAY Payment","warning");
|
swal("Oops","Please Pay with JUNCTIONPAY Payment","warning");
|
||||||
}
|
}
|
||||||
@@ -866,8 +891,9 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
var jcb1 = $('#jcbcount').text();
|
var jcb1 = $('#jcbcount').text();
|
||||||
var master1 = $('#mastercount').text();
|
var master1 = $('#mastercount').text();
|
||||||
var unionpay1 = $('#unionpaycount').text();
|
var unionpay1 = $('#unionpaycount').text();
|
||||||
|
var alipay1 = $('#alipaycount').text();
|
||||||
var junctionpay1 = $('#junctionpaycount').text();
|
var junctionpay1 = $('#junctionpaycount').text();
|
||||||
var othertotal = parseFloat(credit1) + parseFloat(card1) + parseFloat(paypar1) + parseFloat(visa1) + parseFloat(jcb1) + parseFloat(master1) + parseFloat(unionpay1) + parseFloat(junctionpay1);
|
var othertotal = parseFloat(credit1) + parseFloat(card1) + parseFloat(paypar1) + parseFloat(visa1) + parseFloat(jcb1) + parseFloat(master1) + parseFloat(unionpay1) + parseFloat(alipay1) + parseFloat(junctionpay1);
|
||||||
var total = $('#amount_due').text();
|
var total = $('#amount_due').text();
|
||||||
var amt = 0;
|
var amt = 0;
|
||||||
<% if precision.to_i > 0 %>;
|
<% if precision.to_i > 0 %>;
|
||||||
@@ -895,9 +921,10 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
var jcb = $('#jcbcount').text();
|
var jcb = $('#jcbcount').text();
|
||||||
var master = $('#mastercount').text();
|
var master = $('#mastercount').text();
|
||||||
var unionpay = $('#unionpaycount').text();
|
var unionpay = $('#unionpaycount').text();
|
||||||
|
var alipay = $('#alipaycount').text();
|
||||||
var junctionpay = $('#junctionpaycount').text();
|
var junctionpay = $('#junctionpaycount').text();
|
||||||
var amount_due = $('#amount_due').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(junctionpay)
|
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master) + parseFloat(unionpay) + parseFloat(alipay) + parseFloat(junctionpay)
|
||||||
var result = parseFloat(amount_due) - parseFloat(total);
|
var result = parseFloat(amount_due) - parseFloat(total);
|
||||||
<% if precision.to_i > 0 %>
|
<% if precision.to_i > 0 %>
|
||||||
$('#balance').text(parseFloat(result).toFixed(<%= precision %>));
|
$('#balance').text(parseFloat(result).toFixed(<%= precision %>));
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ en:
|
|||||||
mpu: "MPU"
|
mpu: "MPU"
|
||||||
jcb: "JCB"
|
jcb: "JCB"
|
||||||
visa: "VISA"
|
visa: "VISA"
|
||||||
|
master: "MASTER"
|
||||||
|
alipay: "Alipay"
|
||||||
credit: "CREDIT"
|
credit: "CREDIT"
|
||||||
other_payment: "Other Payment"
|
other_payment: "Other Payment"
|
||||||
percentage: "PERCENTAGE"
|
percentage: "PERCENTAGE"
|
||||||
@@ -412,6 +414,7 @@ en:
|
|||||||
redeem_sales: "Redeem Sales"
|
redeem_sales: "Redeem Sales"
|
||||||
cash_sales: "Cash Sales"
|
cash_sales: "Cash Sales"
|
||||||
credit_sales: "Credit Sales"
|
credit_sales: "Credit Sales"
|
||||||
|
alipay_sales: "Alipay Sales"
|
||||||
foc_sales: "FOC Sales"
|
foc_sales: "FOC Sales"
|
||||||
foc_item: "Item FOC"
|
foc_item: "Item FOC"
|
||||||
net_amount: "Net Amount"
|
net_amount: "Net Amount"
|
||||||
|
|||||||
@@ -117,6 +117,8 @@ mm:
|
|||||||
mpu: "MPU"
|
mpu: "MPU"
|
||||||
jcb: "JCB"
|
jcb: "JCB"
|
||||||
visa: "VISA"
|
visa: "VISA"
|
||||||
|
master: "MASTER"
|
||||||
|
alipay: "Alipay"
|
||||||
credit: "အကြွေး"
|
credit: "အကြွေး"
|
||||||
other_payment: "အခြားငွေပေးဆောင်မှုများ"
|
other_payment: "အခြားငွေပေးဆောင်မှုများ"
|
||||||
percentage: "ရာခိုင်နှုန်း"
|
percentage: "ရာခိုင်နှုန်း"
|
||||||
@@ -404,6 +406,7 @@ mm:
|
|||||||
master_sales: "Master ရောင်းရငွေ"
|
master_sales: "Master ရောင်းရငွေ"
|
||||||
visa_sales: "Visa ရောင်းရငွေ"
|
visa_sales: "Visa ရောင်းရငွေ"
|
||||||
jcb_sales: "JCB ရောင်းရငွေ"
|
jcb_sales: "JCB ရောင်းရငွေ"
|
||||||
|
alipay_sales: "Alipay ရောင်းရငွေ"
|
||||||
redeem_sales: "ဆုကြေးပြန်သုံးငွေနှင့် ရောင်းရငွေ"
|
redeem_sales: "ဆုကြေးပြန်သုံးငွေနှင့် ရောင်းရငွေ"
|
||||||
cash_sales: "ငွေသား ရောင်းရငွေ"
|
cash_sales: "ငွေသား ရောင်းရငွေ"
|
||||||
credit_sales: "အကြွေး ရောင်းရငွေ"
|
credit_sales: "အကြွေး ရောင်းရငွေ"
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
post 'payment/paypar' => 'paypar_payments#create'
|
post 'payment/paypar' => 'paypar_payments#create'
|
||||||
post 'payment/credit' => 'credit_payments#create'
|
post 'payment/credit' => 'credit_payments#create'
|
||||||
post 'payment/voucher' => 'voucher_payments#create'
|
post 'payment/voucher' => 'voucher_payments#create'
|
||||||
|
post 'payment/alipay' => 'alipay#create'
|
||||||
|
post 'payment/junctionpay' => 'junctionpay#create'
|
||||||
|
|
||||||
get 'sale/:sale_id/:type/payment/credit_payment' => "credit_payments#index"
|
get 'sale/:sale_id/:type/payment/credit_payment' => "credit_payments#index"
|
||||||
get 'sale/:sale_id/:type/payment/others_payment' => "others_payments#index"
|
get 'sale/:sale_id/:type/payment/others_payment' => "others_payments#index"
|
||||||
@@ -191,6 +193,8 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
get 'sale/:sale_id/:type/payment/others_payment/UNIONPAY' => "unionpay#index"
|
get 'sale/:sale_id/:type/payment/others_payment/UNIONPAY' => "unionpay#index"
|
||||||
get 'sale/:sale_id/:type/payment/others_payment/Redeem' => "redeem_payments#index"
|
get 'sale/:sale_id/:type/payment/others_payment/Redeem' => "redeem_payments#index"
|
||||||
get 'sale/:sale_id/:type/payment/others_payment/Voucher' => "voucher#index"
|
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"
|
||||||
|
|
||||||
#---------Void --------------#
|
#---------Void --------------#
|
||||||
post 'sale/:sale_id/:type/void' => 'void#overall_void'
|
post 'sale/:sale_id/:type/void' => 'void#overall_void'
|
||||||
|
|||||||
5
spec/controllers/origami/alipay_controller_spec.rb
Normal file
5
spec/controllers/origami/alipay_controller_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe Origami::AlipayController, type: :controller do
|
||||||
|
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user