Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes
This commit is contained in:
@@ -73,8 +73,9 @@ $(function() {
|
||||
}
|
||||
//end show list function
|
||||
//click menu sidebar menu category
|
||||
$(".menu_category").on("click", function(){
|
||||
var menu_id = $(this).find(".menu-id").text();
|
||||
// $(".menu_category").on("click", function(){
|
||||
$(document).on('click', '.menu_category', function(event){
|
||||
var menu_id = $(this).attr("data-id");
|
||||
var url = "get_menu_category/"+menu_id;
|
||||
show_menu_item_list(url);
|
||||
});
|
||||
@@ -918,6 +919,47 @@ $(function() {
|
||||
}
|
||||
});
|
||||
|
||||
//click menu sidebar menu category
|
||||
|
||||
$(".sub_click").on("click", function(){
|
||||
var menu_id = $(this).attr("data-id");
|
||||
var url = "get_menu_sub_category/"+menu_id;
|
||||
sub_category = $(this).find('.sub_category_list');
|
||||
show_sub_category_list(url,sub_category);
|
||||
});
|
||||
//End menu category Click
|
||||
|
||||
//show menu item list when click menu category
|
||||
function show_sub_category_list(url,sub_category){
|
||||
|
||||
var menu_list = $('.sub_category_list');
|
||||
menu_list.empty();
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
var sub_category_list = $('.sub_category_list');
|
||||
sub_category_list.empty();
|
||||
data = data.sub_category;
|
||||
|
||||
if (data.length>0) {
|
||||
$(sub_category).removeClass('hidden');
|
||||
for(var i in data) {
|
||||
|
||||
row = '<li class="menu_category" data-id="'+data[i].id+'">'
|
||||
+'<a class="nav-link" data-toggle="tab" href="" role="tab">'+ data[i].name+'</a>'
|
||||
+'</li>' ;
|
||||
$(sub_category).append(row);
|
||||
//end is_sub_item false
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//end Ajax
|
||||
}
|
||||
/* $("input").keypress(function(){
|
||||
$("span").text(i += 1);
|
||||
});*/
|
||||
|
||||
@@ -69,7 +69,17 @@ section .content{
|
||||
font-weight: bold;
|
||||
border-color: #fff #fff #fff #54A5AF;
|
||||
}
|
||||
|
||||
.sub_category_list{
|
||||
background:#fff;
|
||||
margin-top:8px;
|
||||
}
|
||||
.sub_category_list > li{
|
||||
list-style:none;
|
||||
margin-left:-40px;
|
||||
}
|
||||
.sub_category_list > li > a.nav-link{
|
||||
border-bottom:1px solid #eee;
|
||||
}
|
||||
.custom-modal-dialog {
|
||||
left:auto;
|
||||
right: auto;
|
||||
|
||||
@@ -180,6 +180,7 @@ class Origami::DiscountsController < BaseOrigamiController
|
||||
end
|
||||
|
||||
generic_customer_id = sale.customer.membership_id
|
||||
account_no = sale.customer.paypar_account_no
|
||||
receipt_no = sale.receipt_no
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
memberaction = MembershipAction.find_by_membership_type("member_discount")
|
||||
|
||||
@@ -37,7 +37,7 @@ class Origami::OtherChargesController < BaseOrigamiController
|
||||
sale_item.qty = 1
|
||||
sale_item.unit_price = di["price"]
|
||||
sale_item.taxable_price = di["price"] * 1
|
||||
sale_item.is_taxable = 1
|
||||
sale_item.is_taxable = di["is_taxable"]
|
||||
sale_item.account_id = 0
|
||||
|
||||
sale_item.price = di["price"] * 1
|
||||
|
||||
@@ -91,8 +91,9 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
if customer.membership_id != nil && rebate
|
||||
member_info = Customer.get_member_account(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
current_balance = SaleAudit.paymal_search(sale_id)
|
||||
end
|
||||
|
||||
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# Calculate Food and Beverage Total
|
||||
@@ -100,7 +101,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid")
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid",current_balance)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -212,6 +213,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
if customer.membership_id != nil && rebate
|
||||
member_info = Customer.get_member_account(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
current_balance = SaleAudit.paymal_search(sale_id)
|
||||
end
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
@@ -221,7 +223,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Re-print")
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Re-print",current_balance)
|
||||
end
|
||||
|
||||
def foc
|
||||
@@ -230,6 +232,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
sub_total = params[:sub_total]
|
||||
member_info = nil
|
||||
rebate_amount = nil
|
||||
current_balance = nil
|
||||
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
|
||||
@@ -18,39 +18,21 @@ class License
|
||||
if (server != "")
|
||||
self.class.base_uri server
|
||||
end
|
||||
|
||||
# @secret = ENV["aes_key"]
|
||||
# @params = { query: { device: "SX", token: SECRETS_CONFIG['provision_key'] } }
|
||||
end
|
||||
|
||||
# For Cloud
|
||||
def detail_with_local_cache(lookup)
|
||||
|
||||
aes = MyAesCrypt.new
|
||||
aes_key, aes_iv = aes.export_to_file(lookup)
|
||||
# flag = ENV["AES_IV"]
|
||||
# # Check Exists IV
|
||||
# if flag == "<%= ENV['AES_IV'] %>"
|
||||
# # Export for Key
|
||||
# aes = MyAesCrypt.new
|
||||
# aes_key, aes_iv = aes.export_key(lookup)
|
||||
# else
|
||||
# aes_key = ENV["AES_KEY"]
|
||||
# aes_iv = ENV["AES_IV"]
|
||||
# end
|
||||
##Check from local redis - if available load local otherwise get from remote
|
||||
cache_key = "#{lookup}:license:#{aes_key}:hostname"
|
||||
|
||||
# No Needs for current
|
||||
# @secret = key
|
||||
##Check from local redis - if available load local otherwise get from remote
|
||||
cache_key = "#{lookup}:license:#{aes_key}:hostname"
|
||||
|
||||
cache_license = nil
|
||||
|
||||
##Get redis connection from connection pool
|
||||
redis = Redis.new
|
||||
cache_license = redis.get(cache_key)
|
||||
# Redis.current do |conn|
|
||||
# cache_license = conn.get(cache_key)
|
||||
# end
|
||||
cache_license = redis.get(cache_key)
|
||||
|
||||
Rails.logger.info "Cache key - " + cache_key.to_s
|
||||
if cache_license.nil?
|
||||
@@ -85,7 +67,7 @@ class License
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# For Local System
|
||||
def detail_with_local_file()
|
||||
has_license = true # verify_license()
|
||||
|
||||
@@ -117,8 +99,7 @@ class License
|
||||
end
|
||||
|
||||
def verify_license
|
||||
api_token = read_license_no_decrypt("api_token")
|
||||
puts api_token
|
||||
api_token = read_license_no_decrypt("api_token")
|
||||
@params = { query: {lookup_type: "application", api_token: api_token} }
|
||||
response = self.class.get("/verify", @params)
|
||||
@varified = response.parsed_response
|
||||
|
||||
@@ -65,12 +65,12 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
||||
end
|
||||
|
||||
#Bill Receipt Print
|
||||
def print_receipt_bill(printer_settings,cashier_terminal,sale_items,sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount=nil,shop_details, printed_status)
|
||||
def print_receipt_bill(printer_settings,cashier_terminal,sale_items,sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount=nil,shop_details, printed_status,balance)
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
|
||||
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status)
|
||||
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance)
|
||||
|
||||
# print as print copies in printer setting
|
||||
count = printer_settings.print_copies
|
||||
|
||||
@@ -979,7 +979,8 @@ end
|
||||
def self.hourly_sales(today)
|
||||
query= Sale.select("grand_total")
|
||||
.where('payment_status="paid" and sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
|
||||
.group("date_format(convert_tz(receipt_date,'+00:00','+06:30'), '%I:%p')")
|
||||
.group("date_format(CONVERT_TZ(receipt_date,'+00:00', 'SYSTEM'), '%I %p')")
|
||||
.order('receipt_date')
|
||||
end
|
||||
|
||||
def self.employee_sales(today)
|
||||
|
||||
@@ -89,6 +89,25 @@ class SaleAudit < ApplicationRecord
|
||||
sale_audit.save!
|
||||
end
|
||||
|
||||
def self.paymal_search(sale_id)
|
||||
paymal = SaleAudit.where("sale_id =? and action = 'PAYMAL'",sale_id)
|
||||
remark = paymal[0].remark.split("}")
|
||||
response = "["+remark[0]+'}]'
|
||||
response = JSON.parse(response)
|
||||
puts response
|
||||
if response[0]["status"] == true
|
||||
if response[0]["current_rebate_amount"].present?
|
||||
amount = response[0]["current_rebate_amount"]
|
||||
else
|
||||
amount = response[0]["current_balance_amount"]
|
||||
end
|
||||
else
|
||||
amount = nil
|
||||
end
|
||||
return amount
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.sale_audit_id = SeedGenerator.generate_id(self.class.name, "SAI")
|
||||
|
||||
@@ -327,7 +327,7 @@ class SalePayment < ApplicationRecord
|
||||
response = rebat(sObj)
|
||||
|
||||
#record an payment in sale-audit
|
||||
remark = "#{response} Redeem- for Customer #{self.sale.customer_id} | Sale Id [#{self.sale.sale_id}]| pay amount -> #{self.received_amount} "
|
||||
remark = "#{response} Rebate- for Customer #{self.sale.customer_id} | Sale Id [#{self.sale.sale_id}]| pay amount -> #{self.received_amount} "
|
||||
sale_audit = SaleAudit.record_paymal(self.sale.sale_id, remark, "Cashier")
|
||||
|
||||
if !response.nil?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class ReceiptBillPdf < Prawn::Document
|
||||
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, :description_width, :price_num_width
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status)
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance)
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.margin = 5
|
||||
@@ -55,7 +55,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
|
||||
if member_info != nil
|
||||
member_info(member_info,customer_name,rebate_amount,sale_data,printer_settings.precision,delimiter)
|
||||
member_info(member_info,customer_name,rebate_amount,sale_data,printer_settings.precision,delimiter,current_balance)
|
||||
end
|
||||
|
||||
customer(customer_name)
|
||||
@@ -286,7 +286,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
|
||||
# show member information
|
||||
def member_info(member_info,customer_name,rebate_amount,sale_data,precision,delimiter)
|
||||
def member_info(member_info,customer_name,rebate_amount,sale_data,precision,delimiter,current_balance)
|
||||
if rebate_amount != nil
|
||||
if rebate_amount["status"] == true
|
||||
stroke_horizontal_rule
|
||||
@@ -342,22 +342,15 @@ class ReceiptBillPdf < Prawn::Document
|
||||
text "#{number_with_precision(redeem, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
|
||||
|
||||
if redeem == 0
|
||||
old = total - rebate_balance
|
||||
else
|
||||
# if redeem_count == 0
|
||||
old = balance + redeem
|
||||
# end
|
||||
end
|
||||
|
||||
move_down 5
|
||||
if current_balance != nil
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Old Balance", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(old, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Old Balance", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(current_balance, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -371,7 +364,6 @@ class ReceiptBillPdf < Prawn::Document
|
||||
total_balance = total_balance + res["balance"]
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
<% if !@total_order.nil? %>
|
||||
<tr>
|
||||
<td width="40px"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.order") %> : </td>
|
||||
<td align="right" width="60px" style="padding: 5px"><%= @total_order.total_order %></td>
|
||||
<td align="right" width="60px"><%= @total_order.total_order %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
<% @total_accounts.each do |account| %>
|
||||
<tr>
|
||||
<td width="40px"><%= account.title %> (Account) : </td>
|
||||
<td align="right" width="60px" style="padding: 5px">
|
||||
<td align="right" width="60px">
|
||||
<% @account_data.each do |data| %>
|
||||
<% acc = account.title %>
|
||||
<%= data[""+acc+""] %> <% if !data[''+acc+''].nil? %> ( <%= data[''+acc+'_amount'] %> ) <% end %>
|
||||
@@ -247,14 +247,14 @@
|
||||
<% if !@top_items.nil? %>
|
||||
<tr>
|
||||
<td width="40px"><%= t :top %> <%= t("views.right_panel.detail.item") %> : </td>
|
||||
<td align="right" width="60px" style="padding: 5px"><%= @top_items.item_name %>
|
||||
<td align="right" width="60px"><%= @top_items.item_name %>
|
||||
<br>(<%= @top_items.item_total_price %>)</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_foc_items.nil? %>
|
||||
<tr>
|
||||
<td width="40px"><%= t("views.right_panel.detail.total") %> <%= t("views.btn.foc") %> <%= t("views.right_panel.detail.item") %> : </td>
|
||||
<td align="right" width="60px" style="padding: 5px"><%= @total_foc_items %></td>
|
||||
<td align="right" width="60px"><%= @total_foc_items %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
@@ -65,13 +65,10 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-white">
|
||||
<!-- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"> </div> -->
|
||||
<div class="row bg-white">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
|
||||
<div class="row justify-content-center form-group">
|
||||
<!-- <span class="col-md-4"></span> -->
|
||||
<input type="text" class="form-control col-4" id="emp_id" onkeypress="empID()" placeholder="Employee ID">
|
||||
<!-- <span class="col-md-4"></span> -->
|
||||
<div class="row justify-content-center form-group">
|
||||
<input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID">
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@@ -157,9 +154,7 @@
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
// for Notificaiotn message
|
||||
|
||||
var placementFrom = $("#noti").attr('data-placement-from');
|
||||
var placementAlign = $("#noti").attr('data-placement-align');
|
||||
var animateEnter = $("#noti").attr('data-animate-enter');
|
||||
@@ -177,20 +172,22 @@
|
||||
$(item).submit();
|
||||
});
|
||||
|
||||
});
|
||||
function empID(){
|
||||
$('#emp_id').keyup(function(e) {
|
||||
var txtVal = this.value;
|
||||
if ($.isNumeric(txtVal)) {
|
||||
if( txtVal.length === 3 ) {
|
||||
window.location.href = '/auth/'+txtVal;
|
||||
}
|
||||
}else{
|
||||
alert("Please Enter Numeric Number")
|
||||
}
|
||||
});
|
||||
$('#emp_id').keyup(function(e) {
|
||||
e.preventDefault();
|
||||
var txtVal = this.value;
|
||||
|
||||
if(txtVal!=''){
|
||||
if ($.isNumeric(txtVal)) {
|
||||
if( txtVal.length === 3 ) {
|
||||
window.location.href = '/auth/'+txtVal;
|
||||
}
|
||||
}else{
|
||||
alert("Please Enter Numeric Number");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {
|
||||
if (colorName === null || colorName === '') { colorName = 'bg-black'; }
|
||||
|
||||
@@ -9,20 +9,15 @@
|
||||
<ul class="nav nav-tabs flex-column" role="tablist" >
|
||||
<% @menu.each do |menu| %>
|
||||
<% if menu.menu_category_id.nil?%>
|
||||
<li class="nav-item menu_category">
|
||||
<li class="nav-item menu_category sub_click" data-id="<%=menu.id%>">
|
||||
<p class="hidden menu-id"><%= menu.id %></p>
|
||||
<a class="nav-link" data-toggle="tab" href="" role="tab"> <%= menu.name%></a>
|
||||
<a class="nav-link" data-toggle="tab" href="" role="tab"> <%= menu.name%>
|
||||
<ul class=" sub_category_list hidden" id="sub_category_list">
|
||||
</ul>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<% end%>
|
||||
<!-- Sub-Category -->
|
||||
<% if !menu.menu_category_id.nil? %>
|
||||
<ul class="collapse" id="<%= menu.menu_category_id %>">
|
||||
<li>
|
||||
<p class="hidden menu-id"><%= menu.id %></p>
|
||||
<a class="nav-link" data-toggle="tab" role="tab"> <%= menu.name%></a>
|
||||
</li>
|
||||
</ul>
|
||||
<% end%>
|
||||
<%end %>
|
||||
<!-- <li class="nav-item menu_category">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Menu 1 <b class="caret"></b></a>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div><strong id="order-title">ORDER DETAILS</strong></div>
|
||||
</div> -->
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="row card-title">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p id="sale-id" class="hidden"><%=@sale_data.sale_id %></p>
|
||||
<p>Receipt No: <span id="receipt_no"><%=@sale_data.receipt_no rescue ' '%></span></p>
|
||||
@@ -95,12 +95,16 @@
|
||||
<div class="card-title">
|
||||
<div class="form-horizontal">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="-group">
|
||||
<div class="bottom-5">
|
||||
<input type="text" id="other-charges-amount" name="other-charges-amount" class="form-control" placeholder="Amount" />
|
||||
</div>
|
||||
<div class="-group">
|
||||
<div class="bottom-5">
|
||||
<textarea id="reasons" name="reasons" rows="2" class="form-control" placeholder="Reasons"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-5">
|
||||
<input type="checkbox" id="is_taxable" name="is_taxable" />
|
||||
<lable for="is_taxable">Is Taxable</lable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -199,7 +203,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function(){
|
||||
$(".cashier_number").on('click', function(event){
|
||||
if(event.handled !== true) {
|
||||
var original_value=0;
|
||||
@@ -270,11 +274,15 @@
|
||||
var sub_total = $('#order-sub-total').text();
|
||||
var charge_amount = $("#other-charges-amount").val();
|
||||
var reasons = $("#reasons").val();
|
||||
var is_taxable = 0
|
||||
if ($("#is_taxable:checked").length > 0) {
|
||||
is_taxable = 1
|
||||
}
|
||||
|
||||
// Update sub total
|
||||
$('#order-sub-total').text(parseFloat(sub_total) + parseFloat(charge_amount));
|
||||
|
||||
var item_row = item_row_template(sale_id, charge_amount, reasons);
|
||||
var item_row = item_row_template(sale_id, charge_amount, reasons, is_taxable);
|
||||
$("#order-items-table tbody").append(item_row);
|
||||
});
|
||||
|
||||
@@ -323,13 +331,14 @@
|
||||
var sale_item = {};
|
||||
sale_item.id = $(this).attr('id');
|
||||
sale_item.name = $(this).find('#item-name-price').text();
|
||||
sale_item.price = $(this).find('#item-total-price').text();
|
||||
sale_item.price = $(this).find('#item-total-price').text()
|
||||
sale_item.is_taxable = $(this).find('#item_taxable').text();
|
||||
sale_items.push(sale_item);
|
||||
});
|
||||
return sale_items;
|
||||
}
|
||||
|
||||
function item_row_template(sale_id, charge_amount, reasons){
|
||||
function item_row_template(sale_id, charge_amount, reasons, is_taxable){
|
||||
var item_row = "<tr class='other-item-row' id='SLI-000000000000'>" +
|
||||
"<td style='width: 60%; text-align: left;'>" +
|
||||
"<span id='item_account_type' class='hidden'>" +
|
||||
@@ -338,6 +347,7 @@
|
||||
"<span id='item-name-price'>" +
|
||||
reasons +
|
||||
"</span>" +
|
||||
"<span id='item_taxable' class='hidden'>" + is_taxable + "</span>" +
|
||||
"</td>" +
|
||||
"<td style='width: 20%; text-align: right;'>" +
|
||||
"<span id='item-qty'>1</span>" +
|
||||
|
||||
@@ -390,10 +390,11 @@
|
||||
$(this).off("click");
|
||||
var sale_id = $('#sale_id').text();
|
||||
var item_row = $('.is_card');
|
||||
|
||||
if (item_row.length < 1) {
|
||||
calculate_member_discount(sale_id);
|
||||
}
|
||||
|
||||
|
||||
// payment
|
||||
var cash = $('#cash').text();
|
||||
var credit = $('#credit').text();
|
||||
|
||||
30
db/seeds.rb
30
db/seeds.rb
@@ -131,7 +131,7 @@ beverage = Account.create({title: "Beverage", account_type: "1"})
|
||||
product = Account.create({title: "Product", account_type: "2"})
|
||||
|
||||
# YGN BBQ
|
||||
person = Account.create({title: "Person", account_type: "3"})
|
||||
# person = Account.create({title: "Person", account_type: "3"})
|
||||
# END
|
||||
|
||||
#Default Menu Options
|
||||
@@ -140,7 +140,7 @@ menu_options = MenuItemOption.create([{option_type: "Oil", name: "Less Oil", val
|
||||
menu_pkg_options = MenuItemOption.create([{option_type: "Package", name: "Bottle", value: "Bottle"},{option_type: "Package", name: "Can", value: "can"}])
|
||||
|
||||
# #Default Menu Category
|
||||
menu_category1 = MenuCategory.create({menu: menu, code:"C001", name: "Person", alt_name: "Person", order_by: 1, is_available: 1, created_by: "SYSTEM DEFAULT"})
|
||||
# menu_category1 = MenuCategory.create({menu: menu, code:"C001", name: "Person", alt_name: "Person", order_by: 1, is_available: 1, created_by: "SYSTEM DEFAULT"})
|
||||
# menu_category2 = MenuCategory.create({menu: menu, code:"C005", name: "Beef & Mutton", alt_name: "Beef_and_mutton", order_by: 2,created_by: "SYSTEM DEFAULT"})
|
||||
# menu_category3 = MenuCategory.create({menu: menu, code:"C006", name: "Pork", alt_name: "Pork", order_by: 3,created_by: "SYSTEM DEFAULT"})
|
||||
# menu_category4 = MenuCategory.create({menu: menu, code:"C006", name: "Chicken", alt_name: "Chicken", order_by: 1, menu_category_id: menu_category3.id, created_by: "SYSTEM DEFAULT"})
|
||||
@@ -159,14 +159,14 @@ menu_pkg_options = MenuItemOption.create([{option_type: "Package", name: "Bottle
|
||||
# menu_category2_menu_item2 = SimpleMenuItem.create({item_code:"I009", name: "Default Menu Item Name 2", alt_name: "Alternate Menu Item Name 2",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, min_qty: 3 , account: food})
|
||||
|
||||
# YGN BBQ
|
||||
menu_item_attribute_adult = MenuItemAttribute.create({attribute_type:"person", name: "Adult", value: "adult"})
|
||||
menu_item_attribute_child = MenuItemAttribute.create({attribute_type:"person", name: "Child", value: "child"})
|
||||
# menu_item_attribute_adult = MenuItemAttribute.create({attribute_type:"person", name: "Adult", value: "adult"})
|
||||
# menu_item_attribute_child = MenuItemAttribute.create({attribute_type:"person", name: "Child", value: "child"})
|
||||
|
||||
menu_category1_menu_item0 = SimpleMenuItem.create({item_code:"P00001", name: "Adult", alt_name: "",menu_category: menu_category1 , min_qty: 1, account: person, :item_attributes => "['1']", created_by: "System" })
|
||||
menu_item0_instance = MenuItemInstance.create({item_instance_name:"",item_instance_code:"PI0001", menu_item: menu_category1_menu_item0, price:15000.00, is_on_promotion:false, is_default:true, :item_attributes => "['1']" })
|
||||
# menu_category1_menu_item0 = SimpleMenuItem.create({item_code:"P00001", name: "Adult", alt_name: "",menu_category: menu_category1 , min_qty: 1, account: person, :item_attributes => "['1']", created_by: "System" })
|
||||
# menu_item0_instance = MenuItemInstance.create({item_instance_name:"",item_instance_code:"PI0001", menu_item: menu_category1_menu_item0, price:15000.00, is_on_promotion:false, is_default:true, :item_attributes => "['1']" })
|
||||
|
||||
menu_category1_menu_item1 = SimpleMenuItem.create({item_code:"P00002", name: "Child", alt_name: "",menu_category: menu_category1 , min_qty: 1, account: person, :item_attributes => "['2']", created_by: "System" })
|
||||
menu_item1_instance = MenuItemInstance.create({item_instance_name:"",item_instance_code:"PI0002", menu_item: menu_category1_menu_item1, price:10000.00, is_on_promotion:false, is_default:true, :item_attributes => "['2']" })
|
||||
# menu_category1_menu_item1 = SimpleMenuItem.create({item_code:"P00002", name: "Child", alt_name: "",menu_category: menu_category1 , min_qty: 1, account: person, :item_attributes => "['2']", created_by: "System" })
|
||||
# menu_item1_instance = MenuItemInstance.create({item_instance_name:"",item_instance_code:"PI0002", menu_item: menu_category1_menu_item1, price:10000.00, is_on_promotion:false, is_default:true, :item_attributes => "['2']" })
|
||||
# END
|
||||
|
||||
menu_item_attribute_size_small = MenuItemAttribute.create({attribute_type:"size", name: "Small", value: "small"})
|
||||
@@ -193,7 +193,7 @@ close_cashier_printer=PrintSetting.create({name: "Close Cashier", unique_code: "
|
||||
crm_order_printer=PrintSetting.create({name: "CRM Order", unique_code: "CrmOrderPdf", printer_name: "Cashier", precision: "0", delimiter: 0, heading_space: 5, page_width: 210, page_height: 1450})
|
||||
queue_no_printer=PrintSetting.create({name: "Queue No", unique_code: "QueueNoPdf", printer_name: "Cashier", precision: "0", delimiter: 0, heading_space: 5, page_width: 210, page_height: 1450})
|
||||
|
||||
cashier_terminal = CashierTerminal.create({name:"Terminal 1", printer_name: "Cashier"})
|
||||
# cashier_terminal = CashierTerminal.create({name:"Terminal 1", printer_name: "Cashier"})
|
||||
|
||||
zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
|
||||
@@ -219,13 +219,13 @@ payment_methods = PaymentMethodSetting.create({payment_method:"Master",gateway_u
|
||||
payment_methods = PaymentMethodSetting.create({payment_method:"Redeem",gateway_url: "http://membership.paypar.ws",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv"})
|
||||
|
||||
#Default Order Queue stations
|
||||
order_queue_station1 = OrderQueueStation.create({station_name: "K1", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['01001','01002','01003','01004']), print_copy:true, cut_per_item: false, use_alternate_name: false, created_by: "SYSTEM DEFAULT"})
|
||||
order_queue_station2 = OrderQueueStation.create({station_name: "K2", is_active: false,printer_name: "Cashier", processing_items: JSON.generate(['02005','02006','02007','02008']), print_copy:true, cut_per_item: true, use_alternate_name: true, created_by: "SYSTEM DEFAULT"})
|
||||
zone_order_queue_station = OrderQueueStation.create({station_name: "K3", is_active: false, printer_name: "Cashier", processing_items: JSON.generate(['01001','01002','01003','01004','02005','02006','02007','02008']), print_copy: true, cut_per_item: true, use_alternate_name: false, created_by: "SYSTEM DEFAULT"})
|
||||
# order_queue_station1 = OrderQueueStation.create({station_name: "K1", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['01001','01002','01003','01004']), print_copy:true, cut_per_item: false, use_alternate_name: false, created_by: "SYSTEM DEFAULT"})
|
||||
# order_queue_station2 = OrderQueueStation.create({station_name: "K2", is_active: false,printer_name: "Cashier", processing_items: JSON.generate(['02005','02006','02007','02008']), print_copy:true, cut_per_item: true, use_alternate_name: true, created_by: "SYSTEM DEFAULT"})
|
||||
# zone_order_queue_station = OrderQueueStation.create({station_name: "K3", is_active: false, printer_name: "Cashier", processing_items: JSON.generate(['01001','01002','01003','01004','02005','02006','02007','02008']), print_copy: true, cut_per_item: true, use_alternate_name: false, created_by: "SYSTEM DEFAULT"})
|
||||
|
||||
# QueueStationZone
|
||||
zone_queue_station1 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station1, zone: zone})
|
||||
zone_queue_station2 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station2, zone: zone})
|
||||
zone_queue_station3 = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone})
|
||||
# zone_queue_station1 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station1, zone: zone})
|
||||
# zone_queue_station2 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station2, zone: zone})
|
||||
# zone_queue_station3 = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone})
|
||||
|
||||
puts " Finished System Default Set Up Data"
|
||||
|
||||
Reference in New Issue
Block a user