This commit is contained in:
Nweni
2017-06-14 16:06:11 +06:30
parent af623cb474
commit f00bd9df37
3 changed files with 15 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
class Api::InvoicesController < ActionController::API
before :authenticate_token
before :set_sale_params, only:[:show, :update, :destroy]
# before :authenticate_token
# before :set_sale_params, only:[:show, :update, :destroy]
#List open invoices for today.
def index

View File

@@ -1,7 +1,7 @@
class Api::MembershipsController < ActionController::API
before :authenticate_token
#before :authenticate_token
#Add Membership to invoice
def create

View File

@@ -29,56 +29,56 @@ class Api::PaymentsController < ActionController::API
#:received_amount, :card_payment_reference, :vochure_no, :giftcard_no,
#:customer_id, :external_payment_status
switch (payment_method)
case "cash"
case payment_method
when "cash"
sale_payment.payment_method = "cash"
sale_payment.received_amount = params[:amount]
@status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name)
case "creditnote"
when "creditnote"
sale_payment.payment_method = "creditnote"
sale_payment.received_amount = params[:amount]
sale_payment.customer_id = params[:customer_id]
@status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name)
case "visa"
when "visa"
sale_payment.payment_method = "visa"
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)
case "master"
when "master"
sale_payment.payment_method = "master"
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)
case "jcb"
when "jcb"
sale_payment.payment_method = "jcb"
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)
case "mpu"
when "mpu"
sale_payment.payment_method = "mpu"
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)
case "unionpay"
when "unionpay"
sale_payment.payment_method = "unionpay"
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)
case "vochure"
when "vochure"
sale_payment.payment_method = "vochure"
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)
case "giftcard"
when "giftcard"
sale_payment.payment_method = "giftcard"
sale_payment.received_amount = params[:amount]
sale_payment.customer_id = params[:customer_id]
sale_payment.payment_reference = params[:giftcard_no]
@status, @invoice = sale_payment.process_payment(sale_payment, current_login_employee.name)
case "paypar"
when "paypar"
sale_payment.payment_method = "paypar"
sale_payment.received_amount = params[:amount]
sale_payment.payment_reference = params[:payment_reference]