Merge branch 'r-1902001-01' into customer_report

This commit is contained in:
Thein Lin Kyaw
2020-09-10 10:07:18 +06:30
209 changed files with 2277 additions and 1920 deletions

View File

@@ -18,7 +18,7 @@ gem 'pg'
gem 'mysql2', '~> 0.5.2'
#Use PosgreSQL
gem "select2-rails"
# redis server for cable
gem 'redis', '~> 3.0'

View File

@@ -264,6 +264,7 @@ GEM
tilt (>= 1.1, < 3)
schema_to_scaffold (0.8.0)
activesupport (>= 3.2.1)
select2-rails (4.0.13)
shoulda-matchers (3.1.3)
activesupport (>= 4.0.0)
sidekiq (5.2.7)
@@ -367,6 +368,7 @@ DEPENDENCIES
rubyzip (= 1.0.0)
sass-rails (~> 5.0)
schema_to_scaffold
select2-rails
shoulda-matchers (~> 3.1)
sidekiq
simple_form

View File

@@ -77,6 +77,9 @@ For Using Star Printer
**_ Need to change these print settings 1) settings/print_settings/unique_code => OrderItemStarPdf 2) settings/print_settings/unique_code => ReceiptBillStarPdf 3) settings/print_settings/unique_code => SaleItemsStarPdf
_** Other print settings aren't need to change.
For Cloud ActionCable Print
settings/lookups => { type: print_settings, name: ActionCable, value: 1 }
For Show Sale Items Summary at CloseCashierPrint 1) settings/print_settings
a) Check => Shift Sale Items

View File

@@ -402,17 +402,17 @@ $(document).on('turbolinks:load', function() {
url: '/oqs/print/print/'+assigned_item_id,
data: params,
success: function(result){
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});
});
// Print Order Summary
@@ -428,10 +428,12 @@ $(document).on('turbolinks:load', function() {
url: '/oqs/print/print_order_summary/'+assigned_item_id,
data: params,
success: function(result){
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();

View File

@@ -36,6 +36,7 @@
//= require custom.js
//= require jquery-fileupload/basic
//= require induties/induties.js
//= require select2
$(document).ready(function() {
$('.count-to').countTo();

View File

@@ -752,6 +752,7 @@ function print_receipt(){
url: "/origami/sale/"+sale_id+"/doemal_order/payment/print",
data: params,
success:function(result){
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
@@ -773,6 +774,7 @@ function print_receipt(){
});
}
}
}
});
}
/* pdf print out */

View File

@@ -12,6 +12,8 @@
@import "BSBMaterial/themes/all-themes";
@import "reset";
@import "induties/assign_in_duties";
@import "select2";
@import "select2-material";
/*@import "bootstrap-select/css/bootstrap-select.min";*/

View File

@@ -0,0 +1,231 @@
.select2-container--material {
width: 100% !important; }
.select2-container--material .select2-selection--single {
background-color: transparent;
border: none;
border-bottom: 1px solid rgba(0,0,0,0.26);
border-radius: 0;
box-shadow: none;
box-sizing: content-box;
height: auto;
margin: 0;
outline: none;
padding: 0.46875rem 0 0.40625rem 0;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; }
.select2-container--material .select2-selection--single .select2-selection__rendered {
color: #444;
font-size: 1rem;
line-height: 18px;
padding-left: 0; }
.select2-container--material .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold; }
.select2-container--material .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--material .select2-selection--single .select2-selection__arrow {
height: 20px;
margin: 0.5rem 0 0.2rem 0;
position: absolute;
line-height: 1rem;
top: 1px;
right: 1px;
width: 20px; }
.select2-container--material .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--material[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--material[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto; }
.select2-container--material.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default; }
.select2-container--material.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none; }
.select2-container--material.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--material .select2-selection--multiple {
background-color: transparent;
border: none;
border-bottom: 1px solid #ced4da;
border-radius: 0;
box-shadow: none;
box-sizing: content-box;
cursor: text;
height: auto;
margin: 0;
outline: none;
padding: 5px 0 0 0;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; }
.select2-container--material .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 5px;
width: 100%; }
.select2-container--material .select2-selection--multiple .select2-selection__rendered li {
list-style: none; }
.select2-container--material .select2-selection--multiple .select2-selection__placeholder {
color: #999;
margin-top: 5px;
float: left; }
.select2-container--material .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-top: 5px;
margin-right: 10px; }
.select2-container--material .select2-selection--multiple .select2-selection__choice {
background-color: #ffca28;
border-radius: 16px;
color: rgba(0, 0, 0, 0.6);
cursor: default;
float: left;
margin-right: 5px;
margin-top: 6px;
padding: 0 12px; }
.select2-container--material .select2-selection--multiple .select2-selection__choice__remove {
cursor: pointer;
display: inline-block;
font-weight: bold;
float: right;
margin-left: 5px; }
.select2-container--material .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; }
.select2-container--material[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--material[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--material[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; }
.select2-container--material[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
.select2-container--material[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--material.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default; }
.select2-container--material.select2-container--disabled .select2-selection__choice__remove {
display: none; }
.select2-container--material.select2-container--open.select2-container--above .select2-selection--single, .select2-container--material.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--material.select2-container--open.select2-container--below .select2-selection--single, .select2-container--material.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--material.select2-container--focus .select2-selection--single {
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
outline: 0; }
.select2-container--material.select2-container--focus .select2-selection--multiple {
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
outline: 0; }
.select2-container--material .select2-search--dropdown .select2-search__field {
border: none;
border-bottom: 1px solid #ced4da;
border-radius: 0;
outline: none; }
.select2-container--material .select2-search--dropdown .select2-search__field:focus:not([readonly]) {
box-shadow: 0 1px 0 0 #ced4da;
border-bottom: 1px solid #ced4da; }
.select2-container--material .select2-search--inline .select2-search__field {
background: transparent;
border: none !important;
outline: 0;
box-shadow: none !important;
-webkit-appearance: textfield; }
.select2-container--material .select2-results > .select2-results__options {
overflow-y: auto; }
.select2-container--material .select2-results__option[role=group] {
padding: 0; }
.select2-container--material .select2-results__option[aria-disabled=true] {
color: #999; }
.select2-container--material .select2-results__option[aria-selected=true] {
background-color: #ddd; }
.select2-container--material .select2-results__option .select2-results__option {
padding-left: 1em; }
.select2-container--material .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0; }
.select2-container--material .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1em;
padding-left: 2em; }
.select2-container--material .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em; }
.select2-container--material .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em; }
.select2-container--material .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em; }
.select2-container--material .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em; }
.select2-container--material .select2-results__option--highlighted[aria-selected] {
background-color: #3f729b;
color: white; }
.select2-container--material .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-dropdown {
background-color: white;
border: 1px solid #ced4da;
border-radius: 4px;
box-sizing: border-box;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
display: block;
position: absolute;
left: -100000px;
width: 100%;
z-index: 1051;
-webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); }
.select2-results {
display: block; }
.select2-results__options {
list-style: none;
margin: 0;
padding: 0; }
.select2-results__option {
padding: 6px;
user-select: none;
-webkit-user-select: none; }
.select2-results__option[aria-selected] {
cursor: pointer; }
.select2-container--open .select2-dropdown {
left: 0; }
.select2-container--open .select2-dropdown--above {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--open .select2-dropdown--below {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-search--dropdown {
display: block;
padding: 4px; }
.select2-search--dropdown .select2-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box; }
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-search--dropdown.select2-search--hide {
display: none; }

View File

@@ -0,0 +1,10 @@
class PrintChannel < ApplicationCable::Channel
def subscribed
stream_from "print_channel_#{params[:shop_code]}"
end
def unsubscribed
# Any cleanup needed when channel is unsubscribed
stop_all_streams
end
end

View File

@@ -28,6 +28,4 @@ class Api::CallWaitersController < Api::ApiController
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_call_waiter(print_settings,@table,@time,@shop)
end
end

View File

@@ -27,7 +27,7 @@ private
crm_root_path
elsif current_user.role == "account"
reports_dailysale_index_path
elsif @current_user.role == "kitchen"
elsif current_user.role == "kitchen"
oqs_root_path
else
login_path

View File

@@ -51,7 +51,6 @@ class Oqs::PrintController < ApplicationController
ai.save
end
# filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount)
if ENV["SERVER_MODE"] == "cloud"
result = {
:filepath => filename,
@@ -119,7 +118,6 @@ class Oqs::PrintController < ApplicationController
ai.save
end
# filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount)
if ENV["SERVER_MODE"] == "cloud"
result = {
:filepath => filename,

View File

@@ -30,27 +30,23 @@ class Origami::HomeController < BaseOrigamiController
@status_order = ""
@status_sale = ""
@sale_array = Array.new
@shop = shop_detail
@membership = MembershipSetting::MembershipSetting
@payment_methods = PaymentMethodSetting.all
@dining_booking = @dining.current_bookings
@order_items = Array.new
@dining_booking.each do |booking|
if @obj_sale || @booking.blank?
@sale_array = @dining.current_sales
if (booking = @dining.current_checkin_booking)
@booking = booking
@order_items = booking.order_items
@obj_order = booking.orders.first
end
if booking.sale_id
if (booking = @dining.current_checkout_booking)
@booking = booking
@obj_sale = booking.sale
@sale_array.push(@obj_sale)
@sale_taxes = @obj_sale.sale_taxes
@status_sale = 'sale'
else
@order_items += booking.order_items
@obj_order = booking.orders.first
end
if @obj_sale || @customer.blank?
@@ -62,14 +58,13 @@ class Origami::HomeController < BaseOrigamiController
if @obj_sale
@status_order = 'sale'
else
elsif @obj_order
@status_order = 'order'
end
if (@obj_sale || @account_arr.blank?) && @customer
@account_arr = TaxProfile.find_by(id: @customer.tax_profiles)
end
end
#for bank integration
@checkout_time = Lookup.collection_of('checkout_time')

View File

@@ -132,14 +132,6 @@ class Origami::PaymentsController < BaseOrigamiController
)
end
# For Print
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
if Lookup.collection_of("print_settings").any? { |x| x == ["ReceiptBillA5Pdf", "1"] } #print_settings with name:ReceiptBillA5Pdf
unique_code = "ReceiptBillA5Pdf"
else
unique_code = PrintSetting.where("unique_code REGEXP ?", "receipt.*bill.*pdf").first.unique_code
end
customer = saleObj.customer
# get member information
@@ -197,12 +189,17 @@ class Origami::PaymentsController < BaseOrigamiController
card_balance_amount = SaleAudit.getCardBalanceAmount(sale_id)
# get printer info
print_settings = PrintSetting.find_by_unique_code(unique_code)
if type.strip.downcase == 'doemal_order'
print_settings = PrintSetting.where(unique_code: 'ReceiptBillOrderPdf').first
else
print_settings = PrintSetting.where("unique_code REGEXP ?", "receipt.*bill.*pdf").first
end
# Calculate Food and Beverage Total
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
other_amount = SaleItem.calculate_other_charges(sale_items)
credit_pdf = Lookup.find_by_lookup_type("credit_pdf")
if (path.include? ("credit_payment")) && !credit_pdf.nil? && credit_pdf.value.to_i == 1
printed_status = 'credit_payment'
else
@@ -211,13 +208,10 @@ class Origami::PaymentsController < BaseOrigamiController
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, printed_status,current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil)
#end
if !saleObj.nil?
# if !saleObj.nil?
# InventoryJob.perform_now(self.id)
# InventoryDefinition.calculate_product_count(saleObj)
end
# end
end
# status, filename, sale_receipt_no, printer_name = Payment.pay(getCloudDomain, cash, sale_id, member_info, type, tax_type, path, latest_order_no, shop_detail, current_user, nil, nil)
@@ -275,7 +269,7 @@ class Origami::PaymentsController < BaseOrigamiController
@payment_methods = PaymentMethodSetting.where(is_active: true).pluck(:payment_method)
@cash = payments.inject(0) { |sum, payment| sum + payment[1] if payment[0] == 'cash' }
@credit = payments.inject(0) { |sum, payment| sum + payment[1] if payment[0] == 'creditnote' }
@credit = payments.inject(0) { |sum, payment| payment[0] == 'creditnote' ? sum + payment[1] : sum }
@other_payments = payments.select { |payment| !['cash', 'creditnote', 'foc'].include? payment[0] }.map { |method, amount| [ @payment_methods.find { |payment_method| payment_method.parameterize == method }, amount ] }
@other_payment = @other_payments.sum { |payment| payment[1] }
@@ -610,34 +604,13 @@ class Origami::PaymentsController < BaseOrigamiController
cashier_type = params[:type]
if cashier_type.strip.downcase == "doemal_order"
unique_code = "ReceiptBillOrderPdf"
print_settings = PrintSetting.where(unique_code: 'ReceiptBillOrderPdf').first
else
receipt_bill_a5_pdf = Lookup.collection_of("print_settings") #print_settings with name:ReceiptBillA5Pdf
unique_code = "ReceiptBillPdf"
print_settings = PrintSetting.all
if !print_settings.nil?
print_settings.each do |setting|
if setting.unique_code == 'ReceiptBillPdf'
unique_code = "ReceiptBillPdf"
elsif setting.unique_code == 'ReceiptBillStarPdf'
unique_code = "ReceiptBillStarPdf"
end
end
end
if !receipt_bill_a5_pdf.empty?
receipt_bill_a5_pdf.each do |receipt_bilA5|
if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
if receipt_bilA5[1] == '1'
unique_code = "ReceiptBillA5Pdf"
# else
# unique_code = "ReceiptBillPdf"
end
end
end
end
print_settings = PrintSetting.where("unique_code REGEXP ?", "receipt.*bill.*pdf").first
end
# get printer info
print_settings = PrintSetting.find_by_unique_code(unique_code)
# print_settings = PrintSetting.find_by_unique_code(unique_code)
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_receipt_pdf(filename,receipt_no,print_settings.print_copies,printer_name)

View File

@@ -67,10 +67,7 @@ class Origami::ShiftsController < BaseOrigamiController
end
end
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# if !close_cashier_print[0].nil?
# @close_cashier_print = close_cashier_print[0][1]
# end
@@ -91,12 +88,10 @@ class Origami::ShiftsController < BaseOrigamiController
shop_details = shop_detail
#get tax
shift_obj = ShiftSale.where('id = ?', @shift.id)
sale_items = ''
@lookup = Lookup.shift_sale_items_lookup_value
if @lookup.to_i == 1
@sale_items = Sale.get_shift_sale_items(@shift.id)
other_charges = Sale.get_other_charges()
@total_other_charges_info = other_charges.where("sales.shift_sale_id IN (?) and sale_status='completed'",@shift)
@total_other_charges_info = ShiftSale.get_other_charges(@shift)
end
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
@total_waste = Sale.get_total_waste(shift_id).sum(:grand_total)
@@ -118,16 +113,11 @@ class Origami::ShiftsController < BaseOrigamiController
printer = Printer::CashierStationPrinter.new(print_settings)
# print close cashier setting
close_cashier_print = Lookup.collection_of('close_cashier_print')
if close_cashier_print.empty?
@settings_lookup = Lookup.new(lookup_type: "close_cashier_print", name: "CloseCashierPrint", value: "1")
@settings_lookup.save
end
find_close_cashier_print = Lookup.collection_of('close_cashier_print')
if find_close_cashier_print[0][1].to_i > 0
if Lookup.collection_of('close_cashier_print').any? { |l| l == ['CloseCashierPrint', '1'] }
printer.print_close_cashier(print_settings, cashier_terminal, @shift, @sale_items, @total_other_charges_info, 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, @total_credit_payments, @payment_methods)
end
end
# end
end
Employee.logout(session[:session_token])
session[:session_token] = nil

View File

@@ -53,9 +53,6 @@ class Reports::ShiftsaleController < BaseReportController
@shift = ShiftSale.find_by_id(shift_id)
shift_obj = ShiftSale.where('id =?',shift_id)
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
close_cashier_pdf = Lookup.collection_of("print_settings")
unique_code = "CloseCashierPdf"
@@ -72,9 +69,15 @@ class Reports::ShiftsaleController < BaseReportController
end
end
shop_details = shop_detail
cashier_terminal = @shift.cashier_terminal
@lookup = Lookup.shift_sale_items_lookup_value
if @lookup.to_i == 1
@sale_items = Sale.get_shift_sale_items(@shift.id)
@total_other_charges_info = ShiftSale.get_other_charges(@shift)
end
@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)
@@ -100,10 +103,6 @@ class Reports::ShiftsaleController < BaseReportController
respond_to do |format|
format.html { redirect_to '/en/reports/shiftsale/', notice: 'Printing Completed.'}
format
end
end
end
end

View File

@@ -1,2 +1,5 @@
module PrintSettingsHelper
def print_settings
tag.div id: 'print_settings', class: 'hidden', data: { action_cable: Lookup.collection_of('print_settings').any? { |x| x == ["ActionCable", "1"] } }
end
end

View File

@@ -58,8 +58,8 @@ class Booking < ApplicationRecord
end
end
scope :active, -> {where("booking_status != 'moved'")}
scope :today, -> {where("created_at >= #{Time.now.utc}")}
scope :active, -> { where('booking_status != ?', 'moved') }
scope :today, -> { where('created_at >= ?', Time.now) }
scope :assign, -> { where(booking_status: 'assign') }
def self.sync_booking_records(bookings)
@@ -171,6 +171,15 @@ class Booking < ApplicationRecord
return @orders, @order_items, @sales, @sale_items, @sale_taxes, @sale_payments, @sale_orders, @sale_audits, @bookings, @assigned_order_items, @shift_sales
end
def self.get_booking_id(order_no)
booking = Booking.joins(" JOIN booking_orders bo ON bo.booking_id = bookings.booking_id")
.joins(" JOIN orders o ON o.order_id=bo.order_id")
.where("o.order_id='#{order_no}'")
.first()
return booking.booking_id
end
private
def generate_custom_id
if self.booking_id.nil?

View File

@@ -176,7 +176,7 @@ class OrderQueueStation < ApplicationRecord
end
def move_print_pdf(change_to,current_user,change_from,order_items,oqs)
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# get printer info
@from = (DiningFacility.find(change_from)).name
@to = (DiningFacility.find(change_to)).name
@@ -197,6 +197,6 @@ class OrderQueueStation < ApplicationRecord
printer.print_move_table(print_settings,@to,@from ,@shop,@date,@type,@moved_by,order_items,oqs)
# end
# end
end
# end
end
end

View File

@@ -39,16 +39,14 @@ class Printer::CashierStationPrinter < Printer::PrinterWorker
# end
def print_close_cashier(printer_settings, cashier_terminal, shift_sale, sale_items, total_other_charges_info, shop_details, sale_taxes, other_payment, amount, discount, member_discount, total_dinein, total_takeway, total_other_charges, total_waste, total_spoile, total_credit_payments, payment_methods)
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
if !sale_items.blank? or !sale_items.nil?
@account_cate_count = Hash.new {|hash, key| hash[key] = 0}
sale_items.each {|acc_cate| @account_cate_count[acc_cate.account_id] += 1}
@menu_cate_count = Hash.new {|hash, key| hash[key] = 0}
sale_items.each {|cate| @menu_cate_count[cate.menu_category_id] += 1}
@totalByAccount = Hash.new {|hash, key| hash[key] = 0}
sale_items.each {|acc| @totalByAccount[acc.account_id] += acc.grand_total}
end
@@ -73,24 +71,48 @@ class Printer::CashierStationPrinter < Printer::PrinterWorker
end
end
end
pdf.render_file filename
pdf.render_file filename
#no print in cloud server
if ENV["SERVER_MODE"] != "cloud"
self.print(filename, cashier_terminal.printer_name)
end
else
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: cashier_terminal.printer_name,
unique_code: print_settings.unique_code,
print_copies: print_settings.print_copies,
data: {
shop_details: shop_details.as_json,
shift_sale: shift_sale,
cashier_terminal: cashier_terminal,
shift_employee: shift_sale.employee,
sale_items: sale_items,
other_charges: total_other_charges_info,
sale_taxes: sale_taxes,
other_payment: other_payment,
total_amount_by_account: amount,
total_discount_by_account: discount,
total_member_discount: member_discount,
total_waste: total_waste,
total_spoile: total_spoile,
total_other_charges: total_other_charges,
total_credit_payments: total_credit_payments
}
)
end
end
def print_sale_items_report(print_settings, shop_details, period_name, type, account, from_date, to_date, shift_name, sale_items, total_other_charges)
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
filename = "tmp/reports_sale_items.pdf"
if print_settings.unique_code == "SaleItemsPdf"
pdf = SaleItemsPdf.new(print_settings, shop_details, period_name, type, account, from_date, to_date, shift_name, sale_items, total_other_charges)
puts 'Printing!!!!'
end
if print_settings.unique_code == "SaleItemsStarPdf"
pdf = SaleItemsStarPdf.new(print_settings, shop_details, period_name, type, account, from_date, to_date, shift_name, sale_items, total_other_charges)
puts 'PrintingStar!!!!'
end
pdf.render_file filename
@@ -99,6 +121,26 @@ class Printer::CashierStationPrinter < Printer::PrinterWorker
if ENV["SERVER_MODE"] != "cloud"
self.print(filename, print_settings.printer_name)
end
else
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: print_settings.printer_name,
unique_code: print_settings.unique_code,
print_copies: print_settings.print_copies,
data: {
sale_items: sale_items.as_json,
total_other_charges: total_other_charges,
shop_details:shop_details.as_json,
sale_details: {
period: period_name,
type: type,
account: account,
from_date: from_date,
to_date: to_date,
shift: shift_name,
},
}
)
end
end
#sqa
end

View File

@@ -1,22 +1,22 @@
class Printer::OrderQueuePrinter < Printer::PrinterWorker
def print_order_item(print_settings, oqs, order_id, order_item_id, print_status, before_updated_qty="", options="")
booking_id = Booking.get_booking_id(order_id)
order_item = print_query('order_item', order_item_id).first #OrderItem.find_by_item_code(item_code)
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
# Must be one print
if print_settings.print_copies == 0
print_settings.print_copies = 1
print_settings.save!
end
order_item = print_query('order_item', order_item_id) #OrderItem.find_by_item_code(item_code)
options = order_item[0].options
options = order_item.options
# check for item not to show
# if order_item[0].price != 0
pdf = print_settings.unique_code.constantize.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
# end
pdf = print_settings.unique_code.constantize.new(print_settings, order_item, print_status, options, oqs.use_alternate_name, before_updated_qty)
shop = Shop.current_shop
directory_name = 'public/orders_'+shop.shop_code
directory_name = "public/orders_#{shop.shop_code}"
Dir.mkdir(directory_name) unless File.exists?(directory_name)
filename = directory_name + "/order_item_#{order_id}_#{order_item_id}" + ".pdf"
@@ -26,15 +26,29 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
if ENV["SERVER_MODE"] != "cloud"
self.print(filename, oqs.printer_name)
end
#For print copy
# pdf.render_file filename.gsub(".","-copy.")
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
else
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: oqs.printer_name,
unique_code: print_settings.unique_code,
print_copies: print_settings.print_copies,
data: {
order_item: order_item.as_json(methods: :type),
print_status: print_status.gsub(/[()]/, ""),
booking_id: booking_id,
precision: print_settings.precision
}
)
end
return filename, order_id, oqs.printer_name
end
# Query for per order
def print_order_summary(print_settings, oqs, order_id, order_items, print_status, before_updated_qty="", options="")
booking_id = Booking.get_booking_id(order_id) #order[0].order_id
order = print_query('order_summary', order_id)
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
#Use CUPS service
#Generate PDF
#Print
@@ -48,34 +62,6 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
directory_name = "public/orders_#{shop.shop_code}"
Dir.mkdir(directory_name) unless File.exists?(directory_name)
# For Print Per Item
if oqs.cut_per_item
order_items.each do |odi|
odi_item = print_query('order_item', odi.order_items_id)
filename = directory_name + "/order_item_#{order_id}.pdf"
# filename = "tmp/order_item_#{order_id}" + ".pdf"
# For Item Options
options = odi.options == "[]" ? "" : odi.options
# check for item not to show
#if odi.price != 0
pdf = print_settings.unique_code.constantize.new(print_settings, odi_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
# pdf.render_file "tmp/order_item.pdf"
pdf.render_file filename
#no print in cloud server
if ENV["SERVER_MODE"] != "cloud"
self.print(filename, oqs.printer_name)
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
end
#end
end
# For Print Order Summary
else
order = print_query('order_summary', order_id)
filename = directory_name + "/order_summary_#{order_id}.pdf"
# filename = "tmp/order_summary_#{order_id}" + ".pdf"
pdf = print_settings.unique_code.constantize.new(print_settings, order, print_status, order_items, oqs.use_alternate_name, before_updated_qty)
@@ -85,10 +71,21 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
if ENV["SERVER_MODE"] != "cloud"
self.print(filename, oqs.printer_name)
end
#For print copy
# pdf.render_file filename.gsub(".","-copy.")
# self.print(filename.gsub(".","-copy."), oqs.printer_name)
else
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: oqs.printer_name,
unique_code: print_settings.unique_code,
print_copies: print_settings.print_copies,
data: {
order_item: order_items,
order: order.as_json(methods: :type),
print_status: "",
booking_id: booking_id,
precision: print_settings.precision
}
)
end
return filename, order_id, oqs.printer_name
end
@@ -173,6 +170,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
# Check in-out time
def print_check_in_out(print_settings, cashier_terminal, booking, table)
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
#Use CUPS service
#Generate PDF
#Print
@@ -180,6 +178,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
filename = "tmp/check_in_out_#{sale_id}" + ".pdf"
pdf = CheckInOutPdf.new(print_settings,booking, table)
print_setting = PrintSetting.all
# if order_item[0].price != 0
@@ -205,5 +204,17 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
if ENV["SERVER_MODE"] != "cloud"
self.print(filename, print_settings.printer_name)
end
else
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: cashier_terminal.printer_name,
unique_code: print_settings.unique_code,
print_copies: print_settings.print_copies,
data: {
booking: booking,
table: table,
table_type: table.type,
}
)
end
end
end

View File

@@ -91,10 +91,10 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
#Bill Receipt Print
def print_receipt_bill(printer_settings, kbz_pay_status, qr_code, 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,card_data,other_amount,latest_order_no,card_balance_amount,order_reservation)
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
#Use CUPS service
#Generate PDF
#Print
if printer_settings
if !printer_settings.unique_code.match?(/receiptbillorder/i)
if Lookup.collection_of("print_settings").any? { |x| x == ["ReceiptBillA5Pdf", "1"] } #print_settings with name:ReceiptBillA5Pdf
pdf = ReceiptBillA5Pdf.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,card_data,other_amount,latest_order_no,card_balance_amount)
@@ -109,48 +109,97 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
# print as print copies in printer setting
count = printer_settings.print_copies
# override print copies for print worker loop
# print_settings.print_copies = 1
# print_settings.save!
end
directory_name = 'public/receipts'
Dir.mkdir(directory_name) unless File.exists?(directory_name)
Rails.logger.debug "############## dir::" + directory_name
if count == 1
filename = directory_name + "/receipt_bill_#{sale_data.receipt_no}.pdf"
filename = "#{directory_name}/receipt_bill_#{sale_data.receipt_no}#{count != 1 ? "_#{count}" : ''}.pdf"
pdf.render_file filename
if printed_status != 'Paid' && printed_status != 'credit_payment'
if printed_status != 'Paid' || !Lookup.where(lookup_type: "ReceiptPdfView").pluck(:value).include?('1')
#no print in cloud server
puts "SERVER_MODE #{ENV["SERVER_MODE"]}"
if ENV["SERVER_MODE"] != "cloud"
self.print(directory_name + "/receipt_bill_#{sale_data.receipt_no}.pdf", cashier_terminal.printer_name)
end
elsif printed_status == 'credit_payment'
filename = directory_name + "/receipt_bill_credit_#{sale_data.receipt_no}.pdf"
pdf.render_file filename
self.print(directory_name + "/receipt_bill_credit_#{sale_data.receipt_no}.pdf", cashier_terminal.printer_name)
end
else
filename = directory_name + "/receipt_bill_#{sale_data.receipt_no}_#{count}.pdf"
pdf.render_file filename
if printed_status != 'Paid'
#no print in cloud server
if ENV["SERVER_MODE"] != "cloud"
self.print(directory_name + "/receipt_bill_#{sale_data.receipt_no}_#{count}.pdf", cashier_terminal.printer_name)
end
self.print(filename, cashier_terminal.printer_name)
end
end
Rails.logger.debug "############## filename::" + filename
return filename, sale_data.receipt_no, cashier_terminal.printer_name
else
if printed_status != 'Paid' || !Lookup.where(lookup_type: "ReceiptPdfView").pluck(:value).include?('1')
sale_payments = SalePayment
.select(:payment_method, 'SUM(`sale_payments`.`payment_amount`) AS `payment_amount`')
.where(sale_id: sale_data.sale_id).group(:payment_method)
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: cashier_terminal.printer_name,
unique_code: print_settings.unique_code,
print_copies: print_settings.print_copies,
data: {
shop_details: shop_details.as_json,
body: { sale_data: sale_data,
booking: sale_data.bookings,
dining_facility: sale_data.booking.dining_facility.as_json(methods: :type),
sale_taxes: sale_data.sale_taxes,
latest_order_no: latest_order_no,
sale_items: sale_items,
precision: print_settings.precision,
delimiter: print_settings.delimiter,
member_info: member_info,
customer_name: customer_name,
rebate_amount: rebate_amount,
current_balance: balance,
card_data: card_data,
card_balance_amount: card_balance_amount,
discount_price_by_accounts: discount_price_by_accounts,
item_price_by_accounts: item_price_by_accounts,
sale_payments: sale_payments.as_json
},
footer: {
printed_status: printed_status, footer_text: "Thank You! See you Again"
}
}
)
end
end
return filename || '', sale_data.receipt_no, cashier_terminal.printer_name
end
# stock check
def print_stock_check_result(print_settings, stockcheck, stockcheck_items, checker_name, shop_details)
pdf = StockResultPdf.new(print_settings,stockcheck, stockcheck_items,checker_name, shop_details)
stock_items= []
if stockcheck_items.length > 0
stockcheck_items.each do |sc|
stock_item= {
count: sc.stock_count.to_s,
item_name: MenuItemInstance.get_item_name(sc.item_code)
}
stock_items.push(stock_item)
end
end
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
pdf = StockCheckPdf.new(print_settings,stockcheck, stockcheck_items,checker_name, shop_details)
pdf.render_file "tmp/print_stock_check_result.pdf"
#no print in cloud server
if ENV["SERVER_MODE"] != "cloud"
self.print("tmp/print_stock_check_result.pdf")
end
else
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: print_settings.printer_name,
unique_code: print_settings.unique_code,
print_copies: print_settings.print_copies,
data: {
stockcheck: stockcheck,
stockcheck_items: stock_items,
checker_name: checker_name,
shop_details: shop_details,
}
)
end
end
#Queue No Print
@@ -168,13 +217,14 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
#Move Table Print
def print_move_table(printer_settings, to, from, shop_detail, date, type, moved_by, order_items, oqs)
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
#Use CUPS service
#Generate PDF
#Print
pdf = MoveTablePdf.new(printer_settings, to, from, shop_detail, date, type, moved_by, order_items)
pdf.render_file "tmp/print_move_table.pdf"
if ENV["SERVER_MODE"] != "cloud"
if oqs.print_copy
self.print("tmp/print_move_table.pdf",oqs.printer_name)
else
@@ -184,6 +234,24 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
self.print("tmp/print_move_table.pdf", oqs.printer_name)
end
end
else
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: oqs.station_name,
unique_code: print_settings.unique_code,
print_copies: print_settings.print_copies,
data: {
type: type,
body: {
to: to,
from: from,
date: date,
moved_by: moved_by,
order_items: order_items.as_json,
},
}
)
end
end
#Bill Receipt Print
def print_crm_order(booking,order_items,setting)
@@ -200,15 +268,30 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
#Queue No Print
def print_call_waiter(printer_settings,table,time,shop_detail)
if Lookup.collection_of('print_settings').none? { |x| x == ["ActionCable", "1"] }
#Use CUPS service
#Generate PDF
#Print
pdf = CallWaiterPdf.new(printer_settings,table,time,shop_detail)
pdf.render_file "tmp/print_call_waiter.pdf"
#no print in cloud server
if ENV["SERVER_MODE"] != "cloud"
self.print("tmp/print_call_waiter.pdf")
end
else
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: print_settings.printer_name,
unique_code: print_settings.unique_code,
print_copies: print_settings.print_copies,
data: {
shop_name: shop_detail.name,
name: print_settings.name,
table: table.name,
time: time,
}
)
end
end
#print receipt pdf from js

View File

@@ -764,7 +764,7 @@ class Sale < ApplicationRecord
SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount")
.sale_payments_with_audit_except_void_between(from, to)
.where("(sale_status = ? OR sale_status = ?) AND sales.receipt_date between ? AND ? ", 'completed', 'void', from, to)
.group("sale_id").to_sql
.group("sale_id")
sale_taxes = Sale.select('sales.sale_id, sale_taxes.tax_name')
.joins(:sale_taxes)
@@ -789,13 +789,13 @@ class Sale < ApplicationRecord
(IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0)) + (IFNULL(SUM(case when (sale_status='completed') then total_discount else 0 end),0)) as gross_sale,
CAST((CONVERT_TZ(receipt_date,'+00:00','+06:30')) AS DATE) as sale_date,
#{payment_methods.map { |method| pm = method == 'paypar' ? 'redeem' : method; "SUM(`#{pm}`) as `#{pm}`"}.push('').join(', ')}
SUM(cash_amount) as cash_amount,
SUM(credit_amount) as credit_amount,
SUM(foc_amount) as foc_amount
SUM(`cash_amount`) as `cash_amount`,
SUM(`credit_amount`) as `credit_amount`,
SUM(`foc_amount`) as `foc_amount`
FROM (
#{sales}
#{sales.to_sql}
) as s
JOIN (#{sale_taxes.to_sql}) AS st ON s.sale_id = st.sale_id
LEFT JOIN (#{sale_taxes.to_sql}) AS st ON s.sale_id = st.sale_id
GROUP BY DATE(CONVERT_TZ(receipt_date,'+00:00','+06:30'))").to_hash.map(&:symbolize_keys)
return daily_total
end
@@ -974,7 +974,7 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status,type,accou
product = product.where("sales.shift_sale_id IN (?) and sale_status='completed'",shift.to_a)
discount_query = Sale.where("sales.shift_sale_id in (?) and sale_status= 'completed' ", shift.to_a).sum(:total_discount)
change_amount = Sale.where("sales.shift_sale_id in (?) and sale_status= 'completed' ", shift.to_a).sum(:amount_changed)
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_amount,
sale_cash = select(Sale.column_names).select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_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='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount")
@@ -997,7 +997,7 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status,type,accou
product = product.where("sales.shift_sale_id IN (?) and sale_status='completed'",shift_sale_range.to_a)
discount_query = Sale.where("sales.shift_sale_id IN (?) and sale_status ='completed'", shift_sale_range.to_a).sum(:total_discount)
change_amount = Sale.where("sales.shift_sale_id IN (?) and sale_status ='completed'", shift_sale_range.to_a).sum(:amount_changed)
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_amount,
sale_cash = select(Sale.column_names).select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_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='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount")
@@ -1021,7 +1021,7 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status,type,accou
discount_query = Sale.where("sales.receipt_date between ? and ? and sale_status ='completed'", from,to).sum(:total_discount)
change_amount = Sale.where("sales.receipt_date between ? and ? and sale_status ='completed'", from,to).sum(:amount_changed)
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_amount,
sale_cash = select(Sale.column_names).select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_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='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount")
@@ -1080,7 +1080,7 @@ def self.get_staff_meal_items(shift_sale_range, shift, from, to, status, account
product = product.where("sales.shift_sale_id IN (?) and sale_status='completed'",shift.to_a)
discount_query = Sale.where("sales.shift_sale_id in (?) and sale_status= 'completed' ", shift.to_a).sum(:total_discount)
change_amount = Sale.where("sales.shift_sale_id in (?) and sale_status= 'completed' ", shift.to_a).sum(:amount_changed)
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_amount,
sale_cash = select(Sale.column_names).select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_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='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount")
@@ -1103,7 +1103,7 @@ def self.get_staff_meal_items(shift_sale_range, shift, from, to, status, account
product = product.where("sales.shift_sale_id IN (?) and sale_status='completed'",shift_sale_range.to_a)
discount_query = Sale.where("sales.shift_sale_id IN (?) and sale_status ='completed'", shift_sale_range.to_a).sum(:total_discount)
change_amount = Sale.where("sales.shift_sale_id IN (?) and sale_status ='completed'", shift_sale_range.to_a).sum(:amount_changed)
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_amount,
sale_cash = select(Sale.column_names).select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_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='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount")
@@ -1127,7 +1127,7 @@ def self.get_staff_meal_items(shift_sale_range, shift, from, to, status, account
discount_query = Sale.where("sales.receipt_date between ? and ? and sale_status ='completed'", from,to).sum(:total_discount)
change_amount = Sale.where("sales.receipt_date between ? and ? and sale_status ='completed'", from,to).sum(:amount_changed)
sale_cash = Sale.select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_amount,
sale_cash = select(Sale.column_names).select("SUM(case when (sale_payments.payment_method IN (#{payment_methods.empty? ? '""' : payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') })) then (sale_payments.payment_amount) else 0 end) as card_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='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount")

View File

@@ -1,14 +1,12 @@
class SeedGenerator < ApplicationRecord
# Generate ID for Tables
def self.generate_id(model, prefix)
model_name = self.get_model_name(model)
prefix ||= ''
prefix << '-' if prefix.present?
if ENV["SERVER_MODE"] == 'cloud'
prefix << 'C'
else
# else
prefix << 'L'
end
@@ -16,14 +14,12 @@ class SeedGenerator < ApplicationRecord
prefix << shop.shop_code
end
seed = self.update_seed(model_name)
seed = self.update_seed(model)
length = 16 - prefix.length
prefix + seed.to_s.rjust(length, '0')
end
def self.generate_ids(model, prefix, count = 1)
model_name = self.get_model_name(model)
prefix ||= ''
prefix << '-' if prefix.present?
@@ -37,7 +33,7 @@ class SeedGenerator < ApplicationRecord
prefix << shop.shop_code
end
start = self.update_seed(model_name, count)
start = self.update_seed(model, count)
stop = start + count - 1
length = 16 - prefix.length
(start..stop).map { |c| prefix + c.to_s.rjust(length, '0') }
@@ -127,7 +123,8 @@ class SeedGenerator < ApplicationRecord
def self.update_seed(model, count = 1)
SeedGenerator.transaction do
seed = SeedGenerator.lock.find_by_model(model)
seed = SeedGenerator.lock.find_by_model(get_model_name(model)) ||
SeedGenerator.lock.find_by_model(model)
seed.next = seed.next + (count * seed.increase_by)
seed.current = seed.next - seed.increase_by
seed.save!

View File

@@ -210,6 +210,11 @@ class ShiftSale < ApplicationRecord
.first()
end
def self.get_other_charges(shift)
query = SaleItem.joins("JOIN sales as s ON s.sale_id = sale_items.sale_id")
.where('shift_sale_id =? and s.sale_status = "completed" and sale_items.product_code = "Other Charges" and sale_items.item_instance_code is null',shift.id)
end
def self.search(filter,from,to)
if filter.blank?
keyword = ''

View File

@@ -597,7 +597,8 @@ class CloseCashierPdf < Prawn::Document
def other_charges_detail(total_other_charges)
total_charges = 0
total_charges_items = 0
p "total other charges<========================="
p total_other_charges
unless total_other_charges.nil?
y_position = cursor
bounding_box([0,y_position], :width =>self.page_width - 10, :height => 20) do
@@ -611,6 +612,7 @@ class CloseCashierPdf < Prawn::Document
total_other_charges.each do |charges|
move_down 3
p charges['product_name']
add_item_line(charges['product_name'], charges['unit_price'].to_i, charges['total_item'].to_i, charges['grand_total'].to_i)
total_charges_items += charges['total_item'].to_i

View File

@@ -398,8 +398,6 @@ class ReceiptBillPdf < Prawn::Document
end
end
end
else
end
# move_down 5

View File

@@ -1,4 +1,4 @@
class StockResultPdf < Prawn::Document
class StockCheckPdf < Prawn::Document
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, stockcheck, stockcheck_items, checker_name, shop_details)

View File

@@ -262,10 +262,7 @@
$("#paypar_account_no").on('focus', function(e){
if($(this).val() == ''){
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
},100);
}
});
@@ -289,6 +286,7 @@
$("#paypar_account_no").val(cardNo);
$("#search").val(cardNo);
$("#type").val("card");
$("#filter_form").submit();
}else{
if($.inArray(cardNo, paypar_account_no) !== -1){
swal({
@@ -309,6 +307,7 @@
}
}
}
$("#sxModal").hide();
}
$("#sxModal .btn_cancel").on('click',function(){

View File

@@ -1,9 +1,9 @@
<!-- <div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t :crm %></li> -->
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<!-- <li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li> -->
<!-- <span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
@@ -161,26 +161,13 @@
$(document).ready(function () {
$("#oqs_loading_wrapper").show();
localStorage.setItem("member_card",false);
/*$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');*/
// Read Card Reader
$("#member_acc_no").on('click', function(e){
localStorage.setItem("member_card",true);
var cardNo = "";
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
$("#filter_form").submit();
},100);
});
// QR Code Reader
$("#qr_code").on('click', function(e){
var code = "";
@@ -319,9 +306,6 @@
//$(".edit_customer").attr('method', 'PATCH');
}
});
// }else{
// }
})
function update_sale(customer_id,sale_id) {

View File

@@ -1,9 +1,9 @@
<div class="container-fluid">
<div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li>
<li class="breadcrumb-item active">CRM</li>
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<!-- <li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li> -->
<span class="float-right">
<%= link_to 'Back', crm_customers_path %>
</span>
@@ -240,4 +240,3 @@
</div>
</div>

View File

@@ -1,11 +1,11 @@
<div class="container-fluid">
<div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= crm_dining_queues_path %>">Queue</a></li>
<li class="breadcrumb-item active">Assign Queue <%=@queue.queue_no%></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
<%= link_to 'Back', root_path %>
</span>
</ul>
</div>

View File

@@ -1,10 +1,10 @@
<div class="container-fluid">
<div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("en.queue") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
<%= link_to 'Back', root_path %>
</span>
</ul>
</div>

View File

@@ -1,7 +1,7 @@
<div class="container-fluid">
<div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= crm_dining_queues_path %>"><%= t("en.queue") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
<span class="float-right">

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t :inventory %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t :inventory %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), inventory_path %>

View File

@@ -1,6 +1,6 @@
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= inventory_path %>"><%= t :inventory %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
<span class="float-right">

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.stock_check") %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), inventory_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%=inventory_stock_checks_path%>"></a><%= t("views.right_panel.detail.stock_check") %></li>
<li class="breadcrumb-item active"><%= t :details %></li>
<span class="float-right">

View File

@@ -17,15 +17,9 @@
<!-- <a href="javascript:void(0);" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false"></a> -->
<%if current_login_employee.role !="waiter" %>
<a href="javascript:void(0);" class="bars"></a>
<% if current_login_employee.role == "administrator" || current_login_employee.role == "manager" || current_login_employee.role == "account" %>
<a class="navbar-brand mbl_view" href="<%=dashboard_path%>" style="margin-left: 20px;">
<% elsif current_login_employee.role == "supervisor" || current_login_employee.role == "cashier" || current_login_employee.role == "waiter" %>
<a class="navbar-brand mbl_view" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
<a class="navbar-brand mbl_view" href="<%= root_path %>" style="margin-left: 20px;">
<% else %>
<a class="navbar-brand mbl_view" href="" style="margin-left: 20px;">
<% end %>
<% else %>
<a class="navbar-brand m-0 mbl_view" href="<%= origami_dashboard_path%>">
<a class="navbar-brand m-0 mbl_view" href="<%= root_path %>">
<%end%>
<img src="<%= asset_path('SX-Logo-small.png') %>" width="40" height="40" alt="Logo" />
<span class="navbar-brand-txt">SX Restaurant</span>

View File

@@ -1,7 +1,7 @@
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li>
<li class="breadcrumb-item active">OQS</li>
<span class="float-right">
<%= link_to 'Back', oqs_root_path %>

View File

@@ -195,6 +195,8 @@
</div>
<input type="hidden" id="server_mode" value="<%=ENV["SERVER_MODE"]%>">
<%= print_settings %>
<script type="text/javascript">
$(document).on('turbolinks:load', function() {
$('#back').on('click', function () {
@@ -202,8 +204,6 @@
});
});
document.getElementById("defaultOpen").click();
</script>
<style type="text/css">

View File

@@ -1,15 +1,17 @@
<!-- <div class="container-fluid">
<div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li>
<li class="breadcrumb-item active">CRM</li> -->
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<!-- <li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li> -->
<!-- <span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ul>
</div> -->
<div id="loading_wrapper" style="display:none;">
<div id="loading"></div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
@@ -366,6 +368,8 @@
var page = "<%= @page %>";
var paypar_account_no = [];
$(function() {
setHeaderBreadCrumb(_CUSTOMERS_);
paypar_account_no = JSON.parse('<%= @paypar_accountno.to_json.html_safe %>', function (key, value) {
var type;
if (value && typeof value === 'object') {
@@ -376,7 +380,7 @@
}
return value;
});
console.log(paypar_account_no);
/* check webview loaded*/
var webview = <%= @webview %>;
showHideNavbar(webview);
@@ -394,57 +398,15 @@
$("#paypar_account_no").on('focus', function(e){
if($(this).val() == ''){
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
},100);
}
});
$(document).ready(function () {
setHeaderBreadCrumb(_CUSTOMERS_);
});
// Read Card Reader
$("#member_acc_no").on('click', function(e){
localStorage.setItem("member_card",true);
var cardNo = "";
var customer_id = '';
var customer_name = '';
var sale_id = $("#sale_id").val() || 0;
var customer_mamber_card_no = 0;
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
customer_mamber_card_no = $("#search").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/get_customer" ,
data: { filter : customer_mamber_card_no ,type :"card"},
dataType: "json",
success: function(data) {
if (data[0].customer_id == false) {
swal("Alert!", data[0].message, "error");
// $.alert({
// title: 'Alert!',
// content: data[0].message,
// type: 'red',
// typeAnimated: true,
// btnClass: 'btn-danger',
// });
}else{
customer_id = data[0].customer_id;
customer_name = data[0].name;
update_sale(customer_id, customer_name,sale_id);
}
}
});
}
},100);
});
/*new customer UI func:*/
@@ -453,7 +415,6 @@
//Wizard
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
var $target = $(e.target);
if ($target.parent().hasClass('disabled')) {
@@ -467,6 +428,7 @@
nextTab($active);
$('.wizard .nav-tabs li.active .connecting-line').css({"border-bottom-left-radius": 0, "border-top-left-radius": 0});
});
$(".prev-step").click(function (e) {
var $active = $('.wizard .nav-tabs li a.active');
@@ -488,8 +450,10 @@
// Read NFC card no from java
function getCardNo(){
if (typeof code2lab != 'undefined') {
code2lab.readNFC();
}
}
// get CardNo from Java
function setCardNo(cardNo){
@@ -499,6 +463,7 @@
$("#paypar_account_no").val(cardNo);
$("#search").val(cardNo);
$("#type").val("card");
get_customer();
}else{
if($.inArray(cardNo, paypar_account_no) !== -1){
swal({
@@ -519,6 +484,35 @@
}
}
}
$("#sxModal").hide();
}
function get_customer() {
var cardNo = "";
var customer_id = '';
var customer_name = '';
var sale_id = $("#sale_id").val() || 0;
var customer_mamber_card_no = $("#search").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
$('#loading_wrapper').show();
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/get_customer" ,
data: { filter : customer_mamber_card_no ,type :"card"},
dataType: "json",
success: function(data) {
if (data[0].customer_id == false) {
swal("Alert!", data[0].message, "error");
}else{
customer_id = data[0].customer_id;
customer_name = data[0].name;
update_sale(customer_id, customer_name,sale_id);
}
$('#loading_wrapper').hide();
}
});
}
}
// QR Code Reader
@@ -574,17 +568,14 @@
}
$(document).on('click',".customer_tr",function(){
// if(this.checked){
$(this).closest('tr').find('.checkbox_check').prop( "checked", true );
var sale_id = $("#sale_id").val() || 0;
var customer_id = $(this).attr('data-ref');
var customer_name = $(this).children("td:nth-child(3)").text();
console.log(sale_id);
if(sale_id != 0){
// var url = "/"+customer_id;
update_sale(customer_id, customer_name,sale_id);
}else{
var url = "customers/"+customer_id;
}
@@ -645,9 +636,6 @@
//$(".edit_customer").attr('method', 'PATCH');
}
});
// }else{
// }
})
function update_sale(customer_id, customer_name, sale_id) {
@@ -658,13 +646,14 @@
swal({
title: "Confirmation !",
text: 'Are You Sure to assign this customer' + customer + '!',
text: 'Are you sure to assign this customer' + customer + '!',
showCancelButton: true,
confirmButtonColor: "green",
confirmButtonText: "Yes!",
cancelButtonClass: 'btn btn-danger',
closeOnConfirm: false,
closeOnConfirm: true,
}, function () {
$( "#loading_wrapper").show();
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/"+cashier_type+"/customers/update_sale" ,

View File

@@ -106,13 +106,8 @@
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default m-t-10 btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/<%= @cashier_type %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
<div id="sxModal">
<div id="sxModal-Content"><h3>Card Tap</h3></div>
<div class="m-r-20" align="right">
<button type="button" class="btn btn-lg btn-link bg-red waves-effect btn_cancel">Cancel</button>
</div>
</div>
</div>
<div id="sxModal">
<div id="sxModal-Content"><h3>Card Tap</h3></div>
<div class="m-r-20" align="right">
@@ -252,6 +247,26 @@
// Read Card Reader
$(".btn_member").on('click', function(){
$("#is_paymemberModal").hide();
$("#sxModal").show();
getCardNo();
});
// Read NFC card no from java
function getCardNo(){
code2lab.readNFC();
}
// get CardNo from Java
function setCardNo(cardNo){
if(cardNo.length == 16){
$("#paypar_account_no").val(cardNo);
send_account();
}
$("#sxModal").hide();
}
function send_account() {
var cardNo = "";
var customer_id = '';
var customer_name = '';
@@ -259,14 +274,7 @@
var membership_type = '';
var sale_id = $("#sale_id").text() || 0;
var receipt_no = $("#receipt_no").text() || 0;
var customer_mamber_card_no = 0;
$("#is_paymemberModal").hide();
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
customer_mamber_card_no = $("#paypar_account_no").val();
var customer_mamber_card_no = $("#paypar_account_no").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
$.ajax({
@@ -279,7 +287,6 @@
if (data.status == true) {
var valid_amount = parseFloat(data.old_balance_amount) - parseFloat(data.reload_amount);
$("#valid_amount").val((valid_amount > 0) ? parseFloat(valid_amount) : 0);
$.ajax({
type: "POST",
url: "<%=origami_payment_dinga_path%>",
@@ -316,23 +323,9 @@
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/DINGA";
});
}
}
});
}
},100);
});
// Read NFC card no from java
function getCardNo(){
code2lab.readNFC();
}
// get CardNo from Java
function setCardNo(cardNo){
if(cardNo.length == 16){
$("#paypar_account_no").val(cardNo);
}
}
// QR Code Reader

View File

@@ -239,7 +239,7 @@
<div class="col-lg-8 col-md-8 col-sm-8">
&nbsp; Receipt No: <span id="receipt_no">
<% if @status_sale == 'sale' %>
<%= @sale_array[0].receipt_no rescue '' %>
<%= @obj_sale.receipt_no rescue '' %>
<% end %>
</span>
<br>
@@ -266,8 +266,8 @@
<div class="row p-l-5 p-r-5">
<div class="col-lg-6 col-md-6 col-sm-6">
<% if @status_sale == 'sale' %>
<p class="hidden customer-id"><%= @sale_array[0].customer_id rescue '' %></p>
&nbsp; Customer : <%= @sale_array[0].customer.name rescue '' %>
<p class="hidden customer-id"><%= @obj_sale.customer_id rescue '' %></p>
&nbsp; Customer : <%= @obj_sale.customer.name rescue '' %>
<% elsif @status_order == 'order'
%>
<p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p>
@@ -291,9 +291,9 @@
<% count = 0
sub_total = 0
if @status_sale == "sale"
@sale_array[0].sale_items.each do |sale_item|
@obj_sale.sale_items.each do |sale_item|
sub_total = sub_total + sale_item.price%>
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
<%count += 1 %>
<tr>
<td><%= count %></td>
@@ -455,7 +455,7 @@
<% end %>
<% @sale_array.each do |sale|
if @sale_array.size > 1
unless sale.receipt_no == @sale_array[0].receipt_no
unless sale.receipt_no == @obj_sale.receipt_no
%>
<table class="table table-striped">
<tr>
@@ -529,7 +529,7 @@
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
<% if !@split_bill.nil? %>
<% if @split_bill == '1' && (!(@order_items.nil?) || !(@order_items.empty?)) %>
<% if @split_bill == '1' && (@orde_items.present?) %>
<button type="button" id="split_bills" class="btn btn-block bg-blue waves-effect">Split Bill</button>
<% end %>
<% end %>
@@ -597,6 +597,8 @@
</div>
</div>
<%= print_settings %>
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
@@ -972,12 +974,14 @@
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no,"");
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});
@@ -1028,12 +1032,15 @@
receipt_no = ($("#receipt_no").html()).trim();
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no,type);
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});
@@ -1054,7 +1061,6 @@
success:function(result){
}
});
}
$('#pay').on('click', function () {
@@ -1269,12 +1275,14 @@
url: ajax_url,
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
success: function (result) {
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
window.location.href = '/origami/';
}
});
@@ -1378,12 +1386,14 @@
data: "remark="+ remark + "&sale_id=" + sale_id,
success: function (result) {
console.log(result)
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
window.location.href = '/origami/';
}
});

View File

@@ -28,7 +28,7 @@
end
%>
<!-- end count function -->
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
<% if request.user_agent.include? "Mobile" %>
<div class="row m-t-10" style="margin-left: 0.2rem">
<% else %>
@@ -565,6 +565,10 @@
<p id="order_id" class="hidden"></p>
<p id="status" class="hidden"></p>
<%= print_settings %>
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
<div class="modal fade" id="waiting_timeModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">

View File

@@ -248,22 +248,35 @@
// Read Card Reader
$(".btn_member").on('click', function(){
$("#is_paymemberModal").hide();
$("#sxModal").show();
getCardNo();
});
// Read NFC card no from java
function getCardNo(){
code2lab.readNFC();
}
// get CardNo from Java
function setCardNo(cardNo){
if(cardNo.length == 16){
$("#paypar_account_no").val(cardNo);
}
$("#sxModal").hide();
}
function send_account() {
var cardNo = "";
var sale_id = $("#sale_id").text() || 0;
var receipt_no = $("#receipt_no").val() || "";
var customer_mamber_card_no = 0;
var payment_amount = parseFloat($("#used_amount").text());
var customer_mamber_card_no = $("#paypar_account_no").val();
$("#is_paymemberModal").hide();
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
customer_mamber_card_no = $("#paypar_account_no").val();
if (customer_mamber_card_no == 0) {
customer_mamber_card_no = $("#membership_id").text() || 0;
}
if(sale_id != 0 && customer_mamber_card_no !=0){
$.ajax({
type: "POST",
@@ -310,25 +323,11 @@
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/PAYMAL";
});
}
}
});
}else{
swal("Opp","Please Check Member","warning")
}
},100);
});
// Read NFC card no from java
function getCardNo(){
code2lab.readNFC();
}
// get CardNo from Java
function setCardNo(cardNo){
if(cardNo.length == 16){
$("#paypar_account_no").val(cardNo);
}
}
// QR Code Reader

View File

@@ -315,6 +315,9 @@
</div>
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
</div>
<%= print_settings %>
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
@@ -723,6 +726,7 @@ $(document).ready(function(){
data: "cash="+ cash + "&sale_id=" + sale_id + "&type=" + cashier_type + "&tax_type=" + tax_type + "&is_kbz=" + is_kbz,
success:function(result){
/* start delete receipt no in first bill*/
console.log(result);
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
var receipt_no = ($("#receipt_no").html()).trim();
deleteReceiptNoInFirstBillData(receipt_no);
@@ -737,16 +741,6 @@ $(document).ready(function(){
var msg = '';
}
$("#loading_wrapper" ).hide();
if(location.pathname.includes("credit_payment")){
payment_success_alert();
}else{
//PDF lightbox data
var pdfPath = "/en/pdfjs/minimal?file=" + result.filename.substring(6);
$("#sale_receipt_no").val(result.receipt_no);
$("#filename").val(result.filename);
$("#printer_name").val(result.printer_name);
$("#receipt_pdf").attr("src", pdfPath);
$("#changed_amount").text("");
if($('#balance').text() < 0){
<% if precision.to_i > 0 %>
@@ -756,14 +750,20 @@ $(document).ready(function(){
<% end %>
}
if (pdf_view == 1) {
if(location.pathname.includes("credit_payment") || pdf_view != 1){
payment_success_alert();
} else {
//PDF lightbox data;
var pdfPath = "/en/pdfjs/minimal?file=" + result.filename.substring(6)
$("#sale_receipt_no").val(result.receipt_no);
$("#filename").val(result.filename);
$("#printer_name").val(result.printer_name);
$("#receipt_pdf").attr("src", pdfPath);
$("#pdfModal").modal({show : true, backdrop : false, keyboard : false});
$("#pdfModalLabel").text("Sale Completed");
}else{
//PDF lightbox data
print_receipt();
}
}
$("#loading_wrapper").hide();
}
});
}
@@ -1007,6 +1007,7 @@ $(document).ready(function(){
if($('#pay').is(":visible")) {
$('#pay').prop("disabled",true);
}
$("#loading_wrapper" ).show();
var sale_id = $('#sale_id').text();
var filename = $("#filename").val();
@@ -1018,12 +1019,14 @@ $(document).ready(function(){
url: "/origami/sale/"+sale_id+"/"+cashier_type+"/payment/print",
data: params,
success:function(result){
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
if (pdf_view ==1) {
var flag = localStorage.getItem("trans_flag");
@@ -1043,6 +1046,8 @@ $(document).ready(function(){
}else{
payment_success_alert();
}
$("#loading_wrapper" ).hide();
}
});
}
@@ -1104,22 +1109,42 @@ $(document).ready(function(){
// Read Card Reader
$(".btn_member").on('click', function(){
$("#is_memberModal").hide();
$("#sxModal").show();
getCardNo();
});
// Read NFC card no from java
function getCardNo(){
if(typeof code2lab != 'undefined'){
code2lab.readNFC();
}
}
// get CardNo from Java
function setCardNo(cardNo){
if(cardNo.length == 16){
$("#paypar_account_no").val(cardNo);
if (cashier_type == "food_court") {
send_account();
} else {
get_customer();
}
}
$("#sxModal").hide();
}
function get_customer() {
var cardNo = "";
var customer_id = '';
var customer_name = '';
var membership_id = '';
var membership_type = '';
var sale_id = $("#sale_id").text() || 0;
var customer_mamber_card_no = 0;
$("#is_memberModal").hide();
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
customer_mamber_card_no = $("#paypar_account_no").val();
var customer_mamber_card_no = $("#paypar_account_no").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
$('#loading_wrapper').show();
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/get_customer" ,
@@ -1135,24 +1160,97 @@ $(document).ready(function(){
membership_type = data[0].membership_type;
update_sale(membership_id, customer_id, customer_name,sale_id);
}
$('#loading_wrapper').hide();
}
});
}
},100);
}
function send_account() {
var cardNo = "";
var sale_id = $("#sale_id").text() || 0;
var receipt_no = "";
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
receipt_no = ($("#receipt_no").html()).trim();
}
var payment_amount = parseFloat($("#grand_total").text());
var customer_mamber_card_no = $("#paypar_account_no").val();
if (customer_mamber_card_no == 0) {
customer_mamber_card_no = $("#membership_id").text() || 0;
}
if(sale_id != 0 && customer_mamber_card_no !=0){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/send_account" ,
data: { account_no : customer_mamber_card_no, amount : payment_amount, receipt_no : receipt_no},
dataType: "json",
success: function(data) {
if (data.status == true) {
var valid_amount = parseFloat(data.old_balance_amount) - parseFloat(data.reload_amount);
// $("#valid_amount").val((valid_amount > 0) ? parseFloat(valid_amount) : 0);
$.ajax({
type: "POST",
url: "<%=origami_payment_paymal_path%>",
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:customer_mamber_card_no},
success: function(result){
if(result.status == true){
swal({
title: "Information!",
text: result.message,
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
// Read NFC card no from java
function getCardNo(){
if(typeof code2lab != 'undefined'){
code2lab.readNFC();
}else{
swal({
title: 'Oops',
text: result.message,
type: 'warning',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment";
});
}
}
// get CardNo from Java
function setCardNo(cardNo){
if(cardNo.length == 16){
$("#paypar_account_no").val(cardNo);
});
}else{
swal({
title: 'Oops',
text: data.message.toString(),
type: 'error',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment";
});
}
}
});
}else{
swal({
title: 'Oops',
text: 'Please Check Member',
type: 'warning',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment";
});
}
}
@@ -1211,6 +1309,7 @@ $(document).ready(function(){
cancelButtonClass: 'btn btn-danger',
closeOnConfirm: false,
}, function () {
$('#loading_wrapper').show();
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/"+cashier_type+"/customers/update_sale" ,
@@ -1323,12 +1422,14 @@ $(document).ready(function(){
title: "Information!",
text: 'Thank You !',
}, function () {
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
var flag = localStorage.getItem("trans_flag");
if((flag!=null) && (flag != "true")){
window.location.href = '/transactions/sales/'+sale_id;
@@ -1369,12 +1470,14 @@ $(document).ready(function(){
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
success: function (result) {result
customer_display_view(null,"reload");
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
var flag = localStorage.getItem("trans_flag");
if((flag!=null) && (flag != "true")){
window.location.href = '/transactions/sales/'+sale_id;
@@ -1412,12 +1515,14 @@ $(document).ready(function(){
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
success: function (result) {
// console.log(result)
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
var flag = localStorage.getItem("trans_flag");
if((flag!=null) && (flag != "true")){
window.location.href = '/transactions/sales/'+sale_id;
@@ -1500,104 +1605,15 @@ $(document).ready(function(){
$("#customer_name").on("click",function(){
//start customer modal popup
if((cashier_type=='quick_service' || cashier_type=='food_court') && (customer_id!=undefined) && (customer_id!=null) && (customer_id!="")){
$("#is_memberModal").modal({show : true, backdrop: false, keyboard : false});
}
});
// Read Card Reader - Paymal payment for FoodCourt
$(".btn_paymal_member").on('click', function (){
var cardNo = "";
var sale_id = $("#sale_id").text() || 0;
var receipt_no = "";
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
receipt_no = ($("#receipt_no").html()).trim();
}
var customer_mamber_card_no = 0;
var payment_amount = parseFloat($("#grand_total").text());
$("#is_paymemberModal").hide();
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
customer_mamber_card_no = $("#paypar_account_no").val();
if (customer_mamber_card_no == 0) {
customer_mamber_card_no = $("#membership_id").text() || 0;
}
if(sale_id != 0 && customer_mamber_card_no !=0){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/send_account" ,
data: { account_no : customer_mamber_card_no, amount : payment_amount, receipt_no : receipt_no},
dataType: "json",
success: function(data) {
if (data.status == true) {
var valid_amount = parseFloat(data.old_balance_amount) - parseFloat(data.reload_amount);
// $("#valid_amount").val((valid_amount > 0) ? parseFloat(valid_amount) : 0);
$.ajax({
type: "POST",
url: "<%=origami_payment_paymal_path%>",
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:customer_mamber_card_no},
success: function(result){
if(result.status == true){
swal({
title: "Information!",
text: result.message,
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
}else{
swal({
title: 'Oops',
text: result.message,
type: 'warning',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment";
});
}
}
});
}else{
swal({
title: 'Oops',
text: data.message.toString(),
type: 'error',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment";
});
}
}
});
}else{
swal({
title: 'Oops',
text: 'Please Check Member',
type: 'warning',
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment";
});
}
},100);
});
// QR Code Reader

View File

@@ -234,6 +234,8 @@
</div>
</div>
<%= print_settings %>
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
@@ -326,11 +328,13 @@ $(document).ready(function(){
type: "GET",
url: ajax_url,
success: function (result) {
if (!$('#print_settings').data('action-cable')) {
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});
@@ -396,10 +400,12 @@ $(document).ready(function(){
url: ajax_url,
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
success: function (result) {
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
window.location.href = '/origami/'+cashier_type;
}
});
@@ -437,11 +443,13 @@ function check_emp_access_code(access_code,type) {
type: "GET",
url: ajax_url,
success: function (result) {
if (!$('#print_settings').data('action-cable')) {
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});

View File

@@ -624,6 +624,8 @@
</div>
</div>
<%= print_settings %>
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
@@ -1067,12 +1069,14 @@ $("#first_bill").on('click', function(){
receipt_no = ($("#receipt_no").html()).trim();
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no,"");
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});
@@ -1107,13 +1111,14 @@ $(".choose_payment").on('click', function () {
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no,type);
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});
@@ -1350,12 +1355,14 @@ $('#add_invoice').on('click',function(){
url: ajax_url,
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
success: function (result) {
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
window.location.href = '/origami/';
}
});
@@ -1442,12 +1449,14 @@ $('#add_invoice').on('click',function(){
data: "remark="+ remark + "&sale_id=" + sale_id,
success: function (result) {
console.log(result)
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
window.location.href = '/origami/';
}
});

View File

@@ -314,6 +314,8 @@
</div>
</div>
<%= print_settings %>
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
@@ -440,11 +442,13 @@ $('#reprint').on('click', function () {
type: "GET",
url: ajax_url,
success: function (result) {
if (!$('#print_settings').data('action-cable')) {
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});
@@ -478,6 +482,7 @@ $(document).on('click', '.access_modal', function(event){
$(".ok").attr("data-action",type);
$('#AccessCodeModal').modal('show');
});
$('#void').on('click', function () {
var access_code = localStorage.getItem("access_code");
swal({
@@ -490,6 +495,7 @@ $(document).on('click', '.access_modal', function(event){
closeOnConfirm: false
}, function (isConfirm) {
if (isConfirm) {
$('.confirm').prop("disabled", true);
var sale_id = $('#sale_id').val();
var ajax_url = "/origami/sale/" + sale_id +'/'+'cashier'+ '/void';
$.ajax({
@@ -542,12 +548,14 @@ $(document).on('click', '.access_modal', function(event){
type: "GET",
url: ajax_url,
success: function (result) {
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_accounts_path %>"><%= t("views.right_panel.detail.account") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.edit") %></li>
<span class="float-right">

View File

@@ -1,7 +1,7 @@
<!-- -->
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_accounts_path %>"><%= t("views.right_panel.detail.account") %></a></li>
<li class="breadcrumb-item active"><%= t :details %></li>
<span class="float-right">

View File

@@ -164,6 +164,8 @@
</div>
</div>
<%= print_settings %>
<!-- membership paymentmodal -->
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
@@ -243,7 +245,6 @@
</div>
</div>
</div>
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
<div class="modal fade" id="AccessCodeModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm" role="document">
@@ -303,31 +304,6 @@ $(document).ready(function(){
})
});
// $('#pay').on('click',function() {
// window.location.href = '/origami/sale/<%= @sale.id %>/payment';
// });
// Print for first bill
// $("#first_bill").on('click', function () {
// var sale_id = '<%= @sale.id %>';
// var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
// $.ajax({
// type: "GET",
// url: ajax_url,
// success: function (result) {
// receipt_no = ($("#receipt_no").html()).trim();
// if((receipt_no!=undefined) && (receipt_no!=""))
// createReceiptNoInFirstBillData(receipt_no,"");
// // For Server Print - from jade
// if ($("#server_mode").val() == "cloud") {
// code2lab.printFile(result.filepath.substr(6), result.printer_url);
// }
// location.reload();
// }
// });
// });
// Print for first bill
$("#first_bill").on('click', function () {
swal({
@@ -353,13 +329,14 @@ $(document).ready(function(){
receipt_no = ($("#receipt_no").html()).trim();
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no,"");
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});
@@ -389,12 +366,15 @@ $(document).ready(function(){
receipt_no = ($("#receipt_no").html()).trim();
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no,type);
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
location.reload();
}
});
@@ -463,12 +443,14 @@ $('#void').on('click',function () {
url: ajax_url,
data: "remark="+ remark + "&sale_id=" + sale_id + "&access_code=" + access_code ,
success: function (result) {
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
window.location.href = '/origami';
}
});
@@ -502,12 +484,14 @@ $('#foc').click(function() {
title: "Information!",
text: 'Thank You !',
}, function () {
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
window.location.href = '/origami';
});
}
@@ -531,7 +515,6 @@ $(document).on('click', '.access_modal', function(event){
url: url,
data: {},
success: function (result) {
console.log(result)
if (result.status == true) {
createAccessCode(code);
if (type == "edit") {

View File

@@ -5,7 +5,7 @@
<%= simple_form_for(@print_setting) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<div class="form-inputs p-l-10">
<%= f.input :name %>
<%= f.input :unique_code %>
<%= f.input :template %>
@@ -13,11 +13,8 @@
<%= f.input :header_font_size %>
<%= f.input :item_font_size %>
<% if(@server_mode != 'cloud') %>
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: "Please Select" %>
<% else %>
<%= f.input :printer_name, :as => :select, :collection => [], include_blank: "Please Select" %>
<% end %>
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: "Please Select", class: "mdb-select md-form" %>
<%= f.input :brand_name %>
<%= f.input :printer_type %>
<%= f.input :api_settings %>
@@ -45,7 +42,7 @@
</div>
<div class="form-actions">
<div class="form-actions p-l-10">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
@@ -87,7 +84,7 @@
<script type="text/javascript">
$(document).ready(function(){
var serverMode = "<%= @server_mode %>";
if(serverMode == 'cloud'){
if(serverMode == 'cloud' && typeof code2lab != 'undefined'){
var printers = code2lab.getPrinters();
var printerInfo = JSON.parse([printers]);
var select = $("#print_setting_printer_name");
@@ -100,6 +97,8 @@
});
}
$('#print_setting_printer_name option:first').attr('disabled', true);
if ($('#sale_items').val() == '1') {
$('#sale_items').prop('checked', true);
}
@@ -121,6 +120,11 @@
$("#print_setting_api_settings").val($(this).val());
}
});
$("#print_setting_printer_name").select2({
theme: 'material',
tags: true
})
});
function isNumberKey(evt) {

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= print_settings_path %>"><%= t("views.right_panel.header.print_settings") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.edit") %></li>
<span class="float-right">
@@ -10,5 +10,3 @@
</div>
<%= render 'form', print_setting: @print_setting %>

View File

@@ -2,7 +2,7 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.header.print_settings") %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= print_settings_path %>"><%= t("views.right_panel.header.print_settings") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
<span class="float-right">

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= print_settings_path %>"><%= t("views.right_panel.header.print_settings") %></a></li>
<li class="breadcrumb-item active"><%= t :details %></li>
<span class="float-right">

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.cb_payments") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.cb_payments") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.commission_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.credit_payment_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,7 +1,7 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.daily_sale_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,7 +1,7 @@
<div class="container-fluid">
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.waste_spoilage_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,7 +1,7 @@
<div class="container-fluid">
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.hourly_saleitem_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.induty_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.order_reservation_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active">Payment Method Report</li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.product_sale_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.receipt_no_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,7 +1,7 @@
<div class="container-fluid">
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.receipt_no_report") %> Details</li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.sale_item_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.shift_sale_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.staff_meal_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li>
<li class="breadcrumb-item active">Stock Check Report</li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.void_sale_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,7 +1,7 @@
<div class="container-fluid">
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.waste_spoilage_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,7 +1,7 @@
<div class="container-fluid">
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.waste_spoilage_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_accounts_path %>"><%= t("views.right_panel.detail.account") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.edit") %></li>
<span class="float-right">

View File

@@ -1,9 +1,9 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.account") %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
<%= link_to t('.back', :default => t("views.btn.back")), root_path %>
</span>
</ol>
</div>
@@ -74,4 +74,3 @@
</div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_accounts_path %>"><%= t("views.right_panel.detail.account") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
<span class="float-right">

View File

@@ -1,7 +1,7 @@
<!-- -->
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_accounts_path %>"><%= t("views.right_panel.detail.account") %></a></li>
<li class="breadcrumb-item active"><%= t :details %></li>
<span class="float-right">

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= settings_commissions_path %>">Commissions</a></li>
<li class="breadcrumb-item active"><%= @commission.name %></li>
<span class="float-right">

View File

@@ -12,11 +12,9 @@
<%= f.input :auto_print_receipt %>
<%= f.label "Select Zones", :class => 'control-label' %>
<%= f.collection_check_boxes :zone_ids , Zone.all, :id, :name , :class => 'checkbox form-group'%>
<% if(@server_mode != 'cloud') %>
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
<% else %>
<%= f.input :printer_name, :as => :select, :collection => [], include_blank: false %>
<% end %>
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: "Please Select", class: "mdb-select md-form" %>
<%= f.input :font %>
<%= f.input :font_size %>
<%= f.input :show_tax %>
@@ -24,7 +22,7 @@
<%= f.input :show_guest_info %>
</div>
<div class="form-actions">
<div class="form-actions p-l-10">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
@@ -65,7 +63,7 @@
<script type="text/javascript">
$(document).ready(function(){
var serverMode = "<%= @server_mode %>";
if(serverMode == 'cloud'){
if(serverMode == 'cloud' && typeof code2lab != 'undefined'){
var printers = code2lab.getPrinters();
var printerInfo = JSON.parse([printers]);
var select = $("#cashier_terminal_printer_name");
@@ -77,5 +75,12 @@
.text(value.deviceName));
});
}
$('#cashier_terminal_printer_name option:first').attr('disabled', true);
$("#cashier_terminal_printer_name").select2({
theme: 'material',
tags: true
})
});
</script>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_cashier_terminals_path %>"><%= t("views.right_panel.header.cashier_terminal") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.edit") %></li>
<span class="float-right">

View File

@@ -1,9 +1,9 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.header.cashier_terminal") %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
<%= link_to t('.back', :default => t("views.btn.back")), root_path %>
</span>
</ol>
</div>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_cashier_terminals_path %>"><%= t("views.right_panel.header.cashier_terminal") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
<span class="float-right">

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_cashier_terminals_path %>"><%= t("views.right_panel.header.cashier_terminal") %></a></li>
<li class="breadcrumb-item active"><%= t :details %></li>
<span class="float-right">

View File

@@ -1,7 +1,7 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_commissioners_path %>"><%= t("en.commissioners") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.edit") %></li>
<span class="float-right">

View File

@@ -1,9 +1,9 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("en.commissioners") %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
<%= link_to t('.back', :default => t("views.btn.back")), root_path %>
</span>
</ol>
</div>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_commissioners_path %>"><%= t("en.commissioners") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
<span class="float-right">

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_commissioners_path %>"><%= t("en.commissioners") %></a></li>
<li class="breadcrumb-item active"><%= t :details %></li>
<span class="float-right">

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_commissions_path %>"><%= t("en.commissions") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.edit") %></li>
<span class="float-right">

View File

@@ -1,9 +1,9 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("en.commissions") %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
<%= link_to t('.back', :default => t("views.btn.back")), root_path %>
</span>
</ol>
</div>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_commissions_path %>"><%= t("en.commissions") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
<span class="float-right">

View File

@@ -2,7 +2,7 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li>
<% if @table %>
<li class="breadcrumb-item"><a href="<%= edit_settings_zone_table_path(@zone,@settings_dining_facility) %>">Table / Room</a></li>
<% elsif @room %>

View File

@@ -1,7 +1,7 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li>
<% if @table %>
<li class="breadcrumb-item"><a href="<%= edit_settings_zone_table_path(@zone,@settings_dining_facility) %>">Table / Room</a></li>
<% elsif @room %>

View File

@@ -1,7 +1,7 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= settings_employees_path %>"><%= t("views.right_panel.detail.employees") %></a></li>
<li class="breadcrumb-item active"><%= t("views.btn.edit") %></li>
<span class="float-right">

View File

@@ -1,10 +1,10 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.employee") %></li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
<%= link_to t('.back', :default => t("views.btn.back")), root_path %>
</span>
</ol>
</div>

Some files were not shown because too many files have changed in this diff Show More