Prevent environmental and oil fees for customer 999 with onlyTankCleaning attribute

This commit is contained in:
Jeppe Bundgaard
2025-10-01 16:38:27 +02:00
parent 8e6ad68253
commit 13ee541d57
@@ -654,7 +654,7 @@ class collected_order_invoices_o extends db
// Get the user object
$user = (new users_o())->getUserByCustomerNumber($this->customer_number->value());
// Check if the user has the onlyTankCleaning attribute
if ($user->doesUserHaveAttribute('onlyTankCleaning')) {
if ($user->doesUserHaveAttribute('onlyTankCleaning') && (int)$user->customer_number->value() !== 999) {
// Add the environmental fee & oil fees to the invoice draft
$economic = new economic();
$economic->invoices->draft->add_environmental_and_oil_fees(