1
0
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:
David Bomba 2022-01-28 10:56:14 +11:00
parent e6759db35d
commit c7c26532c5
3 changed files with 4 additions and 4 deletions

View File

@ -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);
}

View File

@ -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;
}

View File

@ -88,7 +88,6 @@ class MarkPaid extends AbstractService
$this->invoice
->service()
->applyNumber()
// ->deletePdf()
->touchPdf()
->save();