diff --git a/services/nginx/app/classes/invoice_period_flag_service.php b/services/nginx/app/classes/invoice_period_flag_service.php index 2b1f823f..2646ee4b 100644 --- a/services/nginx/app/classes/invoice_period_flag_service.php +++ b/services/nginx/app/classes/invoice_period_flag_service.php @@ -1495,6 +1495,7 @@ class invoice_period_flag_service { $product = (string)($params['product'] ?? 'Item'); $expectedProduct = (string)($params['expected_product'] ?? 'expected product'); + $washId = (string)($params['wash_id'] ?? ''); return match ($definitionKey) { 'price_mismatch' => "{$product} product price differs from expected.", 'customer_rule_restrict_addon_services' => "{$product} violates restricted addon services.", @@ -1514,7 +1515,9 @@ class invoice_period_flag_service 'duplicate_vehicle_subscription_charge_same_month' => "Duplicate vehicle subscription charges exist in the same month.", 'vehicle_subscription_type_mismatch' => "{$product} does not match the vehicle subscription type {$expectedProduct}.", 'historical_primary_product_mismatch' => "{$product} differs from the registration number's usual product {$expectedProduct}.", - 'xlvask_missing_order_link' => "XL Vask wash is neither ignored nor linked to an order in the selected period.", + 'xlvask_missing_order_link' => $washId === '' + ? 'XL Vask wash is neither ignored nor linked to an order in the selected period.' + : "XL Vask wash {$washId} is neither ignored nor linked to an order in the selected period.", default => "Automatically detected invoice-period issue.", }; } @@ -1541,7 +1544,8 @@ class invoice_period_flag_service ['type' => 'text', 'text' => ' is attached without a wash certificate item.'], ], 'xlvask_missing_order_link' => [ - ['type' => 'xlvask_usage_log', 'text' => 'XL Vask wash'], + ['type' => 'text', 'text' => 'XL Vask wash '], + ['type' => 'xlvask_usage_log', 'text' => (string)($params['wash_id'] ?? '')], ['type' => 'text', 'text' => ' is neither ignored nor linked to an order in the selected period.'], ], default => [], diff --git a/services/nginx/app/tests/Unit/Invoicing/InvoicePeriodFlagServiceTest.php b/services/nginx/app/tests/Unit/Invoicing/InvoicePeriodFlagServiceTest.php index f9d1be45..d2449e66 100644 --- a/services/nginx/app/tests/Unit/Invoicing/InvoicePeriodFlagServiceTest.php +++ b/services/nginx/app/tests/Unit/Invoicing/InvoicePeriodFlagServiceTest.php @@ -167,7 +167,8 @@ it('builds interactive message parts for order and wash certificate warnings', f ['type' => 'text', 'text' => ' is present without a wash certificate.'], ]); expect($xlVaskFlag['message_parts'])->toBe([ - ['type' => 'xlvask_usage_log', 'text' => 'XL Vask wash'], + ['type' => 'text', 'text' => 'XL Vask wash '], + ['type' => 'xlvask_usage_log', 'text' => 'wash-55'], ['type' => 'text', 'text' => ' is neither ignored nor linked to an order in the selected period.'], ]); });