fixed #719
This commit is contained in:
parent
ef86989367
commit
bc86edf4a6
@ -157,8 +157,7 @@ class ExpenseSummary extends Controller
|
||||
private function setAmount(&$graph, &$totals, &$expenses, $items, $type, $date_field)
|
||||
{
|
||||
foreach ($items as $item) {
|
||||
switch ($item->getTable()) {
|
||||
case 'bill_payments':
|
||||
if ($item->getTable() == 'bill_payments') {
|
||||
$bill = $item->bill;
|
||||
|
||||
if ($vendors = request('vendors')) {
|
||||
@ -168,8 +167,9 @@ class ExpenseSummary extends Controller
|
||||
}
|
||||
|
||||
$item->category_id = $bill->category_id;
|
||||
break;
|
||||
case 'bills':
|
||||
}
|
||||
|
||||
if ($item->getTable() == 'bills') {
|
||||
if ($accounts = request('accounts')) {
|
||||
foreach ($item->payments as $payment) {
|
||||
if (!in_array($payment->account_id, $accounts)) {
|
||||
@ -177,7 +177,6 @@ class ExpenseSummary extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$month = Date::parse($item->$date_field)->format('F');
|
||||
|
@ -202,14 +202,13 @@ class IncomeExpenseSummary extends Controller
|
||||
private function setAmount(&$graph, &$totals, &$compares, $items, $type, $date_field)
|
||||
{
|
||||
foreach ($items as $item) {
|
||||
if ($item->getTable() == 'bill_payments' || $item->getTable() == 'invoice_payments') {
|
||||
if (($item->getTable() == 'bill_payments') || ($item->getTable() == 'invoice_payments')) {
|
||||
$type_item = $item->$type;
|
||||
|
||||
$item->category_id = $type_item->category_id;
|
||||
}
|
||||
|
||||
switch ($item->getTable()) {
|
||||
case 'invoice_payments':
|
||||
if ($item->getTable() == 'invoice_payments') {
|
||||
$invoice = $item->invoice;
|
||||
|
||||
if ($customers = request('customers')) {
|
||||
@ -219,8 +218,9 @@ class IncomeExpenseSummary extends Controller
|
||||
}
|
||||
|
||||
$item->category_id = $invoice->category_id;
|
||||
break;
|
||||
case 'bill_payments':
|
||||
}
|
||||
|
||||
if ($item->getTable() == 'bill_payments') {
|
||||
$bill = $item->bill;
|
||||
|
||||
if ($vendors = request('vendors')) {
|
||||
@ -230,9 +230,9 @@ class IncomeExpenseSummary extends Controller
|
||||
}
|
||||
|
||||
$item->category_id = $bill->category_id;
|
||||
break;
|
||||
case 'invoices':
|
||||
case 'bills':
|
||||
}
|
||||
|
||||
if (($item->getTable() == 'invoices') || ($item->getTable() == 'bills')) {
|
||||
if ($accounts = request('accounts')) {
|
||||
foreach ($item->payments as $payment) {
|
||||
if (!in_array($payment->account_id, $accounts)) {
|
||||
@ -240,7 +240,6 @@ class IncomeExpenseSummary extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$month = Date::parse($item->$date_field)->format('F');
|
||||
|
@ -157,8 +157,7 @@ class IncomeSummary extends Controller
|
||||
private function setAmount(&$graph, &$totals, &$incomes, $items, $type, $date_field)
|
||||
{
|
||||
foreach ($items as $item) {
|
||||
switch ($item->getTable()) {
|
||||
case 'invoice_payments':
|
||||
if ($item->getTable() == 'invoice_payments') {
|
||||
$invoice = $item->invoice;
|
||||
|
||||
if ($customers = request('customers')) {
|
||||
@ -168,8 +167,9 @@ class IncomeSummary extends Controller
|
||||
}
|
||||
|
||||
$item->category_id = $invoice->category_id;
|
||||
break;
|
||||
case 'invoices':
|
||||
}
|
||||
|
||||
if ($item->getTable() == 'invoices') {
|
||||
if ($accounts = request('accounts')) {
|
||||
foreach ($item->payments as $payment) {
|
||||
if (!in_array($payment->account_id, $accounts)) {
|
||||
@ -177,7 +177,6 @@ class IncomeSummary extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$month = Date::parse($item->$date_field)->format('F');
|
||||
|
@ -174,7 +174,7 @@ 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')) {
|
||||
if (($item->getTable() == 'bill_payments') || ($item->getTable() == 'invoice_payments')) {
|
||||
$type_item = $item->$type;
|
||||
|
||||
$item->category_id = $type_item->category_id;
|
||||
|
@ -120,7 +120,7 @@ class TaxSummary extends Controller
|
||||
private function setAmount(&$items, &$totals, $rows, $type, $date_field)
|
||||
{
|
||||
foreach ($rows as $row) {
|
||||
if ($row->getTable() == 'bill_payments' || $row->getTable() == 'invoice_payments') {
|
||||
if (($row->getTable() == 'bill_payments') || ($row->getTable() == 'invoice_payments')) {
|
||||
$type_row = $row->$type;
|
||||
|
||||
$row->category_id = $type_row->category_id;
|
||||
|
Loading…
x
Reference in New Issue
Block a user