fixed payment methods & license
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
|
||||
border: none;
|
||||
position: fixed;
|
||||
/*top: 0;*/
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 12;
|
||||
width: 100%; }
|
||||
@@ -6649,7 +6649,7 @@ fieldset[disabled] .form-control {
|
||||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
|
||||
border: none;
|
||||
position: fixed;
|
||||
/*top: 0;*/
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 12;
|
||||
width: 100%; }
|
||||
|
||||
@@ -108,8 +108,6 @@ class HomeController < ApplicationController
|
||||
@hourly_sales = Sale.hourly_sales(current_user,@from,@to)
|
||||
# .group_by_hour(:created_at, :time_zone => 'Asia/Rangoon',format: '%I:%p')
|
||||
# .sum(:grand_total)
|
||||
logger.debug 'hourly_sales<>><><><<<<<<>><<<><><><><><><><><><<>><'
|
||||
logger.debug @hourly_sales.to_json
|
||||
employee_sales = Sale.employee_sales(current_user,@from,@to)
|
||||
# .sum("(CASE WHEN sp.payment_method='cash' THEN ((sp.payment_amount) - (sales.amount_changed)) ELSE (sp.payment_amount) END)")
|
||||
@employee_sales = []
|
||||
|
||||
@@ -10,10 +10,7 @@ class Origami::WasteSpoileController < BaseOrigamiController
|
||||
SaleTax.where("sale_id='#{sale_id}'").find_each do |existing_tax|
|
||||
existing_tax.delete
|
||||
end
|
||||
sale.update_attributes(total_discount: 0,total_tax: 0,grand_total: sale.total_amount,rounding_adjustment:0)
|
||||
sale.payment_status = remark
|
||||
sale.sale_status = remark
|
||||
sale.save
|
||||
sale.update_attributes(total_discount: 0, total_tax: 0, grand_total: sale.total_amount, rounding_adjustment:0, payment_status: remark, sale_status: remark)
|
||||
|
||||
# add to sale item with foc
|
||||
# sale_items = SaleItem.where("sale_id='#{ sale_id }' and status is null")
|
||||
|
||||
@@ -4,12 +4,12 @@ class Reports::PaymentMethodController < BaseReportController
|
||||
|
||||
@payment_methods = PaymentMethodSetting.where("is_active='1'").pluck("payment_method")
|
||||
|
||||
@payments = [["All Payment",''],["Cash Payment","cash"], ["Credit Payment","creditnote"],
|
||||
["FOC Payment","foc"]]
|
||||
@payments = [["All",''], ["Cash","cash"], ["Card", "card"], ["Credit","creditnote"],
|
||||
["FOC","foc"]] + PaymentMethodSetting.pluck(:payment_method).map { |payment_method| [payment_method, payment_method.parameterize] }
|
||||
|
||||
@payment_methods.each do |m|
|
||||
@payments.push(["#{m} Payment", m.parameterize])
|
||||
end
|
||||
# @payment_methods.each do |m|
|
||||
# @payments.push(["#{m} Payment", m.parameterize])
|
||||
# end
|
||||
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
class Reports::ReceiptNoDetailController < BaseReportController
|
||||
authorize_resource :class => false
|
||||
def index
|
||||
@payments = [["All Payment",''], ["Cash Payment","cash"], ["Credit Payment","creditnote"], ["FOC Payment","foc"]]
|
||||
@payment_method = PaymentMethodSetting.all
|
||||
@payment_methods = [["All", ''], ["Cash", "cash"], ["Card", "card"], ["Credit", "creditnote"], ["FOC", "foc"]] + PaymentMethodSetting.pluck(:payment_method).map { |payment_method| [payment_method, payment_method.parameterize] }
|
||||
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
@shift_sale_range = ''
|
||||
|
||||
@shift = ''
|
||||
if params[:shift_name].to_i != 0
|
||||
@shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
@shift = ''
|
||||
if params[:shift_name].to_i != 0
|
||||
@shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
|
||||
@shift_sale = ShiftSale.find(params[:shift_name])
|
||||
if to.blank?
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',@shift_sale.shift_started_at)
|
||||
else
|
||||
if @shift_sale.shift_closed_at.blank?
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL',@shift_sale.shift_started_at)
|
||||
else
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',@shift_sale.shift_started_at, @shift_sale.shift_closed_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
@shift_sale = ShiftSale.find(params[:shift_name])
|
||||
if to.blank?
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',@shift_sale.shift_started_at)
|
||||
else
|
||||
if @shift_sale.shift_closed_at.blank?
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL',@shift_sale.shift_started_at)
|
||||
else
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',@shift_sale.shift_started_at, @shift_sale.shift_closed_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
payment_type = params[:payment_type]
|
||||
@sale_data = Sale.get_shift_sales_by_receipt_no_detail(@shift_sale_range,@shift,from,to,payment_type)
|
||||
payment_type = params[:payment_type]
|
||||
@sale_data = Sale.get_shift_sales_by_receipt_no_detail(@shift_sale_range,@shift,from,to,payment_type)
|
||||
|
||||
@from = from
|
||||
@to = to
|
||||
# get printer info
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
if @shift.present?
|
||||
@shift.each do |sh|
|
||||
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||
@shift_data = sh
|
||||
end
|
||||
end
|
||||
@from = from
|
||||
@to = to
|
||||
# get printer info
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
if @shift.present?
|
||||
@shift.each do |sh|
|
||||
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||
@shift_data = sh
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xls
|
||||
end
|
||||
format.html
|
||||
format.xls
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -10,16 +10,16 @@ class Transactions::ShiftSalesController < ApplicationController
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil?
|
||||
@shift_sales = ShiftSale.all.order("id desc")
|
||||
@shift_sales = ShiftSale.all.order("id desc")
|
||||
@shift_sales = Kaminari.paginate_array(@shift_sales).page(params[:page]).per(20)
|
||||
else
|
||||
shift_sale = ShiftSale.search(filter,from,to)
|
||||
if shift_sale.count > 0
|
||||
@shift_sales = shift_sale
|
||||
@shift_sales = shift_sale
|
||||
@shift_sales = Kaminari.paginate_array(@shift_sales).page(params[:page]).per(20)
|
||||
else
|
||||
@shift_sales = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
@@ -32,7 +32,7 @@ class Transactions::ShiftSalesController < ApplicationController
|
||||
# GET /transactions/shift_sales/1
|
||||
# GET /transactions/shift_sales/1.json
|
||||
def show
|
||||
|
||||
|
||||
@shift = ShiftSale.find(params[:id])
|
||||
|
||||
#get tax
|
||||
@@ -40,13 +40,13 @@ class Transactions::ShiftSalesController < ApplicationController
|
||||
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
|
||||
#other payment details for mpu or visa like card
|
||||
@other_payment = ShiftSale.get_by_shift_other_payment(@shift)
|
||||
|
||||
@payment_methods = SalePayment.where.not(payment_method: ['cash', 'creditnote', 'foc']).distinct.pluck(:payment_method)
|
||||
# Calculate price_by_accounts
|
||||
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
||||
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
||||
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
|
||||
|
||||
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
@@ -59,7 +59,7 @@ class Transactions::ShiftSalesController < ApplicationController
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_transactions_shift_sale
|
||||
|
||||
@@ -164,10 +164,10 @@ class License
|
||||
elsif old_renewable_date.to_date < @varified['renewable_date'].to_date
|
||||
update_license("renewable_date", @varified['renewable_date'])
|
||||
status = 1
|
||||
message = "*** License con be verified. ***"
|
||||
message = "*** License con be verified. ***"
|
||||
end
|
||||
return status, message
|
||||
|
||||
|
||||
else
|
||||
delete_license_file
|
||||
end
|
||||
@@ -204,7 +204,7 @@ class License
|
||||
|
||||
def days_to_expire
|
||||
if renewal_date_str = read_license("renewable_date")
|
||||
Date.today - DateTime.parse(renewal_date_str).to_date
|
||||
Date.today - DateTime.parse(renewal_date_str).to_date
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1200,11 +1200,21 @@ def self.get_shift_sales_by_receipt_no_detail(shift_sale_range,shift,from,to,pay
|
||||
.includes(:bookings => :dining_facility)
|
||||
.select("sales.*, SUM(sale_payments.payment_amount) AS payments_for_credits_amount")
|
||||
.joins(:bookings)
|
||||
.joins("INNER JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||
.left_joins(:payments_for_credits)
|
||||
.completed
|
||||
.where.not(total_amount: 0)
|
||||
.group(:sale_id)
|
||||
.order(:receipt_date)
|
||||
|
||||
if payment_type.present?
|
||||
if payment_type == 'card'
|
||||
query = query.where(sanitize_sql_array(["sp.payment_method IN (?)", SalePayment::CARD]))
|
||||
else
|
||||
query = query.where("sp.payment_method = (?)", payment_type)
|
||||
end
|
||||
end
|
||||
|
||||
if shift.present?
|
||||
query = query.where("sales.shift_sale_id in (?)", shift.to_a)
|
||||
elsif shift_sale_range.present?
|
||||
@@ -1363,7 +1373,11 @@ def self.get_payment_method_by_shift(shift,from,to,payment_type)
|
||||
end
|
||||
|
||||
if payment_type.present?
|
||||
sale_payment = sale_payment.where(payment_method: payment_type)
|
||||
if payment_type == 'card'
|
||||
sale_payment = sale_payment.where(sanitize_sql_array(["payment_method IN (?)", SalePayment::CARD]))
|
||||
else
|
||||
sale_payment = sale_payment.where("payment_method = (?)", payment_type)
|
||||
end
|
||||
end
|
||||
|
||||
return payments_total, sale_payment
|
||||
@@ -1577,11 +1591,10 @@ end
|
||||
end
|
||||
|
||||
def self.total_payment_methods(current_user=nil,from=nil,to=nil)
|
||||
payment_methods = SalePayment.where.not(payment_method: ['cash', 'creditnote', 'foc']).distinct.pluck(:payment_method)
|
||||
query = Sale.select("CASE WHEN sp.payment_method IN (#{payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') }) THEN 'card' ELSE sp.payment_method END as payment_method")
|
||||
query = Sale.select(sanitize_sql_array(["CASE WHEN sp.payment_method IN (?) THEN 'card' ELSE sp.payment_method END as payment_method", SalePayment::CARD]))
|
||||
.where("sales.sale_status = 'completed'")
|
||||
.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
.group("CASE WHEN sp.payment_method IN (#{payment_methods.map{ |pm| "\"#{pm}\"" }.join(', ') }) THEN 'card' ELSE sp.payment_method END")
|
||||
.group(sanitize_sql_array(["CASE WHEN sp.payment_method IN (?) THEN 'card' ELSE sp.payment_method END", SalePayment::CARD]))
|
||||
|
||||
if (!from.nil? && !to.nil?)
|
||||
query = query.receipt_date_between(from, to)
|
||||
@@ -2293,7 +2306,7 @@ private
|
||||
self.total_tax = self.total_tax.round(precision)
|
||||
end
|
||||
self.grand_total = (self.total_amount - self.total_discount) + self.total_tax
|
||||
if (!['foc'].include? self.payment_status)
|
||||
if (!['foc','waste','spoile'].include? self.payment_status)
|
||||
adjust_rounding
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
class SalePayment < ApplicationRecord
|
||||
|
||||
CARD = ['mpu', 'visa', 'master', 'jcb', 'unionpay']
|
||||
|
||||
self.primary_key = "sale_payment_id"
|
||||
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
@@ -11,7 +14,7 @@ class SalePayment < ApplicationRecord
|
||||
attr_accessor :received_amount, :card_payment_reference, :voucher_no, :giftcard_no, :customer_id, :external_payment_status,:action_by
|
||||
|
||||
scope :credits, -> { where(payment_method: 'creditnote') }
|
||||
scope :cards, -> { where(payment_method: PaymentMethodSetting.where("is_active='1'").pluck("payment_method")) }
|
||||
scope :cards, -> { where(payment_method: ['mpu', 'visa', 'master', 'jcb', 'unionpay']) }
|
||||
|
||||
def self.sync_sale_payment_records(sale_payments)
|
||||
if !sale_payments.nil?
|
||||
|
||||
@@ -209,30 +209,36 @@
|
||||
<table class="table">
|
||||
<% if !(@total_payment_methods.nil?) %>
|
||||
<% @total_payment_methods.each do |payment| %>
|
||||
<% if payment.payment_method != 'card' %>
|
||||
<tr>
|
||||
<% 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">
|
||||
<%= number_format(@sale_data.find {|x| x.key?(payment.payment_method) }[payment.payment_method], precision: precision.to_i ,delimiter: delimiter) rescue number_format(0, precision: precision.to_i ,delimiter: delimiter) %>
|
||||
</td>
|
||||
</tr>
|
||||
<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.find {|x| x.key?("card") } %>
|
||||
<% if !total_card.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
||||
<td align="right">
|
||||
<%= number_format(total_card["card"], precision: precision.to_i ,delimiter: delimiter) rescue number_format(0, precision: precision.to_i ,delimiter: delimiter) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% total_card = @sale_data.select { |hash| hash["card"]!=nil } %>
|
||||
<% if !total_card.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
||||
<td align="right">
|
||||
<% total_other_amt = 0 %>
|
||||
<% @sale_data.map { |k,v| k.map{|meth,amt| meth != 'cash' && meth != 'foc' && meth != 'creditnote' ? total_other_amt += amt : meth }} %>
|
||||
<%= total_other_amt %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -31,38 +31,38 @@
|
||||
<p>Please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'shared/license_expire_warning' %>
|
||||
<%= render 'shared/license_expire_warning' if Rails.env.production? %>
|
||||
<!-- #END# Page Loader -->
|
||||
<!-- Overlay For Sidebars -->
|
||||
<div class="overlay"></div>
|
||||
<!-- #END# Overlay For Sidebars -->
|
||||
<%= render 'layouts/header' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
</section>
|
||||
|
||||
<!-- Main Content -->
|
||||
<section class="content">
|
||||
<section class="content">
|
||||
<% flash.each do |type, message| %>
|
||||
<% if !flash["errors"]%>
|
||||
<%
|
||||
<%
|
||||
if type == "notice"
|
||||
color = "alert-success"
|
||||
end
|
||||
if type == "error"
|
||||
color = "alert-danger"
|
||||
end
|
||||
end
|
||||
%>
|
||||
<% if flash["error"] || flash["notice"]%>
|
||||
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
||||
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
<%= yield %>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -35,25 +35,25 @@
|
||||
<p>Please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'shared/license_expire_warning' %>
|
||||
<%= render 'shared/license_expire_warning' if Rails.env.production? %>
|
||||
<!-- #END# Page Loader -->
|
||||
<!-- Overlay For Sidebars -->
|
||||
<div class="overlay"></div>
|
||||
<!-- #END# Overlay For Sidebars -->
|
||||
<%= render 'layouts/header' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
</section>
|
||||
|
||||
<!-- Main Content -->
|
||||
<section class="content">
|
||||
<section class="content">
|
||||
<% flash.each do |type, message| %>
|
||||
<div class="alert fade in">
|
||||
<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button>
|
||||
<%= message %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</section>
|
||||
</body>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<title>SmartSales : Restaurant</title>
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
|
||||
<%= stylesheet_link_tag 'application', media: 'all' %>
|
||||
<%= javascript_include_tag 'application' %>
|
||||
<%= javascript_include_tag 'application' %>
|
||||
</head>
|
||||
|
||||
<body class="theme-indigo">
|
||||
@@ -32,33 +32,34 @@
|
||||
<p>Please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'shared/license_expire_warning' %>
|
||||
|
||||
<%= render 'shared/license_expire_warning' if Rails.env.production? %>
|
||||
<!-- #END# Page Loader -->
|
||||
<!-- Overlay For Sidebars -->
|
||||
<div class="overlay"></div>
|
||||
<!-- #END# Overlay For Sidebars -->
|
||||
<%= render 'layouts/header' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
</section>
|
||||
|
||||
<!-- Main Content -->
|
||||
<section class="content">
|
||||
<section class="content">
|
||||
<% flash.each do |type, message| %>
|
||||
<% if type == "notice"
|
||||
<% if type == "notice"
|
||||
color = "alert-success"
|
||||
elsif type == "error"
|
||||
color = "alert-danger"
|
||||
else
|
||||
color = "bg-black"
|
||||
end %>
|
||||
|
||||
|
||||
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
||||
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
||||
</p>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</section>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -31,15 +31,15 @@
|
||||
<p>Please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'shared/license_expire_warning' %>
|
||||
<%= render 'shared/license_expire_warning' if Rails.env.production? %>
|
||||
<!-- #END# Page Loader -->
|
||||
<!-- Overlay For Sidebars -->
|
||||
<div class="overlay"></div>
|
||||
<!-- #END# Overlay For Sidebars -->
|
||||
<%= render 'layouts/header' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
</section>
|
||||
|
||||
<!-- Main Content -->
|
||||
@@ -52,9 +52,9 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -31,15 +31,15 @@
|
||||
<p>Please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'shared/license_expire_warning' %>
|
||||
<%= render 'shared/license_expire_warning' if Rails.env.production? %>
|
||||
<!-- #END# Page Loader -->
|
||||
<!-- Overlay For Sidebars -->
|
||||
<div class="overlay"></div>
|
||||
<!-- #END# Overlay For Sidebars -->
|
||||
<%= render 'layouts/header' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
</section>
|
||||
|
||||
<!-- Notify -->
|
||||
@@ -47,21 +47,20 @@
|
||||
<!-- Notify -->
|
||||
|
||||
<!-- Main Content -->
|
||||
<section class="content">
|
||||
<section class="content">
|
||||
<% flash.each do |type, message| %>
|
||||
<% if type == "notice"
|
||||
<% if type == "notice"
|
||||
color = "alert-success"
|
||||
elsif type == "error"
|
||||
color = "alert-danger"
|
||||
else
|
||||
color = "bg-black"
|
||||
end %>
|
||||
|
||||
|
||||
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
||||
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
||||
</p>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -116,12 +116,14 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
|
||||
<% total_card = @sale_data.select { |hash| hash["card"]!=nil } %>
|
||||
<% if !total_card.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
||||
<td align="right">
|
||||
<%= total_card["card"].to_f %>
|
||||
<% total_other_amt = 0 %>
|
||||
<% @sale_data.map { |k,v| k.map{|meth,amt| meth != 'cash' && meth != 'foc' && meth != 'creditnote' ? total_other_amt += amt : meth }} %>
|
||||
<%= total_other_amt %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -18,17 +18,14 @@
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
<% if defined? payments %>
|
||||
<% if defined? @payment_methods %>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
|
||||
<select name="payment_type" id="payment_type" class="form-control">
|
||||
<% @payments.each do |pm| %>
|
||||
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
|
||||
<%end %>
|
||||
<% @payment_method.each do |pm| %>
|
||||
<option value="<%=pm.payment_method%>" class="<%=pm.payment_method%>" > <%=pm.payment_method%></option>
|
||||
<% @payment_methods.each do |pm| %>
|
||||
<option value="<%=pm[1].downcase%>"><%=pm[0]%></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% if !sale.item_instance_code.nil?%>
|
||||
<% waste_and_spoil_item_count += sale.qty.to_i %>
|
||||
<% grand_total += sale.grand_total.to_i %>
|
||||
<% grand_total += sale.price.to_i %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<% if !menu_cat_arr.include?(sale.name) %>
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
<% date_count = (renewable_date.to_date - Date.today).to_i %>
|
||||
<% day = pluralize( date_count, 'day' )%>
|
||||
|
||||
<% if license_status == 0
|
||||
<% if license_status == 0
|
||||
text = 'Your license has expired.'
|
||||
elsif license_status == 2
|
||||
text = "Your license will expire in #{day}."
|
||||
end
|
||||
%>
|
||||
<% if license_status == 0 || license_status == 2 %>
|
||||
<div class="alert alert-danger fade show text-center" role="alert">
|
||||
<strong style="margin-left: 40px !important"><%= text %></strong>
|
||||
<div id="license-alert" class="alert alert-danger fade show text-center" role="alert">
|
||||
<strong style="margin-left: 40px !important"><%= text %></strong>
|
||||
<%= link_to 'Review License', expire_url, class: 'btn btn-sm btn-primary', style: "margin-left: 20px !important"%>
|
||||
<button type="button" class="close btn-close" data-dismiss="alert" aria-label="Close" style="padding-top: 5px;">
|
||||
<span aria-hidden="true" class="text-white">×</span>
|
||||
@@ -22,14 +22,19 @@
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
divLicnese = $('#license-alert');
|
||||
navbar = $('.navbar');
|
||||
leftsidebar = $('#leftsidebar');
|
||||
if (<%= license_status %> == 1) {
|
||||
$('.navbar').css("top", 0)
|
||||
$('section.content').css('margin-top', '0 !important')
|
||||
navbar.css("top", 0);
|
||||
leftsidebar.css("top", 0);
|
||||
$('section.content').css('margin-top', '0 !important');
|
||||
}
|
||||
else {
|
||||
$('.navbar').css("top", '45px')
|
||||
$('.block-header, .addorder-pages').css('margin-top', '115px')
|
||||
$('.page-header, .m-top-100').css('margin-top', '100px')
|
||||
navbar.css("top", divLicnese.outerHeight() + 'px');
|
||||
leftsidebar.css("top", navbar.outerHeight() + divLicnese.outerHeight() + 'px');
|
||||
$('.block-header, .addorder-pages').css('margin-top', '115px');
|
||||
$('.page-header, .m-top-100').css('margin-top', '100px');
|
||||
$('.alert-danger').css({
|
||||
'top': 0,
|
||||
'position': 'fixed',
|
||||
@@ -38,10 +43,10 @@
|
||||
})
|
||||
}
|
||||
$('.btn-close').on ('click', function() {
|
||||
$('.navbar').css("top", '0')
|
||||
navbar.css("top", '0')
|
||||
$('.block-header, .addorder-pages').css('margin-top', '')
|
||||
$('.page-header, .m-top-100').css('margin-top', '')
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -48,31 +48,31 @@
|
||||
<table width="100%">
|
||||
<% @total_amount_by_account.each do |amount| %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<td style="text-align: right;"> Total <%= amount.account_name %> Amount</td>
|
||||
<td><%= amount.total_price.round(2) %></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Net Sales</th>
|
||||
<th><%=@shift.nett_sales %></th>
|
||||
</tr>
|
||||
|
||||
<% @total_discount_by_account.each do |amount| %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<td style="text-align: right;"> Total <%= amount.account_name %> Discount</td>
|
||||
<td><%= amount.total_price.round(2) %></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
|
||||
<% if !@total_member_discount[0].member_discount.nil?
|
||||
@member_discount = @total_member_discount[0].member_discount rescue 0.0
|
||||
@member_discount = @total_member_discount[0].member_discount rescue 0.0
|
||||
@overall = @shift.total_discounts - @member_discount
|
||||
%>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Member Discount</th>
|
||||
<th><%= @member_discount %></th>
|
||||
</tr>
|
||||
@@ -80,35 +80,35 @@
|
||||
|
||||
<%end%>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Overall Discount</th>
|
||||
<th><%= @overall %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Discount</th>
|
||||
<th><%= @shift.total_discounts %></th>
|
||||
</tr>
|
||||
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<td style="text-align: right;"> <%= tax.tax_name %> </td>
|
||||
<td><%= tax.st_amount.round(2) %></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Tax </th>
|
||||
<th><%=@shift.total_taxes %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Rounding Adj </th>
|
||||
<th><%= @shift.total_rounding.round(2) %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Grand Total </th>
|
||||
<th><%= @shift.grand_total.round(2) %></th>
|
||||
</tr>
|
||||
@@ -134,36 +134,14 @@
|
||||
<th style="text-align: right;">Other Payment Detail </th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">MPU Payment </td>
|
||||
<td><%=other.mpu_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.mpu_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">VISA Payment </td>
|
||||
<td><%=other.visa_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.visa_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">Master Payment </td>
|
||||
<td><%=other.master_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.jcb_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">JCB Payment </td>
|
||||
<td><%=other.jcb_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.master_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">Reedem Payment </td>
|
||||
<td><%=other.paypar_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.paypar_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<% @payment_methods.each do |method| %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;"><%= method.upcase %> Payment </td>
|
||||
<td><%=other[method.parameterize.to_sym].round(2) rescue '-' %></td>
|
||||
<% @total_amount = @total_amount+other[method.parameterize.to_sym] rescue 0.0 %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;"><strong>FOC </strong></td>
|
||||
|
||||
Reference in New Issue
Block a user