mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
validation for payment number for store/update routes
This commit is contained in:
parent
5f2c745f01
commit
f86a57c632
@ -104,7 +104,8 @@ class StorePaymentRequest extends Request
|
|||||||
'credits.*.credit_id' => new ValidCreditsRules($this->all()),
|
'credits.*.credit_id' => new ValidCreditsRules($this->all()),
|
||||||
'credits.*.amount' => 'required',
|
'credits.*.amount' => 'required',
|
||||||
'invoices' => new ValidPayableInvoicesRule(),
|
'invoices' => new ValidPayableInvoicesRule(),
|
||||||
'number' => 'nullable',
|
'number' => 'nullable|unique:payments,number,' . $this->id . ',id,company_id,' . $this->company_id,
|
||||||
|
//'number' => 'nullable',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ class UpdatePaymentRequest extends Request
|
|||||||
'invoices' => ['array',new PaymentAppliedValidAmount,new ValidCreditsPresentRule],
|
'invoices' => ['array',new PaymentAppliedValidAmount,new ValidCreditsPresentRule],
|
||||||
'invoices.*.invoice_id' => 'distinct',
|
'invoices.*.invoice_id' => 'distinct',
|
||||||
'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx',
|
'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'))) {
|
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user