Merge branch 'adminbsb_ui_changes' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
//= require bootstrap-notify/bootstrap-notify.js
|
||||
//= require node-waves/waves.js
|
||||
//= require sweetalert/sweetalert.min.js
|
||||
//= require fileinput.min
|
||||
//= require BSBMaterial/turbolink_admin.js
|
||||
//= require BSBMaterial/demo.js
|
||||
//= require custom.js
|
||||
@@ -34,4 +35,24 @@ $(document).on('turbolinks:load', function() {
|
||||
weekStart: 1,
|
||||
time: false
|
||||
});
|
||||
});
|
||||
|
||||
$("#customer_image_path").fileinput({
|
||||
previewFileType: "image",
|
||||
allowedFileExtensions: ["jpg", "gif", "png"],
|
||||
browseClass: "btn btn-success",
|
||||
browseLabel: "Pick Image",
|
||||
browseIcon: "<i class=\"fa fa-image\"></i> ",
|
||||
removeClass: "btn btn-danger",
|
||||
removeLabel: "Delete",
|
||||
removeIcon: "<i class=\"fa fa-trash\"></i> ",
|
||||
showUpload: false,
|
||||
// uploadClass: "btn btn-info",
|
||||
// uploadLabel: "Upload",
|
||||
// uploadIcon: "<i class=\"fa fa-upload\"></i> ",
|
||||
previewTemplates: {
|
||||
image: '<div class="file-preview-frame" id="{previewId}" data-fileindex="{fileindex}">\n' +
|
||||
' <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" style="width: 200px;height: 200px;">\n' +
|
||||
'</div>\n',
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -104,6 +104,86 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
$("#shop_logo").fileinput({
|
||||
previewFileType: "image",
|
||||
allowedFileExtensions: ["jpg", "gif", "png"],
|
||||
browseClass: "btn btn-success",
|
||||
browseLabel: "Pick Image",
|
||||
browseIcon: "<i class=\"fa fa-image\"></i> ",
|
||||
removeClass: "btn btn-danger",
|
||||
removeLabel: "Delete",
|
||||
removeIcon: "<i class=\"fa fa-trash\"></i> ",
|
||||
showUpload: false,
|
||||
// uploadClass: "btn btn-info",
|
||||
// uploadLabel: "Upload",
|
||||
// uploadIcon: "<i class=\"fa fa-upload\"></i> ",
|
||||
previewTemplates: {
|
||||
image: '<div class="file-preview-frame" id="{previewId}" data-fileindex="{fileindex}">\n' +
|
||||
' <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" style="width: 200px;height: 200px;">\n' +
|
||||
'</div>\n',
|
||||
}
|
||||
});
|
||||
|
||||
$("#commissioner_image_path").fileinput({
|
||||
previewFileType: "image",
|
||||
allowedFileExtensions: ["jpg", "gif", "png"],
|
||||
browseClass: "btn btn-success",
|
||||
browseLabel: "Pick Image",
|
||||
browseIcon: "<i class=\"fa fa-image\"></i> ",
|
||||
removeClass: "btn btn-danger",
|
||||
removeLabel: "Delete",
|
||||
removeIcon: "<i class=\"fa fa-trash\"></i> ",
|
||||
showUpload: false,
|
||||
// uploadClass: "btn btn-info",
|
||||
// uploadLabel: "Upload",
|
||||
// uploadIcon: "<i class=\"fa fa-upload\"></i> ",
|
||||
previewTemplates: {
|
||||
image: '<div class="file-preview-frame" id="{previewId}" data-fileindex="{fileindex}">\n' +
|
||||
' <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" style="width: 200px;height: 200px;">\n' +
|
||||
'</div>\n',
|
||||
}
|
||||
});
|
||||
|
||||
$("#employee_image_path").fileinput({
|
||||
previewFileType: "image",
|
||||
allowedFileExtensions: ["jpg", "gif", "png"],
|
||||
browseClass: "btn btn-success",
|
||||
browseLabel: "Pick Image",
|
||||
browseIcon: "<i class=\"fa fa-image\"></i> ",
|
||||
removeClass: "btn btn-danger",
|
||||
removeLabel: "Delete",
|
||||
removeIcon: "<i class=\"fa fa-trash\"></i> ",
|
||||
showUpload: false,
|
||||
// uploadClass: "btn btn-info",
|
||||
// uploadLabel: "Upload",
|
||||
// uploadIcon: "<i class=\"fa fa-upload\"></i> ",
|
||||
previewTemplates: {
|
||||
image: '<div class="file-preview-frame" id="{previewId}" data-fileindex="{fileindex}">\n' +
|
||||
' <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" style="width: 200px;height: 200px;">\n' +
|
||||
'</div>\n',
|
||||
}
|
||||
});
|
||||
|
||||
$("#shop_image").fileinput({
|
||||
previewFileType: "image",
|
||||
allowedFileExtensions: ["jpg", "gif", "png"],
|
||||
browseClass: "btn btn-success",
|
||||
browseLabel: "Pick Image",
|
||||
browseIcon: "<i class=\"fa fa-image\"></i> ",
|
||||
removeClass: "btn btn-danger",
|
||||
removeLabel: "Delete",
|
||||
removeIcon: "<i class=\"fa fa-trash\"></i> ",
|
||||
showUpload: false,
|
||||
// uploadClass: "btn btn-info",
|
||||
// uploadLabel: "Upload",
|
||||
// uploadIcon: "<i class=\"fa fa-upload\"></i> ",
|
||||
previewTemplates: {
|
||||
image: '<div class="file-preview-frame" id="{previewId}" data-fileindex="{fileindex}">\n' +
|
||||
' <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" style="width: 200px;height: 200px;">\n' +
|
||||
'</div>\n',
|
||||
}
|
||||
});
|
||||
|
||||
// first input focus for all form
|
||||
$('form:first *input[data-behaviour!=datepicker]:input[type!=hidden]:first').focus();
|
||||
|
||||
|
||||
@@ -9,12 +9,37 @@
|
||||
//= require bootstrap-notify/bootstrap-notify.js
|
||||
//= require node-waves/waves.js
|
||||
//= require sweetalert/sweetalert.min.js
|
||||
//= require fileinput.min
|
||||
//= require cable
|
||||
//= require turbolinks
|
||||
//= require BSBMaterial/turbolink_admin.js
|
||||
//= require BSBMaterial/demo.js
|
||||
//= require custom.js
|
||||
|
||||
|
||||
$(document).on('turbolinks:load', function() {
|
||||
|
||||
$("#customer_image_path").fileinput({
|
||||
previewFileType: "image",
|
||||
allowedFileExtensions: ["jpg", "gif", "png"],
|
||||
browseClass: "btn btn-success",
|
||||
browseLabel: "Pick Image",
|
||||
browseIcon: "<i class=\"fa fa-image\"></i> ",
|
||||
removeClass: "btn btn-danger",
|
||||
removeLabel: "Delete",
|
||||
removeIcon: "<i class=\"fa fa-trash\"></i> ",
|
||||
showUpload: false,
|
||||
// uploadClass: "btn btn-info",
|
||||
// uploadLabel: "Upload",
|
||||
// uploadIcon: "<i class=\"fa fa-upload\"></i> ",
|
||||
previewTemplates: {
|
||||
image: '<div class="file-preview-frame" id="{previewId}" data-fileindex="{fileindex}">\n' +
|
||||
' <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" style="width: 200px;height: 200px;">\n' +
|
||||
'</div>\n',
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('turbolinks:load', function() {
|
||||
$('.datetimepicker').bootstrapMaterialDatePicker({
|
||||
format: 'DD-MM-YYYY - HH:mm',
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
@import "BSBMaterial/style";
|
||||
@import "BSBMaterial/themes/all-themes";
|
||||
@import "reset";
|
||||
@import "fileinput.min";
|
||||
|
||||
.sx-margin-0 {
|
||||
margin: 0 !important;
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
background-color: #2790a5;
|
||||
}
|
||||
|
||||
.active_tab{
|
||||
border-style: solid;
|
||||
border-color: #2790a5;
|
||||
}
|
||||
|
||||
.login-page {
|
||||
margin: 0% auto;
|
||||
background-color: #2790a5;
|
||||
@@ -75,3 +80,13 @@
|
||||
background-color: #fff;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.p-card{
|
||||
margin: 20px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.p-name{
|
||||
padding-bottom: 20px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
class BaseController < ActionController::Base
|
||||
layout "installation"
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -5,8 +5,29 @@ class BaseCrmController < ActionController::Base
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
#change locallization
|
||||
def set_locale
|
||||
I18n.locale = params[:locale] || I18n.default_locale
|
||||
end
|
||||
|
||||
# RESTful url for localize
|
||||
def default_url_options
|
||||
{ locale: I18n.locale }
|
||||
end
|
||||
|
||||
def current_user
|
||||
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,8 +5,19 @@ class BaseInventoryController < ActionController::Base
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
def current_user
|
||||
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,9 +4,30 @@ class BaseOqsController < ActionController::Base
|
||||
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
#change locallization
|
||||
def set_locale
|
||||
I18n.locale = params[:locale] || I18n.default_locale
|
||||
end
|
||||
|
||||
# RESTful url for localize
|
||||
def default_url_options
|
||||
{ locale: I18n.locale }
|
||||
end
|
||||
|
||||
def current_user
|
||||
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,6 +7,7 @@ class BaseOrigamiController < ActionController::Base
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
# redirect_to origami_root_path
|
||||
@@ -25,4 +26,10 @@ class BaseOrigamiController < ActionController::Base
|
||||
def get_cashier
|
||||
@cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -5,7 +5,9 @@ class BaseReportController < ActionController::Base
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
helper_method :shop_detail
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
end
|
||||
@@ -80,4 +82,9 @@ class BaseReportController < ActionController::Base
|
||||
|
||||
return from, to
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,4 +4,11 @@ class BaseWaiterController < ActionController::Base
|
||||
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,9 +15,4 @@ class Crm::BookingsController < BaseCrmController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -396,12 +396,7 @@ end
|
||||
def customer_params
|
||||
|
||||
params.require(:customer).permit(:id, :name, :company, :contact_no, :email,
|
||||
:date_of_birth,:salutation,:gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type)
|
||||
:date_of_birth,:salutation,:gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :image_path)
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -142,10 +142,5 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
def dining_queue_params
|
||||
params.require(:dining_queue).permit(:customer_id, :name, :contact_no, :queue_no,:status,:seater,:remark)
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -56,10 +56,5 @@ class Crm::HomeController < BaseCrmController
|
||||
# end
|
||||
# end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
class HomeController < ApplicationController
|
||||
# layout "application", except: [:index, :show]
|
||||
# skip_before_action only: [:index, :show, :create, :update, :destroy]
|
||||
# skip_before_action :authenticate, only: [:index, :show, :create, :update, :destroy]
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
def index
|
||||
# @employees = Employee.all_emp_except_waiter.order("name asc")
|
||||
@@ -135,12 +137,6 @@ class HomeController < ApplicationController
|
||||
render :json => {:status=> "Success", :url => root_path }.to_json
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
@@ -194,4 +190,9 @@ class HomeController < ApplicationController
|
||||
|
||||
return from, to
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,6 +3,8 @@ class InstallController < BaseController
|
||||
skip_before_action :verify_authenticity_token
|
||||
# before_action :check_license
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
@@ -75,4 +77,9 @@ class InstallController < BaseController
|
||||
# return nil
|
||||
# end
|
||||
# end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -30,12 +30,6 @@ class Oqs::HomeController < BaseOqsController
|
||||
@queue_stations_items
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
# Get Order items
|
||||
def get_order_items
|
||||
items = []
|
||||
@@ -129,9 +123,4 @@ class Oqs::HomeController < BaseOqsController
|
||||
# completed_order = AssignedOrderItem.group(:order_id).where('delivery_status=true');
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -60,9 +60,4 @@ class Oqs::EditController < BaseOqsController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -244,10 +244,4 @@ class Oqs::HomeController < BaseOqsController
|
||||
.group("order_queue_stations.id")
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -102,9 +102,4 @@ class Oqs::PrintController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
@@ -226,9 +226,4 @@ class Origami::AddordersController < BaseOrigamiController
|
||||
# @dining = DiningFacility.find(params[:id])
|
||||
# end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -96,9 +96,4 @@ class Origami::BankIntegrationController < ApplicationController #BaseOrigamiCon
|
||||
render json: response
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -24,9 +24,4 @@ class Origami::CardPaymentsController < BaseOrigamiController
|
||||
def create
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,10 +14,5 @@ class Origami::CashInsController < BaseOrigamiController
|
||||
shift.cash_in = shift.cash_in + amount.to_i
|
||||
shift.save
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -8,9 +8,4 @@ class Origami::CashMgmtController < ApplicationController
|
||||
def create
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,9 +13,4 @@ class Origami::CashOutsController < BaseOrigamiController
|
||||
shift.save
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -36,9 +36,4 @@ class Origami::CheckInProcessController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -47,10 +47,4 @@ class Origami::CreditPaymentsController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -141,10 +141,5 @@ class Origami::CustomersController < BaseOrigamiController
|
||||
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -58,8 +58,4 @@ class Origami::DashboardController < BaseOrigamiController
|
||||
@current_user = current_user
|
||||
end
|
||||
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -355,9 +355,5 @@ class Origami::DiscountsController < BaseOrigamiController
|
||||
|
||||
# redirect_to origami_path(sale_id)
|
||||
# end
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -136,12 +136,6 @@ class Origami::HomeController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_dining
|
||||
|
||||
@@ -81,9 +81,4 @@ class Origami::HomeController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -169,9 +169,4 @@ class Origami::InDutiesController < BaseOrigamiController
|
||||
params.require(:in_duty).permit(:id, :dinning_id, :commissioner_ids, :in_time, :out_time)
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,6 +9,7 @@ class Origami::JcbController < BaseOrigamiController
|
||||
@jcbcount = 0
|
||||
others = 0
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
@@ -58,9 +59,4 @@ class Origami::JcbController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,6 +9,7 @@ class Origami::MasterController < BaseOrigamiController
|
||||
@mastercount = 0
|
||||
others = 0
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
@@ -57,9 +58,4 @@ class Origami::MasterController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,11 +35,5 @@ class Origami::MoveroomController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -70,10 +70,5 @@ class Origami::MovetableController < BaseOrigamiController
|
||||
|
||||
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -7,7 +7,8 @@ class Origami::MpuController < BaseOrigamiController
|
||||
total = sale_data.grand_total
|
||||
@mpucount = 0
|
||||
others = 0
|
||||
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
@@ -57,9 +58,4 @@ class Origami::MpuController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -80,10 +80,5 @@ class Origami::OrdersController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -76,10 +76,5 @@ class Origami::OtherChargesController < BaseOrigamiController
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
@@ -37,9 +37,4 @@ class Origami::OthersPaymentsController < BaseOrigamiController
|
||||
def create
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -511,10 +511,4 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
|
||||
render :json => {status: true}
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
@@ -29,9 +29,4 @@ class Origami::PayparPaymentsController < BaseOrigamiController
|
||||
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -41,9 +41,4 @@ class Origami::PendingOrderController < BaseOrigamiController
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -137,9 +137,4 @@ class Origami::ProductCommissionsController < BaseOrigamiController
|
||||
params.fetch(:product_commission, {})
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,6 +6,7 @@ class Origami::RedeemPaymentsController < BaseOrigamiController
|
||||
@membership_rebate_balance=0
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
# if @shop.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
@@ -68,10 +69,5 @@ class Origami::RedeemPaymentsController < BaseOrigamiController
|
||||
end
|
||||
@out = false, 0
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -58,10 +58,5 @@ class Origami::RequestBillsController < ApplicationController
|
||||
|
||||
# printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, item_price_by_accounts,member_info,shop_details)
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -37,9 +37,4 @@ class Origami::RoomInvoicesController < BaseOrigamiController
|
||||
@customer = @sale.customer
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -136,9 +136,4 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -196,10 +196,5 @@ class Origami::SaleEditController < BaseOrigamiController
|
||||
ProductCommission.remove_product_commission(item)
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -56,9 +56,4 @@ class Origami::SalesController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -125,9 +125,4 @@ class Origami::ShiftsController < BaseOrigamiController
|
||||
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -366,11 +366,4 @@ class Origami::SplitBillController < BaseOrigamiController
|
||||
|
||||
render :json => { status: true }
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -90,10 +90,5 @@ class Origami::SurveysController < BaseOrigamiController
|
||||
def survey_params
|
||||
params.require(:survey).permit(:child, :adult,:male,:female,:local,:foreigner, :dining_name,:receipt_no,:shift_id,:created_by,:total_customer,:total_amount,:survey_id)
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -70,9 +70,4 @@ class Origami::TableInvoicesController < BaseOrigamiController
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@ class Origami::UnionpayController < BaseOrigamiController
|
||||
@unionpaycount = 0
|
||||
others = 0
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
@@ -57,9 +58,4 @@ class Origami::UnionpayController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@ class Origami::VisaController < BaseOrigamiController
|
||||
@visacount = 0
|
||||
others = 0
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
@@ -57,9 +58,4 @@ class Origami::VisaController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -134,10 +134,5 @@ class Origami::VoidController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
@@ -78,9 +78,4 @@ class Origami::VoucherController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,6 +2,8 @@ class PrintSettingsController < ApplicationController
|
||||
load_and_authorize_resource except: [:create]
|
||||
before_action :set_print_setting, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
# GET /print_settings
|
||||
# GET /print_settings.json
|
||||
def index
|
||||
@@ -72,4 +74,9 @@ class PrintSettingsController < ApplicationController
|
||||
def print_setting_params
|
||||
params.require(:print_setting).permit(:name, :unique_code, :template, :printer_name, :font, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space)
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,10 +16,4 @@ class Reports::SaleitemController < BaseReportController
|
||||
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -49,11 +49,6 @@ class Reports::CommissionController < BaseReportController
|
||||
format.json { render json: out }
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -60,9 +60,4 @@ authorize_resource :class => false
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
@@ -19,10 +19,5 @@ class Reports::DailysaleController < BaseReportController
|
||||
def show
|
||||
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -62,9 +62,4 @@ class Reports::PaymentMethodController < BaseReportController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
@@ -61,10 +61,5 @@ authorize_resource :class => false
|
||||
format.json { render json: out }
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
@@ -76,10 +76,5 @@ class Reports::SaleitemController < BaseReportController
|
||||
format.json { render json: out }
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -48,10 +48,5 @@ class Reports::ShiftsaleController < BaseReportController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -46,11 +46,6 @@ class Reports::StockCheckController < BaseReportController
|
||||
format.json { render json: out }
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -59,9 +59,4 @@ authorize_resource :class => false
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
@@ -91,6 +91,6 @@ class Settings::CommissionersController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def commissioner_params
|
||||
params.require(:commissioner).permit(:name, :emp_id, :created_by, :commission_id, :joined_date, :resigned_date, :is_active)
|
||||
params.require(:commissioner).permit(:name, :emp_id, :created_by, :commission_id, :joined_date, :resigned_date, :is_active, :image_path)
|
||||
end
|
||||
end
|
||||
|
||||
11
app/controllers/settings/display_images_controller.rb
Normal file
11
app/controllers/settings/display_images_controller.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class Settings::DisplayImagesController < ApplicationController
|
||||
def destroy
|
||||
#byebug
|
||||
@item_photo = DisplayImage.find(params[:shop_id])
|
||||
item = @item_photo.id
|
||||
@item_photo.destroy
|
||||
respond_to do |format|
|
||||
format.html {redirect_to settings_shops_url+'/1/edit', notice: 'Image was successfully destroyed.'}
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -68,6 +68,6 @@ class Settings::EmployeesController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def employee_params
|
||||
params.require(:employee).permit(:name, :role, :emp_id, :password)
|
||||
params.require(:employee).permit(:name, :role, :emp_id, :password, :image_path)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Settings::ShopsController < ApplicationController
|
||||
load_and_authorize_resource except: [:create]
|
||||
before_action :set_shop, only: [:show, :edit, :update]
|
||||
before_action :set_shop, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /settings/shops
|
||||
# GET /settings/shops.json
|
||||
@@ -11,11 +11,13 @@ class Settings::ShopsController < ApplicationController
|
||||
# GET /settings/shops/1
|
||||
# GET /settings/shops/1.json
|
||||
def show
|
||||
@display_images = @settings_shop.display_images.all
|
||||
end
|
||||
|
||||
# GET /settings/shops/new
|
||||
def new
|
||||
@settings_shop = Shop.new
|
||||
@display_image = @settings_shop.display_images.build
|
||||
end
|
||||
|
||||
# GET /settings/shops/1/edit
|
||||
@@ -28,6 +30,11 @@ class Settings::ShopsController < ApplicationController
|
||||
@settings_shop = Shop.new(shop_params)
|
||||
respond_to do |format|
|
||||
if @settings_shop.save
|
||||
if params[:display_images].present?
|
||||
params[:display_images]['image'].each do |a|
|
||||
@display_image = @settings_shop.display_images.create!(:shop_id => @shop.id, :image => a)
|
||||
end
|
||||
end
|
||||
format.html { redirect_to settings_shops_url, notice: 'Shop was successfully created.' }
|
||||
format.json { render :index, status: :created, location: @settings_shop }
|
||||
else
|
||||
@@ -42,6 +49,11 @@ class Settings::ShopsController < ApplicationController
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_shop.update(shop_params)
|
||||
if params[:display_images].present?
|
||||
params[:display_images]['image'].each do |a|
|
||||
@display_image = @settings_shop.display_images.create!(:shop_id => @shop.id, :image => a)
|
||||
end
|
||||
end
|
||||
format.html { redirect_to settings_shops_url, notice: 'Shop was successfully updated.' }
|
||||
format.json { render :index, status: :ok, location: @settings_shop }
|
||||
else
|
||||
@@ -71,6 +83,6 @@ class Settings::ShopsController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def shop_params
|
||||
params.require(:shop).permit(:name,:address,:city,:township,:state,:country,:phone_no,:reservation_no,:license,:activated_at,:license_data,:base_currency,:cloud_token,:cloud_url,:owner_token,:id_prefix,:is_rounding_adj,:quick_sale_summary,:calc_tax_order,:show_account_info)
|
||||
params.require(:shop).permit(:logo, :name,:address,:city,:township,:state,:country,:phone_no,:reservation_no,:license,:activated_at,:license_data,:base_currency,:cloud_token,:cloud_url,:owner_token,:id_prefix,:is_rounding_adj,:quick_sale_summary,:calc_tax_order,:show_account_info, display_images_attributes: [:id, :shop_id, :image])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,6 +2,8 @@ class SymControlController < BaseController
|
||||
skip_before_action :verify_authenticity_token
|
||||
http_basic_authenticate_with name: "vip", password: "!abcABC01"
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
def run
|
||||
sym_path = File.expand_path("~/symmetric/")
|
||||
check_sym_proc_str = `#{"sudo service SymmetricDS status"}`
|
||||
@@ -43,4 +45,9 @@ class SymControlController < BaseController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
@@ -7,4 +7,7 @@ class Commissioner < ApplicationRecord
|
||||
|
||||
# validations
|
||||
validates_presence_of :name
|
||||
|
||||
# Commissioner Image Uploader
|
||||
mount_uploader :image_path, CommissionerImageUploader
|
||||
end
|
||||
|
||||
@@ -2,6 +2,9 @@ class Customer < ApplicationRecord
|
||||
|
||||
#self.primary_key = :customer_id
|
||||
|
||||
# Customer Image Uploader
|
||||
mount_uploader :image_path, CustomerImageUploader
|
||||
|
||||
before_create :generate_custom_id
|
||||
has_many :orders
|
||||
has_many :sales
|
||||
|
||||
5
app/models/display_image.rb
Normal file
5
app/models/display_image.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class DisplayImage < ApplicationRecord
|
||||
mount_uploader :image, DisplayImageUploader
|
||||
belongs_to :shop
|
||||
|
||||
end
|
||||
@@ -8,6 +8,9 @@ class Employee < ApplicationRecord
|
||||
validates :emp_id, uniqueness: true, numericality: true, length: {in: 1..4}, allow_blank: true
|
||||
validates :password, numericality: true, length: {in: 3..9}, allow_blank: true
|
||||
|
||||
# Employee Image Uploader
|
||||
mount_uploader :image_path, EmployeeImageUploader
|
||||
|
||||
def self.all_emp_except_waiter
|
||||
Employee.where('role!=?','waiter')
|
||||
end
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Shop < ApplicationRecord
|
||||
ShopDetail = Shop.find_by_id(1)
|
||||
|
||||
# Shop Image Uploader
|
||||
mount_uploader :logo, ShopImageUploader
|
||||
|
||||
has_many :display_images
|
||||
accepts_nested_attributes_for :display_images
|
||||
end
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class ReceiptBillA5Pdf < Prawn::Document
|
||||
include ActionView::Helpers::NumberHelper
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width
|
||||
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data)
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
@@ -15,6 +16,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
|
||||
self.description_width = 500
|
||||
self.price_num_width = 100
|
||||
self.line_move = 10
|
||||
# @item_width = self.page_width.to_i / 2
|
||||
# @qty_width = @item_width.to_i / 3
|
||||
# @double = @qty_width * 1.3
|
||||
@@ -91,27 +93,33 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
end
|
||||
|
||||
def header (shop_details)
|
||||
move_down 10
|
||||
move_down line_move
|
||||
text "#{shop_details.name}", :size => self.header_font_size,:align => :center
|
||||
move_down 10
|
||||
move_down line_move
|
||||
text "#{shop_details.address}", :size => self.item_font_size,:align => :center
|
||||
# move_down self.item_height
|
||||
move_down 10
|
||||
move_down line_move
|
||||
text "#{shop_details.phone_no}", :size => self.item_font_size,:align => :center
|
||||
move_down 10
|
||||
move_down line_move
|
||||
|
||||
stroke_horizontal_rule
|
||||
end
|
||||
|
||||
def cashier_info(sale_data, customer_name)
|
||||
move_down 12
|
||||
move_down line_move
|
||||
# move_down 2
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Receipt No: #{sale_data.receipt_no}", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
move_down 10
|
||||
|
||||
if sale_data.bookings[0].dining_facility_id.to_i > 0
|
||||
bounding_box([self.item_description_width, y_position], :width => self.item_description_width, :height => self.item_height) do
|
||||
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
|
||||
move_down line_move
|
||||
|
||||
y_position = cursor
|
||||
if sale_data.bookings[0].dining_facility_id.to_i > 0
|
||||
@@ -126,7 +134,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
bounding_box([self.item_description_width - 2,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "C: #{sale_data.cashier_name}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down 10
|
||||
move_down line_move
|
||||
|
||||
y_position = cursor
|
||||
if sale_data.bookings[0].dining_facility_id.to_i > 0
|
||||
@@ -145,7 +153,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
# :size => self.item_font_size,:align => :right
|
||||
# end
|
||||
|
||||
move_down 10
|
||||
move_down line_move
|
||||
stroke_horizontal_rule
|
||||
end
|
||||
|
||||
@@ -162,9 +170,9 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
item_label_total_front_width = (self.item_width+self.price_width) + 5
|
||||
item_label_total_end_width = self.total_width + 4
|
||||
end
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
move_down 10
|
||||
move_down line_move
|
||||
pad_top(15) {
|
||||
# @item_width.to_i + @half_qty.to_i
|
||||
text_box "Items", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :size => self.item_font_size, :overflow => :shrink_to_fix
|
||||
@@ -172,7 +180,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
text_box "Qty", :at =>[item_label_qty_front_width,y_position], :width => item_label_qty_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "Total", :at =>[item_label_total_front_width,y_position], :width => item_label_total_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
}
|
||||
move_down -5
|
||||
move_down line_move
|
||||
stroke_horizontal_rule
|
||||
add_line_item_row(sale_items,precision,delimiter)
|
||||
end
|
||||
@@ -192,7 +200,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
item_total_end_width = self.total_width + 4
|
||||
end
|
||||
y_position = cursor
|
||||
move_down 10
|
||||
move_down line_move
|
||||
sub_total = 0.0
|
||||
sale_items.each do |item|
|
||||
# check for item not to show
|
||||
@@ -223,25 +231,25 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
end
|
||||
end
|
||||
end
|
||||
move_down line_move
|
||||
}
|
||||
move_down 10
|
||||
end
|
||||
end
|
||||
|
||||
stroke_horizontal_rule
|
||||
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
|
||||
text "Sub Total", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}" ,:delimiter => ',', :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down 10
|
||||
end
|
||||
end
|
||||
|
||||
def all_total(sale_data,precision,delimiter)
|
||||
move_down line_move
|
||||
item_name_width = self.item_width
|
||||
y_position = cursor
|
||||
if sale_data.discount_type == 'member_discount'
|
||||
@@ -259,7 +267,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
|
||||
if sale_data.sale_taxes.length > 0
|
||||
sale_data.sale_taxes.each do |st|
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
|
||||
@@ -284,7 +292,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
# end
|
||||
|
||||
if sale_data.rounding_adjustment != 0.0
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
|
||||
@@ -295,16 +303,16 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
end
|
||||
end
|
||||
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
move_down 10
|
||||
move_down line_move
|
||||
bounding_box([0,y_position], :width =>self.description_width) do
|
||||
text "Grand Total",:style => :bold, :size => self.header_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(sale_data.grand_total, :precision => precision.to_i, :delimiter => delimiter)}" , :style => :bold, :size => self.header_font_size,:align => :right
|
||||
end
|
||||
move_down 10
|
||||
move_down line_move
|
||||
|
||||
sale_payment(sale_data,precision,delimiter)
|
||||
|
||||
@@ -312,7 +320,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
|
||||
def sale_payment(sale_data,precision,delimiter)
|
||||
stroke_horizontal_rule
|
||||
move_down 10
|
||||
# move_down 10
|
||||
sale_payments = SalePayment.select("SUM(sale_payments.payment_amount) as payment_amount,sale_payments.payment_method").where('sale_id = ?', sale_data.sale_id).group("payment_method")
|
||||
sale_payments.each do |payment|
|
||||
y_position = cursor
|
||||
@@ -329,18 +337,18 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
bounding_box([self.description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(payment.payment_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down 10
|
||||
move_down line_move
|
||||
end
|
||||
if sale_data.amount_received > 0
|
||||
y_position = cursor
|
||||
move_down 10
|
||||
move_down line_move
|
||||
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
|
||||
text "Change Amount", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(sale_data.amount_changed, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down 10
|
||||
#move_down line_move
|
||||
end
|
||||
end
|
||||
|
||||
@@ -367,7 +375,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
|
||||
rebate_balance = rebate_balance + res["deposit"]
|
||||
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
|
||||
text "Rebate Earn", :size => self.item_font_size,:align => :left
|
||||
@@ -380,7 +388,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
# Total Rebate Amount if birthday
|
||||
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebatebonusAccount" && res["status"]== "Rebate"
|
||||
rebate_balance = rebate_balance + res["deposit"]
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
|
||||
text "Rebate Earn Bonus", :size => self.item_font_size,:align => :left
|
||||
@@ -392,7 +400,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
#end Total rebate if birthday
|
||||
end
|
||||
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
|
||||
text "Redeem Amount", :size => self.item_font_size,:align => :left
|
||||
@@ -402,7 +410,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
end
|
||||
|
||||
if current_balance != nil
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
|
||||
text "Old Balance", :size => self.item_font_size,:align => :left
|
||||
@@ -424,7 +432,7 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
|
||||
end
|
||||
end
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
|
||||
text "Total Balance", :size => self.item_font_size,:align => :left
|
||||
@@ -437,21 +445,22 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
end
|
||||
|
||||
def customer(customer_name)
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
move_down line_move
|
||||
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
|
||||
text "Customer Name", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.description_width,y_position], :width =>self.label_width) do
|
||||
text "#{ customer_name }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down line_move
|
||||
end
|
||||
|
||||
|
||||
def discount_account(discount_price_by_accounts,precision,delimiter)
|
||||
move_down 10
|
||||
stroke_horizontal_rule
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
discount_price_by_accounts.each do |ipa|
|
||||
y_position = cursor
|
||||
@@ -461,13 +470,13 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
bounding_box([self.description_width,y_position], :width =>self.label_width) do
|
||||
text "(" + "#{ number_with_precision(ipa[:price], :precision => precision.to_i, :delimiter => delimiter) }" + ")" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down line_move
|
||||
end
|
||||
end
|
||||
|
||||
def items_account(item_price_by_accounts,precision,delimiter)
|
||||
move_down 10
|
||||
stroke_horizontal_rule
|
||||
move_down 10
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
item_price_by_accounts.each do |ipa|
|
||||
y_position = cursor
|
||||
@@ -477,15 +486,15 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
bounding_box([self.label_width,y_position], :width =>self.description_width) do
|
||||
text "#{number_with_precision(ipa[:price], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down line_move
|
||||
end
|
||||
end
|
||||
|
||||
#individual payment per person
|
||||
def individual_payment(sale_data, precision, delimiter)
|
||||
per_person = sale_data.grand_total.to_f / sale_data.equal_persons.to_i
|
||||
move_down 5
|
||||
def individual_payment(sale_data, survey, precision, delimiter)
|
||||
per_person = sale_data.grand_total.to_f / survey.total_customer.to_i
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.label_width+50) do
|
||||
text "Split Bill for #{sale_data.equal_persons} persons", :size => self.item_font_size+1,:align => :left
|
||||
@@ -541,9 +550,9 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
end
|
||||
|
||||
def footer(printed_status)
|
||||
move_down 10
|
||||
move_down line_move
|
||||
stroke_horizontal_rule
|
||||
move_down 10
|
||||
move_down line_move
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.item_description_width) do
|
||||
@@ -553,15 +562,15 @@ class ReceiptBillA5Pdf < Prawn::Document
|
||||
text "Thank You! See you Again", :left_margin => -5, :size => self.item_font_size,:align => :right
|
||||
end
|
||||
|
||||
move_down 10
|
||||
move_down line_move
|
||||
end
|
||||
|
||||
#start card sale trans data
|
||||
def card_sale_data(card_data)
|
||||
if card_data != nil && !card_data.empty?
|
||||
move_down 5
|
||||
move_down line_move
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
move_down line_move
|
||||
|
||||
y_position = cursor
|
||||
card_data.each do |data|
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class ReceiptBillPdf < Prawn::Document
|
||||
include ActionView::Helpers::NumberHelper
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width
|
||||
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data)
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
@@ -15,6 +16,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
self.description_width = 150
|
||||
self.price_num_width = 50
|
||||
self.line_move = 2
|
||||
# @item_width = self.page_width.to_i / 2
|
||||
# @qty_width = @item_width.to_i / 3
|
||||
# @double = @qty_width * 1.3
|
||||
@@ -91,27 +93,32 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
|
||||
def header (shop_details)
|
||||
move_down 5
|
||||
text "#{shop_details.name}", :left_margin => -10, :size => self.header_font_size,:align => :center
|
||||
move_down 5
|
||||
move_down line_move
|
||||
text "#{shop_details.address}", :size => self.item_font_size,:align => :center
|
||||
# move_down self.item_height
|
||||
move_down 5
|
||||
move_down line_move
|
||||
text "#{shop_details.phone_no}", :size => self.item_font_size,:align => :center
|
||||
move_down 5
|
||||
move_down line_move
|
||||
|
||||
stroke_horizontal_rule
|
||||
end
|
||||
|
||||
def cashier_info(sale_data, customer_name)
|
||||
move_down 7
|
||||
move_down line_move
|
||||
# move_down 2
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width, :height => self.item_height) do
|
||||
text "Receipt No: #{sale_data.receipt_no}", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
move_down 5
|
||||
if sale_data.bookings[0].dining_facility_id.to_i > 0
|
||||
bounding_box([self.description_width - 2,y_position], :width => self.price_num_width, :height => self.item_height) do
|
||||
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
|
||||
move_down line_move
|
||||
|
||||
y_position = cursor
|
||||
if sale_data.bookings[0].dining_facility_id.to_i > 0
|
||||
@@ -126,7 +133,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
bounding_box([self.label_width - 2,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "C: #{sale_data.cashier_name}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down 5
|
||||
move_down line_move
|
||||
|
||||
y_position = cursor
|
||||
if sale_data.bookings[0].dining_facility_id.to_i > 0
|
||||
@@ -146,7 +153,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
# :size => self.item_font_size,:align => :right
|
||||
# end
|
||||
|
||||
move_down 5
|
||||
move_down line_move
|
||||
stroke_horizontal_rule
|
||||
end
|
||||
|
||||
@@ -163,9 +170,9 @@ class ReceiptBillPdf < Prawn::Document
|
||||
item_label_total_front_width = (self.item_width+self.price_width) + 5
|
||||
item_label_total_end_width = self.total_width + 4
|
||||
end
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
move_down 5
|
||||
move_down line_move
|
||||
pad_top(15) {
|
||||
# @item_width.to_i + @half_qty.to_i
|
||||
text_box "Items", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :size => self.item_font_size, :overflow => :shrink_to_fix
|
||||
@@ -173,7 +180,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
text_box "Qty", :at =>[item_label_qty_front_width,y_position], :width => item_label_qty_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "Total", :at =>[item_label_total_front_width,y_position], :width => item_label_total_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
}
|
||||
move_down -5
|
||||
# move_down line_move
|
||||
stroke_horizontal_rule
|
||||
add_line_item_row(sale_items,precision,delimiter)
|
||||
end
|
||||
@@ -193,7 +200,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
item_total_end_width = self.total_width + 4
|
||||
end
|
||||
y_position = cursor
|
||||
move_down 5
|
||||
move_down line_move
|
||||
sub_total = 0.0
|
||||
sale_items.each do |item|
|
||||
# check for item not to show
|
||||
@@ -224,25 +231,27 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
end
|
||||
end
|
||||
move_down line_move
|
||||
}
|
||||
move_down 5
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
stroke_horizontal_rule
|
||||
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Sub Total", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}" ,:delimiter => ',', :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down 5
|
||||
end
|
||||
end
|
||||
|
||||
def all_total(sale_data,precision,delimiter)
|
||||
|
||||
move_down line_move
|
||||
item_name_width = self.item_width
|
||||
y_position = cursor
|
||||
if sale_data.discount_type == 'member_discount'
|
||||
@@ -260,7 +269,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
if sale_data.sale_taxes.length > 0
|
||||
sale_data.sale_taxes.each do |st|
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
@@ -285,7 +294,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
# end
|
||||
|
||||
if sale_data.rounding_adjustment != 0.0
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
@@ -296,16 +305,16 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
end
|
||||
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
move_down 5
|
||||
move_down line_move
|
||||
bounding_box([0,y_position], :width =>self.item_description_width) do
|
||||
text "Grand Total",:style => :bold, :size => self.header_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(sale_data.grand_total, :precision => precision.to_i, :delimiter => delimiter)}" , :style => :bold, :size => self.header_font_size,:align => :right
|
||||
end
|
||||
move_down 5
|
||||
move_down line_move
|
||||
|
||||
sale_payment(sale_data,precision,delimiter)
|
||||
|
||||
@@ -313,7 +322,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
def sale_payment(sale_data,precision,delimiter)
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
#move_down line_move
|
||||
sale_payments = SalePayment.select("SUM(sale_payments.payment_amount) as payment_amount,sale_payments.payment_method").where('sale_id = ?', sale_data.sale_id).group("payment_method")
|
||||
sale_payments.each do |payment|
|
||||
y_position = cursor
|
||||
@@ -330,18 +339,18 @@ class ReceiptBillPdf < Prawn::Document
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(payment.payment_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down 5
|
||||
move_down line_move
|
||||
end
|
||||
if sale_data.amount_received > 0
|
||||
y_position = cursor
|
||||
move_down 5
|
||||
move_down line_move
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Change Amount", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(sale_data.amount_changed, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down 5
|
||||
# move_down line_move
|
||||
end
|
||||
end
|
||||
|
||||
@@ -368,7 +377,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
rebate_balance = rebate_balance + res["deposit"]
|
||||
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Rebate Earn", :size => self.item_font_size,:align => :left
|
||||
@@ -381,7 +390,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
# Total Rebate Amount if birthday
|
||||
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebatebonusAccount" && res["status"]== "Rebate"
|
||||
rebate_balance = rebate_balance + res["deposit"]
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Rebate Earn Bonus", :size => self.item_font_size,:align => :left
|
||||
@@ -393,7 +402,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
#end Total rebate if birthday
|
||||
end
|
||||
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Redeem Amount", :size => self.item_font_size,:align => :left
|
||||
@@ -403,7 +412,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
|
||||
if current_balance != nil
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Old Balance", :size => self.item_font_size,:align => :left
|
||||
@@ -425,7 +434,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
end
|
||||
end
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Total Balance", :size => self.item_font_size,:align => :left
|
||||
@@ -438,21 +447,23 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
|
||||
def customer(customer_name)
|
||||
move_down 5
|
||||
# move_down line_move
|
||||
y_position = cursor
|
||||
#move_down line_move
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Customer Name", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{ customer_name }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down line_move
|
||||
end
|
||||
|
||||
|
||||
def discount_account(discount_price_by_accounts,precision,delimiter)
|
||||
move_down 5
|
||||
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
discount_price_by_accounts.each do |ipa|
|
||||
y_position = cursor
|
||||
@@ -462,13 +473,13 @@ class ReceiptBillPdf < Prawn::Document
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "(" + "#{ number_with_precision(ipa[:price], :precision => precision.to_i, :delimiter => delimiter) }" + ")" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down line_move
|
||||
end
|
||||
end
|
||||
|
||||
def items_account(item_price_by_accounts,precision,delimiter)
|
||||
move_down 5
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
item_price_by_accounts.each do |ipa|
|
||||
y_position = cursor
|
||||
@@ -477,16 +488,16 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
bounding_box([self.label_width,y_position], :width =>self.item_description_width) do
|
||||
text "#{number_with_precision(ipa[:price], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
move_down line_move
|
||||
end
|
||||
end
|
||||
|
||||
#individual payment per person
|
||||
def individual_payment(sale_data, precision, delimiter)
|
||||
per_person = sale_data.grand_total.to_f / sale_data.equal_persons.to_i
|
||||
move_down 5
|
||||
def individual_payment(sale_data, survey, precision, delimiter)
|
||||
per_person = sale_data.grand_total.to_f / survey.total_customer.to_i
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.label_width+50) do
|
||||
text "Split Bill for #{sale_data.equal_persons} persons", :size => self.item_font_size+1,:align => :left
|
||||
@@ -542,10 +553,11 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
|
||||
def footer(printed_status)
|
||||
move_down 5
|
||||
move_down line_move
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
move_down line_move
|
||||
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.label_width) do
|
||||
text "#{printed_status}",:style => :bold, :size => header_font_size,:align => :left
|
||||
@@ -554,15 +566,15 @@ class ReceiptBillPdf < Prawn::Document
|
||||
text "Thank You! See you Again", :left_margin => -5, :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
move_down 5
|
||||
move_down line_move
|
||||
end
|
||||
|
||||
#start card sale trans data
|
||||
def card_sale_data(card_data)
|
||||
if card_data != nil && !card_data.empty?
|
||||
move_down 5
|
||||
move_down line_move
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
move_down line_move
|
||||
|
||||
y_position = cursor
|
||||
card_data.each do |data|
|
||||
|
||||
59
app/uploaders/commissioner_image_uploader.rb
Normal file
59
app/uploaders/commissioner_image_uploader.rb
Normal file
@@ -0,0 +1,59 @@
|
||||
class CommissionerImageUploader < CarrierWave::Uploader::Base
|
||||
|
||||
# Include RMagick or MiniMagick support:
|
||||
# include CarrierWave::RMagick
|
||||
include CarrierWave::MiniMagick
|
||||
|
||||
# Choose what kind of storage to use for this uploader:
|
||||
storage :file
|
||||
# storage :fog
|
||||
|
||||
def root
|
||||
Rails.root.join 'public/'
|
||||
end
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
"image/commissioner_images"
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
# def default_url(*args)
|
||||
# # For Rails 3.1+ asset pipeline compatibility:
|
||||
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
|
||||
#
|
||||
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
||||
# end
|
||||
|
||||
# Process files as they are uploaded:
|
||||
# process scale: [200, 300]
|
||||
process :resize_to_fit => [200, 150]
|
||||
#
|
||||
# def scale(width, height)
|
||||
# # do something
|
||||
# end
|
||||
|
||||
# Create different versions of your uploaded files:
|
||||
# version :thumb do
|
||||
# process resize_to_fit: [50, 50]
|
||||
# end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
def extension_whitelist
|
||||
%w(jpg jpeg gif png)
|
||||
end
|
||||
|
||||
# Override the filename of the uploaded files:
|
||||
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
||||
# def filename
|
||||
# "something.jpg" if original_filename
|
||||
# end
|
||||
|
||||
end
|
||||
59
app/uploaders/customer_image_uploader.rb
Normal file
59
app/uploaders/customer_image_uploader.rb
Normal file
@@ -0,0 +1,59 @@
|
||||
class CustomerImageUploader < CarrierWave::Uploader::Base
|
||||
|
||||
# Include RMagick or MiniMagick support:
|
||||
# include CarrierWave::RMagick
|
||||
include CarrierWave::MiniMagick
|
||||
|
||||
# Choose what kind of storage to use for this uploader:
|
||||
storage :file
|
||||
# storage :fog
|
||||
|
||||
def root
|
||||
Rails.root.join 'public/'
|
||||
end
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
"image/customer_images"
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
# def default_url(*args)
|
||||
# # For Rails 3.1+ asset pipeline compatibility:
|
||||
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
|
||||
#
|
||||
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
||||
# end
|
||||
|
||||
# Process files as they are uploaded:
|
||||
# process scale: [200, 300]
|
||||
process :resize_to_fit => [200, 150]
|
||||
#
|
||||
# def scale(width, height)
|
||||
# # do something
|
||||
# end
|
||||
|
||||
# Create different versions of your uploaded files:
|
||||
# version :thumb do
|
||||
# process resize_to_fit: [50, 50]
|
||||
# end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
def extension_whitelist
|
||||
%w(jpg jpeg gif png)
|
||||
end
|
||||
|
||||
# Override the filename of the uploaded files:
|
||||
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
||||
# def filename
|
||||
# "something.jpg" if original_filename
|
||||
# end
|
||||
|
||||
end
|
||||
59
app/uploaders/display_image_uploader.rb
Normal file
59
app/uploaders/display_image_uploader.rb
Normal file
@@ -0,0 +1,59 @@
|
||||
class DisplayImageUploader < CarrierWave::Uploader::Base
|
||||
|
||||
# Include RMagick or MiniMagick support:
|
||||
# include CarrierWave::RMagick
|
||||
include CarrierWave::MiniMagick
|
||||
|
||||
# Choose what kind of storage to use for this uploader:
|
||||
storage :file
|
||||
# storage :fog
|
||||
|
||||
# def root
|
||||
# Rails.root.join 'public/'
|
||||
# end
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
#"image/image"
|
||||
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
# def default_url(*args)
|
||||
# # For Rails 3.1+ asset pipeline compatibility:
|
||||
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
|
||||
#
|
||||
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
||||
# end
|
||||
|
||||
# Process files as they are uploaded:
|
||||
# process scale: [200, 300]
|
||||
process :resize_to_fit => [200, 150]
|
||||
#
|
||||
# def scale(width, height)
|
||||
# # do something
|
||||
# end
|
||||
|
||||
# Create different versions of your uploaded files:
|
||||
# version :thumb do
|
||||
# process resize_to_fit: [50, 50]
|
||||
# end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
def extension_whitelist
|
||||
%w(jpg jpeg gif png)
|
||||
end
|
||||
|
||||
# Override the filename of the uploaded files:
|
||||
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
||||
# def filename
|
||||
# "something.jpg" if original_filename
|
||||
# end
|
||||
|
||||
end
|
||||
59
app/uploaders/employee_image_uploader.rb
Normal file
59
app/uploaders/employee_image_uploader.rb
Normal file
@@ -0,0 +1,59 @@
|
||||
class EmployeeImageUploader < CarrierWave::Uploader::Base
|
||||
|
||||
# Include RMagick or MiniMagick support:
|
||||
# include CarrierWave::RMagick
|
||||
include CarrierWave::MiniMagick
|
||||
|
||||
# Choose what kind of storage to use for this uploader:
|
||||
storage :file
|
||||
# storage :fog
|
||||
|
||||
def root
|
||||
Rails.root.join 'public/'
|
||||
end
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
"image/employee_images"
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
# def default_url(*args)
|
||||
# # For Rails 3.1+ asset pipeline compatibility:
|
||||
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
|
||||
#
|
||||
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
||||
# end
|
||||
|
||||
# Process files as they are uploaded:
|
||||
# process scale: [200, 300]
|
||||
process :resize_to_fit => [200, 150]
|
||||
#
|
||||
# def scale(width, height)
|
||||
# # do something
|
||||
# end
|
||||
|
||||
# Create different versions of your uploaded files:
|
||||
# version :thumb do
|
||||
# process resize_to_fit: [50, 50]
|
||||
# end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
def extension_whitelist
|
||||
%w(jpg jpeg gif png)
|
||||
end
|
||||
|
||||
# Override the filename of the uploaded files:
|
||||
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
||||
# def filename
|
||||
# "something.jpg" if original_filename
|
||||
# end
|
||||
|
||||
end
|
||||
59
app/uploaders/shop_image_uploader.rb
Normal file
59
app/uploaders/shop_image_uploader.rb
Normal file
@@ -0,0 +1,59 @@
|
||||
class ShopImageUploader < CarrierWave::Uploader::Base
|
||||
|
||||
# Include RMagick or MiniMagick support:
|
||||
# include CarrierWave::RMagick
|
||||
include CarrierWave::MiniMagick
|
||||
|
||||
# Choose what kind of storage to use for this uploader:
|
||||
storage :file
|
||||
# storage :fog
|
||||
|
||||
def root
|
||||
Rails.root.join 'public/'
|
||||
end
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
"image/shop_images"
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
# def default_url(*args)
|
||||
# # For Rails 3.1+ asset pipeline compatibility:
|
||||
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
|
||||
#
|
||||
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
||||
# end
|
||||
|
||||
# Process files as they are uploaded:
|
||||
# process scale: [200, 300]
|
||||
process :resize_to_fit => [200, 150]
|
||||
#
|
||||
# def scale(width, height)
|
||||
# # do something
|
||||
# end
|
||||
|
||||
# Create different versions of your uploaded files:
|
||||
# version :thumb do
|
||||
# process resize_to_fit: [50, 50]
|
||||
# end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
def extension_whitelist
|
||||
%w(jpg jpeg gif png)
|
||||
end
|
||||
|
||||
# Override the filename of the uploaded files:
|
||||
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
||||
# def filename
|
||||
# "something.jpg" if original_filename
|
||||
# end
|
||||
|
||||
end
|
||||
@@ -90,6 +90,21 @@
|
||||
<label><%= t("views.right_panel.detail.date_of_birth") %></label>
|
||||
<%= f.text_field :date_of_birth, :value=>"01-01-1990",:class=>"datepicker form-control col-md-12"%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.customer_photo") %></label>
|
||||
<div class="panel padding-10">
|
||||
<div class="menu-item-img">
|
||||
<% if f.object.image_path? %>
|
||||
<p><%= f.object.name %></p>
|
||||
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
|
||||
<% else %>
|
||||
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.file_field :image_path, :class => "img-thumbnail" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.select_customer_type") %></label>
|
||||
@@ -164,6 +179,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
// Read Card Reader
|
||||
$("#paypar_account_no").on('focus', function(e){
|
||||
|
||||
@@ -164,8 +164,8 @@
|
||||
<td align="right"><%= @summ_sale.total_receipt %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.net") %> <%= t :sale %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) rescue number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %></td>
|
||||
<td><%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
|
||||
@@ -176,8 +176,8 @@
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter) rescue number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.gross_sale") %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter) rescue number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %></td>
|
||||
<td><%= t("views.right_panel.detail.total_sale") %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="table">
|
||||
@@ -186,7 +186,11 @@
|
||||
<% if !@sale_data[0].empty? %>
|
||||
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' && payment.payment_method != 'unionpay' %>
|
||||
<tr>
|
||||
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
||||
<% if payment.payment_method == 'paypar' %>
|
||||
<td>Redeem Sale : </td>
|
||||
<% else %>
|
||||
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
||||
<% end %>
|
||||
<td align="right">
|
||||
<% @sale_data.each do |data| %>
|
||||
<% pay_mth = payment.payment_method %>
|
||||
@@ -201,7 +205,7 @@
|
||||
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
|
||||
<% if !total_card.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.card_sale") %> : </td>
|
||||
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
||||
<td align="right">
|
||||
<%= number_with_precision(total_card["card"], precision: precision.to_i ,delimiter: delimiter) rescue number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %>
|
||||
</td>
|
||||
@@ -215,8 +219,8 @@
|
||||
</div>
|
||||
<% if current_user.role == 'administrator' || current_user.role == 'manager' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if current_user.role == 'administrator' || current_user.role == 'manager' %>
|
||||
<div class="row">
|
||||
|
||||
@@ -27,6 +27,11 @@
|
||||
<img src="<%= asset_path('SX-Logo-small.png') %>" width="40" height="40" alt="Logo" />
|
||||
<span class="navbar-brand-txt">SX Restaurant</span>
|
||||
</a>
|
||||
<% if @payment_method_setting_nav.present? %>
|
||||
<span class="navbar-brand m-0">/
|
||||
<span id="otherPayment"></span> Payment
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<!-- Start Shop Info -->
|
||||
@@ -78,6 +83,11 @@
|
||||
</nav>
|
||||
|
||||
<script type="text/javascript">
|
||||
if((document.getElementById("otherPayment")!=undefined) && (document.getElementById("otherPayment")!=null) && (document.getElementById("otherPayment")!="")){
|
||||
var otherPayment = location.href.split('/')[location.href.split('/').length -1 ];
|
||||
document.getElementById("otherPayment").innerHTML = otherPayment;
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$('.delete').click(function(){
|
||||
var method = $(this).attr('data-method');
|
||||
|
||||
@@ -57,119 +57,180 @@
|
||||
|
||||
<!-- #END# Page Loader -->
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
|
||||
<div class="row">
|
||||
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
|
||||
<img src="/image/SX-logo.png" width="150px" height="150px">
|
||||
<p>
|
||||
<small>Version - 1.0.1</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-white">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
|
||||
<p>
|
||||
<small>Version - 1.0.1</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-white">
|
||||
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
|
||||
<div class="row justify-content-center form-group">
|
||||
<input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID">
|
||||
</div>
|
||||
<input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID">
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-1 col-black">
|
||||
<span>Supervisor</span>
|
||||
<br>
|
||||
<div class="card padding-10">
|
||||
<div class="card-content">
|
||||
<div class='col-md-12'>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad " data-value="1">1</div>
|
||||
<div class="pin_pad left" data-value="2">2</div>
|
||||
<div class="pin_pad left" data-value="3">3</div>
|
||||
</div>
|
||||
<div class="col-11">
|
||||
<hr />
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad" data-value="4">4</div>
|
||||
<div class="pin_pad left" data-value="5">5</div>
|
||||
<div class="pin_pad left" data-value="6">6</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad" data-value="7">7</div>
|
||||
<div class="pin_pad left" data-value="8">8</div>
|
||||
<div class="pin_pad left" data-value="9">9</div>
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<!-- <div class="pin_pad bg-grey" data-value="CLR">CLR</div>
|
||||
<div class="pin_pad left" data-value="0">0</div>
|
||||
<div class="pin_pad left bg-indigo" data-value="ENT">ENT</div> -->
|
||||
<div class="pin_pad bg-blue-grey" data-value="BAC">BACK</div>
|
||||
<div class="pin_pad left" data-value="0">0</div>
|
||||
<div class="pin_pad bg-grey left" data-value="CLR">CLR</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-b-15">
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == "manager" %>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#manager" role="tab"><b>Manager</b></a>
|
||||
<% break %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == "supervisor" %>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
|
||||
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
|
||||
</form>
|
||||
<div class="card emp-body">
|
||||
<div class="body bg-teal">
|
||||
<%= employee.name%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#supervisor" role="tab"><b>Supervisor</b></a>
|
||||
<% break %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-1 col-black">
|
||||
<span>Cashier</span>
|
||||
</div>
|
||||
<div class="col-11">
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-b-15">
|
||||
<% @employees.each do |employee| %>
|
||||
|
||||
<%if employee.role == "cashier" %>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
|
||||
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
|
||||
</form>
|
||||
<div class="card emp-body">
|
||||
<div class="body bg-teal">
|
||||
<%= employee.name%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#cashier" role="tab"><b>Cashier</b></a>
|
||||
<% break %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-1 col-black">
|
||||
<span>Accountant</span>
|
||||
</div>
|
||||
<div class="col-11">
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-b-15">
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == "account" %>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
|
||||
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
|
||||
</form>
|
||||
<div class="card emp-body">
|
||||
<div class="body bg-teal">
|
||||
<%= employee.name%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%if employee.role == "account" %>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#account" role="tab"><b>Accountant</b></a>
|
||||
<% break %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-1 col-black">
|
||||
<span>Waiter</span>
|
||||
</div>
|
||||
<div class="col-11">
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-b-15">
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == "waiter" %>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
|
||||
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
|
||||
</form>
|
||||
<div class="card emp-body">
|
||||
<div class="body bg-teal">
|
||||
<%= employee.name%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#waiter" role="tab"><b>Waiter</b></a>
|
||||
<% break %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style="max-height:650px; overflow:auto">
|
||||
|
||||
<div class="tab-pane" id="manager" role="tabpanel" style="max-height:; overflow:auto">
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == "manager" %>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
|
||||
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
|
||||
</form>
|
||||
<div class="login_dashboard p-card">
|
||||
<i class="material-icons md-48" style="font-size: 100px;">person</i>
|
||||
<div class="p-name"><b><%= employee.name%></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="tab-pane" id="supervisor" role="tabpanel" style="max-height:; overflow:auto">
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == "supervisor" %>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
|
||||
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
|
||||
</form>
|
||||
<div class="login_dashboard p-card">
|
||||
<i class="material-icons md-48" style="font-size: 100px;">person</i>
|
||||
<div class="p-name"><b><%= employee.name%></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="cashier" role="tabpanel" style="max-height:; overflow:auto">
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == "cashier" %>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
|
||||
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
|
||||
</form>
|
||||
<div class="login_dashboard p-card">
|
||||
<i class="material-icons md-48" style="font-size: 100px;">person</i>
|
||||
<div class="p-name"><b><%= employee.name%></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="account" role="tabpanel" style="max-height:; overflow:auto">
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == "account" %>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
|
||||
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
|
||||
</form>
|
||||
<div class="login_dashboard p-card">
|
||||
<i class="material-icons md-48" style="font-size: 100px;">person</i>
|
||||
<div class="p-name"><b><%= employee.name%></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="waiter" role="tabpanel" style="max-height:; overflow:auto">
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == "waiter" %>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
|
||||
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
|
||||
</form>
|
||||
<div class="login_dashboard p-card">
|
||||
<i class="material-icons md-48" style="font-size: 100px;">person</i>
|
||||
<div class="p-name"><b><%= employee.name%></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"> </div> -->
|
||||
</div>
|
||||
@@ -177,7 +238,9 @@
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
// for Notificaiotn message
|
||||
var placementFrom = $("#noti").attr('data-placement-from');
|
||||
@@ -197,6 +260,36 @@
|
||||
$(item).submit();
|
||||
});
|
||||
|
||||
$('ul.nav.nav-tabs li a').click(function() {
|
||||
var bb = $('.nav-item').children()[0];
|
||||
$(bb).removeClass('active_tab');
|
||||
$(this).parent().addClass('active_tab').siblings().removeClass('active_tab');
|
||||
});
|
||||
|
||||
$("#emp_id").focus();
|
||||
$(".pin_pad").click(function (event) {
|
||||
event.preventDefault();
|
||||
var value = $(this).data("value");
|
||||
|
||||
if (value == "CLR") {
|
||||
$("#emp_id").val("");
|
||||
} else if (value == "BAC") {
|
||||
window.location.href = "/"
|
||||
} else {
|
||||
var old_value = $("#emp_id").val();
|
||||
$("#emp_id").val(old_value + value);
|
||||
}
|
||||
if((old_value + value).length == 3){
|
||||
if($.isNumeric(old_value + value)){
|
||||
if((old_value + value).length === 3){
|
||||
window.location.href = '/auth/'+(old_value + value);
|
||||
}else{
|
||||
alert("Please Enter Numeric Number");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#emp_id').keyup(function(e) {
|
||||
e.preventDefault();
|
||||
var txtVal = this.value;
|
||||
@@ -212,6 +305,11 @@
|
||||
}
|
||||
});
|
||||
|
||||
var aa = $('.nav-item').children().attr('href').replace('#','');
|
||||
$('#'+aa).addClass('active');
|
||||
var bb = $('.nav-item').children()[0];
|
||||
$(bb).parent().addClass('active_tab').siblings().removeClass('active_tab');
|
||||
|
||||
});
|
||||
|
||||
function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {
|
||||
|
||||
@@ -41,65 +41,69 @@
|
||||
|
||||
<% if !@summ_sale.nil? %>
|
||||
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h6><%= t :sale %></h6>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : </td>
|
||||
<td align="right"><%= @summ_sale.total_receipt %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_discount, precision: precision.to_i ,delimiter: delimiter) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter)%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.grand_total") %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="table">
|
||||
<% if !(@total_payment_methods.nil?) %>
|
||||
<% @total_payment_methods.each do |payment| %>
|
||||
<% if !@sale_data[0].empty? %>
|
||||
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
|
||||
<tr>
|
||||
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
||||
<td align="right">
|
||||
<% @sale_data.each do |data| %>
|
||||
<% pay_mth = payment.payment_method %>
|
||||
<%= data[""+pay_mth+""] %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h6><%= t :sale %></h6>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : </td>
|
||||
<td align="right"><%= @summ_sale.total_receipt %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_discount, precision: precision.to_i ,delimiter: delimiter) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter)%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="table">
|
||||
<% if !(@total_payment_methods.nil?) %>
|
||||
<% @total_payment_methods.each do |payment| %>
|
||||
<% if !@sale_data[0].empty? %>
|
||||
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
|
||||
<tr>
|
||||
<% if payment.payment_method == 'paypar' %>
|
||||
<td>Redeem Sale : </td>
|
||||
<% else %>
|
||||
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
||||
<% end %>
|
||||
<td align="right">
|
||||
<% @sale_data.each do |data| %>
|
||||
<% pay_mth = payment.payment_method %>
|
||||
<%= data[""+pay_mth+""] %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
|
||||
<% if !total_card.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.card_sale") %> : </td>
|
||||
<td align="right">
|
||||
<%= total_card["card"].to_f %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
|
||||
<% if !total_card.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
||||
<td align="right">
|
||||
<%= total_card["card"].to_f %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</table>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||
<div class="card">
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div> -->
|
||||
<h5>JCB Payment</h5>
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<span class="hidden" id="membership_id"><%= @membership_id%></span>
|
||||
@@ -51,7 +50,8 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>Reference Number</label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<br><span id="reference_no_Err" style="color:red;"></span>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -194,53 +194,60 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
|
||||
$('#jcb_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var reference_no = $('#reference_no').val();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var receipt_no = "<%= @receipt_no %>";
|
||||
var bank_integration = "<%= @bank_integration %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
// var sub_total = $('#sub-total').text();
|
||||
// var member_id = $('#membership_id').text();
|
||||
// var member_discount = $('#member_discount').text();
|
||||
// if (member_id && member_discount) {
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/origami/" + sale_id + "/member_discount",
|
||||
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//end member discount
|
||||
if(bank_integration == '1'){
|
||||
pay_withBank("SALE", "jcb", amount, sale_id, receipt_no,cashier_type);
|
||||
$("#reference_no_Err").html("");
|
||||
if(reference_no.length > 0){
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
// var sub_total = $('#sub-total').text();
|
||||
// var member_id = $('#membership_id').text();
|
||||
// var member_discount = $('#member_discount').text();
|
||||
// if (member_id && member_discount) {
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/origami/" + sale_id + "/member_discount",
|
||||
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//end member discount
|
||||
if(bank_integration == '1'){
|
||||
$("#reference_no").val("");
|
||||
pay_withBank("SALE", "jcb", amount, sale_id, receipt_no);
|
||||
}else{
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_jcb_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Successfully",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}else{
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_jcb_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Successfully",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
if (amount>0) {
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}else{
|
||||
swal ( "Oops" , "Enter Amount!" , "error" );
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (amount>0) {
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}else{
|
||||
swal ( "Oops" , "Enter Amount!" , "error" );
|
||||
}
|
||||
$("#reference_no_Err").html("can't be blank");
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div> -->
|
||||
<h5>Master Payment</h5>
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<span class="hidden" id="membership_id"><%= @membership_id%></span>
|
||||
@@ -52,7 +51,8 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>Reference Number</label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<br><span id="reference_no_Err" style="color:red;"></span>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -192,10 +192,14 @@
|
||||
});
|
||||
$('#master_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var reference_no = $('#reference_no').val();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var receipt_no = "<%= @receipt_no %>";
|
||||
var bank_integration = "<%= @bank_integration %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$("#reference_no_Err").html("");
|
||||
if(reference_no.length > 0){
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
// var sub_total = $('#sub-total').text();
|
||||
@@ -214,31 +218,34 @@
|
||||
if(bank_integration == '1'){
|
||||
pay_withBank("SALE", "master", amount, sale_id, receipt_no,cashier_type);
|
||||
}else{
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_master_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Successfully",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_master_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Successfully",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}else{
|
||||
if (amount>0) {
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}else{
|
||||
swal ( "Oops" , "Enter Amount!" , "error" );
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (amount>0) {
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}else{
|
||||
swal ( "Oops" , "Enter Amount!" , "error" );
|
||||
}
|
||||
$("#reference_no_Err").html("can't be blank");
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div> -->
|
||||
<h5>MPU Payment</h5>
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<span class="hidden" id="membership_id"><%= @membership_id%></span>
|
||||
@@ -52,7 +51,8 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>Reference Number</label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<br><span id="reference_no_Err" style="color:red;"></span>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -197,26 +197,29 @@
|
||||
|
||||
$('#mpu_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var reference_no = $('#reference_no').val();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var receipt_no = "<%= @receipt_no %>";
|
||||
var bank_integration = "<%= @bank_integration %>";
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
// var sub_total = $('#sub-total').text();
|
||||
// var member_id = $('#membership_id').text();
|
||||
// var member_discount = $('#member_discount').text();
|
||||
// if (member_id && member_discount) {
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/origami/" + sale_id + "/member_discount",
|
||||
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//end member discount
|
||||
$("#reference_no_Err").html("");
|
||||
if(reference_no.length > 0){
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
// var sub_total = $('#sub-total').text();
|
||||
// var member_id = $('#membership_id').text();
|
||||
// var member_discount = $('#member_discount').text();
|
||||
// if (member_id && member_discount) {
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/origami/" + sale_id + "/member_discount",
|
||||
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//end member discount
|
||||
if(bank_integration == '1'){
|
||||
pay_withBank("SALE", "mpu", amount, sale_id, receipt_no,cashier_type);
|
||||
}else{
|
||||
@@ -241,12 +244,15 @@
|
||||
}
|
||||
|
||||
}else{
|
||||
if (amount>0) {
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}else{
|
||||
swal ( "Oops" , "Enter Amount!" , "error" );
|
||||
}
|
||||
}
|
||||
})
|
||||
if (amount>0) {
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}else{
|
||||
swal ( "Oops" , "Enter Amount!" , "error" );
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$("#reference_no_Err").html("can't be blank");
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div> -->
|
||||
<h5>Reedem Payment</h5>
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card m-l-10 m-t-10" style="padding:0px 20px;">
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div> -->
|
||||
<h5>UNIONPAY Payment</h5>
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<span class="hidden" id="membership_id"><%= @membership_id%></span>
|
||||
@@ -52,7 +51,8 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>Reference Number</label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<br><span id="reference_no_Err" style="color:red;"></span>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -196,10 +196,14 @@
|
||||
});
|
||||
$('#unionpay_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var reference_no = $('#reference_no').val();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var receipt_no = "<%= @receipt_no %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
|
||||
$("#reference_no_Err").html("");
|
||||
if(reference_no.length > 0){
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
// var sub_total = $('#sub-total').text();
|
||||
// var member_id = $('#membership_id').text();
|
||||
@@ -219,31 +223,34 @@
|
||||
pay_withBank("SALE", "unionpay", amount, sale_id, receipt_no, cashier_type);
|
||||
}
|
||||
else{
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_unionpay_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Successfully",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_unionpay_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Payment Successfully",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}else{
|
||||
if (amount>0) {
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}else{
|
||||
swal ( "Oops" , "Enter Amount!" , "error" );
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (amount>0) {
|
||||
swal ( "Oops" , "Paid Amount is over!" , "error" );
|
||||
}else{
|
||||
swal ( "Oops" , "Enter Amount!" , "error" );
|
||||
}
|
||||
$("#reference_no_Err").html("can't be blank");
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user