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
@@ -42,7 +42,9 @@ class InvoiceController extends Controller
public function index(Request $request): JsonResponse
{
$query = $this->invoiceRepository->filter(
$perPage = min((int) $request->get('per_page', 15), 100);
$data = $this->invoiceRepository->filter(
$request->all(),
[
'payment',
@@ -54,13 +56,14 @@ class InvoiceController extends Controller
[],
['*'],
true
);
)->paginate($perPage);
return response()->json([
'error' => false,
'data' => [
'items' => InvoiceResource::collection($query->get())->resolve(),
'total' => $query->count(),
'items' => InvoiceResource::collection($data->items())->resolve(),
'total' => $data->total(),
'per_page' => $data->perPage(),
],
]);
}