Fix rendering internal cost/revenue when in contract but not yet invoiced
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 41s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
2025-05-18 23:38:48 +10:00
parent 3cd1f2e34a
commit 3ae588041f
2 changed files with 8 additions and 2 deletions

View File

@@ -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);