feat(billing): renewals, coupons, VAT numbering, billing cycles and invoice payment tracking

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-19 16:37:56 +07:00
co-authored by Claude Sonnet 5.5
parent ea9a53f742
commit 25f23d541e
134 changed files with 4926 additions and 185 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Support;
use App\Models\Customer;
use App\Models\Invoice;
class InvoiceBuyer
{
public static function fromCustomer(?Customer $customer): array
{
return [
'name' => $customer?->fullname ?? '',
'company' => $customer?->invoice_company ?: ($customer?->company ?? ''),
'tax_code' => $customer?->tax_code ?? '',
'address' => $customer?->invoice_address ?: ($customer?->address ?? ''),
'email' => $customer?->invoice_email ?: ($customer?->email ?? ''),
];
}
public static function forInvoice(Invoice $invoice): array
{
return $invoice->buyer_snapshot ?: self::fromCustomer($invoice->customer);
}
}