file updated..

This commit is contained in:
Cüneyt Şentürk
2021-07-10 00:24:44 +03:00
parent deda93e8a1
commit ead767a308
10 changed files with 186 additions and 3 deletions

View File

@@ -30,6 +30,15 @@ const app = new Vue({
form: new Form('transfer'),
bulk_action: new BulkAction('transfers'),
show_rate: false,
transfer_form: new Form('template'),
template: {
modal: false,
title: '',
message: '',
html: '',
errors: new Error()
},
}
},
@@ -87,5 +96,35 @@ const app = new Vue({
}
});
},
onTemplate() {
this.template.modal = true;
this.transfer_form = new Form('template');
this.transfer_form.template = this.transfer_form._template;
},
addTemplate() {
if (this.transfer_form.template != 1) {
this.transfer_form.submit();
this.template.errors = this.transfer_form.errors;
}
this.form.loading = true;
this.$emit("confirm");
},
closeTemplate() {
this.template = {
modal: false,
title: '',
message: '',
errors: this.transfer_form.errors
};
},
}
});

View File

@@ -10,6 +10,33 @@
<x-transfers.show.content :transfer="$transfer" />
@endsection
@push('content_content_end')
<akaunting-modal
:show="template.modal"
@cancel="template.modal = false"
:title="'{{ trans('settings.invoice.choose_template') }}'"
:message="template.html"
:button_cancel="'{{ trans('general.button.save') }}'"
:button_delete="'{{ trans('general.button.cancel') }}'">
<template #modal-body>
@include('modals.settings.transfer_template')
</template>
<template #card-footer>
<div class="float-right">
<button type="button" class="btn btn-outline-secondary" @click="closeTemplate">
{{ trans('general.cancel') }}
</button>
<button :disabled="form.loading" type="button" class="btn btn-success button-submit" @click="addTemplate">
<span v-if="form.loading" class="btn-inner--icon"><i class="aka-loader"></i></span>
<span :class="[{'ml-0': form.loading}]" class="btn-inner--text">{{ trans('general.confirm') }}</span>
</button>
</div>
</template>
</akaunting-modal>
@endpush
@push('scripts_start')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">

View File

@@ -57,9 +57,9 @@
@if (!$hideButtonTemplate)
@stack('button_template_start')
<a class="dropdown-item" href="javascipt::void();">
<button type="button" class="dropdown-item" @click="onTemplate">
{{ trans('general.form.choose', ['field' => trans_choice('general.templates', 1)]) }}
</a>
</button>
@stack('button_template_end')
@endif

View File

@@ -0,0 +1,49 @@
<div class="modal-body pb-0">
{!! Form::open([
'route' => 'modals.transfer-templates.update',
'method' => 'PATCH',
'id' => 'template',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'transfer_form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button mb-0',
'novalidate' => true
]) !!}
<div class="row">
<div class="col-md-4 text-center">
<div class="bg-print border-radius-default print-edge choose" @click="transfer_form.template='default'">
<img src="{{ asset('public/img/transfer_templates/default.png') }}" class="mb-1 mt-3" height="200" alt="Default"/>
<label>
<input type="radio" name="template" value="default" v-model="transfer_form.template">
{{ trans('settings.invoice.default') }}
</label>
</div>
</div>
<div class="col-md-4 text-center px-2">
<div class="bg-print border-radius-default print-edge choose" @click="transfer_form.template='second'">
<img src="{{ asset('public/img/transfer_templates/second.png') }}" class="mb-1 mt-3" height="200" alt="Second"/>
<label>
<input type="radio" name="template" value="second" v-model="transfer_form.template">
{{ trans('settings.transfer.second') }}
</label>
</div>
</div>
<div class="col-md-4 text-center px-0">
<div class="bg-print border-radius-default print-edge choose" @click="transfer_form.template='third'">
<img src="{{ asset('public/img/transfer_templates/third.png') }}" class="mb-1 mt-3" height="200" alt="Third"/>
<label>
<input type="radio" name="template" value="third" v-model="transfer_form.template">
{{ trans('settings.transfer.third') }}
</label>
</div>
</div>
</div>
{!! Form::hidden('transfer_id', $transfer->id) !!}
{!! Form::hidden('_template', setting('transfer.template')) !!}
{!! Form::hidden('_prefix', 'transfer') !!}
{!! Form::close() !!}
</div>