Build the stuff for incoming invoices.

This commit is contained in:
2025-01-21 11:49:56 +01:00
parent e16324249a
commit 0e712a3412
24 changed files with 1495 additions and 14 deletions

View File

@@ -19,6 +19,9 @@ class InvoiceController extends Controller
return response()->json(Invoice::whereBetween('created_at', [$from, $end])->with(['address', 'customer'])->orderBy('created_at', 'desc')->get());
}
/**
* Display a listing of the resource that have a status "sent".
*/
public function open(): JsonResponse
{
return response()->json(Invoice::where('status', '=', 'sent')->orderBy('created_at', 'desc')->with(['customer', 'address', 'payments'])->get());
@@ -49,14 +52,6 @@ class InvoiceController extends Controller
return response()->json($invoice);
}
/**
* Display the specified resource.
*/
public function show(Invoice $invoice)
{
//
}
/**
* Update the specified resource in storage.
*/
@@ -76,6 +71,9 @@ class InvoiceController extends Controller
return response()->json($invoice);
}
/**
* Update the specified resource's status in storage.
*/
public function state(Request $request, Invoice $invoice): JsonResponse
{
$invoiceData = $request->validate([