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
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace App\Support;
use App\Models\ModuleVmware;
use App\Models\Service;
final class ServiceExpirySync
{
public static function toVmware(Service $service): int
{
if (! $service->vm_id || ! $service->expires_at) {
return 0;
}
$timestamp = $service->expires_at->timestamp;
return ModuleVmware::query()
->whereKey($service->vm_id)
->where(fn ($query) => $query->whereNull('next_due_date')->orWhere('next_due_date', '!=', $timestamp))
->update(['next_due_date' => $timestamp]);
}
}