-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
edit.blade.php
94 lines (72 loc) · 5.23 KB
/
edit.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.transfers', 1)]) }}
</x-slot>
<x-slot name="content">
<x-form.container>
<x-form id="transfer" method="PATCH" :route="['transfers.update', $transfer->id]" :model="$transfer">
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('transfers.form_description.general') }}" />
</x-slot>
<x-slot name="body">
<x-form.group.select name="from_account_id" label="{{ trans('transfers.from_account') }}" :options="$accounts" change="onChangeFromAccount" />
<x-form.group.select name="to_account_id" label="{{ trans('transfers.to_account') }}" :options="$accounts" change="onChangeToAccount" />
@if ($transfer->from_currency_code != $transfer->to_currency_code)
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="from_currency_code" :value="$transfer->from_currency_code" v-model="form.from_currency_code" />
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ default_currency() }}'" />
</div>
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="to_currency_code" :value="$transfer->to_currency_code" v-model="form.to_currency_code" />
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ default_currency() }}'" />
</div>
@else
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="from_currency_code" :value="$transfer->from_currency_code" v-model="form.from_currency_code" />
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ default_currency() }}'" />
</div>
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="to_currency_code" :value="$transfer->to_currency_code" v-model="form.to_currency_code" />
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ default_currency() }}'" />
</div>
@endif
<x-form.group.date name="transferred_at" label="{{ trans('general.date') }}" icon="calendar_today" value="{{ Date::parse($transfer->transferred_at)->toDateString() }}" show-date-format="{{ company_date_format() }}" date-format="Y-m-d" autocomplete="off" />
<x-form.group.money name="amount" label="{{ trans('general.amount') }}" :value="$transfer->amount" :currency="$currency" dynamicCurrency="currency" />
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
</x-slot>
</x-form.section>
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('transfers.form_description.other') }}" />
</x-slot>
<x-slot name="body">
<x-form.group.payment-method />
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" not-required />
<x-form.group.attachment />
<x-form.input.hidden name="currency_code" :value="$currency->code" v-model="form.currency_code" />
<x-form.input.hidden name="currency_rate" :value="$currency->rate" v-model="form.currency_rate" />
</x-slot>
</x-form.section>
@can('update-banking-transfers')
<x-form.section>
<x-slot name="foot">
<x-form.buttons cancel-route="transfers.index" />
</x-slot>
</x-form.section>
@endcan
</x-form>
</x-form.container>
</x-slot>
@push('scripts_start')
<script type="text/javascript">
var transfer_edit = {{ $transfer->id }};
if (typeof aka_currency !== 'undefined') {
aka_currency = {!! json_encode(! empty($currency) ? $currency : config('money.currencies.' . company()->currency)) !!};
} else {
var aka_currency = {!! json_encode(! empty($currency) ? $currency : config('money.currencies.' . company()->currency)) !!};
}
</script>
@endpush
<x-script folder="banking" file="transfers" />
</x-layouts.admin>