From 5d38eae9f6cb57c41e9fb3680d9b02cfc0d4aa15 Mon Sep 17 00:00:00 2001 From: Jepp9350 <2jepp9350@gmail.com> Date: Wed, 11 Jun 2025 12:57:20 +0200 Subject: [PATCH] Add `lane` property to `orders_o`, include lane handling in XLVask usage logs, and introduce `xlvask_parser_kapellvask_alle_trailere` parser. --- .../xlvask/helpers/xlvask_parser_halleje.php | 2 +- ...xlvask_parser_kapellvask_alle_trailere.php | 26 +++++++++++++++++++ .../xlvask/helpers/xlvask_usage_log.php | 3 +++ .../app/modules/xlvask/xlvask_helpers.php | 1 + services/nginx/app/objects/orders_o.php | 7 ++++- 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 services/nginx/app/modules/xlvask/helpers/xlvask_parser_kapellvask_alle_trailere.php diff --git a/services/nginx/app/modules/xlvask/helpers/xlvask_parser_halleje.php b/services/nginx/app/modules/xlvask/helpers/xlvask_parser_halleje.php index c0c410ea..7bf6d6ea 100644 --- a/services/nginx/app/modules/xlvask/helpers/xlvask_parser_halleje.php +++ b/services/nginx/app/modules/xlvask/helpers/xlvask_parser_halleje.php @@ -21,6 +21,6 @@ class xlvask_parser_halleje extends xlvask_product_parser */ protected function parse(xlvask_wash_item $wash_item, xlvask_usage_log $xlvask_usage_log): products_o { - return (new products_o())->select(62); // Halleje product ID + return (new products_o())->select(64); // Halleje product ID is actually 62, but since we're currently not using it we just return the 64 (Irrelevant) product ID. } } \ No newline at end of file diff --git a/services/nginx/app/modules/xlvask/helpers/xlvask_parser_kapellvask_alle_trailere.php b/services/nginx/app/modules/xlvask/helpers/xlvask_parser_kapellvask_alle_trailere.php new file mode 100644 index 00000000..4d9e3660 --- /dev/null +++ b/services/nginx/app/modules/xlvask/helpers/xlvask_parser_kapellvask_alle_trailere.php @@ -0,0 +1,26 @@ +setup('Kapellvask (alle trailere)'); + } + + + /** + * @inheritDoc + * @throws Exception + */ + protected function parse(xlvask_wash_item $wash_item, xlvask_usage_log $xlvask_usage_log): products_o + { + return (new products_o())->select(64); // Irrelevant product ID + } +} \ No newline at end of file diff --git a/services/nginx/app/modules/xlvask/helpers/xlvask_usage_log.php b/services/nginx/app/modules/xlvask/helpers/xlvask_usage_log.php index 72ad5a3c..6b0a0df2 100644 --- a/services/nginx/app/modules/xlvask/helpers/xlvask_usage_log.php +++ b/services/nginx/app/modules/xlvask/helpers/xlvask_usage_log.php @@ -516,6 +516,9 @@ class xlvask_usage_log return null; } + /** + * @throws Exception + */ public function getCustomer(): xlvask_customer { $xlvask = new xlvask(); diff --git a/services/nginx/app/modules/xlvask/xlvask_helpers.php b/services/nginx/app/modules/xlvask/xlvask_helpers.php index b28ed0f7..c5956b83 100644 --- a/services/nginx/app/modules/xlvask/xlvask_helpers.php +++ b/services/nginx/app/modules/xlvask/xlvask_helpers.php @@ -28,6 +28,7 @@ require_once WD . '/modules/xlvask/helpers/xlvask_parser_manuel_ht_koldtvand.php require_once WD . '/modules/xlvask/helpers/xlvask_parser_manuel_s_bepistol_t.php'; require_once WD . '/modules/xlvask/helpers/xlvask_parser_manuel_spot_free.php'; require_once WD . '/modules/xlvask/helpers/xlvask_parser_manual_ht_varmtvand.php'; +require_once WD . '/modules/xlvask/helpers/xlvask_parser_kapellvask_alle_trailere.php'; use helpers\xlvask_cache; use helpers\xlvask_customer; diff --git a/services/nginx/app/objects/orders_o.php b/services/nginx/app/objects/orders_o.php index 5397c8ba..d61412be 100644 --- a/services/nginx/app/objects/orders_o.php +++ b/services/nginx/app/objects/orders_o.php @@ -32,6 +32,7 @@ class orders_o extends db public object_property $invoice_collection_id; public object_property $booking_id; public object_property $wash_id; // The XL Vask Wash ID, if any + public object_property $lane; // The lane used for the order, if any public function structure(): void { @@ -75,6 +76,7 @@ class orders_o extends db $this->invoice_collection_id = new object_property($this->table, $this->id, 'invoice_collection_id', 'int', false); $this->booking_id = new object_property($this->table, $this->id, 'booking_id', 'int', false); $this->wash_id = new object_property($this->table, $this->id, 'wash_id', 'string', false); + $this->lane = new object_property($this->table, $this->id, 'lane', 'string', false); } public function getCustomerByOrderId(?string $order_id): users_o @@ -490,6 +492,7 @@ class orders_o extends db 'invoice_collection_id' => (int)$this->invoice_collection_id->value(), 'booking_id' => (int)$this->booking_id->value(), 'wash_id' => $this->wash_id->value(), + 'lane' => $this->lane->value(), 'closed_at' => (int)$this->invoice_collection_id->value() ? (new collected_order_invoices_o())->select((int)$this->invoice_collection_id->value())->closed_at->value() : null, ]; } @@ -733,6 +736,8 @@ class orders_o extends db (int)$xlvask_usage_log->getDepartment()->id, $xlvask_usage_log->RegistrationNumber, ); + // Set the lane used for the order (if applicable) + $this->lane->set($xlvask_usage_log->getLane()); // Add the products to the order $firstItemId = null; /** @var xlvask_wash_item $washItem */ @@ -747,7 +752,7 @@ class orders_o extends db $this->id, $washItem->getProduct($xlvask_usage_log)->id, '', - $washItem->OriginalProductName, + '', //$washItem->OriginalProductName, 2285, $washItem->getPriceExVat(), $washItem->Count,