Fix rendering internal cost/revenue when in contract but not yet invoiced
This commit is contained in:
@@ -944,6 +944,9 @@ class Service extends Model implements IDs
|
||||
{
|
||||
$max = max($date,$this->getCancelDateAttribute())->clone();
|
||||
|
||||
if (! $this->getPaidToAttribute())
|
||||
return $this->account->taxed($this->getContractTermAttribute()*$this->getBillingChargeNormalisedAttribute());
|
||||
|
||||
if ($this->getPaidToAttribute()->lessThan($max)) {
|
||||
$d = $this->getPaidToAttribute()->diffInDays($max);
|
||||
|
||||
@@ -981,6 +984,9 @@ class Service extends Model implements IDs
|
||||
{
|
||||
$max = max($date,$this->getCancelDateAttribute())->clone();
|
||||
|
||||
if (! $this->getInvoicedToAttribute())
|
||||
return $this->account->taxed($this->getContractTermAttribute()*$this->getBillingChargeNormalisedAttribute());
|
||||
|
||||
if ($this->getInvoicedToAttribute()->lessThan($max)) {
|
||||
$d = $this->getInvoicedToAttribute()->diffInDays($max);
|
||||
|
||||
|
Reference in New Issue
Block a user