Files
2026-06-30 12:10:09 +02:00

235 lines
12 KiB
PHP

@extends('layout.v3.session')
@section('content')
<form action="{{ route('recurring.store') }}" method="post" id="store" class="form-horizontal"
enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
{{-- row with recurrence information --}}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
{{-- mandatory recurrence stuff --}}
<div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.mandatory_for_recurring') }}</h3>
</div>
<div class="card-body">
{!! ExpandedForm::text('title') !!}
{!! ExpandedForm::date('first_date',$preFilled['first_date'], ['helpText' => trans('firefly.help_first_date'), 'min' => $preFilled['first_date']]) !!}
{!! ExpandedForm::select('repetition_type', [], null, ['helpText' => trans('firefly.change_date_other_options')]) !!}
{!! ExpandedForm::integer('skip',0, ['helpText' => trans('firefly.skip_help_text')]) !!}
{!! ExpandedForm::select('weekend', $weekendResponses, null, ['helpText' => trans('firefly.help_weekend')]) !!}
{!! ExpandedForm::select('repetition_end', $repetitionEnds) !!}
{!! ExpandedForm::date('repeat_until',null) !!}
{!! ExpandedForm::integer('repetitions',null) !!}
{{-- calendar in popup --}}
<div class="form-group" id="calendar_holder">
<label for="ffInput_calendar"
class="col-sm-4 control-label">{{ trans('form.calendar') }}</label>
<div class="col-sm-8">
<p class="form-control-static" id="ffInput_calendar">
<a href="#" id="calendar-link">{{ __('firefly.click_for_calendar') }}</a>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{{-- optional recurrence stuff --}}
<div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.optional_for_recurring') }}</h3>
</div>
<div class="card-body">
{!! ExpandedForm::textarea('recurring_description') !!}
{{-- only correct way to do active checkbox --}}
{!! ExpandedForm::checkbox('active', 1) !!}
{!! ExpandedForm::checkbox('apply_rules',1) !!}
{!! ExpandedForm::file('attachments[]', ['multiple' => 'multiple','helpText' => trans('firefly.upload_max_file_size', ['size' => print_nice_filesize($uploadSize)])]) !!}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
{{-- mandatory transaction information --}}
<div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.mandatory_for_transaction') }}</h3>
</div>
<div class="card-body">
<p><em>{{ __('firefly.mandatory_fields_for_tranaction') }}</em></p>
{{-- three buttons to distinguish type of transaction --}}
<div class="form-group" id="name_holder">
<label for="ffInput_type" class="col-sm-4 control-label">
{{ trans('form.transaction_type') }}
</label>
<div class="col-sm-8">
<div class="btn-group btn-group-sm">
<a href="#" class="btn btn-outline-secondary switch-button"
data-value="withdrawal">{{ __('firefly.withdrawal') }}</a>
<a href="#" class="btn btn-outline-secondary switch-button"
data-value="deposit">{{ __('firefly.deposit') }}</a>
<a href="#" class="btn btn-outline-secondary switch-button"
data-value="transfer">{{ __('firefly.transfer') }}</a>
</div>
</div>
</div>
<input type="hidden" name="transaction_type" value="">
{{-- end of three buttons --}}
{!! ExpandedForm::text('transaction_description') !!}
{{-- transaction information (mandatory) --}}
{!! CurrencyForm::currencyList('transaction_currency_id', $primaryCurrency->id) !!}
{!! ExpandedForm::amountNoCurrency('amount') !!}
{{-- source account if withdrawal, or if transfer: --}}
{!! AccountForm::longAccountList('source_id', null, ['label' => trans('form.asset_source_account')]) !!}
{{-- for deposits, a drop down with revenue accounts, loan debt cash and mortgage --}}
{!! AccountForm::activeDepositDestinations('deposit_source_id', null, ['label' => trans('form.deposit_source_id')]) !!}
{{-- destination if deposit or transfer: --}}
{{ AccountForm::longAccountList('destination_id', null, ['label' => trans('form.asset_destination_account')]) }}
{{-- destination account name for withdrawals --}}
{{-- {!! ExpandedForm::text('destination_name', null, {label: trans('form.expense_account')}) }} --}}
{{-- NEW for withdrawals, also a drop down with expense accounts, loans, debts, mortgages or (cash). --}}
{{ AccountForm::activeWithdrawalDestinations('withdrawal_destination_id', null, ['label' => trans('form.withdrawal_destination_id')]) }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{{-- optional transaction information --}}
<div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.optional_for_transaction') }}</h3>
</div>
<div class="card-body">
{{-- transaction information (optional) --}}
{!! CurrencyForm::currencyListEmpty('foreign_currency_id') !!}
{!! ExpandedForm::amountNoCurrency('foreign_amount') !!}
{{-- BUDGET ONLY WHEN CREATING A WITHDRAWAL --}}
@if(count($budgets) > 1)
{!! ExpandedForm::select('budget_id', $budgets, null) !!}
@else
{!! ExpandedForm::select('budget_id', $budgets, null, ['helpText' => trans('firefly.no_budget_pointer', ['link' => route('budgets.index')])]) !!}
@endif
{{-- CATEGORY ALWAYS --}}
{!! ExpandedForm::text('category') !!}
{{-- BILL / SUBSCRIPTION ONLY FOR WITHDRAWALS --}}
@if(count($bills) > 1)
{!! ExpandedForm::select('bill_id', $bills, null) !!}
@else
{!! ExpandedForm::select('bill_id', $bills, null, ['helpText' => trans('firefly.no_bill_pointer', ['link' => route('subscriptions.index')])]) !!}
@endif
{{-- TAGS --}}
{!! ExpandedForm::text('tags') !!}
{{-- RELATE THIS TRANSFER TO A PIGGY BANK --}}
{!! PiggyBankForm::piggyBankList('piggy_bank_id') !!}
</div>
</div>
</div>
</div>
{{-- row with submit stuff. --}}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.options') }}</h3>
</div>
<div class="card-body">
{!! ExpandedForm::optionsList('create','recurrence') !!}
</div>
<div class="card-footer text-end">
<button type="submit" class="btn btn-success">
{{ __('store_new_recurrence') }}
</button>
</div>
</div>
</div>
</div>
{{--
<div class="row">
<div class="card mb-2">
<div class="card-header">
<h3 class="card-title">{{ __('firefly.expected_repetitions') }}</h3>
</div>
<div class="card-body">
Here.
</div>
</div>
</div>
</div>
</div>
--}}
</form>
{{-- calendar modal --}}
<div class="modal fade" id="calendarModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ __('firefly.recurring_calendar_view') }}</h5>
</div>
<div class="modal-body">
<div id="recurring_calendar" class="calendar-display">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
@endsection
@section('scripts')
@vite(['js/pages/generic.js'])
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/typeahead/typeahead.bundle.min.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/common/autocomplete.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/bootstrap-tagsinput.min.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/lib/fc/fullcalendar.min.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
var transactionType = "{{ $preFilled['transaction_type'] }}";
var suggestUrl = "{{ route('recurring.suggest') }}";
var eventsUrl = "{{ route('recurring.events') }}";
var oldRepetitionType = "{{ $oldRepetitionType }}";
</script>
<script type="text/javascript" src="v1/js/ff/recurring/create.js?v={{ $FF_BUILD_TIME }}"
nonce="{{ $JS_NONCE }}"></script>
@endsection
@section('styles')
<link href="v1/css/bootstrap-tagsinput.css?v={{ $FF_BUILD_TIME }}" type="text/css" rel="stylesheet" media="all"
nonce="{{ $JS_NONCE }}">
<link href="v1/css/jquery-ui/jquery-ui.structure.min.css?v={{ $FF_BUILD_TIME }}" type="text/css" rel="stylesheet"
media="all" nonce="{{ $JS_NONCE }}">
<link href="v1/css/jquery-ui/jquery-ui.theme.min.css?v={{ $FF_BUILD_TIME }}" type="text/css" rel="stylesheet"
media="all" nonce="{{ $JS_NONCE }}">
<link href="v1/lib/fc/fullcalendar.min.css?v={{ $FF_BUILD_TIME }}" type="text/css" rel="stylesheet" media="all"
nonce="{{ $JS_NONCE }}">
@endsection