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:
Jeppe Bundgaard
2025-11-25 13:04:57 +01:00
parent 449908c833
commit 537582e44d
@@ -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;
}
}