fixed #553
This commit is contained in:
parent
fbdeb95f1e
commit
ff08aec93c
@ -104,7 +104,7 @@ 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') {
|
||||
if ($row->getTable() == 'bill_payments' || $row->getTable() == 'invoice_payments') {
|
||||
$type_row = $row->$type;
|
||||
|
||||
$row->category_id = $type_row->category_id;
|
||||
@ -127,7 +127,14 @@ class TaxSummary extends Controller
|
||||
continue;
|
||||
}
|
||||
|
||||
$amount = $this->convert($row_total->amount, $row->currency_code, $row->currency_rate);
|
||||
if ($date_field == 'paid_at') {
|
||||
$rate = ($row->amount * 100) / $type_row->amount;
|
||||
$row_amount = ($row_total->amount / 100) * $rate;
|
||||
} else {
|
||||
$row_amount = $row_total->amount;
|
||||
}
|
||||
|
||||
$amount = $this->convert($row_amount, $row->currency_code, $row->currency_rate);
|
||||
|
||||
$items[$row_total->name][$date]['amount'] += $amount;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user