payment method changed in report

This commit is contained in:
yarzar_code
2020-07-09 14:46:18 +06:30
parent 8f5ea9417d
commit 3d2d18a330
26 changed files with 1836 additions and 1976 deletions

View File

@@ -4,14 +4,13 @@ class Transactions::ShiftSalesController < ApplicationController
before_action :check_user
def index
filter = params[:filter]
from = params[:from]
to = params[:to]
if filter.nil? && from.nil? && to.nil?
@shift_sales = ShiftSale.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)
@@ -33,22 +32,20 @@ class Transactions::ShiftSalesController < ApplicationController
# GET /transactions/shift_sales/1
# GET /transactions/shift_sales/1.json
def show
@shift = ShiftSale.find(params[:id])
#get tax
shift_obj = ShiftSale.where('id =?',@shift.id)
@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)
@other_payment = ShiftSale.get_by_shift_other_payment(@shift).first
@payment_methods = PaymentMethodSetting.where(is_active: true).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
format.json { render json: @shift }