fixed payment methods & license
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -43,6 +43,7 @@ pickle-email-*.html
|
|||||||
/config/initializers/*
|
/config/initializers/*
|
||||||
config/deploy/config/*
|
config/deploy/config/*
|
||||||
#config/puma.rb
|
#config/puma.rb
|
||||||
|
config/license.yml
|
||||||
|
|
||||||
config/shops.json
|
config/shops.json
|
||||||
!/log/.keep
|
!/log/.keep
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ GEM
|
|||||||
concurrent-ruby (1.1.5)
|
concurrent-ruby (1.1.5)
|
||||||
connection_pool (2.2.2)
|
connection_pool (2.2.2)
|
||||||
crass (1.0.5)
|
crass (1.0.5)
|
||||||
|
cups (0.0.7)
|
||||||
database_cleaner (1.7.0)
|
database_cleaner (1.7.0)
|
||||||
diff-lcs (1.3)
|
diff-lcs (1.3)
|
||||||
erubi (1.9.0)
|
erubi (1.9.0)
|
||||||
@@ -334,6 +335,7 @@ DEPENDENCIES
|
|||||||
carrierwave (~> 1.0)
|
carrierwave (~> 1.0)
|
||||||
chartkick
|
chartkick
|
||||||
coffee-rails (~> 4.2)
|
coffee-rails (~> 4.2)
|
||||||
|
cups (~> 0.0.7)
|
||||||
database_cleaner
|
database_cleaner
|
||||||
factory_girl_rails (~> 4.0)
|
factory_girl_rails (~> 4.0)
|
||||||
faker
|
faker
|
||||||
@@ -382,4 +384,4 @@ RUBY VERSION
|
|||||||
ruby 2.6.5p114
|
ruby 2.6.5p114
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.0.2
|
2.1.4
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
|
||||||
border: none;
|
border: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
/*top: 0;*/
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 12;
|
z-index: 12;
|
||||||
width: 100%; }
|
width: 100%; }
|
||||||
@@ -6649,7 +6649,7 @@ fieldset[disabled] .form-control {
|
|||||||
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
|
||||||
border: none;
|
border: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
/*top: 0;*/
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 12;
|
z-index: 12;
|
||||||
width: 100%; }
|
width: 100%; }
|
||||||
|
|||||||
@@ -108,8 +108,6 @@ class HomeController < ApplicationController
|
|||||||
@hourly_sales = Sale.hourly_sales(current_user,@from,@to)
|
@hourly_sales = Sale.hourly_sales(current_user,@from,@to)
|
||||||
# .group_by_hour(:created_at, :time_zone => 'Asia/Rangoon',format: '%I:%p')
|
# .group_by_hour(:created_at, :time_zone => 'Asia/Rangoon',format: '%I:%p')
|
||||||
# .sum(:grand_total)
|
# .sum(:grand_total)
|
||||||
logger.debug 'hourly_sales<>><><><<<<<<>><<<><><><><><><><><><<>><'
|
|
||||||
logger.debug @hourly_sales.to_json
|
|
||||||
employee_sales = Sale.employee_sales(current_user,@from,@to)
|
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)")
|
# .sum("(CASE WHEN sp.payment_method='cash' THEN ((sp.payment_amount) - (sales.amount_changed)) ELSE (sp.payment_amount) END)")
|
||||||
@employee_sales = []
|
@employee_sales = []
|
||||||
|
|||||||
@@ -10,10 +10,7 @@ class Origami::WasteSpoileController < BaseOrigamiController
|
|||||||
SaleTax.where("sale_id='#{sale_id}'").find_each do |existing_tax|
|
SaleTax.where("sale_id='#{sale_id}'").find_each do |existing_tax|
|
||||||
existing_tax.delete
|
existing_tax.delete
|
||||||
end
|
end
|
||||||
sale.update_attributes(total_discount: 0,total_tax: 0,grand_total: sale.total_amount,rounding_adjustment:0)
|
sale.update_attributes(total_discount: 0, total_tax: 0, grand_total: sale.total_amount, rounding_adjustment:0, payment_status: remark, sale_status: remark)
|
||||||
sale.payment_status = remark
|
|
||||||
sale.sale_status = remark
|
|
||||||
sale.save
|
|
||||||
|
|
||||||
# add to sale item with foc
|
# add to sale item with foc
|
||||||
# sale_items = SaleItem.where("sale_id='#{ sale_id }' and status is null")
|
# 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")
|
@payment_methods = PaymentMethodSetting.where("is_active='1'").pluck("payment_method")
|
||||||
|
|
||||||
@payments = [["All Payment",''],["Cash Payment","cash"], ["Credit Payment","creditnote"],
|
@payments = [["All",''], ["Cash","cash"], ["Card", "card"], ["Credit","creditnote"],
|
||||||
["FOC Payment","foc"]]
|
["FOC","foc"]] + PaymentMethodSetting.pluck(:payment_method).map { |payment_method| [payment_method, payment_method.parameterize] }
|
||||||
|
|
||||||
@payment_methods.each do |m|
|
# @payment_methods.each do |m|
|
||||||
@payments.push(["#{m} Payment", m.parameterize])
|
# @payments.push(["#{m} Payment", m.parameterize])
|
||||||
end
|
# end
|
||||||
|
|
||||||
from, to = get_date_range_from_params
|
from, to = get_date_range_from_params
|
||||||
|
|
||||||
|
|||||||
@@ -1,46 +1,46 @@
|
|||||||
class Reports::ReceiptNoDetailController < BaseReportController
|
class Reports::ReceiptNoDetailController < BaseReportController
|
||||||
authorize_resource :class => false
|
authorize_resource :class => false
|
||||||
def index
|
def index
|
||||||
@payments = [["All Payment",''], ["Cash Payment","cash"], ["Credit Payment","creditnote"], ["FOC Payment","foc"]]
|
@payment_methods = [["All", ''], ["Cash", "cash"], ["Card", "card"], ["Credit", "creditnote"], ["FOC", "foc"]] + PaymentMethodSetting.pluck(:payment_method).map { |payment_method| [payment_method, payment_method.parameterize] }
|
||||||
@payment_method = PaymentMethodSetting.all
|
|
||||||
from, to = get_date_range_from_params
|
from, to = get_date_range_from_params
|
||||||
|
|
||||||
@shift_sale_range = ''
|
@shift_sale_range = ''
|
||||||
|
|
||||||
@shift = ''
|
@shift = ''
|
||||||
if params[:shift_name].to_i != 0
|
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_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||||
|
|
||||||
@shift_sale = ShiftSale.find(params[:shift_name])
|
@shift_sale = ShiftSale.find(params[:shift_name])
|
||||||
if to.blank?
|
if to.blank?
|
||||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',@shift_sale.shift_started_at)
|
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',@shift_sale.shift_started_at)
|
||||||
else
|
else
|
||||||
if @shift_sale.shift_closed_at.blank?
|
if @shift_sale.shift_closed_at.blank?
|
||||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL',@shift_sale.shift_started_at)
|
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL',@shift_sale.shift_started_at)
|
||||||
else
|
else
|
||||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',@shift_sale.shift_started_at, @shift_sale.shift_closed_at)
|
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',@shift_sale.shift_started_at, @shift_sale.shift_closed_at)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
payment_type = params[: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)
|
@sale_data = Sale.get_shift_sales_by_receipt_no_detail(@shift_sale_range,@shift,from,to,payment_type)
|
||||||
|
|
||||||
@from = from
|
@from = from
|
||||||
@to = to
|
@to = to
|
||||||
# get printer info
|
# get printer info
|
||||||
@print_settings = PrintSetting.get_precision_delimiter()
|
@print_settings = PrintSetting.get_precision_delimiter()
|
||||||
if @shift.present?
|
if @shift.present?
|
||||||
@shift.each do |sh|
|
@shift.each do |sh|
|
||||||
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
@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_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||||
@shift_data = sh
|
@shift_data = sh
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.xls
|
format.xls
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class Transactions::ShiftSalesController < ApplicationController
|
|||||||
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
|
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
|
||||||
#other payment details for mpu or visa like card
|
#other payment details for mpu or visa like card
|
||||||
@other_payment = ShiftSale.get_by_shift_other_payment(@shift)
|
@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
|
# Calculate price_by_accounts
|
||||||
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
@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_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
||||||
|
|||||||
@@ -1200,11 +1200,21 @@ def self.get_shift_sales_by_receipt_no_detail(shift_sale_range,shift,from,to,pay
|
|||||||
.includes(:bookings => :dining_facility)
|
.includes(:bookings => :dining_facility)
|
||||||
.select("sales.*, SUM(sale_payments.payment_amount) AS payments_for_credits_amount")
|
.select("sales.*, SUM(sale_payments.payment_amount) AS payments_for_credits_amount")
|
||||||
.joins(:bookings)
|
.joins(:bookings)
|
||||||
|
.joins("INNER JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||||
.left_joins(:payments_for_credits)
|
.left_joins(:payments_for_credits)
|
||||||
.completed
|
.completed
|
||||||
.where.not(total_amount: 0)
|
.where.not(total_amount: 0)
|
||||||
.group(:sale_id)
|
.group(:sale_id)
|
||||||
.order(:receipt_date)
|
.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?
|
if shift.present?
|
||||||
query = query.where("sales.shift_sale_id in (?)", shift.to_a)
|
query = query.where("sales.shift_sale_id in (?)", shift.to_a)
|
||||||
elsif shift_sale_range.present?
|
elsif shift_sale_range.present?
|
||||||
@@ -1363,7 +1373,11 @@ def self.get_payment_method_by_shift(shift,from,to,payment_type)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if payment_type.present?
|
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
|
end
|
||||||
|
|
||||||
return payments_total, sale_payment
|
return payments_total, sale_payment
|
||||||
@@ -1577,11 +1591,10 @@ end
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.total_payment_methods(current_user=nil,from=nil,to=nil)
|
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(sanitize_sql_array(["CASE WHEN sp.payment_method IN (?) THEN 'card' ELSE sp.payment_method END as payment_method", SalePayment::CARD]))
|
||||||
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")
|
|
||||||
.where("sales.sale_status = 'completed'")
|
.where("sales.sale_status = 'completed'")
|
||||||
.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
.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?)
|
if (!from.nil? && !to.nil?)
|
||||||
query = query.receipt_date_between(from, to)
|
query = query.receipt_date_between(from, to)
|
||||||
@@ -2293,7 +2306,7 @@ private
|
|||||||
self.total_tax = self.total_tax.round(precision)
|
self.total_tax = self.total_tax.round(precision)
|
||||||
end
|
end
|
||||||
self.grand_total = (self.total_amount - self.total_discount) + self.total_tax
|
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
|
adjust_rounding
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
class SalePayment < ApplicationRecord
|
class SalePayment < ApplicationRecord
|
||||||
|
|
||||||
|
CARD = ['mpu', 'visa', 'master', 'jcb', 'unionpay']
|
||||||
|
|
||||||
self.primary_key = "sale_payment_id"
|
self.primary_key = "sale_payment_id"
|
||||||
|
|
||||||
#primary key - need to be unique generated for multiple shops
|
#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
|
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 :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)
|
def self.sync_sale_payment_records(sale_payments)
|
||||||
if !sale_payments.nil?
|
if !sale_payments.nil?
|
||||||
|
|||||||
@@ -209,30 +209,36 @@
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<% if !(@total_payment_methods.nil?) %>
|
<% if !(@total_payment_methods.nil?) %>
|
||||||
<% @total_payment_methods.each do |payment| %>
|
<% @total_payment_methods.each do |payment| %>
|
||||||
<% if payment.payment_method != 'card' %>
|
<% if !@sale_data[0].empty? %>
|
||||||
<tr>
|
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
|
||||||
|
<tr>
|
||||||
<% if payment.payment_method == 'paypar' %>
|
<% if payment.payment_method == 'paypar' %>
|
||||||
<td>Redeem Sale : </td>
|
<td>Redeem Sale : </td>
|
||||||
<% else %>
|
<% else %>
|
||||||
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td align="right">
|
<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) %>
|
<% @sale_data.each do |data| %>
|
||||||
</td>
|
<% pay_mth = payment.payment_method %>
|
||||||
</tr>
|
<%= data[""+pay_mth+""] %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% total_card = @sale_data.find {|x| x.key?("card") } %>
|
<% total_card = @sale_data.select { |hash| hash["card"]!=nil } %>
|
||||||
<% if !total_card.nil? %>
|
<% if !total_card.nil? %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<%= number_format(total_card["card"], precision: precision.to_i ,delimiter: delimiter) rescue number_format(0, precision: precision.to_i ,delimiter: delimiter) %>
|
<% total_other_amt = 0 %>
|
||||||
</td>
|
<% @sale_data.map { |k,v| k.map{|meth,amt| meth != 'cash' && meth != 'foc' && meth != 'creditnote' ? total_other_amt += amt : meth }} %>
|
||||||
</tr>
|
<%= total_other_amt %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<p>Please wait...</p>
|
<p>Please wait...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%= render 'shared/license_expire_warning' %>
|
<%= render 'shared/license_expire_warning' if Rails.env.production? %>
|
||||||
<!-- #END# Page Loader -->
|
<!-- #END# Page Loader -->
|
||||||
<!-- Overlay For Sidebars -->
|
<!-- Overlay For Sidebars -->
|
||||||
<div class="overlay"></div>
|
<div class="overlay"></div>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<p>Please wait...</p>
|
<p>Please wait...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%= render 'shared/license_expire_warning' %>
|
<%= render 'shared/license_expire_warning' if Rails.env.production? %>
|
||||||
<!-- #END# Page Loader -->
|
<!-- #END# Page Loader -->
|
||||||
<!-- Overlay For Sidebars -->
|
<!-- Overlay For Sidebars -->
|
||||||
<div class="overlay"></div>
|
<div class="overlay"></div>
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
<p>Please wait...</p>
|
<p>Please wait...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%= render 'shared/license_expire_warning' %>
|
|
||||||
|
<%= render 'shared/license_expire_warning' if Rails.env.production? %>
|
||||||
<!-- #END# Page Loader -->
|
<!-- #END# Page Loader -->
|
||||||
<!-- Overlay For Sidebars -->
|
<!-- Overlay For Sidebars -->
|
||||||
<div class="overlay"></div>
|
<div class="overlay"></div>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<p>Please wait...</p>
|
<p>Please wait...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%= render 'shared/license_expire_warning' %>
|
<%= render 'shared/license_expire_warning' if Rails.env.production? %>
|
||||||
<!-- #END# Page Loader -->
|
<!-- #END# Page Loader -->
|
||||||
<!-- Overlay For Sidebars -->
|
<!-- Overlay For Sidebars -->
|
||||||
<div class="overlay"></div>
|
<div class="overlay"></div>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<p>Please wait...</p>
|
<p>Please wait...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%= render 'shared/license_expire_warning' %>
|
<%= render 'shared/license_expire_warning' if Rails.env.production? %>
|
||||||
<!-- #END# Page Loader -->
|
<!-- #END# Page Loader -->
|
||||||
<!-- Overlay For Sidebars -->
|
<!-- Overlay For Sidebars -->
|
||||||
<div class="overlay"></div>
|
<div class="overlay"></div>
|
||||||
@@ -64,4 +64,3 @@
|
|||||||
<%= yield %>
|
<%= yield %>
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
@@ -116,12 +116,14 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% 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? %>
|
<% if !total_card.nil? %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
||||||
<td align="right">
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -18,17 +18,14 @@
|
|||||||
<option value="9">Last year</option>
|
<option value="9">Last year</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<% if defined? payments %>
|
<% if defined? @payment_methods %>
|
||||||
|
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
<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>
|
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||||
|
|
||||||
<select name="payment_type" id="payment_type" class="form-control">
|
<select name="payment_type" id="payment_type" class="form-control">
|
||||||
<% @payments.each do |pm| %>
|
<% @payment_methods.each do |pm| %>
|
||||||
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
|
<option 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>
|
|
||||||
<%end %>
|
<%end %>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
<% @sale_data.each do |sale| %>
|
<% @sale_data.each do |sale| %>
|
||||||
<% if !sale.item_instance_code.nil?%>
|
<% if !sale.item_instance_code.nil?%>
|
||||||
<% waste_and_spoil_item_count += sale.qty.to_i %>
|
<% waste_and_spoil_item_count += sale.qty.to_i %>
|
||||||
<% grand_total += sale.grand_total.to_i %>
|
<% grand_total += sale.price.to_i %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<tr>
|
<tr>
|
||||||
<% if !menu_cat_arr.include?(sale.name) %>
|
<% if !menu_cat_arr.include?(sale.name) %>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
<% if license_status == 0 || license_status == 2 %>
|
<% if license_status == 0 || license_status == 2 %>
|
||||||
<div class="alert alert-danger fade show text-center" role="alert">
|
<div id="license-alert" class="alert alert-danger fade show text-center" role="alert">
|
||||||
<strong style="margin-left: 40px !important"><%= text %></strong>
|
<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"%>
|
<%= 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;">
|
<button type="button" class="close btn-close" data-dismiss="alert" aria-label="Close" style="padding-top: 5px;">
|
||||||
@@ -22,14 +22,19 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
divLicnese = $('#license-alert');
|
||||||
|
navbar = $('.navbar');
|
||||||
|
leftsidebar = $('#leftsidebar');
|
||||||
if (<%= license_status %> == 1) {
|
if (<%= license_status %> == 1) {
|
||||||
$('.navbar').css("top", 0)
|
navbar.css("top", 0);
|
||||||
$('section.content').css('margin-top', '0 !important')
|
leftsidebar.css("top", 0);
|
||||||
|
$('section.content').css('margin-top', '0 !important');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('.navbar').css("top", '45px')
|
navbar.css("top", divLicnese.outerHeight() + 'px');
|
||||||
$('.block-header, .addorder-pages').css('margin-top', '115px')
|
leftsidebar.css("top", navbar.outerHeight() + divLicnese.outerHeight() + 'px');
|
||||||
$('.page-header, .m-top-100').css('margin-top', '100px')
|
$('.block-header, .addorder-pages').css('margin-top', '115px');
|
||||||
|
$('.page-header, .m-top-100').css('margin-top', '100px');
|
||||||
$('.alert-danger').css({
|
$('.alert-danger').css({
|
||||||
'top': 0,
|
'top': 0,
|
||||||
'position': 'fixed',
|
'position': 'fixed',
|
||||||
@@ -38,7 +43,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
$('.btn-close').on ('click', function() {
|
$('.btn-close').on ('click', function() {
|
||||||
$('.navbar').css("top", '0')
|
navbar.css("top", '0')
|
||||||
$('.block-header, .addorder-pages').css('margin-top', '')
|
$('.block-header, .addorder-pages').css('margin-top', '')
|
||||||
$('.page-header, .m-top-100').css('margin-top', '')
|
$('.page-header, .m-top-100').css('margin-top', '')
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -134,36 +134,14 @@
|
|||||||
<th style="text-align: right;">Other Payment Detail </th>
|
<th style="text-align: right;">Other Payment Detail </th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<% @payment_methods.each do |method| %>
|
||||||
<th></th>
|
<tr>
|
||||||
<td style="text-align: right;">MPU Payment </td>
|
<th></th>
|
||||||
<td><%=other.mpu_amount.round(2) rescue 0.0 %></td>
|
<td style="text-align: right;"><%= method.upcase %> Payment </td>
|
||||||
<% @total_amount = @total_amount+other.mpu_amount rescue 0.0 %>
|
<td><%=other[method.parameterize.to_sym].round(2) rescue '-' %></td>
|
||||||
</tr>
|
<% @total_amount = @total_amount+other[method.parameterize.to_sym] rescue 0.0 %>
|
||||||
<tr>
|
</tr>
|
||||||
<th></th>
|
<% end %>
|
||||||
<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>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<td style="text-align: right;"><strong>FOC </strong></td>
|
<td style="text-align: right;"><strong>FOC </strong></td>
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
localhost:
|
|
||||||
iv_key: 03TLQUDDVSOPa/lEEHqhVw==
|
|
||||||
shop_name: scdemo3
|
|
||||||
email: hanwintun@code2lab.com
|
|
||||||
telephone: ''
|
|
||||||
fax: ''
|
|
||||||
address: ''
|
|
||||||
dbhost: gG0jQLrVX6l0dZaA5wVP9bNTrfgzotwAcjcFKQmM9WUQ5121pkwg+9mYh5XDrIwL4//1UNjRR6CNZPorBMGtAw==
|
|
||||||
dbschema: M9ddWoBb89JN51Ld1r7vTw==
|
|
||||||
dbusername: 8Lc2lKIyJld/xfG6+ZxcOw==
|
|
||||||
dbpassword: "+EhtSe5kJuVKp+wFMRlmoA=="
|
|
||||||
api_token: UQFLAbMvJxUCnDVCOhIdqYZEGRqVQMvI
|
|
||||||
app_token: DvRXGlomaBFpGVLYsidekVVZyqosntouTA
|
|
||||||
plan_sku: 2NY6p1HAlR7UqE8AsBEytg==
|
|
||||||
renewable_date: vlKVqrJyCB6LxXTkv63COg==
|
|
||||||
plan_name: 6NSPpVHcwHBoFZPcVNjkvD6F5quXIWVaWieCRzpspbE=
|
|
||||||
Reference in New Issue
Block a user