Refactor XL Vask module for better null handling and primary item validation

- Improved null safety by updating product ID retrieval logic in parsers and usage logs.
- Enhanced primary wash item selection with stricter checks for valid product types.
- Adjusted import date modifier in `importUsageLogs` for extended range (`-7 day`).
- Streamlined product and user association in order creation with additional validations.
- Removed redundant checks and refined permission handling in import tasks.
This commit is contained in:
Jeppe Bundgaard
2025-07-21 16:47:05 +02:00
parent 4cc270e258
commit 16198f49e6
7 changed files with 32 additions and 17 deletions
+1
View File
@@ -682,6 +682,7 @@ class users_o extends db
*/
public function getCustomPrice(int $object_id, bool $is_category = false): int|null
{
self::requireSelected();
// Get the custom price for the product
$discount = $this->price_overrides->setUser($this->id)->getPrice($is_category, $object_id);
// If the is_category is false, check if there is a custom price for the category that the product belongs to