mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 08:37:33 -04:00 
			
		
		
		
	Don't show recurring invoices as overdue
This commit is contained in:
		
							parent
							
								
									557e088c46
								
							
						
					
					
						commit
						7763c7c8f6
					
				| @ -608,9 +608,9 @@ class Invoice extends EntityModel implements BalanceAffecting | ||||
|         return trans("texts.{$label}"); | ||||
|     } | ||||
| 
 | ||||
|     public static function calcStatusClass($statusId, $balance, $dueDate) | ||||
|     public static function calcStatusClass($statusId, $balance, $dueDate, $isRecurring) | ||||
|     { | ||||
|         if ($statusId >= INVOICE_STATUS_SENT && static::calcIsOverdue($balance, $dueDate)) { | ||||
|         if ($statusId >= INVOICE_STATUS_SENT && ! $isRecurring && static::calcIsOverdue($balance, $dueDate)) { | ||||
|             return 'danger'; | ||||
|         } | ||||
| 
 | ||||
| @ -637,7 +637,7 @@ class Invoice extends EntityModel implements BalanceAffecting | ||||
| 
 | ||||
|     public function statusClass() | ||||
|     { | ||||
|         return static::calcStatusClass($this->invoice_status_id, $this->balance, $this->getOriginal('due_date')); | ||||
|         return static::calcStatusClass($this->invoice_status_id, $this->balance, $this->getOriginal('due_date'), $this->is_recurring); | ||||
|     } | ||||
| 
 | ||||
|     public function statusLabel() | ||||
|  | ||||
| @ -168,7 +168,7 @@ class InvoiceDatatable extends EntityDatatable | ||||
| 
 | ||||
|     private function getStatusLabel($model) | ||||
|     { | ||||
|         $class = Invoice::calcStatusClass($model->invoice_status_id, $model->balance, $model->due_date); | ||||
|         $class = Invoice::calcStatusClass($model->invoice_status_id, $model->balance, $model->due_date, $model->is_recurring); | ||||
|         $label = Invoice::calcStatusLabel($model->invoice_status_name, $class, $this->entityType, $model->quote_invoice_id); | ||||
| 
 | ||||
|         return "<h4><div class=\"label label-{$class}\">$label</div></h4>"; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user