Removed redundant functions from Invoice, optimised Invoice tables
This commit is contained in:
@@ -97,7 +97,7 @@ class AdminController extends Controller
|
||||
if (collect($value)->sum() > $request->post('total_amt'))
|
||||
$fail('Allocation is greater than payment total.');
|
||||
}],
|
||||
'invoices.*.id' => 'nullable|exists:ab_invoice,id',
|
||||
'invoices.*.id' => 'nullable|exists:invoices,id',
|
||||
]);
|
||||
|
||||
if (! $o->exists) {
|
||||
|
@@ -54,7 +54,7 @@ class HomeController extends Controller
|
||||
*/
|
||||
public function invoice_pdf(Invoice $o)
|
||||
{
|
||||
return PDF::loadView('u.invoice.home',['o'=>$o])->stream(sprintf('%s.pdf',$o->invoice_account_id));
|
||||
return PDF::loadView('u.invoice.home',['o'=>$o])->stream(sprintf('%s.pdf',$o->sid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -24,13 +24,13 @@ class AccountController extends Controller
|
||||
});
|
||||
|
||||
// Get our invoice due date for this invoice
|
||||
$io->due_date = $s->min(function($item) { return $item->invoice_next; });
|
||||
$io->due_at = $s->min(function($item) { return $item->invoice_next; });
|
||||
|
||||
// @todo The days in advance is an application parameter
|
||||
$io->date_orig = $io->due_date->subDays(30);
|
||||
$io->created_at = $io->due_at->subDays(30);
|
||||
|
||||
// Work out items to add to this invoice, plus any in the next additional days
|
||||
$days = now()->diffInDays($io->due_date)+1+7;
|
||||
$days = now()->diffInDays($io->due_at)+1+7;
|
||||
foreach ($s as $so)
|
||||
{
|
||||
if ($so->isInvoiceDueSoon($days))
|
||||
|
Reference in New Issue
Block a user