Pull from master

This commit is contained in:
San Wai Lwin
2018-05-18 09:49:47 +06:30
34 changed files with 316 additions and 271 deletions

View File

@@ -19,21 +19,7 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', {
}); });
// alert(order_lists); // alert(order_lists);
// swal({ checkNewOrderAlert(shop_code, order_lists);
// title: 'Information',
// target: document.getElementById(shop_code+"_notify_new_order"),
// text: "You have new orders <br/>"+
// "Are you accept or reject for these orders <b>"+order_lists+"</b>?",
// type: 'success',
// html: true,
// closeOnConfirm: false,
// closeOnCancel: false,
// allowOutsideClick: false
// }, function (isConfirm) {
// if(isConfirm){
// swal.close();
// }
// });
// $("#notify_new_order_lists").text(order_lists); // $("#notify_new_order_lists").text(order_lists);
// if($("#"+shop_code+"_notify_new_order").hasClass("hidden")){ // if($("#"+shop_code+"_notify_new_order").hasClass("hidden")){
// $("#"+shop_code+"_notify_new_order").removeClass("hidden"); // $("#"+shop_code+"_notify_new_order").removeClass("hidden");

View File

@@ -19,21 +19,7 @@ App.check_order_ready_to_delivery = App.cable.subscriptions.create('CheckOrderRe
}); });
// alert(order_lists); // alert(order_lists);
// swal({ checkOrderReadyToKitchenAlert(shop_code, order_lists);
// title: 'Information',
// target: document.getElementById(shop_code+"_notify_order_ready_to_delivery"),
// text: "You have orders that are ready to deliver <br/>"+
// "Could you ready these orders <b>"+order_lists+"</b> to deliver?",
// type: 'success',
// html: true,
// closeOnConfirm: false,
// closeOnCancel: false,
// allowOutsideClick: false
// }, function (isConfirm) {
// if(isConfirm){
// 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")){
// $("#"+shop_code+"_notify_order_ready_to_delivery").removeClass("hidden"); // $("#"+shop_code+"_notify_order_ready_to_delivery").removeClass("hidden");

View File

@@ -19,21 +19,7 @@ App.check_order_send_to_kitchen = App.cable.subscriptions.create('CheckOrderSend
}); });
// alert(order_lists); // alert(order_lists);
// swal({ checkOrderSendToKitchen(shop_code, order_lists);
// title: 'Information',
// target: document.getElementById(shop_code+"_notify_order_send_to_kitchen"),
// text: "You have to send order to kitchen <br/>"+
// "Could you send these orders <b>"+order_lists+"</b> to kitchen?",
// type: 'success',
// html: true,
// closeOnConfirm: false,
// closeOnCancel: false,
// allowOutsideClick: false
// }, function (isConfirm) {
// if(isConfirm){
// 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")){
// $("#"+shop_code+"_notify_order_send_to_kitchen").removeClass("hidden"); // $("#"+shop_code+"_notify_order_send_to_kitchen").removeClass("hidden");

View File

@@ -42,6 +42,15 @@ $(document).ready(function() {
railBorderRadius: '0', railBorderRadius: '0',
touchScrollStep : 50 touchScrollStep : 50
}); });
$('#menu1-slimscroll').slimScroll({
height: height-$('#menu1-slimscroll').attr('data-height'),
size: '5px',
color: 'rgba(0,0,0,0.5)',
alwaysVisible: false,
borderRadius: '0',
railBorderRadius: '0',
touchScrollStep : 50
});
$('#modal-slimscroll').slimScroll({ $('#modal-slimscroll').slimScroll({
height: height-$('#modal-slimscroll').attr('data-height'), height: height-$('#modal-slimscroll').attr('data-height'),
@@ -148,3 +157,12 @@ $(document).ready(function() {
} }
//end Notificaiotn message //end Notificaiotn message
}); });
function audioPlayBackground(shop_code){
//audio play
var audio = new Audio('/'+shop_code+'-beep.mp3'); // define your audio
// setTimeout(function(){
// audio.loop = true;
audio.play();
// },10000);
}

View File

@@ -265,6 +265,7 @@ function show_order_detail(url,sr_no){
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {
// console.log(data); // console.log(data);
$("#order_remark").text("");
$(".tbl_customer").show(); $(".tbl_customer").show();
if(data.status != "delivered"){ if(data.status != "delivered"){
$('#accepted').show(); $('#accepted').show();
@@ -482,46 +483,81 @@ function showNewOrder(order_reservation,shop_code){
var date = new Date(order_reservation.requested_time); var date = new Date(order_reservation.requested_time);
var time = timeFormat(date); var time = timeFormat(date);
var requested_date = date.getFullYear() + '-' + (date.getMonth() >= 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ (date.getDate() >= 10? date.getDate() : '0' + date.getDate()) +' '+time; var requested_date = date.getFullYear() + '-' + (date.getMonth() >= 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ (date.getDate() >= 10? date.getDate() : '0' + date.getDate()) +' '+time;
//audio play $('.first-1').click();
var audio = new Audio('/'+shop_code+'-beep.mp3'); // define your audio audioPlayBackground(shop_code);
// setTimeout(function(){
// audio.loop = true;
audio.play();
// },10000);
$("#new_order").text(order_reservation.order_reservation_id); swal({
$("#new_order_date").text(requested_date); title: 'Information',
// if($("#"+shop_code+"_doemal_new_order").hasClass("hidden")){ target: document.getElementById(shop_code+"_notify_new_order"),
// $("#"+shop_code+"_doemal_new_order").removeClass("hidden"); text: "You have new order "+
// } "<b>"+order_reservation.order_reservation_id+"</b> requested for "+requested_date+"?",
// $("#"+shop_code+"_doemal_new_order").on('shown.bs.modal', function(e){ type: 'success',
// // $(document).off('focusin.modal'); html: true,
// $("#"+shop_code+"_doemal_new_order").focus(); closeOnConfirm: false,
// $("#"+shop_code+"_notify_new_order").addClass("hidden"); closeOnCancel: false,
// $("#"+shop_code+"_notify_order_send_to_kitchen").addClass("hidden"); allowOutsideClick: false
// $("#"+shop_code+"_notify_order_ready_to_delivery").addClass("hidden"); }, function (isConfirm) {
// }).on('hide.bs.modal', function (e) { if(isConfirm){
// $("#"+shop_code+"_doemal_new_order").addClass("hidden"); swal.close();
// }).modal({show: true, keyboard: false, backdrop: false}); }
// swal({ });
// title: 'Information',
// target: document.getElementById(shop_code+"_notify_new_order"),
// text: "You have new order "+
// "<b>"+order_reservation.order_reservation_id+"</b> requested for "+requested_date+"?",
// type: 'success',
// html: true,
// closeOnConfirm: false,
// closeOnCancel: false,
// allowOutsideClick: false
// }, function (isConfirm) {
// if(isConfirm){
// audio.pause();
// swal.close();
// }
// });
} }
} }
function checkNewOrderAlert(shop_code, order_lists){
swal({
title: 'Information',
target: document.getElementById(shop_code+"_notify_new_order"),
text: "You have new orders <br/>"+
"Are you accept or reject for these orders <b>"+order_lists+"</b>?",
type: 'success',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function (isConfirm) {
if(isConfirm){
swal.close();
}
});
}
function checkOrderSendToKitchen(shop_code, order_lists){
swal({
title: 'Information',
target: document.getElementById(shop_code+"_notify_order_send_to_kitchen"),
text: "You have to send order to kitchen <br/>"+
"Could you send these orders <b>"+order_lists+"</b> to kitchen?",
type: 'success',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function (isConfirm) {
if(isConfirm){
swal.close();
}
});
}
function checkOrderReadyToKitchenAlert(shop_code, order_lists){
swal({
title: 'Information',
target: document.getElementById(shop_code+"_notify_order_ready_to_delivery"),
text: "You have orders that are ready to deliver <br/>"+
"Could you ready these orders <b>"+order_lists+"</b> to deliver?",
type: 'success',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function (isConfirm) {
if(isConfirm){
swal.close();
}
});
}
function getOrderMonth(month){ function getOrderMonth(month){
var MONTHS = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"]; var MONTHS = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"];
return MONTHS[month]; return MONTHS[month];

View File

@@ -18,7 +18,7 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
end end
if status if status
check_customer = Customer.find_by_email_and_membership_id(params[:email],params[:membership_id]) check_customer = Customer.find_by_email_and_membership_id_and_customer_type(params[:email],params[:membership_id],'Doemal')
if !check_customer.nil? if !check_customer.nil?
customer_id = check_customer.customer_id customer_id = check_customer.customer_id
else else

View File

@@ -18,8 +18,8 @@ class Api::SurveyController < Api::ApiController
cashier_zone = CashierTerminalByZone.find_by_zone_id(dining_facility.zone_id) cashier_zone = CashierTerminalByZone.find_by_zone_id(dining_facility.zone_id)
shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil) shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil)
if params[:survey_id] if params[:id]
survey = Survey.find(params[:survey_id]) survey = Survey.find(params[:id])
else else
survey = Survey.new survey = Survey.new
end end

View File

@@ -39,8 +39,10 @@ class Oqs::EditController < BaseOqsController
if ENV["SERVER_MODE"] != "cloud" && order.source == 'cashier' #no print in cloud server if ENV["SERVER_MODE"] != "cloud" && order.source == 'cashier' #no print in cloud server
# print # print
assigned_item = AssignedOrderItem.find_by_instance_code(order_item.item_instance_code) assigned_item = AssignedOrderItem.find_by_instance_code(order_item.item_instance_code)
assigned_items = AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'") assigned_items = nil
if !assigned_item.nil?
assigned_items = AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'")
end
if !assigned_items.nil? if !assigned_items.nil?
assigned_items.each do |assign_item| assigned_items.each do |assign_item|
# order queue stations # order queue stations

View File

@@ -8,13 +8,14 @@ class Origami::CashInsController < BaseOrigamiController
amount = params[:amount] amount = params[:amount]
payment_method = params[:payment_method] payment_method = params[:payment_method]
payment_method_reference = params[:payment_method_reference] payment_method_reference = params[:payment_method_reference]
type = params[:type]
p_jour = PaymentJournal.new p_jour = PaymentJournal.new
p_jour.cash_in(reference, remark, amount, payment_method, payment_method_reference, current_user.id) p_jour.cash_in(reference, remark, amount, payment_method, payment_method_reference, current_user.id)
shift = ShiftSale.current_open_shift(current_user.id) shift = ShiftSale.current_open_shift(current_user.id)
current_shift = ShiftSale.current_shift current_shift = ShiftSale.current_shift
# set cashier # set cashier
if shift != nil if shift != nil
shift = shift shift = shift
else else
@@ -24,15 +25,15 @@ class Origami::CashInsController < BaseOrigamiController
shift = ShiftSale.current_open_shift(open_cashier[0].id) shift = ShiftSale.current_open_shift(open_cashier[0].id)
if shift if shift
shift = ShiftSale.current_open_shift(shift.id) shift = ShiftSale.current_open_shift(shift.id)
else else
shift = ShiftSale.current_open_shift(current_shift.id) shift = ShiftSale.current_open_shift(current_shift.id)
end end
else else
shift = Employee.find(current_shift.employee_id).name shift = Employee.find(current_shift.employee_id).name
end
end end
end
shift.cash_in = shift.cash_in + amount.to_f shift.cash_in = shift.cash_in + amount.to_f
shift.save shift.save

View File

@@ -6,7 +6,7 @@ class Origami::PaymentsController < BaseOrigamiController
def first_bill def first_bill
sale_id = params[:sale_id] # sale_id sale_id = params[:sale_id] # sale_id
sale_data = Sale.find_by_sale_id(sale_id) sale_data = Sale.find_by_sale_id(sale_id)
sale_items = SaleItem.unscoped.select("sale_id,product_code,item_instance_code,product_name,product_alt_name,account_id,status,remark,SUM(qty) as qty,SUM(unit_price) as unit_price,SUM(taxable_price) as taxable_price,SUM(price) as price,is_taxable").where("sale_id=?",sale_id).group("item_instance_code,unit_price") sale_items = SaleItem.get_all_sale_items(sale_id)
member_info = nil member_info = nil
# For Cashier by Zone # For Cashier by Zone
@@ -99,7 +99,7 @@ class Origami::PaymentsController < BaseOrigamiController
if(Sale.exists?(sale_id)) if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id) saleObj = Sale.find(sale_id)
sale_items = SaleItem.unscoped.select("sale_id,product_code,item_instance_code,product_name,product_alt_name,account_id,status,remark,SUM(qty) as qty,SUM(unit_price) as unit_price,SUM(taxable_price) as taxable_price,SUM(price) as price,is_taxable").where("sale_id=?",sale_id).group("item_instance_code,unit_price") sale_items = SaleItem.get_all_sale_items(sale_id)
shop_details = Shop.first shop_details = Shop.first
# rounding adjustment # rounding adjustment
if shop_details.is_rounding_adj if shop_details.is_rounding_adj
@@ -338,7 +338,10 @@ class Origami::PaymentsController < BaseOrigamiController
if spay.payment_method == "cash" if spay.payment_method == "cash"
@cash = spay.payment_amount @cash = spay.payment_amount
end end
@other_payment += spay.payment_amount if spay.payment_method !="creditnote"
@other_payment += spay.payment_amount
end
if spay.payment_method == "mpu" if spay.payment_method == "mpu"
@other += spay.payment_amount @other += spay.payment_amount
elsif spay.payment_method == "paypar" elsif spay.payment_method == "paypar"

View File

@@ -62,7 +62,13 @@ class Origami::PendingOrderController < BaseOrigamiController
@table_id = nil @table_id = nil
@dining = nil @dining = nil
end end
end
def cash_ins
render "origami/cash_ins/new"
end
def cash_outs
render "origami/cash_outs/new"
end end
end end

View File

@@ -41,7 +41,7 @@ class Origami::SalesController < BaseOrigamiController
end end
# Re-compute for add # Re-compute for add
saleobj.compute saleobj.compute(order.source)
saleobj.save saleobj.save
order.save order.save
booking.save booking.save

View File

@@ -29,6 +29,7 @@ class Origami::VoidController < BaseOrigamiController
end end
end end
sale.rounding_adjustment = 0.0
sale.payment_status = 'void' sale.payment_status = 'void'
sale.sale_status = 'void' sale.sale_status = 'void'
sale.save sale.save
@@ -114,7 +115,8 @@ class Origami::VoidController < BaseOrigamiController
if customer.membership_id != nil && rebate if customer.membership_id != nil && rebate
member_info = Customer.get_member_account(customer) member_info = Customer.get_member_account(customer)
rebate_amount = Customer.get_membership_transactions(customer,sale.receipt_no) rebate_amount = Customer.get_membership_transactions(customer,sale.receipt_no)
current_balance = SaleAudit.paymal_search(sale_id) # current_balance = SaleAudit.paymal_search(sale_id)
current_balance = 0
end end
# get printer info # get printer info

View File

@@ -285,13 +285,18 @@ class Order < ApplicationRecord
#Process order items and send to order queue #Process order items and send to order queue
def process_order_queue def process_order_queue
if ENV["SERVER_MODE"] != 'cloud' print_status = nil
cup_status = nil
#Send to background job for processing #Send to background job for processing
order = Order.find(self.id) order = Order.find(self.id)
cup_status = `#{"sudo service cups status"}`
print_status = check_cup_status(cup_status)
sidekiq = Lookup.find_by_lookup_type("sidekiq") sidekiq = Lookup.find_by_lookup_type("sidekiq")
if ENV["SERVER_MODE"] != 'cloud'
cup_status = `#{"sudo service cups status"}`
print_status = check_cup_status(cup_status)
end
if print_status if print_status
if !sidekiq.nil? if !sidekiq.nil?
OrderQueueProcessorJob.perform_later(self.id, self.table_id) OrderQueueProcessorJob.perform_later(self.id, self.table_id)
@@ -304,9 +309,11 @@ class Order < ApplicationRecord
# ActionCable.server.broadcast "order_queue_station_channel",order: assign_order # ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
end end
else else
cup_start = `#{"sudo service cups start"}` if ENV["SERVER_MODE"] != 'cloud'
cup_status = `#{"sudo service cups status"}` cup_start = `#{"sudo service cups start"}`
print_status = check_cup_status(cup_status) cup_status = `#{"sudo service cups status"}`
print_status = check_cup_status(cup_status)
end
if print_status if print_status
if !sidekiq.nil? if !sidekiq.nil?
@@ -320,33 +327,28 @@ class Order < ApplicationRecord
# ActionCable.server.broadcast "order_queue_station_channel",order: assign_order # ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
end end
else else
msg = ' Print Error ! Please contact to service' if ENV["SERVER_MODE"] != 'cloud'
#if ENV["SERVER_MODE"] != 'cloud'
msg = ' Print Error ! Please contact to service'
ActionCable.server.broadcast "call_waiter_channel",table: msg,time:'print_error' ActionCable.server.broadcast "call_waiter_channel",table: msg,time:'print_error'
#end end
if !sidekiq.nil? if !sidekiq.nil?
OrderQueueProcessorJob.perform_later(self.id, self.table_id) OrderQueueProcessorJob.perform_later(self.id, self.table_id)
else else
if order if order
oqs = OrderQueueStation.new oqs = OrderQueueStation.new
oqs.process_order(order, self.table_id, self.source) oqs.process_order(order, self.table_id, self.source)
end end
# assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id) assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id)
# ActionCable.server.broadcast "order_queue_station_channel",order: assign_order ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
end end
end end
end end
assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id)
#if ENV["SERVER_MODE"] != 'cloud'
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
#end
end
end end
#Process order items and send to order queue #Process order items and send to order queue
def self.pay_process_order_queue(id,table_id) def self.pay_process_order_queue(id,table_id)
if ENV["SERVER_MODE"] != 'cloud' # if ENV["SERVER_MODE"] != 'cloud'
sidekiq = Lookup.find_by_lookup_type("sidekiq") sidekiq = Lookup.find_by_lookup_type("sidekiq")
if !sidekiq.nil? if !sidekiq.nil?
OrderQueueProcessorJob.perform_later(id, table_id) OrderQueueProcessorJob.perform_later(id, table_id)
@@ -359,7 +361,7 @@ class Order < ApplicationRecord
assign_order = AssignedOrderItem.assigned_order_item_by_job(id) assign_order = AssignedOrderItem.assigned_order_item_by_job(id)
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
end end
end # end
end end
def check_cup_status(status) def check_cup_status(status)

View File

@@ -30,10 +30,19 @@ class OrderReservation < ApplicationRecord
customer.address = params[:address] ? params[:address] : '' customer.address = params[:address] ? params[:address] : ''
customer.date_of_birth = params[:date_of_birth] ? Time.parse(params[:date_of_birth]).strftime("%Y-%m-%d") : '' customer.date_of_birth = params[:date_of_birth] ? Time.parse(params[:date_of_birth]).strftime("%Y-%m-%d") : ''
customer.membership_id = params[:membership_id] customer.membership_id = params[:membership_id]
customer.customer_type = "Takeaway" customer.customer_type = "Doemal"
customer.tax_profiles = ["2"] customer.tax_profiles = ["2"]
customer.save customer.save
# unless customer.valid?
# render json: {
# status: 422,
# message: "Validation error",
# errors: customer.errors
# }.to_json
# return
# end
return customer return customer
end end

View File

@@ -752,7 +752,7 @@ def self.daily_sales_list(from,to)
SUM(case when (sale_payments.payment_method='cash') then sale_payments.payment_amount else 0 end) as cash_amount, SUM(case when (sale_payments.payment_method='cash') then sale_payments.payment_amount else 0 end) as cash_amount,
SUM(case when (sale_payments.payment_method='creditnote') then sale_payments.payment_amount else 0 end) as credit_amount, SUM(case when (sale_payments.payment_method='creditnote') then sale_payments.payment_amount else 0 end) as credit_amount,
SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount") SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount")
.joins("join (select * from sale_payments group by sale_payments.sale_id, sale_payments.payment_method) sale_payments on sale_payments.sale_id = sales.sale_id") .joins(" left join sale_payments on sale_payments.sale_id = sales.sale_id")
.where("sale_status = ? AND sales.receipt_date between ? and ? ", 'completed', from, to) .where("sale_status = ? AND sales.receipt_date between ? and ? ", 'completed', from, to)
.group("DATE_FORMAT((CONVERT_TZ(sales.receipt_date,'+00:00','+06:30')),'%Y-%m-%d')") .group("DATE_FORMAT((CONVERT_TZ(sales.receipt_date,'+00:00','+06:30')),'%Y-%m-%d')")
@@ -2692,6 +2692,7 @@ end
query = query.joins("join sale_orders as sale_orders on sale_orders.sale_id = sales.sale_id") query = query.joins("join sale_orders as sale_orders on sale_orders.sale_id = sales.sale_id")
.joins("join orders as orders on orders.order_id = sale_orders.order_id") .joins("join orders as orders on orders.order_id = sale_orders.order_id")
query = query.where("sales.sale_status != 'new' AND orders.status = 'billed' AND orders.source =? ","quick_service") query = query.where("sales.sale_status != 'new' AND orders.status = 'billed' AND orders.source =? ","quick_service")
query = query.where("DATE_FORMAT(sales.created_at,'%Y-%m-%d') = ? ",DateTime.now.strftime('%Y-%m-%d'))
.group("sales.sale_id") .group("sales.sale_id")
end end

View File

@@ -161,6 +161,20 @@ class SaleItem < ApplicationRecord
# return price # return price
# end # end
def self.get_all_sale_items(sale_id)
sale_items = SaleItem.select("sale_id,product_code,item_instance_code,
product_name,product_alt_name,account_id,status,remark,
(CASE WHEN qty > 0 AND remark IS NULL THEN SUM(qty) ELSE qty END) as qty,
unit_price,
taxable_price,
(CASE WHEN price > 0 AND remark IS NULL THEN SUM(price) ELSE price END) as price,
is_taxable")
.where("sale_id = ?",sale_id)
.order("product_name asc")
.group("status,product_name,item_instance_code,unit_price")
return sale_items
end
private private
def generate_custom_id def generate_custom_id
self.sale_item_id = SeedGenerator.generate_id(self.class.name, "SLI") self.sale_item_id = SeedGenerator.generate_id(self.class.name, "SLI")

View File

@@ -207,7 +207,9 @@ class ReceiptBillA5Pdf < Prawn::Document
# check for item not to show # check for item not to show
if item.price != 0 if item.price != 0
sub_total += item.price #(item.qty*item.unit_price) - comment for room charges sub_total += item.price #(item.qty*item.unit_price) - comment for room charges
total_qty += item.qty if item.status != 'Discount' && item.qty > 0
total_qty += item.qty
end
qty = item.qty qty = item.qty
total_price = item.price #item.qty*item.unit_price - comment for room charges total_price = item.price #item.qty*item.unit_price - comment for room charges
price = item.unit_price price = item.unit_price

View File

@@ -201,7 +201,9 @@ class ReceiptBillPdf < Prawn::Document
# check for item not to show # check for item not to show
if item.price != 0 if item.price != 0
sub_total += item.price #(item.qty*item.unit_price) - comment for room charges sub_total += item.price #(item.qty*item.unit_price) - comment for room charges
total_qty += item.qty if item.status != 'Discount' && item.qty > 0
total_qty += item.qty
end
qty = item.qty qty = item.qty
total_price = item.price #item.qty*item.unit_price - comment for room charges total_price = item.price #item.qty*item.unit_price - comment for room charges
price = item.unit_price price = item.unit_price

View File

@@ -29,7 +29,7 @@
<%end%> <%end%>
</ul> </ul>
</li> </li>
<div id="menu-slimscroll" data-height="0"> <div id="menu1-slimscroll" data-height="0">
<ul class="nav nav-tabs flex-column category_list" role="tablist" id="ul-navbar"> <ul class="nav nav-tabs flex-column category_list" role="tablist" id="ul-navbar">
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>"> <li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
<a class="nav-link" data-toggle="tab" href="" role="tab">Products</a> <a class="nav-link" data-toggle="tab" href="" role="tab">Products</a>
@@ -499,30 +499,54 @@
<div class="card-columns" style="column-count: 7;"> <div class="card-columns" style="column-count: 7;">
<%zone.tables.each do |table| %> <%zone.tables.each do |table| %>
<% if table.status == 'occupied' %> <% if table.status == 'occupied' %>
<% if table.get_booking.nil? %> <% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %> <% if table.get_checkout_booking.nil? %>
<% color="red"%> <% color="red"%>
<% else %> <% else %>
<% color="orange"%> <% color="orange"%>
<% end %> <% end %>
<% else %>
<% if table.get_checkout_booking.nil? %>
<% color="blue"%>
<% else %>
<% color="orange"%>
<% end %>
<% end %>
<% else %> <% else %>
<% if table.get_checkout_booking.nil? %> <% color="green"%>
<% color="blue"%>
<% else %>
<% color="orange"%>
<% end %>
<% end %>
<% else %>
<% color="green"%>
<% end %> <% end %>
<div class="card tables <%=color%> text-white table_<%= table.id %>" data-id="<%= table.id %>" data-type="<%= table.type %>" data-name="<%= table.name %>"> <div class="card tables <%=color%> text-white table_<%= table.id %>" data-id="<%= table.id %>" data-type="<%= table.type %>" data-name="<%= table.name %>">
<div class="card-block"> <div class="card-block">
<%= table.name %> <%= table.name %>
</div> </div>
</div> </div>
<%end%> <%end%>
<%zone.rooms.each do |table| %>
<% if table.status == 'occupied' %>
<% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %>
<% color="red"%>
<% else %>
<% color="orange"%>
<% end %>
<% else %>
<% if table.get_checkout_booking.nil? %>
<% color="blue"%>
<% else %>
<% color="orange"%>
<% end %>
<% end %>
<% else %>
<% color="green"%>
<% end %>
<div class="card tables <%=color%> text-white table_<%= table.id %>" data-id="<%= table.id %>" data-type="<%= table.type %>" data-name="<%= table.name %>">
<div class="card-block">
<%= table.name %>
</div>
</div>
<%end%>
</div> </div>
<%end%> <%end%>
<div class="modal-footer p-r-30"> <div class="modal-footer p-r-30">

View File

@@ -56,6 +56,9 @@
</div> </div>
<script> <script>
cashier_type = window.location.href.indexOf("quick_service");
console.log(cashier_type)
var payment_method = ""; var payment_method = "";
$('.payment-type').on('click',function(){ $('.payment-type').on('click',function(){
$('.payment-type').css("background-color","#7a62d3") $('.payment-type').css("background-color","#7a62d3")
@@ -80,11 +83,19 @@
url: "<%= origami_cash_ins_path %>", url: "<%= origami_cash_ins_path %>",
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount + "&payment_method="+payment_method + "&payment_method_reference="+ payment_method_reference, data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount + "&payment_method="+payment_method + "&payment_method_reference="+ payment_method_reference,
success:function(result){ success:function(result){
window.location.href = '/origami'; if (cashier_type == -1) {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service/pending_order';
}
} }
}); });
}) })
$('#back').on('click',function(){ $('#back').on('click',function(){
window.location.href = '/origami'; if (cashier_type == -1) {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service/pending_order';
}
}) })
</script> </script>

View File

@@ -25,6 +25,7 @@
</div> </div>
</div> </div>
<script> <script>
cashier_type = window.location.href.indexOf("quick_service");
$('#cash_out').on('click',function(){ $('#cash_out').on('click',function(){
var reference = $('#reference').val(); var reference = $('#reference').val();
var remark = $('#remark').val(); var remark = $('#remark').val();
@@ -33,12 +34,22 @@
url: "<%= origami_cash_outs_path %>", url: "<%= origami_cash_outs_path %>",
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount, data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount,
success:function(result){ success:function(result){
window.location.href = '/origami';
if (cashier_type == -1) {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service/pending_order';
}
} }
}); });
}) })
$('#back').on('click',function(){ $('#back').on('click',function(){
window.location.href = '/origami'; cashier_type = window.location.href.indexOf("quick_service");
if (cashier_type == -1) {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service/pending_order';
}
}) })
</script> </script>

View File

@@ -29,7 +29,9 @@ if (menu.menu_categories)
if category.menu_items if category.menu_items
json.items category.menu_items do |item| json.items category.menu_items do |item|
json.partial! 'origami/addorders/menu_item', item: item if item.is_available
json.partial! 'origami/addorders/menu_item', item: item
end
end end
end end
end end

View File

@@ -463,10 +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>
@@ -582,92 +582,3 @@
</div> </div>
</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-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title text-center" id="doemal_new_orderLabel">New Order</h4><hr>
</div>
<div class="modal-body doemal_new_orderBody">
<div class="form-group text-center">
You have new order <b><span id="new_order"></span></b> requested for <b><span id="new_order_date"></span></b>
</div>
</div>
<div class="modal-footer ">
<div class="row p-r-20">
<div class="col-md-5">
<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>
<div class="modal fade text-center" id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_new_order" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title text-center" id="notify_new_orderLabel">You have new orders</h4><hr>
</div>
<div class="modal-body notify_new_orderBody">
<div class="form-group text-center">
Are you accept or reject for these orders <b><span id="notify_new_order_lists"></span></b>?
</div>
</div>
<div class="modal-footer ">
<div class="row p-r-20">
<div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue notify_new_close" data-value="<%= @shop.shop_code ? @shop.shop_code : '' %>" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade text-center" id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_send_to_kitchen" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title text-center" id="notify_order_send_to_kitchenLabel">You have to send order to kitchen</h4><hr>
</div>
<div class="modal-body notify_order_send_to_kitchenBody">
<div class="form-group text-center">
Could you send these orders <b><span id="notify_order_send_to_kitchen_lists"></span></b> to kitchen?
</div>
</div>
<div class="modal-footer ">
<div class="row p-r-20">
<div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue notify_order_send_close" data-value="<%= @shop.shop_code ? @shop.shop_code : '' %>" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade text-center" id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_ready_to_delivery" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title text-center" id="notify_order_ready_to_deliveryLabel">You have orders that are ready to deliver</h4><hr>
</div>
<div class="modal-body notify_order_ready_to_deliveryBody">
<div class="form-group text-center">
Could you ready these orders <b><span id="notify_order_ready_to_delivery_lists"></span></b> to deliver?
</div>
</div>
<div class="modal-footer ">
<div class="row p-r-20">
<div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue notify_order_ready_close" data-value="<%= @shop.shop_code ? @shop.shop_code : '' %>" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,4 +1,4 @@
<div class="container-fluid"> `<div class="container-fluid">
<div id="loading_wrapper" style="display:none;"> <div id="loading_wrapper" style="display:none;">
<div id="loading"></div> <div id="loading"></div>
</div> </div>
@@ -447,9 +447,9 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="mr-2 btn btn-link bg-red waves-effect print_receipt"> Print <button type="button" class="mr-2 m-t-5 btn-lg btn-block bg-red waves-effect print_receipt"> Print
</button> </button>
<button type="button" class="btn btn-link bg-blue waves-effect btn_pdf_close" data-dismiss="modal"> <button type="button" class="btn-lg btn-block bg-blue waves-effect btn_pdf_close" data-dismiss="modal">
CLOSE CLOSE
</button> </button>
</div> </div>
@@ -571,6 +571,7 @@ var customer_name = "<%= @customer.name %>";
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment"); payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
console.log(payment_type) console.log(payment_type)
console.log(parseInt(jQuery.inArray("MPU", payment_type)))
if (member_id && member_discount) { if (member_id && member_discount) {
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){ if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
$("#credit_payment").hide(); $("#credit_payment").hide();
@@ -654,7 +655,7 @@ var customer_name = "<%= @customer.name %>";
else if(parseInt(jQuery.inArray("Alipay", payment_type)) != -1 && $('#alipaycount').text()== 0 && sub_total != 0.0 && member){ else if(parseInt(jQuery.inArray("Alipay", payment_type)) != -1 && $('#alipaycount').text()== 0 && sub_total != 0.0 && member){
swal("Oops","Please Pay with Alipay Payment","warning"); swal("Oops","Please Pay with Alipay Payment","warning");
} }
else if(parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 != -1 && $('#junctionpaycount').text()==0 && sub_total != 0.0 && member){ else if(parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 && $('#junctionpaycount').text()==0 && sub_total != 0.0 && member){
swal("Oops","Please Pay with JUNCTIONPAY Payment","warning"); swal("Oops","Please Pay with JUNCTIONPAY Payment","warning");
} }
else if(payment_type == "Credit" && $('#credit').text()==0 && sub_total != 0.0 && member){ else if(payment_type == "Credit" && $('#credit').text()==0 && sub_total != 0.0 && member){
@@ -987,7 +988,8 @@ var customer_name = "<%= @customer.name %>";
} }
//print pdf function //print pdf function
$(".print_receipt").on('click',function(){ // $(".print_receipt").on('click',function(){
$(document).on('touchstart click', '.print_receipt', function(event){
var sale_id = $('#sale_id').text(); var sale_id = $('#sale_id').text();
var filename = $("#filename").val(); var filename = $("#filename").val();
var printer_name = $("#printer_name").val(); var printer_name = $("#printer_name").val();

View File

@@ -17,7 +17,7 @@
<% @completed.each do |sale| %> <% @completed.each do |sale| %>
<div class="card completed bg-red text-white" data-id = "<%= sale.sale_id %>"> <div class="card completed bg-red text-white" data-id = "<%= sale.sale_id %>">
<div class="card-block"> <div class="card-block">
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;">Billed</span> <%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
</div> </div>
</div> </div>
<% end %> <% end %>
@@ -172,6 +172,8 @@
<button type="button" id="reprint" class="btn bg-blue btn-block">Reprint</button> <button type="button" id="reprint" class="btn bg-blue btn-block">Reprint</button>
<% if current_user.role != "waiter" %> <% if current_user.role != "waiter" %>
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button> <button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<button id="cash_in" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_in") %> </button>
<button id="cash_out" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_out") %> </button>
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -201,7 +203,13 @@ $(document).ready(function(){
var linkURL = '/origami/shift/quick_service/close'; var linkURL = '/origami/shift/quick_service/close';
warnBeforeRedirect(linkURL); warnBeforeRedirect(linkURL);
}); });
$('#cash_in').on('click',function(){
window.location.href = '/origami/quick_service/cash_ins';
})
$('#cash_out').on('click',function(){
window.location.href = '/origami/quick_service/cash_outs';
})
}); });
</script> </script>

View File

@@ -19,7 +19,7 @@
<% @completed.each do |sale| %> <% @completed.each do |sale| %>
<div class="card completed bg-red text-white" data-id = "<%= sale.sale_id %>"> <div class="card completed bg-red text-white" data-id = "<%= sale.sale_id %>">
<div class="card-block"> <div class="card-block">
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;">Billed</span> <%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
</div> </div>
</div> </div>
<% end %> <% end %>
@@ -55,6 +55,8 @@
</button> </button>
<% if current_user.role != "waiter" %> <% if current_user.role != "waiter" %>
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button> <button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<button id="cash_in" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_in") %> </button>
<button id="cash_out" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_out") %> </button>
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -83,6 +85,14 @@
warnBeforeRedirect(linkURL); warnBeforeRedirect(linkURL);
}); });
$('#cash_in').on('click',function(){
window.location.href = '/origami/quick_service/cash_ins';
})
$('#cash_out').on('click',function(){
window.location.href = '/origami/quick_service/cash_outs';
})
function warnBeforeRedirect(linkURL) { function warnBeforeRedirect(linkURL) {
swal({ swal({
title: "Alert!", title: "Alert!",

View File

@@ -17,7 +17,7 @@
<% @completed.each do |sale| %> <% @completed.each do |sale| %>
<div class="card completed bg-red text-white" data-id = "<%= sale.sale_id %>"> <div class="card completed bg-red text-white" data-id = "<%= sale.sale_id %>">
<div class="card-block"> <div class="card-block">
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;">Billed</span> <%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
</div> </div>
</div> </div>
<% end %> <% end %>
@@ -188,6 +188,8 @@
<%end%> <%end%>
<% if current_user.role != "waiter" %> <% if current_user.role != "waiter" %>
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button> <button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<!-- <button id="cash_in" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_in") %> </button>
<button id="cash_out" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_out") %> </button> -->
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -321,5 +323,13 @@ $(document).ready(function(){
window.location.href = '/oqs/'+ assigned_order_item_id + "/edit/pending"; window.location.href = '/oqs/'+ assigned_order_item_id + "/edit/pending";
} }
}); });
$('#cash_in').on('click',function(){
window.location.href = '/origami/quick_service/cash_ins';
})
$('#cash_out').on('click',function(){
window.location.href = '/origami/quick_service/cash_outs';
})
}); });
</script> </script>

View File

@@ -9,7 +9,7 @@
<div class="row clearfix"> <div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 "> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
<div class="form-group p-l-10 p-r-10"> <div class="form-group p-l-10 p-r-10">
<%= f.input :child, input_html: { value: @survey_data.child, class: 'col-md-10', :onChange => "total_customer();" }%>
</div> </div>
</div> </div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 "> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">

View File

@@ -154,8 +154,8 @@
<% total_tax = 0 %> <% total_tax = 0 %>
<% net = 0 %> <% net = 0 %>
<% unless @tax.empty? %> <% unless @tax.empty? %>
<% @tax.each do |tax| %> <% @tax.each do |tax|
<% total_tax += tax.tax_amount.to_f %> total_tax += tax.tax_amount.to_f %>
<tr style="font-weight:600;"> <tr style="font-weight:600;">
<td colspan="17" style='text-align:right;'><%= tax.tax_name rescue '-'%></td> <td colspan="17" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> <td style='text-align:right;'><%= number_with_precision(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
@@ -164,14 +164,7 @@
<% end %> <% end %>
<% end %> <% end %>
<tr style="font-weight:600;"> <% net = grand_total %>
<td colspan="17" style='text-align:right;'>Discount </td>
<td style='text-align:right;'><%= number_with_precision(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td colspan="2">&nbsp;</td>
</tr>
<% net = grand_total%>
<% net = grand_total- discount%>
<% net = net - rounding_adj%> <% net = net - rounding_adj%>
<% net = net - total_tax %> <% net = net - total_tax %>
<tr style="font-weight:600;"> <tr style="font-weight:600;">

View File

@@ -118,6 +118,7 @@
</tr> </tr>
<% total_tax = 0 %> <% total_tax = 0 %>
<% net = 0 %>
<% unless @tax.empty? %> <% unless @tax.empty? %>
<% @tax.each do |tax| %> <% @tax.each do |tax| %>
<% total_tax += tax.tax_amount.to_f %> <% total_tax += tax.tax_amount.to_f %>
@@ -128,7 +129,9 @@
</tr> </tr>
<% end %> <% end %>
<% net = total - total_tax %> <% net = grand_total %>
<% net = net - rounding_adj%>
<% net = net - total_tax %>
<tr style="font-weight:600;"> <tr style="font-weight:600;">
<td colspan="12" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td> <td colspan="12" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%></td> <td style='text-align:right;'><%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%></td>

View File

@@ -116,7 +116,9 @@
<td><b><%= number_with_precision(discount_amt, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b></td> <td><b><%= number_with_precision(discount_amt, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b></td>
<% if !@sale_taxes.empty? <% if !@sale_taxes.empty?
@sale_taxes.each do |tax| %> @sale_taxes.each do |tax| %>
<td><b><%= number_with_precision(tax.st_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b></td> <td>
<b><%= number_with_precision(tax.st_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b>
</td>
<% end %> <% end %>
<% else %> <% else %>
<% @tax_profiles.each do |tax| %> <% @tax_profiles.each do |tax| %>

View File

@@ -67,8 +67,8 @@
<tr> <tr>
<td><%=s.product_name rescue ' '%></td> <td><%=s.product_name rescue ' '%></td>
<td><%=s.qty rescue ' '%></td> <td><%=s.qty rescue ' '%></td>
<td><%= number_with_precision(s.unit_price, :precision => 2, :delimiter => ',') rescue ' '%></td>
<td><%= number_with_precision(s.price, :precision => 2, :delimiter => ',') rescue ' '%></td> <td><%= number_with_precision(s.price, :precision => 2, :delimiter => ',') rescue ' '%></td>
<td><%= number_with_precision(s.qty * s.price, :precision => 2, :delimiter => ',') rescue ' '%></td>
<td><%=l s.created_at.utc.getlocal , :format => :short rescue ' ' %></td> <td><%=l s.created_at.utc.getlocal , :format => :short rescue ' ' %></td>
<td><%=s.remark rescue ' '%></td> <td><%=s.remark rescue ' '%></td>
</tr> </tr>

View File

@@ -110,6 +110,8 @@ scope "(:locale)", locale: /en|mm/ do
get "quick_service/modify_order/:sale_id" => "quick_service#modify_order" get "quick_service/modify_order/:sale_id" => "quick_service#modify_order"
post 'quick_service/update_modify_order' => "quick_service#update_modify_order", :defaults => { :format => 'json' } post 'quick_service/update_modify_order' => "quick_service#update_modify_order", :defaults => { :format => 'json' }
get "quick_service/cash_ins" => "pending_order#cash_ins"
get "quick_service/cash_outs" => "pending_order#cash_outs"
resources :cash_ins, only: [:new, :create] resources :cash_ins, only: [:new, :create]
resources :cash_outs, only: [:new, :create] resources :cash_outs, only: [:new, :create]