mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 21:34:35 -04:00
Allow negative invoices
This commit is contained in:
parent
e6759db35d
commit
c7c26532c5
@ -658,7 +658,8 @@ class InvoiceController extends BaseController
|
|||||||
// code...
|
// code...
|
||||||
break;
|
break;
|
||||||
case 'mark_paid':
|
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);
|
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['line_items'] = 'array';
|
||||||
$rules['discount'] = 'sometimes|numeric';
|
$rules['discount'] = 'sometimes|numeric';
|
||||||
|
|
||||||
if($this->input('status_id') != Invoice::STATUS_DRAFT)
|
// if($this->input('status_id') != Invoice::STATUS_DRAFT)
|
||||||
$rules['balance'] = new InvoiceBalanceSanity($this->invoice, $this->all());
|
// $rules['balance'] = new InvoiceBalanceSanity($this->invoice, $this->all());
|
||||||
|
|
||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,6 @@ class MarkPaid extends AbstractService
|
|||||||
$this->invoice
|
$this->invoice
|
||||||
->service()
|
->service()
|
||||||
->applyNumber()
|
->applyNumber()
|
||||||
// ->deletePdf()
|
|
||||||
->touchPdf()
|
->touchPdf()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user