From 537582e44dea9c18ba8acd2547b97b2439b6014e Mon Sep 17 00:00:00 2001 From: Jeppe Bundgaard Date: Tue, 25 Nov 2025 13:04:57 +0100 Subject: [PATCH] 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. --- services/nginx/app/objects/departments_o.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/services/nginx/app/objects/departments_o.php b/services/nginx/app/objects/departments_o.php index 9f08ea4f..f72fade1 100644 --- a/services/nginx/app/objects/departments_o.php +++ b/services/nginx/app/objects/departments_o.php @@ -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; + } } \ No newline at end of file