mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:04:41 -04:00
Add taxes and discounts to html viewer in portal
This commit is contained in:
parent
1d438d14d3
commit
a3be388a3d
@ -55,6 +55,8 @@ class PdfSlot extends Component
|
|||||||
|
|
||||||
public $is_quote = false;
|
public $is_quote = false;
|
||||||
|
|
||||||
|
private $entity_calc;
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
MultiDB::setDb($this->db);
|
MultiDB::setDb($this->db);
|
||||||
@ -123,6 +125,7 @@ class PdfSlot extends Component
|
|||||||
{
|
{
|
||||||
|
|
||||||
$this->entity_type = $this->resolveEntityType();
|
$this->entity_type = $this->resolveEntityType();
|
||||||
|
$this->entity_calc = $this->entity->calc();
|
||||||
|
|
||||||
$this->settings = $this->entity->client ? $this->entity->client->getMergedSettings() : $this->entity->company->settings;
|
$this->settings = $this->entity->client ? $this->entity->client->getMergedSettings() : $this->entity->company->settings;
|
||||||
|
|
||||||
@ -149,6 +152,8 @@ class PdfSlot extends Component
|
|||||||
'services' => $this->getServices(),
|
'services' => $this->getServices(),
|
||||||
'amount' => Number::formatMoney($this->entity->amount, $this->entity->client ?: $this->entity->vendor),
|
'amount' => Number::formatMoney($this->entity->amount, $this->entity->client ?: $this->entity->vendor),
|
||||||
'balance' => Number::formatMoney($this->entity->balance, $this->entity->client ?: $this->entity->vendor),
|
'balance' => Number::formatMoney($this->entity->balance, $this->entity->client ?: $this->entity->vendor),
|
||||||
|
'discount' => $this->entity_calc->getTotalDiscount() > 0 ? Number::formatMoney($this->entity_calc->getTotalDiscount(), $this->entity->client ?: $this->entity->vendor) : false,
|
||||||
|
'taxes' => $this->entity_calc->getTotalTaxes() > 0 ? Number::formatMoney($this->entity_calc->getTotalTaxes(), $this->entity->client ?: $this->entity->vendor) : false,
|
||||||
'company_details' => $this->getCompanyDetails(),
|
'company_details' => $this->getCompanyDetails(),
|
||||||
'company_address' => $this->getCompanyAddress(),
|
'company_address' => $this->getCompanyAddress(),
|
||||||
'entity_details' => $this->getEntityDetails(),
|
'entity_details' => $this->getEntityDetails(),
|
||||||
|
@ -132,6 +132,18 @@ span {
|
|||||||
<div id="totals" class="mb-10 mr-3 ml-3">
|
<div id="totals" class="mb-10 mr-3 ml-3">
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@if($discount)
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left; padding-right:10px;" class="text-lg">{{ ctrans('texts.discount') }}</td>
|
||||||
|
<td style="text-align:right; padding-right:10px;" class="text-lg">{{ $discount }}</td>
|
||||||
|
</tr>
|
||||||
|
@endif
|
||||||
|
@if($taxes)
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left; padding-right:10px;" class="text-lg">{{ ctrans('texts.tax') }}</td>
|
||||||
|
<td style="text-align:right; padding-right:10px;" class="text-lg">{{ $taxes }}</td>
|
||||||
|
</tr>
|
||||||
|
@endif
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align:left; padding-right:10px;" class="text-lg">{{ ctrans('texts.total') }}</td>
|
<td style="text-align:left; padding-right:10px;" class="text-lg">{{ ctrans('texts.total') }}</td>
|
||||||
<td style="text-align:right; padding-right:10px;" class="text-lg">{{ $amount }}</td>
|
<td style="text-align:right; padding-right:10px;" class="text-lg">{{ $amount }}</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user