Merge origin/master and resolve invoice_period_flag_service conflict

This commit is contained in:
copilot-swe-agent[bot]
2026-06-01 21:37:53 +00:00
committed by GitHub
26 changed files with 697 additions and 141 deletions
@@ -653,6 +653,25 @@ it('does not report a price mismatch when a product-specific discount makes the
expect($flags)->toBe([]);
});
it('does not treat subset primary vehicle product names as equivalent', function (): void {
expect(invoice_period_flag_service_invoke('primaryVehicleProductsMatch', [5, 'Forvogn', 6, 'Forvogn med hænger']))
->toBeFalse()
->and(invoice_period_flag_service_invoke('primaryVehicleProductsMatch', [10, 'Indvendig vask Kassevogn', 11, 'Kassevogn']))
->toBeTrue();
});
it('rebuilds automatic invoice period data on cache misses instead of hiding warnings', function (): void {
$content = file_get_contents(app_path('classes/invoice_period_flag_service.php'));
expect($content)->not->toBeFalse();
$content = (string)$content;
expect($content)->toContain('$flags = $this->buildAutomaticFlagsForPeriod($dateFrom, $dateTo);');
expect($content)->toContain('$rows = $this->fetchOrderItemRowsFromDb($dateFrom, $dateTo);');
expect($content)->toContain('cache_invoice_period_order_item_rows($dateFrom, $dateTo, $rows)');
expect($content)->not->toContain('enqueue_invoice_period_warming($dateFrom, $dateTo)');
});
it('preloads and caches missing e-conomic discounts before price mismatch detection', function (): void {
$content = file_get_contents(app_path('classes/invoice_period_flag_service.php'));