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

@ -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';