update report detail ,close_cashire_pdf and view reports

This commit is contained in:
Aung Myo
2017-07-21 09:57:22 +06:30
parent 3792133aad
commit a0edef735d
20 changed files with 150 additions and 232 deletions

View File

@@ -30,12 +30,20 @@ class Origami::ShiftsController < BaseOrigamiController
unique_code = "CloseCashierPdf"
shop_details = Shop.find(1)
#get tax
shift_obj = ShiftSale.where('id =?',@shift.id)
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
puts @sale_taxes.to_a
puts @sale_taxes
puts @sale_taxes.to_json
puts "taxxxxxxxxxxxx"
# get printer info
print_settings=PrintSetting.find_by_unique_code(unique_code)
printer = Printer::CashierStationPrinter.new(print_settings)
printer.print_close_cashier(print_settings,@shift,shop_details)
printer.print_close_cashier(print_settings,@shift,shop_details,@sale_taxes)
end

View File

@@ -2,9 +2,11 @@ class Reports::DailysaleController < BaseReportController
authorize_resource :class => false
def index
from, to ,report_type = get_date_range_from_params
from, to = get_date_range_from_params
@sale_data = Sale.daily_sales_list(from,to)
@tax = SaleTax.get_tax(from,to)
@from = from
@to = to
respond_to do |format|
format.html

View File

@@ -17,7 +17,12 @@ authorize_resource :class => false
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',shift_sale.shift_started_at, shift_sale.shift_closed_at)
end
end
@sale_data = Sale.get_shift_sales_by_receipt_no(@shift_sale_range,@shift,from,to, params[:payment_type])
payment_type = params[:payment_type]
@sale_data = Sale.get_shift_sales_by_receipt_no(@shift_sale_range,@shift,from,to,payment_type)
@sale_taxes = Sale.get_separate_tax(@shift,from,to,payment_type)
@from = from
@to = to
if @shift.present?
@shift.each do |sh|

View File

@@ -29,6 +29,8 @@ class Reports::SaleitemController < BaseReportController
@totalByAccount = Hash.new {|hash, key| hash[key] = 0}
@sale_data.each {|acc| @totalByAccount[acc.account_id] += acc.grand_total}
@from = from
@to = to
if shift.present?
shift.each do |sh|

View File

@@ -9,6 +9,14 @@ class Reports::ShiftsaleController < BaseReportController
@shift = ShiftSale.find(params[:shift_name])
end
@sale_data = Sale.get_by_shiftsales(from,to,@shift)
@from = from
@to = to
if @shift.present?
@shift_from = @shift.shift_started_at.nil? ? '-' : @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_to = @shift.shift_closed_at.nil? ? '-' : @shift.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
@shift_data = @shift
end
respond_to do |format|
format.html