92 lines
4.5 KiB
PHP
Raw Normal View History

2017-09-14 22:21:00 +03:00
@extends('layouts.admin')
@section('title', trans('general.title.edit', ['type' => trans_choice('general.payments', 1)]))
@section('content')
2020-09-27 00:33:06 +03:00
@if (($recurring = $payment->recurring) && ($next = $recurring->getNextRecurring()))
2020-01-23 17:32:50 +03:00
<div class="media mb-3">
<div class="media-body">
<div class="media-comment-text">
<div class="d-flex">
<h5 class="mt-0">{{ trans('recurring.recurring') }}</h5>
</div>
2018-04-28 11:56:11 +03:00
2020-01-23 17:32:50 +03:00
<p class="text-sm lh-160 mb-0">{{ trans('recurring.message', [
'type' => mb_strtolower(trans_choice('general.payments', 1)),
'date' => $next->format($date_format)
]) }}
</p>
</div>
</div>
2018-04-28 11:56:11 +03:00
</div>
@endif
2019-11-16 10:21:14 +03:00
<div class="card">
2017-09-14 22:21:00 +03:00
{!! Form::model($payment, [
'method' => 'PATCH',
'files' => true,
2019-11-16 10:21:14 +03:00
'route' => ['payments.update', $payment->id],
2018-09-17 13:57:03 +03:00
'role' => 'form',
2019-11-16 10:21:14 +03:00
'id' => 'payment',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'class' => 'form-loading-button',
'novalidate' => 'true'
2017-09-14 22:21:00 +03:00
]) !!}
2019-11-16 10:21:14 +03:00
<div class="card-body">
<div class="row">
2020-02-11 18:04:10 +03:00
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($payment->paid_at)->toDateString()) }}
2017-09-14 22:21:00 +03:00
2019-11-16 10:21:14 +03:00
{!! Form::hidden('currency_code', $payment->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
2018-07-10 19:37:06 +03:00
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency, 'dynamic-currency' => 'currency'], $payment->amount) }}
2017-09-14 22:21:00 +03:00
2020-03-09 11:57:06 +03:00
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $payment->account_id, ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }}
2017-09-14 22:21:00 +03:00
2020-11-10 21:20:50 +03:00
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $payment->contact_id, ['path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
2018-04-26 18:40:04 +03:00
2019-11-16 10:21:14 +03:00
{{ Form::textareaGroup('description', trans('general.description')) }}
2017-09-14 22:21:00 +03:00
2020-11-10 21:20:50 +03:00
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?type=expense']) }}
2017-09-14 22:21:00 +03:00
2019-11-16 10:21:14 +03:00
{{ Form::recurring('edit', $payment) }}
2017-09-14 22:21:00 +03:00
2019-11-16 10:21:14 +03:00
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, $payment->payment_method) }}
2017-09-14 22:21:00 +03:00
2019-11-16 10:21:14 +03:00
{{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }}
2017-09-14 22:21:00 +03:00
2020-03-04 13:55:00 +03:00
@if ($payment->attachment)
<div class="col-md-6">
2020-03-04 12:28:24 +03:00
@php $file = $payment->attachment; @endphp
@include('partials.media.file')
2020-03-04 13:55:00 +03:00
</div>
@else
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
@endif
2017-09-14 22:21:00 +03:00
2019-11-16 10:21:14 +03:00
@if ($payment->bill)
2020-03-20 17:25:21 +03:00
{{ Form::textGroup('document', trans_choice('general.bills', 1), 'file-invoice', ['disabled' => 'true'], $payment->bill->bill_number) }}
{{ Form::hidden('document_id', $payment->bill->id) }}
2019-11-16 10:21:14 +03:00
@endif
</div>
</div>
2017-09-14 22:21:00 +03:00
2020-10-14 17:07:59 +03:00
@can('update-purchases-payments')
2019-11-16 10:21:14 +03:00
<div class="card-footer">
2020-02-15 13:04:37 +03:00
<div class="row save-buttons">
{{ Form::saveButtons('payments.index') }}
2019-11-16 10:21:14 +03:00
</div>
</div>
2020-10-14 17:07:59 +03:00
@endcan
2020-02-11 18:04:10 +03:00
2019-11-16 10:21:14 +03:00
{{ Form::hidden('type', 'expense') }}
{!! Form::close() !!}
</div>
2017-09-14 22:21:00 +03:00
@endsection
2019-11-16 10:21:14 +03:00
@push('scripts_start')
2019-12-31 15:49:09 +03:00
<script src="{{ asset('public/js/purchases/payments.js?v=' . version('short')) }}"></script>
2017-11-13 21:55:15 +03:00
@endpush