feat(services): partial/unpaid payment on admin create, payment history per invoice, zip attachments

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-22 22:22:09 +07:00
co-authored by Claude Opus 5.5
parent 02daefe4c2
commit fe68171aa7
15 changed files with 281 additions and 40 deletions
@@ -30,6 +30,7 @@ class ServiceOrderRecorder
bool $paid,
?string $paymentMethod = null,
?string $clientIp = null,
int $amountPaid = 0,
): array {
$months = OrderHelper::cycleToMonths($billingCycle);
$isDomain = $product?->product_type === 'domain';
@@ -69,6 +70,7 @@ class ServiceOrderRecorder
'tax' => 0,
'total' => $price,
'status' => $paid ? InvoiceStatus::PAID->value : InvoiceStatus::UNPAID->value,
'amount_paid' => $paid ? $price : $amountPaid,
'payment_method' => $paymentMethod,
'paid_at' => $paid ? now() : null,
'due_date' => $paid ? now()->addMonths($months)->toDateString() : now()->toDateString(),