Make quick sale products on machines as orders paid when ready

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-26 17:11:54 +02:00
co-authored by Claude Sonnet 5.5
parent 920fecdeb2
commit 38b8075a9c
58 changed files with 3435 additions and 26 deletions
@@ -20,7 +20,17 @@ class HoursForQuickSales implements QuickSaleHours
private AddTaskHours $addHours,
) {}
public function bookForOrder(int $userId, DateTimeImmutable $day, int $workTypeId, int $quarters, int $pickupNumber): bool
{
return $this->bookWithNote($userId, $day, $workTypeId, $quarters, __('sales.orders.hours_note', ['number' => $pickupNumber]));
}
public function book(int $sellerId, DateTimeImmutable $day, int $workTypeId, int $quarters, int $saleId): bool
{
return $this->bookWithNote($sellerId, $day, $workTypeId, $quarters, __('sales.hours_note', ['number' => $saleId]));
}
private function bookWithNote(int $sellerId, DateTimeImmutable $day, int $workTypeId, int $quarters, string $note): bool
{
$year = (int) $day->format('Y');
@@ -31,7 +41,7 @@ class HoursForQuickSales implements QuickSaleHours
$taskId,
$day->format('Y-m-d'),
number_format($quarters / 4, 2, ',', ''),
__('sales.hours_note', ['number' => $saleId]),
$note,
);
} catch (DomainException) {
// Approved or locked hours, or a day over 24 hours: the sale stands without them.