Management downloads a created billing material as a semicolon CSV with decimal commas and a UTF-8 BOM for Excel: one row per invoice line with the invoice's customer, billing unit, e-invoice details and reference, the job, the line and its net, VAT and gross amounts. Consumers' full personal identity codes are included only for those who may see them, the response is not cached, and cells Excel would read as formulas are escaped. The columns follow Fennoa's import format once a sample exists. Co-Authored-By: Claude Opus 5.5 <[email protected]>
37 lines
1001 B
PHP
37 lines
1001 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Billing\Application\DTOs;
|
|
|
|
use App\Modules\Billing\Domain\Enums\LineKind;
|
|
|
|
/**
|
|
* One invoice line of a created billing material for a billing file, with
|
|
* its invoice's customer details. Amounts are in cents; the quantity is in
|
|
* quarters of an hour for hours, otherwise in pieces (a month is one).
|
|
*/
|
|
final readonly class ExportRow
|
|
{
|
|
public function __construct(
|
|
public int $invoiceNumber,
|
|
public CustomerBillingDetails $customer,
|
|
public ?string $reference,
|
|
public string $jobNumber,
|
|
public string $jobName,
|
|
public LineKind $kind,
|
|
public string $description,
|
|
public ?int $recordedQuarters,
|
|
public ?int $quantityQuarters,
|
|
public int $unitPriceCents,
|
|
public int $vatBasisPoints,
|
|
public int $netCents,
|
|
public int $vatCents,
|
|
) {}
|
|
|
|
public function grossCents(): int
|
|
{
|
|
return $this->netCents + $this->vatCents;
|
|
}
|
|
}
|