Merge pull request #2185 from cuneytsenturk/show-transfer

Added transfer show page
This commit is contained in:
Cüneyt Şentürk
2021-07-11 12:36:08 +03:00
committed by GitHub
46 changed files with 2647 additions and 14 deletions

View File

@ -19,7 +19,7 @@ import BulkAction from './../../plugins/bulk-action';
Vue.use(DashboardPlugin);
const app = new Vue({
el: '#app',
el: '#main-body',
mixins: [
Global
@ -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

@ -6,6 +6,7 @@ return [
'from_account_rate' => 'From Account Rate',
'to_account' => 'To Account',
'to_account_rate' => 'To Account Rate',
'details' => 'Detail|Details',
'messages' => [
'delete' => ':from to :to (:amount)',

View File

@ -41,6 +41,8 @@
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], null , 'col-md-12') }}
{!! Form::hidden('currency_code', null, ['id' => 'currency_code', 'v-model' => 'form.currency_code']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate', 'v-model' => 'form.currency_rate']) !!}
</div>

View File

@ -42,6 +42,8 @@
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], !empty($transfer) ? $transfer->attachment : null , 'col-md-12') }}
{!! Form::hidden('currency_code', $currency->code, ['id' => 'currency_code', 'v-model' => 'form.currency_code']) !!}
{!! Form::hidden('currency_rate', $currency->rate, ['id' => 'currency_rate', 'v-model' => 'form.currency_rate']) !!}
</div>

View File

@ -52,7 +52,7 @@
@endphp
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->expense_transaction->account->name) }}</td>
<td class="col-md-2 d-none d-md-block"><a class="col-aka" href="{{ route('transfers.edit', $item->id) }}">@date($item->expense_transaction->paid_at)</a></td>
<td class="col-md-2 d-none d-md-block"><a class="col-aka" href="{{ route('transfers.show', $item->id) }}">@date($item->expense_transaction->paid_at)</a></td>
<td class="col-sm-2 col-md-3 d-none d-sm-block long-texts">{{ $item->expense_transaction->account->name }}</td>
<td class="col-xs-4 col-sm-4 col-md-2 long-texts">{{ $item->income_transaction->account->name }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 text-right long-texts">@money($item->expense_transaction->amount, $item->expense_transaction->currency_code, true)</td>
@ -62,6 +62,8 @@
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<a class="dropdown-item" href="{{ route('transfers.show', $item->id) }}">{{ trans('general.show') }}</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{ route('transfers.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@can('delete-banking-transfers')
<div class="dropdown-divider"></div>

View File

@ -0,0 +1,9 @@
@extends('layouts.print')
@section('title', trans_choice('general.transfers', 1))
@section('content')
<x-transfers.template.ddefault
:transfer="$transfer"
/>
@endsection

View File

@ -0,0 +1,9 @@
@extends('layouts.print')
@section('title', trans_choice('general.transfers', 1))
@section('content')
<x-transfers.template.second
:transfer="$transfer"
/>
@endsection

View File

@ -0,0 +1,9 @@
@extends('layouts.print')
@section('title', trans_choice('general.transfers', 1))
@section('content')
<x-transfers.template.third
:transfer="$transfer"
/>
@endsection

View File

@ -0,0 +1,44 @@
@extends('layouts.admin')
@section('title', trans_choice('general.transfers', 1))
@section('new_button')
<x-transfers.show.top-buttons :transfer="$transfer" />
@endsection
@section('content')
<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">
<x-transfers.script />
@endpush

View File

@ -0,0 +1 @@
<script src="{{ asset( $scriptFile . '?v=' . $version) }}"></script>

View File

@ -0,0 +1,9 @@
@if ($attachment)
<div class="row align-items-center">
@foreach ($attachment as $file)
<div class="col-xs-12 col-sm-4 mb-4">
@include('partials.media.file')
</div>
@endforeach
</div>
@endif

View File

@ -0,0 +1,86 @@
@stack('content_header_start')
@if (!$hideHeader)
<x-transfers.show.header
:transfer="$transfer"
hide-header-from-account="{{ $hideHeaderFromAccount }}"
text-header-from-account="{{ $textHeaderFromAccount }}"
class-header-from-account="{{ $classHeaderFromAccount }}"
hide-header-to-account="{{ $hideHeaderToAccount }}"
text-header-to-account="{{ $textHeaderToAccount }}"
class-header-to-account="{{ $classHeaderToAccount }}"
hide-header-amount="{{ $hideHeaderAmount }}"
text-header-amount="{{ $textHeaderAmount }}"
class-header-amount="{{ $classHeaderAmount }}"
hide-header-paid-at="{{ $hideHeaderPaidAt }}"
text-header-paid-at="{{ $textHeaderPaidAt }}"
class-header-paid-at="{{ $classHeaderPaidAt }}"
/>
@endif
@stack('content_header_end')
@stack('transfer_start')
<x-transfers.show.transfer
:transfer="$transfer"
transfer-template="{{ $transferTemplate }}"
hide-from-account="{{ $hideFromAccount }}"
hide-from-account-title="{{ $hideFromAccountTitle }}"
hide-from-account-name="{{ $hideFromAccountName }}"
hide-from-account-number="{{ $hideFromAccountNumber }}"
hide-from-account-bank-name="{{ $hideFromAccountBankName }}"
hide-from-account-bank-phone="{{ $hideFromAccountBankPhone }}"
hide-from-account-bank-address="{{ $hideFromAccountBankAddress }}"
text-from-account-title="{{ $textFromAccountTitle }}"
text-from-account-number="{{ $textFromAccountNumber }}"
hide-to-account="{{ $hideToAccount }}"
hide-to-account-title="{{ $hideToAccountTitle }}"
hide-to-account-name="{{ $hideToAccountName }}"
hide-to-account-number="{{ $hideToAccountNumber }}"
hide-to-account-bank-name="{{ $hideToAccountBankName }}"
hide-to-account-bank-phone="{{ $hideToAccountBankPhone }}"
hide-to-account-bank-address="{{ $hideToAccountBankAddress }}"
text-to-account-title="{{ $textToAccountTitle }}"
text-to-account-number="{{ $textToAccountNumber }}"
hide-details="{{ $hideDetails }}"
hide-detail-title="{{ $hideDetailTitle }}"
hide-detail-date="{{ $hideDetailDate }}"
hide-detail-payment-method="{{ $hideDetailPaymentMethod }}"
hide-detail-reference="{{ $hideDetailReference }}"
hide-detail-description="{{ $hideDetailDescription }}"
hide-detail-amount="{{ $hideDetailAmount }}"
text-detail-title="{{ $textDetailTitle }}"
text-detail-date="{{ $textDetailDate }}"
text-detail-payment-method="{{ $textDetailPaymentMethod }}"
text-detail-reference="{{ $textDetailReference }}"
text-detail-description="{{ $textDetailDescription }}"
text-detail-amount="{{ $textDetailAmount }}"
/>
@stack('transfer_end')
@stack('attachment_start')
@if (!$hideAttachment)
<x-transfers.show.attachment
:transfer="$transfer"
:attachment="$attachment"
/>
@endif
@stack('attachment_end')
@stack('row_footer_start')
@if (!$hideFooter)
<x-transfers.show.footer
:transfer="$transfer"
:histories="$histories"
class-footer-histories="{{ $classFooterHistories }}"
hide-footer-histories="{{ $hideFooterHistories }}"
text-histories="{{ $textHistories }}"
/>
@endif
@stack('row_footer_end')
{{ Form::hidden('transfer_id', $transfer->id, ['id' => 'transfer_id']) }}

View File

@ -0,0 +1,13 @@
<div class="row">
@stack('row_footer_histories_start')
@if (!$hideFooterHistories)
<div class="{{ $classFooterHistories }}">
<x-transfers.show.histories
:transfer="$transfer"
:histories="$histories"
text-histories="{{ $textHistories }}"
/>
</div>
@endif
@stack('row_footer_histories_end')
</div>

View File

@ -0,0 +1,69 @@
<div class="row" style="font-size: inherit !important">
@stack('header_account_start')
@if (!$hideHeaderFromAccount)
<div class="{{ $classHeaderFromAccount }}">
{{ trans_choice($textHeaderFromAccount, 1) }}
<br>
<strong>
<span class="float-left long-texts mwpx-200 transaction-head-text">
{{ $transfer->expense_transaction->account->name }}
</span>
</strong>
<br><br>
</div>
@endif
@stack('header_account_end')
@stack('header_category_start')
@if (!$hideHeaderToAccount)
<div class="{{ $classHeaderToAccount }}">
{{ trans_choice($textHeaderToAccount, 1) }}
<br>
<strong>
<span class="float-left long-texts mwpx-300 transaction-head-text">
{{ $transfer->income_transaction->account->name }}
</span>
</strong>
<br><br>
</div>
@endif
@stack('header_category_end')
@stack('header_amount_start')
@if (!$hideHeaderAmount)
<div class="{{ $classHeaderAmount }}">
<span class="float-right">
{{ trans($textHeaderAmount) }}
</span>
<br>
<strong>
<span class="float-right long-texts mwpx-100 transaction-head-text">
@money($transfer->expense_transaction->amount, $transfer->from_currency_code, true)
</span>
</strong>
<br><br>
</div>
@endif
@stack('header_amount_end')
@stack('header_paid_at_start')
@if (!$hideHeaderPaidAt)
<div class="{{ $classHeaderPaidAt }}">
<span class="float-right">
{{ trans($textHeaderPaidAt) }}
</span>
<br>
<strong>
<span class="float-right long-texts mwpx-100 transaction-head-text">
@date($transfer->transferred_at)
</span>
</strong>
<br><br>
</div>
@endif
@stack('header_paid_at_end')
</div>

View File

@ -0,0 +1,47 @@
<div class="accordion">
<div class="card">
<div class="card-header" id="accordion-histories-header" data-toggle="collapse" data-target="#accordion-histories-body" aria-expanded="false" aria-controls="accordion-histories-body">
<h4 class="mb-0">{{ trans($textHistories) }}</h4>
</div>
<div id="accordion-histories-body" class="collapse hide" aria-labelledby="accordion-histories-header">
<div class="table-responsive">
<table class="table table-flush table-hover">
<thead class="thead-light">
@stack('row_footer_histories_head_tr_start')
<tr class="row table-head-line">
@stack('row_footer_histories_head_start')
<th class="col-xs-4 col-sm-3">
{{ trans('general.date') }}
</th>
<th class="col-xs-8 col-sm-9 text-left long-texts">
{{ trans('general.created') }}
</th>
@stack('row_footer_histories_head_end')
</tr>
@stack('row_footer_histories_head_tr_end')
</thead>
<tbody>
@stack('row_footer_histories_body_tr_start')
@foreach($histories as $history)
<tr class="row align-items-center border-top-1 tr-py">
@stack('row_footer_histories_body_td_start')
<td class="col-xs-4 col-sm-3">
@date($history->created_at)
</td>
<td class="col-xs-4 col-sm-6 text-left long-texts">
{{ $history->owner->name }}
</td>
@stack('row_footer_histories_body_td_end')
</tr>
@endforeach
@stack('row_footer_histories_body_tr_end')
</tbody>
</table>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,93 @@
@stack('button_group_start')
@if (!$hideButtonMoreActions)
<div class="dropup header-drop-top">
<button type="button" class="btn btn-white btn-sm" data-toggle="dropdown" aria-expanded="false">
<i class="fa fa-chevron-down"></i>&nbsp; {{ trans('general.more_actions') }}
</button>
<div class="dropdown-menu" role="menu">
@stack('button_dropdown_start')
@stack('edit_button_start')
@if (!$hideButtonEdit)
@can($permissionUpdate)
<a class="dropdown-item" href="{{ route($routeButtonEdit, $transfer->id) }}">
{{ trans('general.edit') }}
</a>
@endcan
@endif
@stack('edit_button_end')
@stack('duplicate_button_start')
@if (!$hideButtonDuplicate)
@can($permissionCreate)
<a class="dropdown-item" href="{{ route($routeButtonDuplicate, $transfer->id) }}">
{{ trans('general.duplicate') }}
</a>
@endcan
@endif
@stack('duplicate_button_end')
@stack('button_dropdown_divider_1_start')
@if (!$hideButtonGroupDivider1)
<div class="dropdown-divider"></div>
@endif
@stack('button_dropdown_divider_1_end')
@if (!$hideButtonPrint)
@stack('button_print_start')
<a class="dropdown-item" href="{{ route($routeButtonPrint, $transfer->id) }}" target="_blank">
{{ trans('general.print') }}
</a>
@stack('button_print_end')
@endif
@stack('button_pdf_start')
@if (!$hideButtonPdf)
<a class="dropdown-item" href="{{ route($routeButtonPdf, $transfer->id) }}">
{{ trans('general.download_pdf') }}
</a>
@endif
@stack('button_pdf_end')
@stack('button_dropdown_divider_2_start')
@if (!$hideButtonGroupDivider2)
<div class="dropdown-divider"></div>
@endif
@stack('button_dropdown_divider_2_end')
@if (!$hideButtonTemplate)
@stack('button_template_start')
<button type="button" class="dropdown-item" @click="onTemplate">
{{ trans('general.form.choose', ['field' => trans_choice('general.templates', 1)]) }}
</button>
@stack('button_template_end')
@endif
@stack('button_dropdown_divider_3_start')
@if (!$hideButtonGroupDivider3)
<div class="dropdown-divider"></div>
@endif
@stack('button_dropdown_divider_3_end')
@stack('delete_button_start')
@if (!$hideButtonDelete)
@can($permissionDelete)
{!! Form::deleteLink($transfer, $routeButtonDelete, $textDeleteModal, 'transfer_number') !!}
@endcan
@endif
@stack('delete_button_end')
@stack('button_dropdown_end')
</div>
</div>
@endif
@stack('button_group_end')
@stack('add_new_button_start')
@if (!$hideButtonAddNew)
@can($permissionCreate)
<a href="{{ route($routeButtonAddNew) }}" class="btn btn-white btn-sm">
{{ trans('general.add_new') }}
</a>
@endcan
@endif
@stack('add_new_button_end')

View File

@ -0,0 +1,137 @@
<div class="card" style="padding: 0; padding-left: 15px; padding-right: 15px; border-radius: 0; box-shadow: 0 4px 16px rgba(0,0,0,.2);">
<div class="card-body show-card-body">
@if ($transferTemplate)
@switch($transferTemplate)
@case('second')
<x-transfers.template.second
:transfer="$transfer"
hide-from-account="{{ $hideFromAccount }}"
hide-from-account-title="{{ $hideFromAccountTitle }}"
hide-from-account-name="{{ $hideFromAccountName }}"
hide-from-account-number="{{ $hideFromAccountNumber }}"
hide-from-account-bank-name="{{ $hideFromAccountBankName }}"
hide-from-account-bank-phone="{{ $hideFromAccountBankPhone }}"
hide-from-account-bank-address="{{ $hideFromAccountBankAddress }}"
text-from-account-title="{{ $textFromAccountTitle }}"
text-from-account-number="{{ $textFromAccountNumber }}"
hide-to-account="{{ $hideToAccount }}"
hide-to-account-title="{{ $hideToAccountTitle }}"
hide-to-account-name="{{ $hideToAccountName }}"
hide-to-account-number="{{ $hideToAccountNumber }}"
hide-to-account-bank-name="{{ $hideToAccountBankName }}"
hide-to-account-bank-phone="{{ $hideToAccountBankPhone }}"
hide-to-account-bank-address="{{ $hideToAccountBankAddress }}"
text-to-account-title="{{ $textToAccountTitle }}"
text-to-account-number="{{ $textToAccountNumber }}"
hide-details="{{ $hideDetails }}"
hide-detail-title="{{ $hideDetailTitle }}"
hide-detail-date="{{ $hideDetailDate }}"
hide-detail-payment-method="{{ $hideDetailPaymentMethod }}"
hide-detail-reference="{{ $hideDetailReference }}"
hide-detail-description="{{ $hideDetailDescription }}"
hide-detail-amount="{{ $hideDetailAmount }}"
text-detail-title="{{ $textDetailTitle }}"
text-detail-date="{{ $textDetailDate }}"
text-detail-payment-method="{{ $textDetailPaymentMethod }}"
text-detail-reference="{{ $textDetailReference }}"
text-detail-description="{{ $textDetailDescription }}"
text-detail-amount="{{ $textDetailAmount }}"
/>
@break
@case('third')
<x-transfers.template.third
:transfer="$transfer"
hide-from-account="{{ $hideFromAccount }}"
hide-from-account-title="{{ $hideFromAccountTitle }}"
hide-from-account-name="{{ $hideFromAccountName }}"
hide-from-account-number="{{ $hideFromAccountNumber }}"
hide-from-account-bank-name="{{ $hideFromAccountBankName }}"
hide-from-account-bank-phone="{{ $hideFromAccountBankPhone }}"
hide-from-account-bank-address="{{ $hideFromAccountBankAddress }}"
text-from-account-title="{{ $textFromAccountTitle }}"
text-from-account-number="{{ $textFromAccountNumber }}"
hide-to-account="{{ $hideToAccount }}"
hide-to-account-title="{{ $hideToAccountTitle }}"
hide-to-account-name="{{ $hideToAccountName }}"
hide-to-account-number="{{ $hideToAccountNumber }}"
hide-to-account-bank-name="{{ $hideToAccountBankName }}"
hide-to-account-bank-phone="{{ $hideToAccountBankPhone }}"
hide-to-account-bank-address="{{ $hideToAccountBankAddress }}"
text-to-account-title="{{ $textToAccountTitle }}"
text-to-account-number="{{ $textToAccountNumber }}"
hide-details="{{ $hideDetails }}"
hide-detail-title="{{ $hideDetailTitle }}"
hide-detail-date="{{ $hideDetailDate }}"
hide-detail-payment-method="{{ $hideDetailPaymentMethod }}"
hide-detail-reference="{{ $hideDetailReference }}"
hide-detail-description="{{ $hideDetailDescription }}"
hide-detail-amount="{{ $hideDetailAmount }}"
text-detail-title="{{ $textDetailTitle }}"
text-detail-date="{{ $textDetailDate }}"
text-detail-payment-method="{{ $textDetailPaymentMethod }}"
text-detail-reference="{{ $textDetailReference }}"
text-detail-description="{{ $textDetailDescription }}"
text-detail-amount="{{ $textDetailAmount }}"
/>
@break
@default
<x-transfers.template.ddefault
:transfer="$transfer"
hide-from-account="{{ $hideFromAccount }}"
hide-from-account-title="{{ $hideFromAccountTitle }}"
hide-from-account-name="{{ $hideFromAccountName }}"
hide-from-account-number="{{ $hideFromAccountNumber }}"
hide-from-account-bank-name="{{ $hideFromAccountBankName }}"
hide-from-account-bank-phone="{{ $hideFromAccountBankPhone }}"
hide-from-account-bank-address="{{ $hideFromAccountBankAddress }}"
text-from-account-title="{{ $textFromAccountTitle }}"
text-from-account-number="{{ $textFromAccountNumber }}"
hide-to-account="{{ $hideToAccount }}"
hide-to-account-title="{{ $hideToAccountTitle }}"
hide-to-account-name="{{ $hideToAccountName }}"
hide-to-account-number="{{ $hideToAccountNumber }}"
hide-to-account-bank-name="{{ $hideToAccountBankName }}"
hide-to-account-bank-phone="{{ $hideToAccountBankPhone }}"
hide-to-account-bank-address="{{ $hideToAccountBankAddress }}"
text-to-account-title="{{ $textToAccountTitle }}"
text-to-account-number="{{ $textToAccountNumber }}"
hide-details="{{ $hideDetails }}"
hide-detail-title="{{ $hideDetailTitle }}"
hide-detail-date="{{ $hideDetailDate }}"
hide-detail-payment-method="{{ $hideDetailPaymentMethod }}"
hide-detail-reference="{{ $hideDetailReference }}"
hide-detail-description="{{ $hideDetailDescription }}"
hide-detail-amount="{{ $hideDetailAmount }}"
text-detail-title="{{ $textDetailTitle }}"
text-detail-date="{{ $textDetailDate }}"
text-detail-payment-method="{{ $textDetailPaymentMethod }}"
text-detail-reference="{{ $textDetailReference }}"
text-detail-description="{{ $textDetailDescription }}"
text-detail-amount="{{ $textDetailAmount }}"
/>
@endswitch
@else
@include($transferTemplate)
@endif
</div>
</div>

View File

@ -0,0 +1,179 @@
@if (!$hideFromAccount)
<table class="border-bottom-1" style="width: 100%;">
<tbody>
<tr>
<td style="width: 60%; padding-bottom: 15px;">
@if (!$hideFromAccountTitle)
<h2 class="mb-1" style="font-size: 16px;">
{{ trans($textFromAccountTitle) }}
</h2>
@endif
@if (!$hideFromAccountName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->name }}
</p>
@endif
@if (!$hideFromAccountNumber)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ trans($textFromAccountNumber) }}: {{ $transfer->expense_transaction->account->number }}
</p>
@endif
@if (!$hideFromAccountBankName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->bank_name }}
</p>
@endif
@if (!$hideFromAccountBankPhone)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->bank_phone }}
</p>
@endif
@if (!$hideFromAccountBankAddress)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->bank_address }}
</p>
@endif
</td>
</tr>
</tbody>
</table>
@endif
@if (!$hideToAccount)
<table class="border-bottom-1" style="width: 100%; margin-top:15px;">
<tbody>
<tr>
<td style="width: 60%; padding-bottom: 15px;">
@if (!$hideToAccountTitle)
<h2 class="mb-1" style="font-size: 16px;">
{{ trans($textToAccountTitle) }}
</h2>
@endif
@if (!$hideToAccountName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->name }}
</p>
@endif
@if (!$hideToAccountNumber)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ trans($textToAccountNumber) }}: {{ $transfer->income_transaction->account->number }}
</p>
@endif
@if (!$hideToAccountBankName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->bank_name }}
</p>
@endif
@if (!$hideToAccountBankPhone)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->bank_phone }}
</p>
@endif
@if (!$hideToAccountBankAddress)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->bank_address }}
</p>
@endif
</td>
</tr>
</tbody>
</table>
@endif
@if (!$hideDetails)
@if (!$hideDetailTitle)
<table>
<tr>
<td style="padding-bottom: 0; padding-top: 32px;">
<h2 class="text-center text-uppercase" style="font-size: 16px;">
{{ trans_choice($textDetailTitle, 2) }}
</h2>
</td>
</tr>
</table>
@endif
<table>
<tr>
<td style="width: 70%; padding-top:0; padding-bottom:0;">
<table>
@if (!$hideDetailDate)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textDetailDate) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
@date($transfer->expense_transaction->paid_at)
</td>
</tr>
@endif
@if (!$hideDetailPaymentMethod)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans_choice($textDetailPaymentMethod, 1) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $payment_methods[$transfer->expense_transaction->payment_method] }}
</td>
</tr>
@endif
@if (!$hideDetailReference)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textDetailReference) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $transfer->expense_transaction->reference }}
</td>
</tr>
@endif
@if (!$hideDetailDescription)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textDetailDescription) }}
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $transfer->expense_transaction->description }}
</td>
</tr>
@endif
</table>
</td>
@if (!$hideDetailAmount)
<td style="width:30%; padding-top:32px; padding-left: 25px;" valign="top">
<table>
<tr>
<td style="background-color: #6da252; -webkit-print-color-adjust: exact; font-weight:bold !important; display:block;">
<h5 class="text-muted mb-0 text-white" style="font-size: 20px; color:#ffffff; text-align:center; margin-top: 16px;">
{{ trans($textDetailAmount) }}:
</h5>
<p class="font-weight-bold mb-0 text-white" style="font-size: 26px; color:#ffffff; text-align:center;">
@money($transfer->expense_transaction->amount, $transfer->expense_transaction->currency_code, true)
</p>
</td>
</tr>
</table>
</td>
@endif
</tr>
</table>
@endif

View File

@ -0,0 +1,179 @@
@if (!$hideDetails)
@if (!$hideDetailTitle)
<table>
<tr>
<td style="padding-bottom: 0; padding-top: 32px;">
<h2 class="text-center text-uppercase" style="font-size: 16px;">
{{ trans_choice($textDetailTitle, 2) }}
</h2>
</td>
</tr>
</table>
@endif
<table class="border-bottom-1">
<tr>
<td style="width: 70%; padding-top:0; padding-bottom:45px;">
<table>
@if (!$hideDetailDate)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textDetailDate) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
@date($transfer->expense_transaction->paid_at)
</td>
</tr>
@endif
@if (!$hideDetailPaymentMethod)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans_choice($textDetailPaymentMethod, 1) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $payment_methods[$transfer->expense_transaction->payment_method] }}
</td>
</tr>
@endif
@if (!$hideDetailReference)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textDetailReference) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $transfer->expense_transaction->reference }}
</td>
</tr>
@endif
@if (!$hideDetailDescription)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textDetailDescription) }}
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $transfer->expense_transaction->description }}
</td>
</tr>
@endif
</table>
</td>
@if (!$hideDetailAmount)
<td style="width:30%; padding-top:32px; padding-left: 25px;" valign="top">
<table>
<tr>
<td style="background-color: #6da252; -webkit-print-color-adjust: exact; font-weight:bold !important; display:block;">
<h5 class="text-muted mb-0 text-white" style="font-size: 20px; color:#ffffff; text-align:center; margin-top: 16px;">
{{ trans($textDetailAmount) }}:
</h5>
<p class="font-weight-bold mb-0 text-white" style="font-size: 26px; color:#ffffff; text-align:center;">
@money($transfer->expense_transaction->amount, $transfer->expense_transaction->currency_code, true)
</p>
</td>
</tr>
</table>
</td>
@endif
</tr>
</table>
@endif
@if (!$hideFromAccount)
<table class="border-bottom-1" style="width: 100%;">
<tbody>
<tr>
<td style="width: 60%; padding-bottom: 15px;">
@if (!$hideFromAccountTitle)
<h2 class="mb-1" style="font-size: 16px;">
{{ trans($textFromAccountTitle) }}
</h2>
@endif
@if (!$hideFromAccountName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->name }}
</p>
@endif
@if (!$hideFromAccountNumber)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ trans($textFromAccountNumber) }}: {{ $transfer->expense_transaction->account->number}}
</p>
@endif
@if (!$hideFromAccountBankName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->bank_name }}
</p>
@endif
@if (!$hideFromAccountBankPhone)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->bank_phone }}
</p>
@endif
@if (!$hideFromAccountBankAddress)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->bank_address }}
</p>
@endif
</td>
</tr>
</tbody>
</table>
@endif
@if (!$hideToAccount)
<table class="border-bottom-1" style="width: 100%; margin-top:15px;">
<tbody>
<tr>
<td style="width: 60%; padding-bottom: 15px;">
@if (!$hideToAccountTitle)
<h2 class="mb-1" style="font-size: 16px;">
{{ trans($textToAccountTitle) }}
</h2>
@endif
@if (!$hideToAccountName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->name }}
</p>
@endif
@if (!$hideToAccountNumber)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ trans($textToAccountNumber) }}: {{ $transfer->income_transaction->account->number }}
</p>
@endif
@if (!$hideToAccountBankName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->bank_name }}
</p>
@endif
@if (!$hideToAccountBankPhone)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->bank_phone }}
</p>
@endif
@if (!$hideToAccountBankAddress)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->bank_address }}
</p>
@endif
</td>
</tr>
</tbody>
</table>
@endif

View File

@ -0,0 +1,191 @@
@if (!$hideFromAccount && !$hideToAccount)
<table class="border-bottom-1" style="width: 100%;">
<tbody>
<tr>
@if (!$hideFromAccount)
<td style="width: 50%; padding-bottom: 15px;" valign="top">
<table>
<tbody>
<tr>
<td>
@if (!$hideFromAccountTitle)
<h2 class="mb-1" style="font-size: 16px;">
{{ trans($textFromAccountTitle) }}
</h2>
@endif
@if (!$hideFromAccountName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->name }}
</p>
@endif
@if (!$hideFromAccountNumber)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ trans($textFromAccountNumber) }}: {{ $transfer->expense_transaction->account->number}}
</p>
@endif
@if (!$hideFromAccountBankName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->bank_name }}
</p>
@endif
@if (!$hideFromAccountBankPhone)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->bank_phone }}
</p>
@endif
@if (!$hideFromAccountBankAddress)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->expense_transaction->account->bank_address }}
</p>
@endif
</td>
</tr>
</tbody>
</table>
</td>
@endif
@if (!$hideToAccount)
<td style="width: 50%; padding-bottom: 15px;" valign="top">
<table>
<tbody>
<tr>
<td style="text-align: right;">
@if (!$hideToAccountTitle)
<h2 class="mb-1" style="font-size: 16px;">
{{ trans($textToAccountTitle) }}
</h2>
@endif
@if (!$hideToAccountName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->name }}
</p>
@endif
@if (!$hideToAccountNumber)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ trans($textToAccountNumber) }}: {{ $transfer->income_transaction->account->number }}
</p>
@endif
@if (!$hideToAccountBankName)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->bank_name }}
</p>
@endif
@if (!$hideToAccountBankPhone)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->bank_phone }}
</p>
@endif
@if (!$hideToAccountBankAddress)
<p style="margin: 0px; padding: 0px; font-size: 14px;">
{{ $transfer->income_transaction->account->bank_address }}
</p>
@endif
</td>
</tr>
</tbody>
</table>
</td>
@endif
</tr>
</tbody>
</table>
@endif
@if (!$hideDetails)
@if (!$hideDetailTitle)
<table>
<tr>
<td style="padding-bottom: 0; padding-top: 32px;">
<h2 class="text-center text-uppercase" style="font-size: 16px;">
{{ trans_choice($textDetailTitle, 2) }}
</h2>
</td>
</tr>
</table>
@endif
<table>
<tr>
<td style="width: 70%; padding-top:0; padding-bottom:0;">
<table>
@if (!$hideDetailDate)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textDetailDate) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
@date($transfer->expense_transaction->paid_at)
</td>
</tr>
@endif
@if (!$hideDetailPaymentMethod)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans_choice($textDetailPaymentMethod, 1) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $payment_methods[$transfer->expense_transaction->payment_method] }}
</td>
</tr>
@endif
@if (!$hideDetailReference)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textDetailReference) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $transfer->expense_transaction->reference }}
</td>
</tr>
@endif
@if (!$hideDetailDescription)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textDetailDescription) }}
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $transfer->expense_transaction->description }}
</td>
</tr>
@endif
</table>
</td>
@if (!$hideDetailAmount)
<td style="width:30%; padding-top:32px; padding-left: 25px;" valign="top">
<table>
<tr>
<td style="background-color: #6da252; -webkit-print-color-adjust: exact; font-weight:bold !important; display:block;">
<h5 class="text-muted mb-0 text-white" style="font-size: 20px; color:#ffffff; text-align:center; margin-top: 16px;">
{{ trans($textDetailAmount) }}:
</h5>
<p class="font-weight-bold mb-0 text-white" style="font-size: 26px; color:#ffffff; text-align:center;">
@money($transfer->expense_transaction->amount, $transfer->expense_transaction->currency_code, true)
</p>
</td>
</tr>
</table>
</td>
@endif
</tr>
</table>
@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>