mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Clarify expired quotes
This commit is contained in:
parent
2b7149cd5f
commit
6b15025092
@ -142,9 +142,6 @@ class ClientPortalController extends BaseController
|
||||
}
|
||||
|
||||
$showApprove = $invoice->quote_invoice_id ? false : true;
|
||||
if ($invoice->due_date) {
|
||||
$showApprove = time() < strtotime($invoice->getOriginal('due_date'));
|
||||
}
|
||||
if ($invoice->invoice_status_id >= INVOICE_STATUS_APPROVED) {
|
||||
$showApprove = false;
|
||||
}
|
||||
|
@ -149,6 +149,13 @@ class QuoteController extends BaseController
|
||||
$invitation = Invitation::with('invoice.invoice_items', 'invoice.invitations')->where('invitation_key', '=', $invitationKey)->firstOrFail();
|
||||
$invoice = $invitation->invoice;
|
||||
|
||||
if ($invoice->due_date) {
|
||||
$carbonDueDate = \Carbon::parse($invoice->due_date);
|
||||
if (! $carbonDueDate->isToday() && ! $carbonDueDate->isFuture()) {
|
||||
return redirect("view/{$invitationKey}")->withError(trans('texts.quote_has_expired'));
|
||||
}
|
||||
}
|
||||
|
||||
$invitationKey = $this->invoiceService->approveQuote($invoice, $invitation);
|
||||
Session::flash('message', trans('texts.quote_is_approved'));
|
||||
|
||||
|
@ -2608,6 +2608,7 @@ $LANG = array(
|
||||
'inclusive_taxes_warning' => 'Warning: existing invoices will need to be resaved',
|
||||
'copy_shipping' => 'Copy Shipping',
|
||||
'copy_billing' => 'Copy Billing',
|
||||
'quote_has_expired' => 'The quote has expired, please contact the merchant.',
|
||||
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user