From 439edffe2049db5881c32889de2d429211c7ff75 Mon Sep 17 00:00:00 2001 From: Lars Bo Rasmussen Date: Mon, 9 Feb 2015 03:16:21 +0100 Subject: [PATCH] Made it possible to add negative payments. Needed when making an invoice with a negative amount. The usecase for this is that in denmark you are not allowed to change an invoice once it has been filed. So to change an invoice or cancel it, it is required to create a creditnote. The system allows this but does not let you enter a negative payment for an invoice(creditnote in this case) which is a mistake. --- app/ninja/repositories/PaymentRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ninja/repositories/PaymentRepository.php b/app/ninja/repositories/PaymentRepository.php index c10acb68c6ea..19535f3352f5 100755 --- a/app/ninja/repositories/PaymentRepository.php +++ b/app/ninja/repositories/PaymentRepository.php @@ -68,7 +68,7 @@ class PaymentRepository $rules = array( 'client' => 'required', 'invoice' => 'required', - 'amount' => 'required|positive', + 'amount' => 'required', ); if ($input['payment_type_id'] == PAYMENT_TYPE_CREDIT) {