Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into r-1804001-01
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -52,6 +52,7 @@ gem 'rubyzip', '= 1.0.0'
|
|||||||
gem 'axlsx', '= 2.0.1'
|
gem 'axlsx', '= 2.0.1'
|
||||||
gem 'axlsx_rails'
|
gem 'axlsx_rails'
|
||||||
gem 'roo'
|
gem 'roo'
|
||||||
|
gem 'pdfjs_viewer-rails'
|
||||||
#Reporting gem
|
#Reporting gem
|
||||||
#gem 'compendium'
|
#gem 'compendium'
|
||||||
#gem "cancan"
|
#gem "cancan"
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ GEM
|
|||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
jquery-ui-rails (6.0.1)
|
jquery-ui-rails (6.0.1)
|
||||||
railties (>= 3.2.16)
|
railties (>= 3.2.16)
|
||||||
|
json (2.1.0)
|
||||||
kaminari (1.0.1)
|
kaminari (1.0.1)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
kaminari-actionview (= 1.0.1)
|
kaminari-actionview (= 1.0.1)
|
||||||
@@ -168,6 +169,10 @@ GEM
|
|||||||
nokogiri (1.8.1)
|
nokogiri (1.8.1)
|
||||||
mini_portile2 (~> 2.3.0)
|
mini_portile2 (~> 2.3.0)
|
||||||
pdf-core (0.7.0)
|
pdf-core (0.7.0)
|
||||||
|
pdfjs_viewer-rails (0.2.0)
|
||||||
|
json (> 1.8.4)
|
||||||
|
rails (> 4.2.0)
|
||||||
|
sass-rails (~> 5.0)
|
||||||
pg (0.21.0)
|
pg (0.21.0)
|
||||||
prawn (2.2.2)
|
prawn (2.2.2)
|
||||||
pdf-core (~> 0.7.0)
|
pdf-core (~> 0.7.0)
|
||||||
@@ -333,6 +338,7 @@ DEPENDENCIES
|
|||||||
momentjs-rails
|
momentjs-rails
|
||||||
mysql2 (>= 0.3.18, < 0.5)
|
mysql2 (>= 0.3.18, < 0.5)
|
||||||
nested_form
|
nested_form
|
||||||
|
pdfjs_viewer-rails
|
||||||
pg
|
pg
|
||||||
prawn
|
prawn
|
||||||
prawn-table
|
prawn-table
|
||||||
|
|||||||
BIN
Main Menu.xlsx
BIN
Main Menu.xlsx
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
class Api::ApiController < ActionController::API
|
class Api::ApiController < ActionController::API
|
||||||
include TokenVerification
|
include TokenVerification
|
||||||
|
|
||||||
before_action :lookup_domain
|
# before_action :lookup_domain
|
||||||
helper_method :current_token, :current_login_employee, :get_cashier
|
helper_method :current_token, :current_login_employee, :get_cashier
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ module TokenVerification
|
|||||||
# Rails.logger.debug "token - " + token.to_s
|
# Rails.logger.debug "token - " + token.to_s
|
||||||
if(options.length !=0 && options["from"] == "DOEMAL")
|
if(options.length !=0 && options["from"] == "DOEMAL")
|
||||||
if(ENV["SERVER_MODE"] === "cloud")
|
if(ENV["SERVER_MODE"] === "cloud")
|
||||||
from = request.subdomain.downcase + "." + request.domain.downcase
|
from = "local" #request.subdomain.downcase + "." + request.domain.downcase
|
||||||
aes = MyAesCrypt.new
|
aes = MyAesCrypt.new
|
||||||
return aes.checkKeyForAuth(from, token)
|
return aes.checkKeyForAuth(from, token)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -169,6 +169,8 @@ class Origami::CustomersController < BaseOrigamiController
|
|||||||
sale_audit = SaleAudit.record_audit_for_edit(sale.sale_id,sale.cashier_id, action_by,remark,"PAYBYACCOUNT" )
|
sale_audit = SaleAudit.record_audit_for_edit(sale.sale_id,sale.cashier_id, action_by,remark,"PAYBYACCOUNT" )
|
||||||
end
|
end
|
||||||
@out = membership_data
|
@out = membership_data
|
||||||
|
|
||||||
|
render json: JSON.generate({:status => membership_data["status"], :message => membership_data["message"]})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,32 +4,32 @@ class Origami::DingaController < BaseOrigamiController
|
|||||||
payment_method = params[:payment_method]
|
payment_method = params[:payment_method]
|
||||||
@cashier_type = params[:type]
|
@cashier_type = params[:type]
|
||||||
@membership_rebate_balance=0
|
@membership_rebate_balance=0
|
||||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
@sale_data = Sale.find_by_sale_id(@sale_id)
|
||||||
@receipt_no = sale_data.receipt_no
|
@receipt_no = @sale_data.receipt_no
|
||||||
@shop = Shop.first
|
@shop = Shop.first
|
||||||
# if @shop.is_rounding_adj
|
# if @shop.is_rounding_adj
|
||||||
# new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
# new_total = Sale.get_rounding_adjustment(@sale_data.grand_total)
|
||||||
# else
|
# else
|
||||||
# new_total = sale_data.grand_total
|
# new_total = @sale_data.grand_total
|
||||||
# end
|
# end
|
||||||
# @rounding_adj = new_total-sale_data.grand_total
|
# @rounding_adj = new_total-@sale_data.grand_total
|
||||||
@rounding_adj = sale_data.rounding_adjustment
|
@rounding_adj = @sale_data.rounding_adjustment
|
||||||
|
|
||||||
@payparcount = 0
|
@payparcount = 0
|
||||||
others = 0
|
others = 0
|
||||||
sale_data.sale_payments.each do |sale_payment|
|
@sale_data.sale_payments.each do |sale_payment|
|
||||||
if sale_payment.payment_method == "dinga"
|
if sale_payment.payment_method == "dinga"
|
||||||
@payparcount = @payparcount + sale_payment.payment_amount
|
@payparcount = @payparcount + sale_payment.payment_amount
|
||||||
else
|
else
|
||||||
others = others + sale_payment.payment_amount
|
others = others + sale_payment.payment_amount
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@payment_prices = sale_data.grand_total - @payparcount -others
|
@payment_prices = @sale_data.grand_total - @payparcount -others
|
||||||
|
|
||||||
|
|
||||||
if sale_data
|
if @sale_data
|
||||||
if sale_data.customer_id
|
if @sale_data.customer_id
|
||||||
customer_data= Customer.find_by_customer_id(sale_data.customer_id)
|
customer_data= Customer.find_by_customer_id(@sale_data.customer_id)
|
||||||
if customer_data
|
if customer_data
|
||||||
@membership_id = customer_data.membership_id
|
@membership_id = customer_data.membership_id
|
||||||
if !@membership_id.nil?
|
if !@membership_id.nil?
|
||||||
@@ -73,6 +73,7 @@ def create
|
|||||||
cash = params[:payment_amount]
|
cash = params[:payment_amount]
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
transaction_ref = params[:transaction_ref]
|
transaction_ref = params[:transaction_ref]
|
||||||
|
account_no = params[:account_no]
|
||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
shop_details = Shop.first
|
shop_details = Shop.first
|
||||||
@@ -85,7 +86,7 @@ def create
|
|||||||
|
|
||||||
# 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, "dinga",transaction_ref)
|
status, @sale = sale_payment.process_payment(saleObj, @user, cash, "dinga",account_no)
|
||||||
if status == true
|
if status == true
|
||||||
@out = true, "Success!"
|
@out = true, "Success!"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ def create
|
|||||||
cash = params[:payment_amount]
|
cash = params[:payment_amount]
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
transaction_ref = params[:transaction_ref]
|
transaction_ref = params[:transaction_ref]
|
||||||
|
account_no = params[:account_no]
|
||||||
|
puts params.to_json
|
||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
shop_details = Shop.first
|
shop_details = Shop.first
|
||||||
@@ -86,7 +88,7 @@ def create
|
|||||||
|
|
||||||
# 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, "paymal",transaction_ref)
|
status, @sale = sale_payment.process_payment(saleObj, @user, cash, "paymal",account_no)
|
||||||
if status == true
|
if status == true
|
||||||
@out = true, "Success!"
|
@out = true, "Success!"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -167,8 +167,9 @@ class Settings::MenusController < ApplicationController
|
|||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
p.serialize("tmp/menus/" + menu.name + ".xlsx")
|
file_path = "public/menus/" + menu.name + ".xlsx"
|
||||||
render :json => {status: true}
|
p.serialize(file_path)
|
||||||
|
render :json => { status: true, path: file_path }
|
||||||
end
|
end
|
||||||
|
|
||||||
def import
|
def import
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ class Menu < ApplicationRecord
|
|||||||
account = Account.create({title: row["Account"], account_type: "0"})
|
account = Account.create({title: row["Account"], account_type: "0"})
|
||||||
end
|
end
|
||||||
|
|
||||||
menu_itm = MenuItem.create(item_code: row["Item Code"], name: row["Item Name"], account_id: account.id, alt_name: row["Item AltName"], image_path: "", description: '', information: '', unit: '', type: "SimpleMenuItem", menu_category_id: menu_cat.id, item_attributes: "[]", item_options: "[]", account_id: account_id, is_sub_item: 0, is_available: 1, created_by: created_by)
|
menu_itm = MenuItem.create(item_code: row["Item Code"], name: row["Item Name"], account_id: account.id, alt_name: row["Item AltName"], image_path: "", description: '', information: '', unit: '', type: "SimpleMenuItem", menu_category_id: menu_cat.id, item_attributes: "[]", item_options: "[]", is_sub_item: 0, is_available: 1, created_by: created_by)
|
||||||
# else
|
# else
|
||||||
# status = status + "Item Code already exists for " + row["Item Name"] + "."
|
# status = status + "Item Code already exists for " + row["Item Name"] + "."
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -197,13 +197,14 @@ class SalePayment < ApplicationRecord
|
|||||||
|
|
||||||
def self.create_payment(paypar_url,token,membership_id,received_amount,sale_id)
|
def self.create_payment(paypar_url,token,membership_id,received_amount,sale_id)
|
||||||
membership_actions_data = MembershipAction.find_by_membership_type("create_payment");
|
membership_actions_data = MembershipAction.find_by_membership_type("create_payment");
|
||||||
|
sale_data = Sale.find_by_sale_id(sale_id)
|
||||||
|
customer_data = Customer.find_by_customer_id(sale_data.customer_id)
|
||||||
if !membership_actions_data.nil?
|
if !membership_actions_data.nil?
|
||||||
|
|
||||||
url = paypar_url.to_s + membership_actions_data.gateway_url.to_s
|
url = paypar_url.to_s + membership_actions_data.gateway_url.to_s
|
||||||
merchant_uid = membership_actions_data.merchant_account_id
|
merchant_uid = membership_actions_data.merchant_account_id
|
||||||
auth_token = membership_actions_data.auth_token
|
auth_token = membership_actions_data.auth_token
|
||||||
sale_data = Sale.find_by_sale_id(sale_id)
|
|
||||||
|
|
||||||
if sale_data
|
if sale_data
|
||||||
others = 0
|
others = 0
|
||||||
@@ -211,14 +212,27 @@ class SalePayment < ApplicationRecord
|
|||||||
others = others + sale_payment.payment_amount
|
others = others + sale_payment.payment_amount
|
||||||
end
|
end
|
||||||
payment_prices = sale_data.grand_total - others
|
payment_prices = sale_data.grand_total - others
|
||||||
# Control for Paypar Cloud
|
|
||||||
begin
|
if membership_id.to_i <= 0
|
||||||
response = HTTParty.post(url,
|
membership_id = customer_data.membership_id
|
||||||
:body => { membership_id:membership_id,
|
params = { membership_id:membership_id,
|
||||||
amount:received_amount,
|
amount:received_amount,
|
||||||
receipt_no:sale_data.receipt_no,
|
receipt_no:sale_data.receipt_no,
|
||||||
merchant_uid:merchant_uid,
|
merchant_uid:merchant_uid,
|
||||||
auth_token:auth_token}.to_json,
|
auth_token:auth_token}.to_json
|
||||||
|
else
|
||||||
|
params = { account_no:membership_id,
|
||||||
|
amount:received_amount,
|
||||||
|
receipt_no:sale_data.receipt_no,
|
||||||
|
merchant_uid:merchant_uid,
|
||||||
|
auth_token:auth_token}.to_json
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# Control for Paypar Cloud
|
||||||
|
begin
|
||||||
|
response = HTTParty.post(url,
|
||||||
|
:body => params,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json; version=3'
|
'Accept' => 'application/json; version=3'
|
||||||
@@ -242,7 +256,7 @@ class SalePayment < ApplicationRecord
|
|||||||
response =false;
|
response =false;
|
||||||
end
|
end
|
||||||
|
|
||||||
Rails.logger.debug "Payment response"
|
Rails.logger.debug "Create Payment response"
|
||||||
Rails.logger.debug response.to_json
|
Rails.logger.debug response.to_json
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
@@ -390,9 +404,13 @@ class SalePayment < ApplicationRecord
|
|||||||
payment_status = false
|
payment_status = false
|
||||||
|
|
||||||
#Next time - validate if the vochure number is valid - within
|
#Next time - validate if the vochure number is valid - within
|
||||||
customer_data = Customer.find_by_customer_id(self.sale.customer_id)
|
# customer_data = Customer.find_by_customer_id(self.sale.customer_id)
|
||||||
|
account_no = self.payment_reference
|
||||||
|
# if account_no.to_i <= 0
|
||||||
|
# account_no = customer_data.membership_id
|
||||||
|
# end
|
||||||
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
|
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)
|
membership_data = SalePayment.create_payment(membership_setting.gateway_url,membership_setting.auth_token,account_no,self.received_amount,self.sale.sale_id)
|
||||||
|
|
||||||
#record an payment in sale-audit
|
#record an payment in sale-audit
|
||||||
remark = "#{membership_data} PayMal Payment- for Customer #{self.sale.customer_id} Sale Id [#{self.sale.sale_id}]| pay amount -> #{self.received_amount} "
|
remark = "#{membership_data} PayMal Payment- for Customer #{self.sale.customer_id} Sale Id [#{self.sale.sale_id}]| pay amount -> #{self.received_amount} "
|
||||||
@@ -433,9 +451,16 @@ class SalePayment < ApplicationRecord
|
|||||||
payment_status = false
|
payment_status = false
|
||||||
|
|
||||||
#Next time - validate if the vochure number is valid - within
|
#Next time - validate if the vochure number is valid - within
|
||||||
customer_data = Customer.find_by_customer_id(self.sale.customer_id)
|
|
||||||
|
# customer_data = Customer.find_by_customer_id(self.sale.customer_id)
|
||||||
|
|
||||||
|
account_no = self.payment_reference
|
||||||
|
# if account_no == 0
|
||||||
|
# account_no = customer_data.customer_id
|
||||||
|
# end
|
||||||
|
|
||||||
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
|
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)
|
membership_data = SalePayment.create_payment(membership_setting.gateway_url,membership_setting.auth_token,account_no,self.received_amount,self.sale.sale_id)
|
||||||
|
|
||||||
#record an payment in sale-audit
|
#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} "
|
remark = "#{membership_data} Dinga Payment- for Customer #{self.sale.customer_id} Sale Id [#{self.sale.sale_id}]| pay amount -> #{self.received_amount} "
|
||||||
|
|||||||
@@ -46,6 +46,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<p class="hidden" name="sale_id" id="sale_id" ><%=@sale_id %></p>
|
||||||
|
<p class="hidden" name="receipt_no" id="receipt_no" ><%=@sale_data.receipt_no %></p>
|
||||||
<!-- <% if @payparcount > 0 %>
|
<!-- <% if @payparcount > 0 %>
|
||||||
<p class="">Last time rebate amount is <%= @payparcount %></p>
|
<p class="">Last time rebate amount is <%= @payparcount %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -203,7 +205,7 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<%=origami_payment_dinga_path%>",
|
url: "<%=origami_payment_dinga_path%>",
|
||||||
data: {payment_amount:payment_amount,membership_id:membership_id,sale_id:sale_id,transaction_ref:""},
|
data: {payment_amount:payment_amount,membership_id:membership_id,sale_id:sale_id,transaction_ref:"",account_no:0},
|
||||||
success: function(result){
|
success: function(result){
|
||||||
if(result.status == true){
|
if(result.status == true){
|
||||||
swal({
|
swal({
|
||||||
@@ -239,6 +241,7 @@
|
|||||||
var membership_id = '';
|
var membership_id = '';
|
||||||
var membership_type = '';
|
var membership_type = '';
|
||||||
var sale_id = $("#sale_id").text() || 0;
|
var sale_id = $("#sale_id").text() || 0;
|
||||||
|
var receipt_no = $("#receipt_no").text() || 0;
|
||||||
var customer_mamber_card_no = 0;
|
var customer_mamber_card_no = 0;
|
||||||
|
|
||||||
$("#is_paymemberModal").hide();
|
$("#is_paymemberModal").hide();
|
||||||
@@ -247,7 +250,6 @@
|
|||||||
getCardNo();
|
getCardNo();
|
||||||
$("#sxModal").hide();
|
$("#sxModal").hide();
|
||||||
customer_mamber_card_no = $("#paypar_account_no").val();
|
customer_mamber_card_no = $("#paypar_account_no").val();
|
||||||
|
|
||||||
if(sale_id != 0 && customer_mamber_card_no != 0){
|
if(sale_id != 0 && customer_mamber_card_no != 0){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@@ -255,6 +257,7 @@
|
|||||||
data: { account_no : customer_mamber_card_no, amount : payment_amount, receipt_no : receipt_no},
|
data: { account_no : customer_mamber_card_no, amount : payment_amount, receipt_no : receipt_no},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
console.log(data)
|
||||||
if (data.status == true) {
|
if (data.status == true) {
|
||||||
var valid_amount = parseFloat(data.old_balance_amount) - parseFloat(data.reload_amount);
|
var valid_amount = parseFloat(data.old_balance_amount) - parseFloat(data.reload_amount);
|
||||||
$("#valid_amount").val(parseFloat(valid_amount));
|
$("#valid_amount").val(parseFloat(valid_amount));
|
||||||
@@ -262,8 +265,9 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<%=origami_payment_dinga_path%>",
|
url: "<%=origami_payment_dinga_path%>",
|
||||||
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref},
|
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no :customer_mamber_card_no},
|
||||||
success: function(result){
|
success: function(result){
|
||||||
|
console.log(result)
|
||||||
if(result.status == true){
|
if(result.status == true){
|
||||||
swal({
|
swal({
|
||||||
title: "Information!",
|
title: "Information!",
|
||||||
@@ -273,7 +277,7 @@
|
|||||||
closeOnCancel: false,
|
closeOnCancel: false,
|
||||||
allowOutsideClick: false
|
allowOutsideClick: false
|
||||||
}, function () {
|
}, function () {
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||||
});
|
});
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@@ -291,14 +295,14 @@
|
|||||||
closeOnCancel: false,
|
closeOnCancel: false,
|
||||||
allowOutsideClick: false
|
allowOutsideClick: false
|
||||||
}, function () {
|
}, function () {
|
||||||
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/DINGA";
|
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/DINGA";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},100);
|
},100);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Read NFC card no from java
|
// Read NFC card no from java
|
||||||
@@ -321,6 +325,7 @@
|
|||||||
var customer_name = '';
|
var customer_name = '';
|
||||||
var membership_id = '';
|
var membership_id = '';
|
||||||
var membership_type = '';
|
var membership_type = '';
|
||||||
|
var receipt_no = $("#receipt_no").text() || 0;
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
code=getQRCode();
|
code=getQRCode();
|
||||||
if(sale_id != 0 && code != ""){
|
if(sale_id != 0 && code != ""){
|
||||||
@@ -337,8 +342,9 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<%=origami_payment_paymal_path%>",
|
url: "<%=origami_payment_paymal_path%>",
|
||||||
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref},
|
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:code},
|
||||||
success: function(result){
|
success: function(result){
|
||||||
|
|
||||||
if(result.status == true){
|
if(result.status == true){
|
||||||
swal({
|
swal({
|
||||||
title: "Information!",
|
title: "Information!",
|
||||||
|
|||||||
@@ -290,7 +290,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<p id="ref_no" class="hidden"></p>
|
<p id="ref_no" class="hidden"></p>
|
||||||
<p id="callback_url" class="hidden"></p>
|
<p id="callback_url" class="hidden"></p>
|
||||||
<p id="order_id"></p>
|
<p id="order_id" class="hidden"></p>
|
||||||
<p id="status" class="hidden"></p>
|
<p id="status" class="hidden"></p>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(function(){
|
jQuery(function(){
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
<div class="card m-l-10 m-t-10" style="padding:0px 20px;">
|
<div class="card m-l-10 m-t-10" style="padding:0px 20px;">
|
||||||
<div class="rebate-form">
|
<div class="rebate-form">
|
||||||
<input type="hidden" name="receipt_no" id="receipt_no" value="<%= @receipt_no%>">
|
<input type="hidden" name="receipt_no" id="receipt_no" value="<%= @receipt_no%>">
|
||||||
|
<p class="hidden" name="sale_id" id="sale_id" ><%=@sale_id %></p>
|
||||||
|
<p class="hidden" name="membership_id" id="membership_id" ><%=@membership_id %></p>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
<label class="">You can pay up to </label>
|
<label class="">You can pay up to </label>
|
||||||
@@ -204,7 +206,7 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<%=origami_payment_paymal_path%>",
|
url: "<%=origami_payment_paymal_path%>",
|
||||||
data: {payment_amount:payment_amount,membership_id:membership_id,sale_id:sale_id,transaction_ref:""},
|
data: {payment_amount:payment_amount,membership_id:membership_id,sale_id:sale_id,transaction_ref:"",account_no:0},
|
||||||
success: function(result){
|
success: function(result){
|
||||||
if(result.status == true){
|
if(result.status == true){
|
||||||
swal({
|
swal({
|
||||||
@@ -237,6 +239,7 @@
|
|||||||
var cardNo = "";
|
var cardNo = "";
|
||||||
var sale_id = $("#sale_id").text() || 0;
|
var sale_id = $("#sale_id").text() || 0;
|
||||||
var receipt_no = $("#receipt_no").val() || "";
|
var receipt_no = $("#receipt_no").val() || "";
|
||||||
|
|
||||||
var customer_mamber_card_no = 0;
|
var customer_mamber_card_no = 0;
|
||||||
var payment_amount = parseFloat($("#used_amount").text());
|
var payment_amount = parseFloat($("#used_amount").text());
|
||||||
|
|
||||||
@@ -246,8 +249,10 @@
|
|||||||
getCardNo();
|
getCardNo();
|
||||||
$("#sxModal").hide();
|
$("#sxModal").hide();
|
||||||
customer_mamber_card_no = $("#paypar_account_no").val();
|
customer_mamber_card_no = $("#paypar_account_no").val();
|
||||||
|
if (customer_mamber_card_no == 0) {
|
||||||
if(sale_id != 0 && customer_mamber_card_no != 0){
|
customer_mamber_card_no = $("#membership_id").text() || 0;
|
||||||
|
}
|
||||||
|
if(sale_id != 0 && customer_mamber_card_no !=0){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/origami/"+sale_id+"/send_account" ,
|
url: "/origami/"+sale_id+"/send_account" ,
|
||||||
@@ -261,7 +266,7 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<%=origami_payment_paymal_path%>",
|
url: "<%=origami_payment_paymal_path%>",
|
||||||
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref},
|
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:customer_mamber_card_no},
|
||||||
success: function(result){
|
success: function(result){
|
||||||
if(result.status == true){
|
if(result.status == true){
|
||||||
swal({
|
swal({
|
||||||
@@ -296,8 +301,10 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
swal("Opp","Please Check Member","warning")
|
||||||
}
|
}
|
||||||
},100);
|
},100);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Read NFC card no from java
|
// Read NFC card no from java
|
||||||
@@ -321,6 +328,7 @@
|
|||||||
var payment_amount = parseFloat($("#used_amount").text());
|
var payment_amount = parseFloat($("#used_amount").text());
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
code=getQRCode();
|
code=getQRCode();
|
||||||
|
alert(code)
|
||||||
if(sale_id != 0 && code != ""){
|
if(sale_id != 0 && code != ""){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@@ -335,8 +343,9 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<%=origami_payment_paymal_path%>",
|
url: "<%=origami_payment_paymal_path%>",
|
||||||
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref},
|
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:code},
|
||||||
success: function(result){
|
success: function(result){
|
||||||
|
alert(result)
|
||||||
if(result.status == true){
|
if(result.status == true){
|
||||||
swal({
|
swal({
|
||||||
title: "Information!",
|
title: "Information!",
|
||||||
|
|||||||
@@ -168,15 +168,15 @@
|
|||||||
<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 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>
|
</div>
|
||||||
<% 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 %>
|
<% 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="row payment other-payment-color" id="card_payment" >
|
||||||
<div class="col-md-8">Other Payments</div>
|
<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 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>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="row payment other-payment-color" id="card_payment" >
|
<div class="row payment other-payment-color" id="card_payment" >
|
||||||
<div class="col-md-8">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 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>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
@@ -269,12 +269,11 @@
|
|||||||
<div class="col-md-4" id="paymalcount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
<div class="col-md-4" id="paymalcount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- DINGA -->
|
<!-- DINGA -->
|
||||||
<div class="row <%= @dingacount!=0.0 ? 'payment others-color' : 'hidden'%>">
|
<div class="row <%= @dingacount!=0.0 ? 'payment others-color' : 'hidden'%>">
|
||||||
<div class="col-md-5"></div>
|
<div class="col-md-5"></div>
|
||||||
<div class="col-md-3">DINGA</div>
|
<div class="col-md-3">DINGA</div>
|
||||||
<% if @paymalcount != 0.0 %>
|
<% if @dingacount != 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>
|
<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 %>
|
<% else %>
|
||||||
<div class="col-md-4" id="dingacount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
<div class="col-md-4" id="dingacount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||||
@@ -634,6 +633,8 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
calculate_member_discount(sale_id);
|
calculate_member_discount(sale_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#pdfModal").modal({show : true, backdrop : false, keyboard : false});
|
||||||
|
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
url: "<%= origami_payment_cash_path %>",
|
url: "<%= origami_payment_cash_path %>",
|
||||||
data: "cash="+ cash + "&sale_id=" + sale_id + "&type=" + cashier_type,
|
data: "cash="+ cash + "&sale_id=" + sale_id + "&type=" + cashier_type,
|
||||||
@@ -656,10 +657,11 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
$("#loading_wrapper" ).hide();
|
$("#loading_wrapper" ).hide();
|
||||||
|
|
||||||
//PDF lightbox data
|
//PDF lightbox data
|
||||||
|
var pdfPath = "/en/pdfjs/minimal?file=" + result.filename.substring(6);
|
||||||
$("#sale_receipt_no").val(result.receipt_no);
|
$("#sale_receipt_no").val(result.receipt_no);
|
||||||
$("#filename").val(result.filename);
|
$("#filename").val(result.filename);
|
||||||
$("#printer_name").val(result.printer_name);
|
$("#printer_name").val(result.printer_name);
|
||||||
$("#receipt_pdf").attr("src", result.filename.substring(6));
|
$("#receipt_pdf").attr("src", pdfPath);
|
||||||
$("#pdfModal").modal({show : true, backdrop : false, keyboard : false});
|
$("#pdfModal").modal({show : true, backdrop : false, keyboard : false});
|
||||||
$("#pdfModalLabel").text("Sale Completed");
|
$("#pdfModalLabel").text("Sale Completed");
|
||||||
$("#changed_amount").text("");
|
$("#changed_amount").text("");
|
||||||
|
|||||||
@@ -115,7 +115,8 @@
|
|||||||
url: "/settings/menus/" + menu_id + "/export",
|
url: "/settings/menus/" + menu_id + "/export",
|
||||||
success: function(result){
|
success: function(result){
|
||||||
if(result.status){
|
if(result.status){
|
||||||
swal("Success", "Export Success...", "success");
|
location.href = result.path.substring(6);
|
||||||
|
// swal("Success", "Export Success...", "success");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
root 'home#index'
|
root 'home#index'
|
||||||
mount Sidekiq::Web => '/kiq'
|
mount Sidekiq::Web => '/kiq'
|
||||||
|
|
||||||
|
mount PdfjsViewer::Rails::Engine => "/pdfjs", as: 'pdfjs'
|
||||||
|
|
||||||
# Action Cable Creation
|
# Action Cable Creation
|
||||||
# if ENV["SERVER_MODE"] != "cloud"
|
# if ENV["SERVER_MODE"] != "cloud"
|
||||||
mount ActionCable.server => "/cable"
|
mount ActionCable.server => "/cable"
|
||||||
|
|||||||
@@ -3,8 +3,15 @@
|
|||||||
{
|
{
|
||||||
"lookup": "local",
|
"lookup": "local",
|
||||||
"value": {
|
"value": {
|
||||||
"key": "999d675168d813d5e1c7",
|
"key": "999d675168d813d5e1c7",
|
||||||
"iv": "999d675168d813d5e1c7"
|
"iv": "999d675168d813d5e1c7"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"lookup": "demo10.pos-myanmar.com",
|
||||||
|
"value": {
|
||||||
|
"key": "634W2ioj6QA88vafKamHBRu5aKX/BLIPdTWuuXGFBsA=\n",
|
||||||
|
"iv": "QqpO/h7o60dYTbNETRbZ4g==\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
BIN
public/menus/Main Menu.xlsx
Normal file
BIN
public/menus/Main Menu.xlsx
Normal file
Binary file not shown.
BIN
public/menus/Shwe Myittar.xlsx
Normal file
BIN
public/menus/Shwe Myittar.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user