diff --git a/app/Http/Requests/Payment/StorePaymentRequest.php b/app/Http/Requests/Payment/StorePaymentRequest.php index ce529aa6f9f5..9194aff53356 100644 --- a/app/Http/Requests/Payment/StorePaymentRequest.php +++ b/app/Http/Requests/Payment/StorePaymentRequest.php @@ -104,7 +104,8 @@ class StorePaymentRequest extends Request 'credits.*.credit_id' => new ValidCreditsRules($this->all()), 'credits.*.amount' => 'required', 'invoices' => new ValidPayableInvoicesRule(), - 'number' => 'nullable', + 'number' => 'nullable|unique:payments,number,' . $this->id . ',id,company_id,' . $this->company_id, + //'number' => 'nullable', ]; diff --git a/app/Http/Requests/Payment/UpdatePaymentRequest.php b/app/Http/Requests/Payment/UpdatePaymentRequest.php index 6149d3d142a8..a9e458011524 100644 --- a/app/Http/Requests/Payment/UpdatePaymentRequest.php +++ b/app/Http/Requests/Payment/UpdatePaymentRequest.php @@ -40,6 +40,7 @@ class UpdatePaymentRequest extends Request 'invoices' => ['array',new PaymentAppliedValidAmount,new ValidCreditsPresentRule], 'invoices.*.invoice_id' => 'distinct', 'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx', + 'number' = 'nullable|unique:payments,number,' . $this->id . ',id,company_id,' . $this->company_id, ]; if ($this->input('documents') && is_array($this->input('documents'))) {