Payment attachment add multiple
This commit is contained in:
		| @@ -66,7 +66,17 @@ class Payments extends Controller | ||||
|  | ||||
|         $payment_methods = Modules::getPaymentMethods(); | ||||
|  | ||||
|         return view('purchases.payments.create', compact('accounts', 'currencies', 'account_currency_code', 'currency', 'vendors', 'categories', 'payment_methods')); | ||||
|         $file_type_mimes = explode(',', config('filesystems.mimes')); | ||||
|  | ||||
|         $file_types = []; | ||||
|  | ||||
|         foreach ($file_type_mimes as $mime) { | ||||
|             $file_types[] = '.' . $mime; | ||||
|         } | ||||
|  | ||||
|         $file_types = implode(',', $file_types); | ||||
|  | ||||
|         return view('purchases.payments.create', compact('accounts', 'currencies', 'account_currency_code', 'currency', 'vendors', 'categories', 'payment_methods', 'file_types')); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -166,7 +176,17 @@ class Payments extends Controller | ||||
|  | ||||
|         $date_format = $this->getCompanyDateFormat(); | ||||
|  | ||||
|         return view('purchases.payments.edit', compact('payment', 'accounts', 'currencies', 'currency', 'vendors', 'categories', 'payment_methods', 'date_format')); | ||||
|         $file_type_mimes = explode(',', config('filesystems.mimes')); | ||||
|  | ||||
|         $file_types = []; | ||||
|  | ||||
|         foreach ($file_type_mimes as $mime) { | ||||
|             $file_types[] = '.' . $mime; | ||||
|         } | ||||
|  | ||||
|         $file_types = implode(',', $file_types); | ||||
|  | ||||
|         return view('purchases.payments.edit', compact('payment', 'accounts', 'currencies', 'currency', 'vendors', 'categories', 'payment_methods', 'date_format', 'file_types')); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -38,9 +38,9 @@ | ||||
|  | ||||
|                     {{ Form::textGroup('reference', trans('general.reference'), 'file', []) }} | ||||
|  | ||||
|                     {{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'form-file']) }} | ||||
|  | ||||
|                     {{ Form::selectGroup('document_id', trans_choice('general.bills', 1), 'file-invoice', [], null, ['disabled' => 'true']) }} | ||||
|  | ||||
|                     {{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], null, 'col-md-12') }} | ||||
|                 </div> | ||||
|             </div> | ||||
|  | ||||
|   | ||||
| @@ -57,19 +57,12 @@ | ||||
|  | ||||
|                     {{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }} | ||||
|  | ||||
|                     @if ($payment->attachment) | ||||
|                         <div class="col-md-6"> | ||||
|                             @php $file = $payment->attachment; @endphp | ||||
|                             @include('partials.media.file') | ||||
|                         </div> | ||||
|                     @else | ||||
|                         {{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'form-file']) }} | ||||
|                     @endif | ||||
|  | ||||
|                     @if ($payment->bill) | ||||
|                         {{ Form::textGroup('document', trans_choice('general.bills', 1), 'file-invoice', ['disabled' => 'true'], $payment->bill->document_number) }} | ||||
|                         {{ Form::hidden('document_id', $payment->bill->id) }} | ||||
|                     @endif | ||||
|  | ||||
|                     {{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], $payment->attachment, 'col-md-12') }} | ||||
|                 </div> | ||||
|             </div> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user