Add isExcludedFromInvoicing method to departments_o
- Introduced `isExcludedFromInvoicing` to check if a department is excluded from invoicing. - Ensured selected department validation before retrieving exclusion status.
This commit is contained in:
@@ -400,4 +400,15 @@ class departments_o extends db
|
||||
// Remove duplicate products
|
||||
return array_unique($products, SORT_REGULAR);
|
||||
}
|
||||
|
||||
/**
|
||||
* If the department is excluded from invoicing
|
||||
* @return bool
|
||||
* @throws Exception If the department is not selected
|
||||
*/
|
||||
public function isExcludedFromInvoicing(): bool
|
||||
{
|
||||
self::requireSelected();
|
||||
return $this->variables->getVariable('exclude_from_invoicing') === true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user