fix
This commit is contained in:
@@ -427,7 +427,7 @@ class Sale < ApplicationRecord
|
|||||||
SUM(case when (sale_payments.payment_method='jcb') then sale_payments.payment_amount else 0 end) as jcb_amount,
|
SUM(case when (sale_payments.payment_method='jcb') then sale_payments.payment_amount else 0 end) as jcb_amount,
|
||||||
SUM(case when (sale_payments.payment_method='paypar') then sale_payments.payment_amount else 0 end) as paypar_amount,
|
SUM(case when (sale_payments.payment_method='paypar') then sale_payments.payment_amount else 0 end) as paypar_amount,
|
||||||
SUM(case when (sale_payments.payment_method='cash') then sale_payments.payment_amount else 0 end) as cash_amount,
|
SUM(case when (sale_payments.payment_method='cash') then sale_payments.payment_amount else 0 end) as cash_amount,
|
||||||
SUM(case when (sale_payments.payment_method='credit') then sale_payments.payment_amount else 0 end) as credit_amount,
|
SUM(case when (sale_payments.payment_method='creditnote') then sale_payments.payment_amount else 0 end) as credit_amount,
|
||||||
SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount")
|
SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount")
|
||||||
.joins("join (select * from sale_payments group by sale_payments.sale_id, sale_payments.payment_method) sale_payments on sale_payments.sale_id = sales.sale_id")
|
.joins("join (select * from sale_payments group by sale_payments.sale_id, sale_payments.payment_method) sale_payments on sale_payments.sale_id = sales.sale_id")
|
||||||
.where("sale_status = ? AND sales.receipt_date between ? and ? AND total_amount != 0", 'completed', from, to)
|
.where("sale_status = ? AND sales.receipt_date between ? and ? AND total_amount != 0", 'completed', from, to)
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
<td><%= result.cashier_name rescue '-' %></td>
|
<td><%= result.cashier_name rescue '-' %></td>
|
||||||
<td><%= result.total_amount rescue '-' %></td>
|
<td><%= result.total_amount rescue '-' %></td>
|
||||||
<td><%= result.total_discount rescue '-' %></td>
|
<td><%= result.total_discount rescue '-' %></td>
|
||||||
<td><%= sprintf "%.2f",result.total_tax rescue '-' %></td>
|
<td><%= result.total_tax rescue '-' %></td>
|
||||||
|
|
||||||
|
|
||||||
<td><%= result.grand_total %></td>
|
<td><%= result.grand_total %></td>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="<%= dashboard_path %>">Home</a></li>
|
<li><a href="<%= dashboard_path %>">Home</a></li>
|
||||||
<li>Daily Sale Report</li>
|
<li>Sale Item Report</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user