Add InvoiceService and initial invoice dashboard widget
This commit is contained in:
@@ -185,6 +185,19 @@ public function salesStatistics()
|
||||
return ApiDataTransformer::snakeToCamel($statistics);
|
||||
}
|
||||
|
||||
public static function getDueInvoices()
|
||||
{
|
||||
$today = date('Y-m-d');
|
||||
$invoices = Invoice::where('due_date', '<=', $today)
|
||||
->whereIn('payment_status', ['issued', 'due', 'reminded'])
|
||||
->orderBy('due_date', 'asc')
|
||||
->get();
|
||||
|
||||
return $invoices->map(function ($invoice) {
|
||||
return ApiDataTransformer::snakeToCamel($invoice->toArray());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function preview($id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user