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:
co-authored by
Claude Sonnet 5.5
parent
ea9a53f742
commit
25f23d541e
@@ -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(),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user