mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Allow negative invoices
This commit is contained in:
parent
e6759db35d
commit
c7c26532c5
@ -658,7 +658,8 @@ class InvoiceController extends BaseController
|
||||
// code...
|
||||
break;
|
||||
case 'mark_paid':
|
||||
if ($invoice->balance < 0 || $invoice->status_id == Invoice::STATUS_PAID || $invoice->is_deleted === true) {
|
||||
if ($invoice->status_id == Invoice::STATUS_PAID || $invoice->is_deleted === true) {
|
||||
// if ($invoice->balance < 0 || $invoice->status_id == Invoice::STATUS_PAID || $invoice->is_deleted === true) {
|
||||
return $this->errorResponse(['message' => ctrans('texts.invoice_cannot_be_marked_paid')], 400);
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,8 @@ class UpdateInvoiceRequest extends Request
|
||||
$rules['line_items'] = 'array';
|
||||
$rules['discount'] = 'sometimes|numeric';
|
||||
|
||||
if($this->input('status_id') != Invoice::STATUS_DRAFT)
|
||||
$rules['balance'] = new InvoiceBalanceSanity($this->invoice, $this->all());
|
||||
// if($this->input('status_id') != Invoice::STATUS_DRAFT)
|
||||
// $rules['balance'] = new InvoiceBalanceSanity($this->invoice, $this->all());
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
@ -88,7 +88,6 @@ class MarkPaid extends AbstractService
|
||||
$this->invoice
|
||||
->service()
|
||||
->applyNumber()
|
||||
// ->deletePdf()
|
||||
->touchPdf()
|
||||
->save();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user