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]>
24 lines
733 B
PHP
24 lines
733 B
PHP
<?php
|
|
|
|
namespace App\Modules\Reports\Infrastructure\Adapters;
|
|
|
|
use App\Modules\Reports\Application\Contracts\ReportSales;
|
|
use App\Modules\Reports\Application\DTOs\SalesData;
|
|
use App\Modules\Reports\Domain\ValueObjects\ReportPeriod;
|
|
use App\Modules\Sales\Application\Contracts\QuickSaleReportQueries;
|
|
|
|
/**
|
|
* Quick sales for reports through the Sales module.
|
|
*/
|
|
class SalesForReports implements ReportSales
|
|
{
|
|
public function __construct(private QuickSaleReportQueries $queries) {}
|
|
|
|
public function between(ReportPeriod $period): SalesData
|
|
{
|
|
$sales = $this->queries->between($period->from, $period->to);
|
|
|
|
return new SalesData($sales->days, $sales->products, $sales->sellers, $sales->dayVatTotals);
|
|
}
|
|
}
|