change query for transactions/order and transactions/bookings, transactions/credit

This commit is contained in:
phyusin
2017-11-27 18:16:46 +06:30
parent 9ad9e9ae57
commit ad34002789
8 changed files with 19 additions and 21 deletions

View File

@@ -14,7 +14,8 @@ class Transactions::CreditNotesController < ApplicationController
to = params[:to]
if filter.nil? && from.nil? && to.nil? && customer.nil?
@credit_notes = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
@credit_notes = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
@credit_notes = Kaminari.paginate_array(@credit_notes).page(params[:page]).per(20)
else
sale = Sale.search_credit_sales(customer,filter,from,to)
if sale.count > 0