Add the quick sales report
Quick sales of a period by cash day, product, seller and VAT rate, with credits, open cash days flagged, a chart by day or month and CSV. VAT is taken out of each day's total of a rate, as on the cash day balance. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Reports\Application\DTOs;
|
||||
|
||||
/**
|
||||
* Quick sales of a period (spec 13), amounts with VAT in cents and
|
||||
* credits negative: by cash day, product, seller (by name) and VAT rate,
|
||||
* the totals, and a chart series by day or, for longer periods, by month
|
||||
* (label Y-m-d or Y-m → cents).
|
||||
*/
|
||||
final readonly class SalesReport
|
||||
{
|
||||
/**
|
||||
* @param list<array{day: string, count: int, cashCents: int, cardCents: int, totalCents: int, isClosed: bool}> $days
|
||||
* @param list<array{name: string, quantity: int, grossCents: int}> $products
|
||||
* @param list<array{name: string, count: int, grossCents: int}> $sellers
|
||||
* @param list<array{vatBasisPoints: int, grossCents: int, netCents: int, vatCents: int}> $vatTotals
|
||||
* @param array<string, int> $series
|
||||
*/
|
||||
public function __construct(
|
||||
public array $days,
|
||||
public array $products,
|
||||
public array $sellers,
|
||||
public array $vatTotals,
|
||||
public int $count,
|
||||
public int $cashCents,
|
||||
public int $cardCents,
|
||||
public int $openDays,
|
||||
public array $series,
|
||||
public bool $seriesByMonth,
|
||||
) {}
|
||||
|
||||
public function totalCents(): int
|
||||
{
|
||||
return $this->cashCents + $this->cardCents;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user