Recurring invoice balance fix

This commit is contained in:
David Bomba 2020-10-20 12:30:55 +11:00
parent e129419644
commit c1e080acd5
3 changed files with 25 additions and 1 deletions

View File

@ -187,6 +187,18 @@ class InvoiceSum
return $this->invoice; return $this->invoice;
} }
public function getRecurringInvoice()
{
$this->invoice->amount = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
$this->invoice->total_taxes = $this->getTotalTaxes();
$this->invoice->balance = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
$this->invoice->save();
return $this->invoice;
}
/** /**
* Build $this->invoice variables after * Build $this->invoice variables after
* calculations have been performed. * calculations have been performed.

View File

@ -174,6 +174,18 @@ class InvoiceSumInclusive
return $this; return $this;
} }
public function getRecurringInvoice()
{
$this->invoice->amount = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
$this->invoice->total_taxes = $this->getTotalTaxes();
$this->invoice->balance = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
$this->invoice->save();
return $this->invoice;
}
public function getInvoice() public function getInvoice()
{ {
//Build invoice values here and return Invoice //Build invoice values here and return Invoice

View File

@ -38,7 +38,7 @@ class RecurringInvoiceRepository extends BaseRepository
->createInvitations() ->createInvitations()
->save(); ->save();
$invoice = $invoice_calc->build()->getInvoice(); $invoice = $invoice_calc->build()->getRecurringInvoice();
return $invoice; return $invoice;
} }