close #420 Fixed: Reports - Income Summary - Paid Tab - Not adding income categories

This commit is contained in:
cuneytsenturk 2018-07-19 14:54:23 +03:00
parent 5a4bed7e04
commit 4c497c3f60
5 changed files with 30 additions and 0 deletions

View File

@ -101,6 +101,12 @@ class ExpenseSummary extends Controller
private function setAmount(&$graph, &$totals, &$expenses, $items, $type, $date_field)
{
foreach ($items as $item) {
if ($item['table'] == 'bill_payments') {
$bill = $item->bill;
$item->category_id = $bill->category_id;
}
$date = Date::parse($item->$date_field)->format('F');
if (!isset($expenses[$item->category_id])) {

View File

@ -138,6 +138,12 @@ class IncomeExpenseSummary extends Controller
private function setAmount(&$graph, &$totals, &$compares, $items, $type, $date_field)
{
foreach ($items as $item) {
if ($item['table'] == 'bill_payments' || $item['table'] == 'invoice_payments') {
$type_item = $item->$type;
$item->category_id = $type_item->category_id;
}
$date = Date::parse($item->$date_field)->format('F');
$group = (($type == 'invoice') || ($type == 'revenue')) ? 'income' : 'expense';

View File

@ -101,6 +101,12 @@ class IncomeSummary extends Controller
private function setAmount(&$graph, &$totals, &$incomes, $items, $type, $date_field)
{
foreach ($items as $item) {
if ($item['table'] == 'invoice_payments') {
$invoice = $item->invoice;
$item->category_id = $invoice->category_id;
}
$date = Date::parse($item->$date_field)->format('F');
if (!isset($incomes[$item->category_id])) {

View File

@ -155,6 +155,12 @@ class ProfitLoss extends Controller
private function setAmount(&$totals, &$compares, $items, $type, $date_field)
{
foreach ($items as $item) {
if ($item['table'] == 'bill_payments' || $item['table'] == 'invoice_payments') {
$type_item = $item->$type;
$item->category_id = $type_item->category_id;
}
$date = Date::parse($item->$date_field)->quarter;
$group = (($type == 'invoice') || ($type == 'revenue')) ? 'income' : 'expense';

View File

@ -103,6 +103,12 @@ class TaxSummary extends Controller
private function setAmount(&$items, &$totals, $rows, $type, $date_field)
{
foreach ($rows as $row) {
if ($row['table'] == 'bill_payments' || $row['table'] == 'invoice_payments') {
$type_row = $row->$type;
$row->category_id = $type_row->category_id;
}
$date = Date::parse($row->$date_field)->format('M');
if ($date_field == 'paid_at') {