mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 13:04:38 -04:00
Fixes for credit payments
This commit is contained in:
parent
07244bd83b
commit
4bee89263a
@ -118,6 +118,7 @@ class Handler extends ExceptionHandler
|
|||||||
} elseif ($exception instanceof MethodNotAllowedHttpException && $request->expectsJson()) {
|
} elseif ($exception instanceof MethodNotAllowedHttpException && $request->expectsJson()) {
|
||||||
return response()->json(['message'=>'Method not support for this route'], 404);
|
return response()->json(['message'=>'Method not support for this route'], 404);
|
||||||
} elseif ($exception instanceof ValidationException && $request->expectsJson()) {
|
} elseif ($exception instanceof ValidationException && $request->expectsJson()) {
|
||||||
|
// info(print_r($exception->validator->getMessageBag(),1));
|
||||||
return response()->json(['message' => 'The given data was invalid.', 'errors' => $exception->validator->getMessageBag()], 422);
|
return response()->json(['message' => 'The given data was invalid.', 'errors' => $exception->validator->getMessageBag()], 422);
|
||||||
} elseif ($exception instanceof RelationNotFoundException && $request->expectsJson()) {
|
} elseif ($exception instanceof RelationNotFoundException && $request->expectsJson()) {
|
||||||
return response()->json(['message' => $exception->getMessage()], 400);
|
return response()->json(['message' => $exception->getMessage()], 400);
|
||||||
|
@ -78,6 +78,10 @@ class ValidCreditsRules implements Rule
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(count($this->input['credits']) >=1 && count($this->input['invoices']) == 0)
|
||||||
|
$this->error_msg = "You must have an invoice set when using a credit";
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user