1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

validation for payment number for store/update routes

This commit is contained in:
David Bomba 2020-08-13 14:26:36 +10:00
parent 5f2c745f01
commit f86a57c632
2 changed files with 3 additions and 1 deletions

View File

@ -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',
];

View File

@ -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'))) {