Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -2,6 +2,21 @@ class Origami::JcbController < BaseOrigamiController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@sale_id = params[:sale_id]
|
@sale_id = params[:sale_id]
|
||||||
|
|
||||||
|
# limit jcb_amount
|
||||||
|
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||||
|
total = sale_data.grand_total
|
||||||
|
@jcbcount = 0
|
||||||
|
others = 0
|
||||||
|
sale_data.sale_payments.each do |sale_payment|
|
||||||
|
if sale_payment.payment_method == "jcb"
|
||||||
|
@jcbcount = @jcbcount + sale_payment.payment_amount
|
||||||
|
else
|
||||||
|
others = others + sale_payment.payment_amount
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@can_jcb = total - @jcbcount - others
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -2,6 +2,20 @@ class Origami::MasterController < BaseOrigamiController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@sale_id = params[:sale_id]
|
@sale_id = params[:sale_id]
|
||||||
|
|
||||||
|
# limit master_amount
|
||||||
|
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||||
|
total = sale_data.grand_total
|
||||||
|
@mastercount = 0
|
||||||
|
others = 0
|
||||||
|
sale_data.sale_payments.each do |sale_payment|
|
||||||
|
if sale_payment.payment_method == "master"
|
||||||
|
@mastercount = @mastercount + sale_payment.payment_amount
|
||||||
|
else
|
||||||
|
others = others + sale_payment.payment_amount
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@can_master = total - @mastercount - others
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -2,6 +2,21 @@ class Origami::MpuController < BaseOrigamiController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@sale_id = params[:sale_id]
|
@sale_id = params[:sale_id]
|
||||||
|
|
||||||
|
# limit mpu_amount
|
||||||
|
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||||
|
total = sale_data.grand_total
|
||||||
|
@mpucount = 0
|
||||||
|
others = 0
|
||||||
|
sale_data.sale_payments.each do |sale_payment|
|
||||||
|
if sale_payment.payment_method == "mpu"
|
||||||
|
@mpucount = @mpucount + sale_payment.payment_amount
|
||||||
|
else
|
||||||
|
others = others + sale_payment.payment_amount
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@can_mpu = total - @mpucount - others
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
@cash = 0.0
|
@cash = 0.0
|
||||||
@other = 0.0
|
@other = 0.0
|
||||||
@ppamount = 0.0
|
@ppamount = 0.0
|
||||||
|
@visacount= 0.0
|
||||||
|
@jcbcount= 0.0
|
||||||
|
@mastercount = 0.0
|
||||||
@sale_data = Sale.find_by_sale_id(sale_id)
|
@sale_data = Sale.find_by_sale_id(sale_id)
|
||||||
|
|
||||||
#get customer amount
|
#get customer amount
|
||||||
@@ -60,6 +63,12 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
@other += spay.payment_amount
|
@other += spay.payment_amount
|
||||||
elsif spay.payment_method == "paypar"
|
elsif spay.payment_method == "paypar"
|
||||||
@ppamount += spay.payment_amount
|
@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
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,6 +2,20 @@ class Origami::VisaController < BaseOrigamiController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@sale_id = params[:sale_id]
|
@sale_id = params[:sale_id]
|
||||||
|
|
||||||
|
# limit visa_amount
|
||||||
|
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||||
|
total = sale_data.grand_total
|
||||||
|
@visacount = 0
|
||||||
|
others = 0
|
||||||
|
sale_data.sale_payments.each do |sale_payment|
|
||||||
|
if sale_payment.payment_method == "visa"
|
||||||
|
@visacount = @visacount + sale_payment.payment_amount
|
||||||
|
else
|
||||||
|
others = others + sale_payment.payment_amount
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@can_visa = total - @visacount - others
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#Form object to use during the installation process - will handle creation of shop model into db after verification from the cloud
|
#Form object to use during the installation process - will handle creation of shop model into db after verification from the cloud
|
||||||
#provising service through license verification
|
#provising service through license verification
|
||||||
|
|
||||||
class ShopForm < ActiveModel
|
# class ShopForm < ActiveModel
|
||||||
:attr_accessor :logo, :name, :address, :township, :city, :state, :country, :license, :base_currency, :password, :password_confirmation
|
# # attr_accessor :logo, :name, :address, :township, :city, :state, :country, :license, :base_currency, :password, :password_confirmation
|
||||||
|
#
|
||||||
end
|
# end
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
self.qty_width = 20
|
self.qty_width = 20
|
||||||
self.total_width = 40
|
self.total_width = 40
|
||||||
self.item_width = self.page_width - ((self.price_width + self.qty_width + self.total_width)+(self.margin*4))
|
self.item_width = self.page_width - ((self.price_width + self.qty_width + self.total_width)+(self.margin*4))
|
||||||
self.item_height = 15
|
self.item_height = 15
|
||||||
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
|
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
|
||||||
self.label_width=80
|
self.label_width=80
|
||||||
|
|
||||||
# @item_width = self.page_width.to_i / 2
|
# @item_width = self.page_width.to_i / 2
|
||||||
# @qty_width = @item_width.to_i / 3
|
# @qty_width = @item_width.to_i / 3
|
||||||
@@ -31,7 +31,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
|
|
||||||
cashier_info(sale_data, customer_name)
|
cashier_info(sale_data, customer_name)
|
||||||
line_items(sale_items, food_total, beverage_total)
|
line_items(sale_items, food_total, beverage_total)
|
||||||
all_total(sale_data)
|
all_total(sale_data)
|
||||||
footer
|
footer
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
|
|
||||||
add_line_item_row(sale_items, food_total, beverage_total)
|
add_line_item_row(sale_items, food_total, beverage_total)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_line_item_row(sale_items, food_total, beverage_total)
|
def add_line_item_row(sale_items, food_total, beverage_total)
|
||||||
@@ -110,17 +110,15 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
total_price = item.qty*item.unit_price
|
total_price = item.qty*item.unit_price
|
||||||
price = item.unit_price
|
price = item.unit_price
|
||||||
product_name = item.product_name
|
product_name = item.product_name
|
||||||
|
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
pad_top(15) {
|
pad_top(15) {
|
||||||
# @item_width.to_i + @half_qty.to_i
|
|
||||||
text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :overflow => :shrink_to_fix, :size => self.item_font_size, :overflow => :shrink_to_fix
|
text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :overflow => :shrink_to_fix, :size => self.item_font_size, :overflow => :shrink_to_fix
|
||||||
text_box "#{price}", :at =>[self.item_width,y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
text_box "#{price}", :at =>[self.item_width,y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||||
text_box "#{qty.to_i}", :at =>[item_name_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
text_box "#{qty.to_i}", :at =>[item_name_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||||
text_box "#{total_price}", :at =>[(item_name_width+2),y_position], :width =>self.total_width+2, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
text_box "#{total_price}", :at =>[(item_name_width+2),y_position], :width =>self.total_width+2, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||||
|
|
||||||
}
|
}
|
||||||
move_down 3
|
move_down 3
|
||||||
end
|
end
|
||||||
@@ -151,7 +149,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
end
|
end
|
||||||
|
|
||||||
def all_total(sale_data)
|
def all_total(sale_data)
|
||||||
item_name_width = self.item_width
|
item_name_width = self.item_width
|
||||||
move_down 5
|
move_down 5
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class MenuReport < Compendium::Report
|
# class MenuReport < Compendium::Report
|
||||||
query :list, collect: :active_record do |params|
|
# query :list, collect: :active_record do |params|
|
||||||
Menu.all
|
# Menu.all
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
|
|||||||
@@ -10,14 +10,14 @@
|
|||||||
<nav class="pagination">
|
<nav class="pagination">
|
||||||
<%= first_page_tag unless current_page.first? %>
|
<%= first_page_tag unless current_page.first? %>
|
||||||
<%= prev_page_tag unless current_page.first? %>
|
<%= prev_page_tag unless current_page.first? %>
|
||||||
<% each_page do |page| -%>
|
<% each_page do |page| %>
|
||||||
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
|
<% if page.left_outer? || page.right_outer? || page.inside_window? %>
|
||||||
<%= page_tag page %>
|
<%= page_tag page %>
|
||||||
<% elsif !page.was_truncated? -%>
|
<% elsif !page.was_truncated? %>
|
||||||
<%= gap_tag %>
|
<%= gap_tag %>
|
||||||
<% end -%>
|
<% end %>
|
||||||
<% end -%>
|
<% end %>
|
||||||
<%= next_page_tag unless current_page.last? %>
|
<%= next_page_tag unless current_page.last? %>
|
||||||
<%= last_page_tag unless current_page.last? %>
|
<%= last_page_tag unless current_page.last? %>
|
||||||
</nav>
|
</nav>
|
||||||
<% end -%>
|
<% end %>
|
||||||
|
|||||||
@@ -9,6 +9,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card" style="margin-top:10px;padding-top:20px;">
|
<div class="card" style="margin-top:10px;padding-top:20px;">
|
||||||
<div class="rebate-form">
|
<div class="rebate-form">
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label class="col-lg-4 col-md-4 col-sm-4">You can pay upto </label>
|
||||||
|
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_jcb %>" data-member-value="">
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% if @jcbcount != 0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label class="col-lg-4 col-md-4 col-sm-4">Recent JCB paid amount </label>
|
||||||
|
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@jcbcount %>" data-member-value="">
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<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="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
||||||
@@ -75,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block"> Back </button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -125,16 +141,19 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
$('#jcb_pay').on('click',function(){
|
$('#jcb_pay').on('click',function(){
|
||||||
var amount = $('#amount').text();
|
var amount = $('#amount').text();
|
||||||
var sale_id = "<%= @sale_id %>";
|
var sale_id = "<%= @sale_id %>";
|
||||||
|
if(parseFloat(amount) <= "<%= @can_jcb %>"){
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
url: "<%= origami_payment_jcb_path %>",
|
url: "<%= origami_payment_jcb_path %>",
|
||||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||||
success:function(result){
|
success:function(result){
|
||||||
if(result){
|
if(result){
|
||||||
alert("Payment success")
|
alert("Payment success")
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
alert("Paid Amount is over!");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,6 +9,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card" style="margin-top:10px;padding-top:20px;">
|
<div class="card" style="margin-top:10px;padding-top:20px;">
|
||||||
<div class="rebate-form">
|
<div class="rebate-form">
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label class="col-lg-4 col-md-4 col-sm-4">You can pay upto </label>
|
||||||
|
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_master %>" data-member-value="">
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% if @mastercount != 0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label class="col-lg-4 col-md-4 col-sm-4">Recent Master paid amount </label>
|
||||||
|
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@mastercount %>" data-member-value="">
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<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="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
||||||
@@ -75,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block"> Back </button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -122,7 +138,7 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
$('#master_pay').on('click',function(){
|
$('#master_pay').on('click',function(){
|
||||||
var amount = $('#amount').text();
|
var amount = $('#amount').text();
|
||||||
var sale_id = "<%= @sale_id %>";
|
var sale_id = "<%= @sale_id %>";
|
||||||
|
if(parseFloat(amount) <= "<%= @can_master %>"){
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
url: "<%= origami_payment_master_path %>",
|
url: "<%= origami_payment_master_path %>",
|
||||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||||
@@ -133,5 +149,8 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
alert("Paid Amount is over!");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,6 +9,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card" style="margin-top:10px;padding-top:20px;">
|
<div class="card" style="margin-top:10px;padding-top:20px;">
|
||||||
<div class="rebate-form">
|
<div class="rebate-form">
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label class="col-lg-4 col-md-4 col-sm-4">You can pay upto </label>
|
||||||
|
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_mpu %>" data-member-value="">
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% if @mpucount != 0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label class="col-lg-4 col-md-4 col-sm-4">Recent MPU paid amount </label>
|
||||||
|
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@mpucount %>" data-member-value="">
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<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="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
||||||
@@ -75,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block"> Back </button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -122,16 +138,19 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
$('#mpu_pay').on('click',function(){
|
$('#mpu_pay').on('click',function(){
|
||||||
var amount = $('#amount').text();
|
var amount = $('#amount').text();
|
||||||
var sale_id = "<%= @sale_id %>";
|
var sale_id = "<%= @sale_id %>";
|
||||||
|
if(parseFloat(amount) <= "<%= @can_mpu %>"){
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
url: "<%= origami_payment_mpu_path %>",
|
url: "<%= origami_payment_mpu_path %>",
|
||||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||||
success:function(result){
|
success:function(result){
|
||||||
if(result){
|
if(result){
|
||||||
alert("Payment success")
|
alert("Payment success")
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
alert("Paid Amount is over!")
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -102,23 +102,76 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="row" id="card_payment">
|
<div class="row" id="card_payment">
|
||||||
<div class="container">
|
<div class="col-md-4">Other Payment</div>
|
||||||
<% if @other != 0.0 %>
|
<div class="col-md-8">
|
||||||
<div class="row">
|
<div class="container">
|
||||||
<div class="col-md-8">MPU</div>
|
<!-- mpu -->
|
||||||
<div class="col-md-4" id="others"><%= @other %></div>
|
<% if @other != 0.0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">MPU</div>
|
||||||
|
<div class="col-md-4" id="others"><%= @other %></div>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="row" style="display:none">
|
||||||
|
<div class="col-md-2">MPU</div>
|
||||||
|
<div class="col-md-4" id="others">0.0</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<!-- paypar -->
|
||||||
|
<% if @ppamount != 0.0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">Paypar</div>
|
||||||
|
<div class="col-md-4" id="ppamount"><%= @ppamount %></div>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="row" style="display:none">
|
||||||
|
<div class="col-md-2">Paypar</div>
|
||||||
|
<div class="col-md-4" id="ppamount">0.0</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<!-- Visa -->
|
||||||
|
<% if @visacount != 0.0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">Visa</div>
|
||||||
|
<div class="col-md-4" id="visacount"><%= @visacount %></div>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="row" style="display:none">
|
||||||
|
<div class="col-md-2">Visa</div>
|
||||||
|
<div class="col-md-4" id="visacount">0.0</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<!-- JCB -->
|
||||||
|
<% if @jcbcount != 0.0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">JCB</div>
|
||||||
|
<div class="col-md-4" id="jcbcount"><%= @jcbcount %></div>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="row" style="display:none">
|
||||||
|
<div class="col-md-2">JCB</div>
|
||||||
|
<div class="col-md-4" id="jcbcount">0.0</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<!-- Master -->
|
||||||
|
<% if @mastercount != 0.0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">Master</div>
|
||||||
|
<div class="col-md-4" id="mastercount"><%= @mastercount %></div>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="row" style="display:none">
|
||||||
|
<div class="col-md-2">Master</div>
|
||||||
|
<div class="col-md-4" id="mastercount">0.0</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% if @other == 0.0 && @ppamount == 0.0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2"></div>
|
||||||
|
<div class="col-md-4" id="others"><%= @ppamount %></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% elsif @ppamount != 0.0 %>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-8">Paypar</div>
|
|
||||||
<div class="col-md-4" id="others"><%= @ppamount %></div>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-8">Others Payment</div>
|
|
||||||
<div class="col-md-4" id="others"><%= @ppamount %></div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
@@ -275,8 +328,12 @@ function update_balance(){
|
|||||||
var cash = $('#cash').text();
|
var cash = $('#cash').text();
|
||||||
var credit = $('#credit').text();
|
var credit = $('#credit').text();
|
||||||
var card = $('#others').text();
|
var card = $('#others').text();
|
||||||
|
var paypar = $('#ppamount').text();
|
||||||
|
var visa = $('#visacount').text();
|
||||||
|
var jcb = $('#jcbcount').text();
|
||||||
|
var master = $('#mastercount').text();
|
||||||
var amount_due = $('#amount_due').text();
|
var amount_due = $('#amount_due').text();
|
||||||
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card)
|
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master)
|
||||||
var result = amount_due - total;
|
var result = amount_due - total;
|
||||||
$('#balance').text(result.toFixed(2));
|
$('#balance').text(result.toFixed(2));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,23 @@
|
|||||||
<div class="rebate-form">
|
<div class="rebate-form">
|
||||||
<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="col-lg-4 col-md-4 col-sm-4">Valid Rebate Amount</label>
|
<label class="col-lg-4 col-md-4 col-sm-4">You can redeem upto </label>
|
||||||
|
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%= @food_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="col-lg-4 col-md-4 col-sm-4">Recent Redeem 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="col-lg-4 col-md-4 col-sm-4">Available Redeem Amount</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 %>">
|
<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>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
@@ -19,10 +35,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% 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 %>
|
||||||
<p class="">You can rebate upto <span style="color:red;" id="food_prices"><%= @food_prices %></span></p>
|
<p class="">You can rebate upto <span style="color:red;" id="food_prices"><%= @food_prices %></span></p> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-7 col-md-7 col-sm-7">
|
<div class="col-lg-7 col-md-7 col-sm-7">
|
||||||
|
|||||||
@@ -9,6 +9,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card" style="margin-top:10px;padding-top:20px;">
|
<div class="card" style="margin-top:10px;padding-top:20px;">
|
||||||
<div class="rebate-form">
|
<div class="rebate-form">
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label class="col-lg-4 col-md-4 col-sm-4">You can pay upto </label>
|
||||||
|
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_visa %>" data-member-value="">
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% if @visacount != 0 %>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<label class="col-lg-4 col-md-4 col-sm-4">Recent Visa paid amount </label>
|
||||||
|
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@visacount %>" data-member-value="">
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<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="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
||||||
@@ -75,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block"> Back </button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -122,7 +138,7 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
$('#visa_pay').on('click',function(){
|
$('#visa_pay').on('click',function(){
|
||||||
var amount = $('#amount').text();
|
var amount = $('#amount').text();
|
||||||
var sale_id = "<%= @sale_id %>";
|
var sale_id = "<%= @sale_id %>";
|
||||||
|
if(parseFloat(amount) <= "<%= @can_visa %>"){
|
||||||
$.ajax({type: "POST",
|
$.ajax({type: "POST",
|
||||||
url: "<%= origami_payment_visa_path %>",
|
url: "<%= origami_payment_visa_path %>",
|
||||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||||
@@ -133,5 +149,8 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
alert("Paid Amount is over!");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user