check tax error, filter for credit payment report and add query for sale payment in receipt no detail
This commit is contained in:
@@ -60,7 +60,7 @@ class Origami::HomeController < BaseOrigamiController
|
||||
accounts = @customer.tax_profiles
|
||||
@account_arr =[]
|
||||
accounts.each do |acc|
|
||||
account = TaxProfile.find(acc)
|
||||
account = TaxProfile.find_by_id(acc)
|
||||
if !account.nil?
|
||||
@account_arr.push(account)
|
||||
end
|
||||
@@ -85,7 +85,7 @@ class Origami::HomeController < BaseOrigamiController
|
||||
accounts = @customer.tax_profiles
|
||||
@account_arr =[]
|
||||
accounts.each do |acc|
|
||||
account = TaxProfile.find(acc)
|
||||
account = TaxProfile.find_by_id(acc)
|
||||
if !account.nil?
|
||||
@account_arr.push(account)
|
||||
end
|
||||
|
||||
@@ -60,7 +60,7 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
accounts = @customer.tax_profiles
|
||||
@account_arr =[]
|
||||
accounts.each do |acc|
|
||||
account = TaxProfile.find(acc)
|
||||
account = TaxProfile.find_by_id(acc)
|
||||
if !account.nil?
|
||||
@account_arr.push(account)
|
||||
end
|
||||
@@ -85,7 +85,7 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
accounts = @customer.tax_profiles
|
||||
@account_arr =[]
|
||||
accounts.each do |acc|
|
||||
account = TaxProfile.find(acc)
|
||||
account = TaxProfile.find_by_id(acc)
|
||||
if !account.nil?
|
||||
@account_arr.push(account)
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ authorize_resource :class => false
|
||||
@filter_for_credit = [['All',''],['Paid','paid'],['Unpaid','unpaid']]
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
@shift_sale_range = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
@shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
|
||||
@shift = ''
|
||||
if params[:shift_name].to_i != 0
|
||||
@@ -42,7 +42,7 @@ authorize_resource :class => false
|
||||
def show
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
@sale_data = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
@sale_data = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
|
||||
date_arr = Array.new
|
||||
@sale_data.each do |sale|
|
||||
|
||||
@@ -1926,7 +1926,7 @@ end
|
||||
query.select("(CASE WHEN sp.payment_method='cash' THEN (SUM(sp.payment_amount) - SUM(sales.amount_changed)) ELSE SUM(sp.payment_amount) END) as payment_amount").first()
|
||||
end
|
||||
else
|
||||
if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor'
|
||||
if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account'
|
||||
if !from_time.nil? && !to_time.nil?
|
||||
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
|
||||
if payment_method == 'card'
|
||||
|
||||
@@ -127,14 +127,14 @@
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% if result.sale_payments.count > 0%>
|
||||
<% result.sale_payments.each do |rec| %>
|
||||
<% sale_payments = SalePayment.get_sale_payments(result) %>
|
||||
<% if sale_payments.length > 0%>
|
||||
<% sale_payments.each do |rec| %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>Payment <%= rec.payment_method.upcase %></td>
|
||||
<td><%= rec.payment_amount %> ( <%= result.payment_status %> )</td>
|
||||
<td><%= rec.payment_amount %> ( <%= rec.payment_status %> )</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -119,8 +119,9 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% if result.sale_payments.count > 0%>
|
||||
<% result.sale_payments.each do |rec| %>
|
||||
<% sale_payments = SalePayment.get_sale_payments(result) %>
|
||||
<% if sale_payments.length > 0%>
|
||||
<% sale_payments.each do |rec| %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
|
||||
Reference in New Issue
Block a user