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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user