1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Working on reports

This commit is contained in:
Hillel Coren 2018-01-21 21:12:49 +02:00
parent ac7f8df10b
commit d8e3aadd11
5 changed files with 44 additions and 2 deletions

View File

@ -22,4 +22,18 @@ class InvoiceItemPresenter extends EntityPresenter
{
return Str::limit($this->entity->notes);
}
public function tax1()
{
$item = $this->entity;
return $item->tax_name1 . ' ' . $item->tax_rate1 . '%';
}
public function tax2()
{
$item = $this->entity;
return $item->tax_name2 . ' ' . $item->tax_rate2 . '%';
}
}

View File

@ -38,6 +38,14 @@ class InvoicePresenter extends EntityPresenter
return $account->formatMoney($invoice->balance, $invoice->client);
}
public function paid()
{
$invoice = $this->entity;
$account = $invoice->account;
return $account->formatMoney($invoice->amount - $invoice->balance, $invoice->client);
}
public function partial()
{
$invoice = $this->entity;

View File

@ -24,6 +24,13 @@ class ProductReport extends AbstractReport
$account = auth()->user()->account;
if ($account->invoice_item_taxes) {
$columns['tax'] = ['columnSelector-false'];
if ($account->enable_second_tax_rate) {
$columns['tax'] = ['columnSelector-false'];
}
}
if ($account->custom_invoice_item_label1) {
$columns[$account->custom_invoice_item_label1] = ['columnSelector-false', 'custom'];
}
@ -65,6 +72,13 @@ class ProductReport extends AbstractReport
Utils::roundSignificant($item->cost, 2),
];
if ($account->invoice_item_taxes) {
$row[] = $item->present()->tax1;
if ($account->enable_second_tax_rate) {
$row[] = $item->present()->tax2;
}
}
if ($account->custom_invoice_item_label1) {
$row[] = $item->custom_value1;
}

View File

@ -14,8 +14,10 @@ class TaxRateReport extends AbstractReport
'invoice',
'tax_name',
'tax_rate',
'amount',
'paid',
'tax_amount',
'tax_paid',
'invoice_amount' => ['columnSelector-false'],
'payment_amount' => ['columnSelector-false'],
];
}
@ -77,6 +79,8 @@ class TaxRateReport extends AbstractReport
$tax['rate'] . '%',
$account->formatMoney($tax['amount'], $client),
$account->formatMoney($tax['paid'], $client),
$invoice->present()->amount,
$invoice->present()->paid,
];
$this->addToTotals($client->currency_id, 'amount', $tax['amount']);

View File

@ -2655,6 +2655,8 @@ $LANG = array(
'client_information' => 'Client Information',
'updated_client_details' => 'Successfully updated client details',
'auto' => 'Auto',
'tax_amount' => 'Tax Amount',
'tax_paid' => 'Tax Paid',
);