Build overview and handling for unpaid incoming.

This commit is contained in:
2025-02-13 11:28:30 +01:00
parent c5a58436e1
commit 447a7d59d5
12 changed files with 284 additions and 7 deletions

View File

@@ -24,6 +24,25 @@ class IncomingController extends Controller
return response()->json(Incoming::whereBetween('issue_date', [$from, $end])->with(['supplier'])->orderBy('issue_date', 'desc')->get());
}
/**
* Display a listing of the resource.
*/
public function payment($from = null, $end = null): JsonResponse
{
Option::updateOrCreate(['name' => 'incoming_payments_from'], ['value' => $from]);
Option::updateOrCreate(['name' => 'incoming_payments_end'], ['value' => $end]);
return response()->json(Incoming::whereBetween('pay_date', [$from, $end])->with(['supplier'])->orderBy('pay_date', 'desc')->get());
}
/**
* Display a listing of the resource that are not paid.
*/
public function open(): JsonResponse
{
return response()->json(Incoming::where('pay_date', '=', null)->orderBy('issue_date', 'desc')->with(['supplier'])->get());
}
/**
* Process an upload file for the resource.
*/