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;
}
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
* calculations have been performed.

View File

@ -174,6 +174,18 @@ class InvoiceSumInclusive
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()
{
//Build invoice values here and return Invoice

View File

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