Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Aung Myo
2018-05-14 15:54:32 +06:30
13 changed files with 167 additions and 125 deletions

View File

@@ -19,33 +19,34 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', {
}); });
// alert(order_lists); // alert(order_lists);
swal({ // swal({
title: 'Information', // title: 'Information',
target: document.getElementById(shop_code+"_notify_new_order"), // target: document.getElementById(shop_code+"_notify_new_order"),
text: "You have new orders <br/>"+ // text: "You have new orders <br/>"+
"Are you accept or reject for these orders <b>"+order_lists+"</b>?", // "Are you accept or reject for these orders <b>"+order_lists+"</b>?",
type: 'success', // type: 'success',
html: true, // html: true,
closeOnConfirm: false, // closeOnConfirm: false,
closeOnCancel: false, // closeOnCancel: false,
allowOutsideClick: false // allowOutsideClick: false
}, function (isConfirm) { // }, function (isConfirm) {
if(isConfirm){ // if(isConfirm){
swal.close(); // swal.close();
} // }
}); // });
// $("#notify_new_order_lists").text(order_lists); $("#notify_new_order_lists").text(order_lists);
// if($("#notify_new_order").hasClass("hidden")){ // if($("#notify_new_order").hasClass("hidden")){
// $("#notify_new_order").removeClass("hidden"); $("#notify_new_order").removeClass("hidden");
// } // }
// $("#notify_new_order").on('show.bs.modal', function(e){ $("#notify_new_order").on('shown.bs.modal', function(e){
// $("#notify_order_send_to_kitchen").addClass("hidden"); $(document).off('focusin.modal');
// $("#notify_order_ready_to_delivery").addClass("hidden"); $("#notify_new_order").focus();
// }).on('shown.bs.modal', function(e){ $("#"+shop_code+"_doemal_new_order").addClass("hidden");
// $("#notify_new_order").focus(); $("#notify_order_send_to_kitchen").addClass("hidden");
// }).on('hide.bs.modal', function (e) { $("#notify_order_ready_to_delivery").addClass("hidden");
// $("#notify_new_order").addClass("hidden"); }).on('hide.bs.modal', function (e) {
// }).modal({show: true, keyboard: false, backdrop: false}); $("#notify_new_order").addClass("hidden");
}).modal({show: true, keyboard: false, backdrop: false});
} }
} }
}); });

View File

@@ -19,33 +19,34 @@ App.check_order_ready_to_delivery = App.cable.subscriptions.create('CheckOrderRe
}); });
// alert(order_lists); // alert(order_lists);
swal({ // swal({
title: 'Information', // title: 'Information',
target: document.getElementById(shop_code+"_notify_order_ready_to_delivery"), // target: document.getElementById(shop_code+"_notify_order_ready_to_delivery"),
text: "You have orders that are ready to deliver <br/>"+ // text: "You have orders that are ready to deliver <br/>"+
"Could you ready these orders <b>"+order_lists+"</b> to deliver?", // "Could you ready these orders <b>"+order_lists+"</b> to deliver?",
type: 'success', // type: 'success',
html: true, // html: true,
closeOnConfirm: false, // closeOnConfirm: false,
closeOnCancel: false, // closeOnCancel: false,
allowOutsideClick: false // allowOutsideClick: false
}, function (isConfirm) { // }, function (isConfirm) {
if(isConfirm){ // if(isConfirm){
swal.close(); // swal.close();
} // }
}); // });
// $("#notify_order_ready_to_delivery_lists").text(order_lists); $("#notify_order_ready_to_delivery_lists").text(order_lists);
// if($("#notify_order_ready_to_delivery").hasClass("hidden")){ // if($("#notify_order_ready_to_delivery").hasClass("hidden")){
// $("#notify_order_ready_to_delivery").removeClass("hidden"); $("#notify_order_ready_to_delivery").removeClass("hidden");
// } // }
// $("#notify_order_ready_to_delivery").on('shown.bs.modal', function(e){ $("#notify_order_ready_to_delivery").on('shown.bs.modal', function(e){
// $("#notify_new_order").addClass("hidden"); // $(document).off('focusin.modal');
// $("#notify_order_send_to_kitchen").addClass("hidden"); $("#notify_order_ready_to_delivery").focus();
// }).on('shown.bs.modal', function(e){ $("#"+shop_code+"_doemal_new_order").addClass("hidden");
// $("#notify_order_ready_to_delivery").focus(); $("#notify_new_order").addClass("hidden");
// }).on('hide.bs.modal', function (e) { $("#notify_order_send_to_kitchen").addClass("hidden");
// $("#notify_order_ready_to_delivery").addClass("hidden"); }).on('hide.bs.modal', function (e) {
// }).modal({show: true, keyboard: false, backdrop: false}); $("#notify_order_ready_to_delivery").addClass("hidden");
}).modal({show: true, keyboard: false, backdrop: false});
} }
} }
}); });

View File

@@ -19,33 +19,34 @@ App.check_order_send_to_kitchen = App.cable.subscriptions.create('CheckOrderSend
}); });
// alert(order_lists); // alert(order_lists);
swal({ // swal({
title: 'Information', // title: 'Information',
target: document.getElementById(shop_code+"_notify_order_send_to_kitchen"), // target: document.getElementById(shop_code+"_notify_order_send_to_kitchen"),
text: "You have to send order to kitchen <br/>"+ // text: "You have to send order to kitchen <br/>"+
"Could you send these orders <b>"+order_lists+"</b> to kitchen?", // "Could you send these orders <b>"+order_lists+"</b> to kitchen?",
type: 'success', // type: 'success',
html: true, // html: true,
closeOnConfirm: false, // closeOnConfirm: false,
closeOnCancel: false, // closeOnCancel: false,
allowOutsideClick: false // allowOutsideClick: false
}, function (isConfirm) { // }, function (isConfirm) {
if(isConfirm){ // if(isConfirm){
swal.close(); // swal.close();
} // }
}); // });
// $("#notify_order_send_to_kitchen_lists").text(order_lists); $("#notify_order_send_to_kitchen_lists").text(order_lists);
// if($("#notify_order_send_to_kitchen").hasClass("hidden")){ // if($("#notify_order_send_to_kitchen").hasClass("hidden")){
// $("#notify_order_send_to_kitchen").removeClass("hidden"); $("#notify_order_send_to_kitchen").removeClass("hidden");
// } // }
// $("#notify_order_send_to_kitchen").on('show.bs.modal', function(e){ $("#notify_order_send_to_kitchen").on('shown.bs.modal', function(e){
// $("#notify_new_order").addClass("hidden"); // $(document).off('focusin.modal');
// $("#notify_order_ready_to_delivery").addClass("hidden"); $("#notify_order_send_to_kitchen").focus();
// }).on('shown.bs.modal', function(e){ $("#"+shop_code+"_doemal_new_order").addClass("hidden");
// $("#notify_order_send_to_kitchen").focus(); $("#notify_new_order").addClass("hidden");
// }).on('hide.bs.modal', function (e) { $("#notify_order_ready_to_delivery").addClass("hidden");
// $("#notify_order_send_to_kitchen").addClass("hidden"); }).on('hide.bs.modal', function (e) {
// }).modal({show: true, keyboard: false, backdrop: false}); $("#notify_order_send_to_kitchen").addClass("hidden");
}).modal({show: true, keyboard: false, backdrop: false});
} }
} }
}); });

View File

@@ -157,6 +157,7 @@ $(function() {
} }
}); });
// $('button[data-dismiss="modal"]').on('click', function(){ $(this).parent().parent().parent().parent().modal('hide'); }); // $('button[data-dismiss="modal"]').on('click', function(){ $(this).parent().parent().parent().parent().modal('hide'); });
// $(".new_order_close").on("click",function(){ // $(".new_order_close").on("click",function(){
@@ -473,36 +474,36 @@ function showNewOrder(order_reservation,shop_code){
audio.play(); audio.play();
// },10000); // },10000);
// $("#new_order").text(order_reservation.order_reservation_id); $("#new_order").text(order_reservation.order_reservation_id);
// $("#new_order_date").text(requested_date); $("#new_order_date").text(requested_date);
// if($("#"+shop_code+"_doemal_new_order").hasClass("hidden")){ // if($("#"+shop_code+"_doemal_new_order").hasClass("hidden")){
// $("#"+shop_code+"_doemal_new_order").removeClass("hidden"); $("#"+shop_code+"_doemal_new_order").removeClass("hidden");
// } // }
// $("#"+shop_code+"_doemal_new_order").on('show.bs.modal', function(e){ $("#"+shop_code+"_doemal_new_order").on('shown.bs.modal', function(e){
// $("#notify_new_order").addClass("hidden"); // $(document).off('focusin.modal');
// $("#notify_order_send_to_kitchen").addClass("hidden"); $("#"+shop_code+"_doemal_new_order").focus();
// $("#notify_order_ready_to_delivery").addClass("hidden"); $("#notify_new_order").addClass("hidden");
// }).on('shown.bs.modal', function(e){ $("#notify_order_send_to_kitchen").addClass("hidden");
// $("#"+shop_code+"_doemal_new_order").focus(); $("#notify_order_ready_to_delivery").addClass("hidden");
// }).on('hide.bs.modal', function (e) { }).on('hide.bs.modal', function (e) {
// $("#"+shop_code+"_doemal_new_order").addClass("hidden"); $("#"+shop_code+"_doemal_new_order").addClass("hidden");
// }).modal({show: true, keyboard: false, backdrop: false}); }).modal({show: true, keyboard: false, backdrop: false});
swal({ // swal({
title: 'Information', // title: 'Information',
target: document.getElementById(shop_code+"_notify_new_order"), // target: document.getElementById(shop_code+"_notify_new_order"),
text: "You have new order "+ // text: "You have new order "+
"<b>"+order_reservation.order_reservation_id+"</b> requested for "+requested_date+"?", // "<b>"+order_reservation.order_reservation_id+"</b> requested for "+requested_date+"?",
type: 'success', // type: 'success',
html: true, // html: true,
closeOnConfirm: false, // closeOnConfirm: false,
closeOnCancel: false, // closeOnCancel: false,
allowOutsideClick: false // allowOutsideClick: false
}, function (isConfirm) { // }, function (isConfirm) {
if(isConfirm){ // if(isConfirm){
audio.pause(); // audio.pause();
swal.close(); // swal.close();
} // }
}); // });
} }
} }

View File

@@ -89,7 +89,6 @@ class Oqs::HomeController < BaseOqsController
# Query for OQS with delivery status # Query for OQS with delivery status
def queue_items_query(status) def queue_items_query(status)
byebug
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type as type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at") AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type as type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at")
.joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id .joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id

View File

@@ -81,6 +81,8 @@ class Origami::ShiftsController < BaseOrigamiController
#get tax #get tax
shift_obj = ShiftSale.where('id =?',@shift.id) shift_obj = ShiftSale.where('id =?',@shift.id)
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='') @sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
@total_waste = Sale.get_total_waste(shift_id).sum(:grand_total)
@total_spoile = Sale.get_total_spoile(shift_id).sum(:grand_total)
#other payment details for mpu or visa like card #other payment details for mpu or visa like card
@other_payment = ShiftSale.get_by_shift_other_payment(@shift) @other_payment = ShiftSale.get_by_shift_other_payment(@shift)
@@ -94,10 +96,9 @@ class Origami::ShiftsController < BaseOrigamiController
# get printer info # get printer info
print_settings = PrintSetting.find_by_unique_code(unique_code) print_settings = PrintSetting.find_by_unique_code(unique_code)
#byebug
printer = Printer::CashierStationPrinter.new(print_settings) printer = Printer::CashierStationPrinter.new(print_settings)
printer.print_close_cashier(print_settings,cashier_terminal,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges) printer.print_close_cashier(print_settings,cashier_terminal,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges,@total_waste,@total_spoile)
end end
end end
Employee.logout(session[:session_token]) Employee.logout(session[:session_token])

View File

@@ -38,7 +38,7 @@ class Printer::CashierStationPrinter < Printer::PrinterWorker
# self.print(filename, cashier_terminal.printer_name) # self.print(filename, cashier_terminal.printer_name)
# end # end
def print_close_cashier(printer_settings,cashier_terminal,shift_sale,shop_details,sale_taxes,other_payment,amount,discount,member_discount,total_dinein,total_takeway,total_other_charges) def print_close_cashier(printer_settings,cashier_terminal,shift_sale,shop_details,sale_taxes,other_payment,amount,discount,member_discount,total_dinein,total_takeway,total_other_charges,total_waste,total_spoile)
#Use CUPS service #Use CUPS service
#Generate PDF #Generate PDF
@@ -46,7 +46,7 @@ class Printer::CashierStationPrinter < Printer::PrinterWorker
cashier = shift_sale.employee.name cashier = shift_sale.employee.name
shift_name = shift_sale.shift_started_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") + "_" + shift_sale.shift_closed_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") shift_name = shift_sale.shift_started_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") + "_" + shift_sale.shift_closed_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p")
filename = "tmp/close_cashier_#{cashier}_#{shift_name}.pdf" filename = "tmp/close_cashier_#{cashier}_#{shift_name}.pdf"
pdf = CloseCashierPdf.new(printer_settings,shift_sale,shop_details,sale_taxes,other_payment,amount,discount,member_discount) pdf = CloseCashierPdf.new(printer_settings,shift_sale,shop_details,sale_taxes,other_payment,amount,discount,member_discount,total_waste,total_spoile)
close_cashier_pdf = Lookup.collection_of("print_settings") #print_settings with name:CloseCashierPdf close_cashier_pdf = Lookup.collection_of("print_settings") #print_settings with name:CloseCashierPdf
if !close_cashier_pdf.empty? if !close_cashier_pdf.empty?
@@ -55,7 +55,7 @@ class Printer::CashierStationPrinter < Printer::PrinterWorker
if close_cashier[1] == '1' if close_cashier[1] == '1'
pdf = CloseCashierCustomisePdf.new(printer_settings,shift_sale,shop_details,sale_taxes,other_payment,amount,discount,member_discount,total_dinein,total_takeway,total_other_charges) pdf = CloseCashierCustomisePdf.new(printer_settings,shift_sale,shop_details,sale_taxes,other_payment,amount,discount,member_discount,total_dinein,total_takeway,total_other_charges)
else else
pdf = CloseCashierPdf.new(printer_settings,shift_sale,shop_details,sale_taxes,other_payment,amount,discount,member_discount) pdf = CloseCashierPdf.new(printer_settings,shift_sale,shop_details,sale_taxes,other_payment,amount,discount,member_discount,total_waste,total_spoile)
end end
end end
end end

View File

@@ -1092,6 +1092,14 @@ end
return sale_arr return sale_arr
end end
def self.get_total_waste(shift_id)
query = Sale.where("sale_status = 'waste' and shift_sale_id = ?", shift_id)
end
def self.get_total_spoile(shift_id)
query = Sale.where("sale_status = 'spoile' and shift_sale_id = ?", shift_id)
end
def self.get_separate_tax(shift_sale_range=nil,shift,from,to,payment_type) def self.get_separate_tax(shift_sale_range=nil,shift,from,to,payment_type)
# wrong amount tax for service and commercial tax # wrong amount tax for service and commercial tax

View File

@@ -70,7 +70,7 @@ class CloseCashierCustomisePdf < Prawn::Document
stroke_horizontal_rule stroke_horizontal_rule
end end
def shift_detail(shift_sale,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,precision,delimiter,total_dinein,total_takeway,total_other_charges) def shift_detail(shift_sale,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,precision,delimiter,total_dinein,total_takeway,total_other_charges,total_spoile)
move_down 7 move_down 7
y_position = cursor y_position = cursor
bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do

View File

@@ -2,7 +2,7 @@ class CloseCashierPdf < Prawn::Document
include ActionView::Helpers::NumberHelper include ActionView::Helpers::NumberHelper
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width,:text_width attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width,:text_width
def initialize(printer_settings, shift_sale,shop_details,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount) def initialize(printer_settings, shift_sale,shop_details,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,total_waste,total_spoile)
self.page_width = printer_settings.page_width #PrintSetting.where("name = ?","Close Cashier").first.page_width self.page_width = printer_settings.page_width #PrintSetting.where("name = ?","Close Cashier").first.page_width
self.page_height = printer_settings.page_height self.page_height = printer_settings.page_height
self.header_font_size = printer_settings.header_font_size.to_i self.header_font_size = printer_settings.header_font_size.to_i
@@ -54,7 +54,7 @@ class CloseCashierPdf < Prawn::Document
stroke_horizontal_rule stroke_horizontal_rule
shift_detail(shift_sale,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,printer_settings.precision,delimiter) shift_detail(shift_sale,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,printer_settings.precision,delimiter,total_waste,total_spoile)
end end
def header (shop_details) def header (shop_details)
@@ -70,7 +70,7 @@ class CloseCashierPdf < Prawn::Document
stroke_horizontal_rule stroke_horizontal_rule
end end
def shift_detail(shift_sale,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,precision,delimiter) def shift_detail(shift_sale,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,precision,delimiter,total_waste,total_spoile)
move_down 7 move_down 7
y_position = cursor y_position = cursor
bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do
@@ -333,7 +333,7 @@ class CloseCashierPdf < Prawn::Document
text "(#{ number_with_precision(@total_foc, :precision => precision.to_i, :delimiter => delimiter)})", :size => self.item_font_size, :align => :right text "(#{ number_with_precision(@total_foc, :precision => precision.to_i, :delimiter => delimiter)})", :size => self.item_font_size, :align => :right
end end
y_position = cursor y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
text "Total Void :", :size => self.item_font_size, :align => :right text "Total Void :", :size => self.item_font_size, :align => :right
end end
@@ -341,6 +341,22 @@ class CloseCashierPdf < Prawn::Document
text "(#{shift_sale.total_void})", :size => self.item_font_size, :align => :right text "(#{shift_sale.total_void})", :size => self.item_font_size, :align => :right
end end
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
text "Total Waste :", :size => self.item_font_size, :align => :right
end
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
text "(#{ number_with_precision(total_waste, :precision => precision.to_i, :delimiter => delimiter)})", :size => self.item_font_size, :align => :right
end
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
text "Total Spoile :", :size => self.item_font_size, :align => :right
end
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
text "(#{ number_with_precision(total_spoile, :precision => precision.to_i, :delimiter => delimiter)})", :size => self.item_font_size, :align => :right
end
# y_position = cursor # y_position = cursor
# bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do # bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
# text "Grand Total :", :size => self.item_font_size, :align => :right # text "Grand Total :", :size => self.item_font_size, :align => :right

View File

@@ -463,11 +463,10 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_doemal_new_order"></div>
<div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_doemal_new_order"></div>
<div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_new_order"></div> <div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_new_order"></div>
<div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_send_to_kitchen"></div> <div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_send_to_kitchen"></div>
<div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_ready_to_delivery"></div> <div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_ready_to_delivery"></div> -->
</div> </div>
<p id="ref_no" class="hidden"></p> <p id="ref_no" class="hidden"></p>
@@ -584,7 +583,8 @@
</div> </div>
</div> </div>
<!-- <div class="modal fade text-center" id="<%= @shop.shop_code ? @shop.shop_code : '' %>_doemal_new_order" tabindex="-1" role="dialog"> <div class="modal fade text-center" id="<%= @shop.shop_code ? @shop.shop_code : '' %>_doemal_new_order" tabindex="-1" role="dialog">
>>>>>>> 8fda04372d3c2d7255bbd4c14ed3b3c8d9f5937e
<div class="modal-dialog modal-md" role="document"> <div class="modal-dialog modal-md" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@@ -598,7 +598,7 @@
<div class="modal-footer "> <div class="modal-footer ">
<div class="row p-r-20"> <div class="row p-r-20">
<div class="col-md-5"> <div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect new_order_close" data-value="<%= @shop.shop_code ? @shop.shop_code : '' %>" data-dismiss="modal">CLOSE</button> <button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue new_order_close" data-value="<%= @shop.shop_code ? @shop.shop_code : '' %>"data-dismiss="modal">CLOSE</button>
</div> </div>
</div> </div>
</div> </div>
@@ -620,7 +620,7 @@
<div class="modal-footer "> <div class="modal-footer ">
<div class="row p-r-20"> <div class="row p-r-20">
<div class="col-md-5"> <div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button> <button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue" data-dismiss="modal">CLOSE</button>
</div> </div>
</div> </div>
</div> </div>
@@ -642,7 +642,7 @@
<div class="modal-footer "> <div class="modal-footer ">
<div class="row p-r-20"> <div class="row p-r-20">
<div class="col-md-5"> <div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button> <button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue" data-dismiss="modal">CLOSE</button>
</div> </div>
</div> </div>
</div> </div>
@@ -664,11 +664,11 @@
<div class="modal-footer "> <div class="modal-footer ">
<div class="row p-r-20"> <div class="row p-r-20">
<div class="col-md-5"> <div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button> <button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue" data-dismiss="modal">CLOSE</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> --> </div>

View File

@@ -24,7 +24,7 @@
<span style='font-size:20px;'><b><%= t :closing_balance %></b></span> <span style='font-size:20px;'><b><%= t :closing_balance %></b></span>
</div> </div>
<div class='col-md-6'> <div class='col-md-6'>
<span style='font-size:20px;'><b><input type='text' class="form-control" id='closing_balance_amount' value=''></b></span> <span style='font-size:20px;'><b><input type='number' class="form-control" id='closing_balance_amount' value='' onkeypress="return isNumberKey(event);" onkeyup="notNegative(this.value);"></b></span>
</div> </div>
</div> </div>
</div> </div>
@@ -58,6 +58,20 @@
</div> </div>
</div> </div>
<script> <script>
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
} else {
return true;
}
}
function greaterThanOne(val){
if(parseInt(val)==0) $("#closing_balance_amount").val(1);
}
var cashier_type = '<%= @cashier_type %>'; var cashier_type = '<%= @cashier_type %>';
$('#close_cashier').on('click',function(){ $('#close_cashier').on('click',function(){
var amount = $('#closing_balance_amount').val(); var amount = $('#closing_balance_amount').val();

BIN
public/AC-beep.mp3 Normal file

Binary file not shown.