diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php new file mode 100644 index 0000000000..b0a8646d6a --- /dev/null +++ b/app/Http/Controllers/Transaction/EditController.php @@ -0,0 +1,81 @@ +. + */ + +namespace FireflyIII\Http\Controllers\Transaction; + + +use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\TransactionGroup; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; + +/** + * Class EditController + */ +class EditController extends Controller +{ + + /** + * SingleController constructor. + */ + public function __construct() + { + parent::__construct(); + + $maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize')); + $maxPostSize = app('steam')->phpBytes(ini_get('post_max_size')); + $uploadSize = min($maxFileSize, $maxPostSize); + + + app('view')->share('uploadSize', $uploadSize); + + // some useful repositories: + $this->middleware( + function ($request, $next) { + + app('view')->share('title', (string)trans('firefly.transactions')); + app('view')->share('mainTitleIcon', 'fa-repeat'); + + return $next($request); + } + ); + } + + + /** + * @param TransactionGroup $transactionGroup + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function edit(TransactionGroup $transactionGroup) + { + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class); + $allowedOpposingTypes = config('firefly.allowed_opposing_types'); + $accountToTypes = config('firefly.account_to_transaction'); + $defaultCurrency = app('amount')->getDefaultCurrency(); + $cash = $repository->getCashAccount(); + + return view('transactions.edit', compact('cash', 'transactionGroup', 'allowedOpposingTypes', 'accountToTypes', 'defaultCurrency' + + )); + + } + +} \ No newline at end of file diff --git a/app/Services/Internal/Update/GroupUpdateService.php b/app/Services/Internal/Update/GroupUpdateService.php index ae54bbe4fd..87b4c8c00a 100644 --- a/app/Services/Internal/Update/GroupUpdateService.php +++ b/app/Services/Internal/Update/GroupUpdateService.php @@ -56,10 +56,10 @@ class GroupUpdateService Log::debug(sprintf('Will now update journal #%d (only journal in group #%d)', $first->id, $transactionGroup->id)); $this->updateTransactionJournal($transactionGroup, $first, reset($transactions)); $transactionGroup->refresh(); - + app('preferences')->mark(); return $transactionGroup; } - die('cannot update split'); + die('cannot update split yet.'); app('preferences')->mark(); } diff --git a/app/Transformers/TransactionGroupTransformer.php b/app/Transformers/TransactionGroupTransformer.php index c5e71e7a29..4ac0447a1e 100644 --- a/app/Transformers/TransactionGroupTransformer.php +++ b/app/Transformers/TransactionGroupTransformer.php @@ -295,6 +295,7 @@ class TransactionGroupTransformer extends AbstractTransformer 'currency_id' => $row['currency_id'], 'currency_code' => $row['currency_code'], + 'currency_name' => $row['currency_name'], 'currency_symbol' => $row['currency_symbol'], 'currency_decimal_places' => $row['currency_decimal_places'], diff --git a/public/v1/js/app.js b/public/v1/js/app.js index fc8910caa6..6ee10da05a 100644 --- a/public/v1/js/app.js +++ b/public/v1/js/app.js @@ -12551,7 +12551,9 @@ Vue.component('account-select', __webpack_require__(119)); Vue.component('passport-clients', __webpack_require__(124)); Vue.component('passport-authorized-clients', __webpack_require__(129)); Vue.component('passport-personal-access-tokens', __webpack_require__(134)); + Vue.component('create-transaction', __webpack_require__(139)); +Vue.component('edit-transaction', __webpack_require__(144)); var app = new Vue({ el: '#app' @@ -51533,7 +51535,7 @@ exports = module.exports = __webpack_require__(0)(false); // module -exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]); +exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]); // exports @@ -51600,30 +51602,44 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); return this.error.length > 0; }, changeData: function changeData() { + var transactionType = this.transactionType; // reset of all are empty: - //console.log('Type "' + this.transactionType + '"'); + //console.log('Type "' + transactionType + '"'); //console.log('Source "' + this.source.name + '"'); //console.log('Dest "' + this.destination.name + '"'); - if (!this.transactionType && !this.source.name && !this.destination.name) { + if (!transactionType && !this.source.name && !this.destination.name) { $(this.$refs.cur).text(''); + console.log('A'); return; } - if ('' === this.transactionType && '' !== this.source.currency_name) { + if (null === transactionType) { + transactionType = ''; + } + + if ('' === transactionType && '' !== this.source.currency_name) { $(this.$refs.cur).text(this.source.currency_name); + console.log('B'); return; } - if ('' === this.transactionType && '' !== this.destination.currency_name) { + if ('' === transactionType && '' !== this.destination.currency_name) { $(this.$refs.cur).text(this.destination.currency_name); + console.log('C'); return; } - if (this.transactionType === 'Withdrawal' || this.transactionType === 'Transfer') { + if (transactionType === 'Withdrawal' || transactionType === 'Transfer') { $(this.$refs.cur).text(this.source.currency_name); + console.log('D'); return; } - if (this.transactionType === 'Deposit') { + if (transactionType === 'Deposit') { $(this.$refs.cur).text(this.destination.currency_name); + console.log('E'); return; } + console.log('transactionType: ' + transactionType); + console.log('this.source.name: ' + this.source.name); + console.log('this.destination.name: ' + this.destination.name); + console.log('F'); } }, watch: { @@ -54882,7 +54898,7 @@ exports = module.exports = __webpack_require__(0)(false); // module -exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]); // exports @@ -55270,6 +55286,10 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); if (this.resetFormAfter) { this.resetTransactions(); } + + var button = $(e.currentTarget); + button.prop("disabled", true); + axios.post(uri, data).then(function (response) { if (_this.createAnother) { // do message: @@ -55278,6 +55298,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); if (_this.resetFormAfter) { _this.addTransaction(); } + button.prop("disabled", false); } else { window.location.href = 'transactions/show/' + response.data.data.id + '?message=created'; } @@ -55286,6 +55307,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // something something render errors. _this.parseErrors(error.response.data); // something. + button.prop("disabled", false); }); if (e) { e.preventDefault(); @@ -56072,7 +56094,11 @@ var render = function() { _c("div", { staticClass: "btn-group" }, [ _c( "button", - { staticClass: "btn btn-success", on: { click: _vm.submit } }, + { + staticClass: "btn btn-success", + attrs: { id: "submitButton" }, + on: { click: _vm.submit } + }, [_vm._v("Submit")] ) ]) @@ -56150,5 +56176,1301 @@ if (false) { } } +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +var disposed = false +function injectStyle (ssrContext) { + if (disposed) return + __webpack_require__(145) +} +var normalizeComponent = __webpack_require__(2) +/* script */ +var __vue_script__ = __webpack_require__(147) +/* template */ +var __vue_template__ = __webpack_require__(148) +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = "data-v-16510831" +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __vue_script__, + __vue_template__, + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "resources/assets/js/components/transactions/EditTransaction.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-16510831", Component.options) + } else { + hotAPI.reload("data-v-16510831", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +module.exports = Component.exports + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +// style-loader: Adds some css to the DOM by adding a \ No newline at end of file diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 3dbcd87920..b74d2b0c26 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -852,6 +852,7 @@ return [ 'deleted_transfer' => 'Successfully deleted transfer ":description"', 'stored_journal' => 'Successfully created new transaction ":description"', 'stored_journal_no_descr' => 'Successfully created your new transaction', + 'updated_journal_no_descr' => 'Successfully updated your transaction', 'select_transactions' => 'Select transactions', 'rule_group_select_transactions' => 'Apply ":title" to transactions', 'rule_select_transactions' => 'Apply ":title" to transactions', diff --git a/resources/views/v1/transactions/create.twig b/resources/views/v1/transactions/create.twig index 353f56b092..31a305aac8 100644 --- a/resources/views/v1/transactions/create.twig +++ b/resources/views/v1/transactions/create.twig @@ -6,6 +6,8 @@ {% block content %} + {# TODO attachments #} + diff --git a/resources/views/v1/transactions/edit.twig b/resources/views/v1/transactions/edit.twig new file mode 100644 index 0000000000..ab3b4c55c0 --- /dev/null +++ b/resources/views/v1/transactions/edit.twig @@ -0,0 +1,288 @@ +{% extends "./layout/default" %} + +{% block breadcrumbs %} + {{ Breadcrumbs.render(Route.getCurrentRoute.getName, transactionGroup) }} + +{% endblock %} + +{% block content %} + + {# +
+ + + + + + {% if errors.all|length > 0 %} +
+
+

{{ 'errors'|_ }}

+
    + {% for err in errors.all %} +
  • {{ err }}
  • + {% endfor %} +
+
+
+ {% endif %} + + +
+
+
+
+

{{ 'mandatoryFields'|_ }}

+
+
+ + + {{ ExpandedForm.text('description',journal.description) }} + + + {% if what == 'transfer' or what == 'withdrawal' %} + {{ ExpandedForm.longAccountList('source_id', data.source_id, {label: trans('form.asset_source_account')}) }} + {% endif %} + + + {% if what == 'deposit' %} + {{ ExpandedForm.text('source_name',data.source_name, {label: trans('form.revenue_account')}) }} + {% endif %} + + + {% if what == 'withdrawal' %} + {{ ExpandedForm.text('destination_name',data.destination_name, {label: trans('form.expense_account')}) }} + {% endif %} + + + {% if what == 'transfer' or what == 'deposit' %} + {{ ExpandedForm.longAccountList('destination_id', data.destination_id, {label: trans('form.asset_destination_account')} ) }} + {% endif %} + + + {{ ExpandedForm.amount('amount',data.amount, {'currency' : data.currency}) }} + + + {{ ExpandedForm.staticText('exchange_rate_instruction','(here be text)') }} + + {{ ExpandedForm.nonSelectableAmount('native_amount', data.native_amount, {currency: data.native_currency}) }} + + {{ ExpandedForm.nonSelectableAmount('source_amount', data.source_amount, {currency: data.source_currency }) }} + + {{ ExpandedForm.nonSelectableAmount('destination_amount', data.destination_amount, {currency: data.destination_currency }) }} + + + {{ ExpandedForm.date('date',data['date']) }} +
+
+ +
+
+
+
+

{{ 'optionalFields'|_ }}

+
+
+ {% if what == 'withdrawal' %} + {% if budgetList|length > 1 %} + {{ ExpandedForm.select('budget_id', budgetList, data['budget_id']) }} + {% else %} + {{ ExpandedForm.select('budget_id', budgetList, data['budget_id'], {helpText: trans('firefly.no_budget_pointer', {link: route('budgets.index')})}) }} + {% endif %} + {% endif %} + {{ ExpandedForm.text('category',data['category']) }} + {{ ExpandedForm.text('tags') }} + + {% if data.bill_id != null %} + {{ ExpandedForm.checkbox('keep_bill_id',1,true, {'helpText': trans('firefly.journal_link_bill', {name: data.bill_name,route: route('bills.show', [data.bill_id])})} ) }} + {% endif %} + +
+
+ + + {% if + not optionalFields.interest_date or + not optionalFields.book_date or + not optionalFields.process_date or + not optionalFields.due_date or + not optionalFields.payment_date or + not optionalFields.invoice_date or + not optionalFields.internal_reference or + not optionalFields.notes or + not optionalFields.attachments %} +

+ {{ trans('firefly.hidden_fields_preferences', {link: route('preferences.index')})|raw }}

+ {% endif %} + {% if + optionalFields.interest_date or + optionalFields.book_date or + optionalFields.process_date or + optionalFields.due_date or + optionalFields.payment_date or + optionalFields.invoice_date or + data.interest_date or + data.book_date or + data.process_date or + data.due_date or + data.payment_date %} +
+
+

{{ 'optional_field_meta_dates'|_ }}

+
+
+ + {% if optionalFields.interest_date or data['interest_date'] %} + {{ ExpandedForm.date('interest_date',data['interest_date']) }} + {% endif %} + + {% if optionalFields.book_date or data['book_date'] %} + {{ ExpandedForm.date('book_date',data['book_date']) }} + {% endif %} + + {% if optionalFields.process_date or data['process_date'] %} + {{ ExpandedForm.date('process_date',data['process_date']) }} + {% endif %} + + {% if optionalFields.due_date or data['due_date'] %} + {{ ExpandedForm.date('due_date',data['due_date']) }} + {% endif %} + + {% if optionalFields.payment_date or data['payment_date'] %} + {{ ExpandedForm.date('payment_date',data['payment_date']) }} + {% endif %} + + {% if optionalFields.invoice_date or data['invoice_date'] %} + {{ ExpandedForm.date('invoice_date',data['invoice_date']) }} + {% endif %} + +
+
+ {% endif %} + + + {% if + optionalFields.internal_reference or + optionalFields.notes or + data['interal_reference'] or + data['notes'] %} +
+
+

{{ 'optional_field_meta_business'|_ }}

+
+
+ {% if optionalFields.internal_reference or data['interal_reference'] %} + {{ ExpandedForm.text('internal_reference', data['interal_reference']) }} + {% endif %} + + {% if optionalFields.notes or data['notes'] %} + {{ ExpandedForm.textarea('notes', data['notes'], {helpText: trans('firefly.field_supports_markdown')}) }} + {% endif %} + +
+
+ {% endif %} + + {% if optionalFields.attachments or journal.attachments|length > 0 %} +
+
+

{{ 'optional_field_attachments'|_ }}

+
+
+ {% if journal.attachments|length > 0 %} +
+ +
+ {% for att in journal.attachments %} + + {% endfor %} +
+
+ {% endif %} + + {{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }} + +
+
+ {% endif %} + + +
+
+

{{ 'options'|_ }}

+
+
+ {{ ExpandedForm.optionsList('update','transaction') }} + +
+ + + +
+
+ +
+
+
+ + +
+ #} + +{% endblock %} +{% block scripts %} + + {# + + + + + + + + + + + +#} +{% endblock %} +{% block styles %} + {# + + + + #} +{% endblock %} diff --git a/resources/views/v1/transactions/show.twig b/resources/views/v1/transactions/show.twig index 4668632afc..1b17cead18 100644 --- a/resources/views/v1/transactions/show.twig +++ b/resources/views/v1/transactions/show.twig @@ -19,6 +19,22 @@ {% endif %} + + {% if message == 'updated' %} +
+
+ +
+
+ {% endif %} +
@@ -55,362 +71,295 @@
{{ 'edit'|_ }} {% if type != 'Opening balance' and type != 'Reconciliation' %} - {{ 'clone'|_ }} - {% if type != 'Withdrawal' %} - {{ 'convert_to_withdrawal'|_ }} - {% endif %} - {% if type != 'Deposit' %} - {{ 'convert_to_deposit'|_ }} - {% endif %} - {% if type != 'Transfer' %} - {{ 'convert_to_transfer'|_ }} - {% endif %} + {# {{ 'clone'|_ }}#} + + {# + {% if type != 'Withdrawal' %} + {{ 'convert_to_withdrawal'|_ }} {% endif %} - {{ 'delete'|_ }} -
+ {% if type != 'Deposit' %} + {{ 'convert_to_deposit'|_ }} + {% endif %} + {% if type != 'Transfer' %} + {{ 'convert_to_transfer'|_ }} + {% endif %} + #} + {% endif %} + {# + {{ 'delete'|_ }} + #}
-
-
-
-

{{ 'transaction_journal_meta'|_ }}

-
-
- - - {% if type != 'Withdrawal' or splits == 1 %} - - - - - {% endif %} - - {% if type != 'Deposit' or splits == 1 %} - - - - - {% endif %} + +
+
+
+

{{ 'transaction_journal_meta'|_ }}

+
+
+
- {{ 'source_accounts'|_ }} - - {% for journal in groupArray.transactions %} - - {{ journal.source_name }} - - {% if loop.index0 != groupArray.transactions|length -1 %}, {% endif %} - {% endfor %} -
- {{ 'destination_accounts'|_ }} - - - {% for journal in groupArray.transactions %} - - {{ journal.destination_name }} - - {% if loop.index0 != groupArray.transactions|length -1 %}, {% endif %} - {% endfor %} -
+ + {% if type != 'Withdrawal' or splits == 1 %} - + - + {% endif %} + + {% if type != 'Deposit' or splits == 1 %} + + + + + {% endif %} + + + + + +
{{ 'total_amount'|_ }} - {% for amount in amounts %} - {% if type == 'Withdrawal' or type == 'Deposit' %} - {{ formatAmountBySymbol(amount.amount*-1,amount.symbol, amount.decimal_places) }}, - {% elseif type == 'Transfer' %} - - {{ formatAmountBySymbol(amount.amount, amount.symbol, amount.decimal_places, false) }}, - - {% endif %} + {{ 'source_accounts'|_ }} + + {% for journal in groupArray.transactions %} + + {{ journal.source_name }} + + {% if loop.index0 != groupArray.transactions|length -1 %}, {% endif %} {% endfor %}
+ {{ 'destination_accounts'|_ }} + + + {% for journal in groupArray.transactions %} + + {{ journal.destination_name }} + + {% if loop.index0 != groupArray.transactions|length -1 %}, {% endif %} + {% endfor %} +
{{ 'total_amount'|_ }} + {% for amount in amounts %} + {% if type == 'Withdrawal' or type == 'Deposit' %} + {{ formatAmountBySymbol(amount.amount*-1,amount.symbol, amount.decimal_places) }}, + {% elseif type == 'Transfer' %} + + {{ formatAmountBySymbol(amount.amount, amount.symbol, amount.decimal_places, false) }}, + + {% endif %} + {% endfor %} +
+
+
+
+ +
+ +
+{% if splits > 1 %} +
+
+

{{ 'splits'|_ }}

+
+
+{% endif %} +{% set boxSize=12 %} +{% if(splits == 2) %} + {% set boxSize=6 %} +{% endif %} +{% if (splits > 2) %} + {% set boxSize = 4 %} +{% endif %} +
+ {% for index,journal in groupArray.transactions %} +
+
+
+

+ {{ journal.description }} + {% if journal.reconciled %} + + {% endif %} + {% if splits > 1 %} + + {{ index+1 }} / {{ splits }} + + {% endif %} +

+
+
+ + + + + {% if null != journal.category_id %} + + + + + {% endif %} + {% if null != journal.budget_id and type == 'Withdrawal' %} + + + + + {% endif %} + {% if null != journal.bill_id and type == 'Withdrawal' %} + + + + + {% endif %} + + {% for dateField in ['interest_date','book_date','process_date','due_date','payment_date','invoice_date'] %} + {% if journalHasMeta(journal.transaction_journal_id, dateField) %} + + + + + {% endif %} + {% endfor %} + {% for metaField in ['external_id','bunq_payment_id','internal_reference','sepa_batch_id','sepa_ct_id','sepa_ct_op','sepa_db','sepa_country','sepa_cc','sepa_ep','sepa_ci'] %} + {% if journalHasMeta(journal.transaction_journal_id, metaField) %} + + + + + {% endif %} + {% endfor %} + {% if null != journal.notes and '' != journal.notes %} + + + + + {% endif %} + {% if journal.tags|length > 0 %} + + + + + {% endif %}
+ {{ journal.source_name }} → + {% if type == 'Withdrawal' or type == 'Deposit' %} + {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }} + {% elseif type == 'Transfer' %} + + {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places, false) }} + + {% endif %} + + + {% if null != journal.foreign_amount %} + {% if type == 'Withdrawal' or type == 'Deposit' %} + ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }}) + {% elseif type == 'Transfer' %} + + ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }}) + + {% endif %} + {% endif %} + + + → + {{ journal.destination_name }} +
{{ 'category'|_ }}{{ journal.category_name }}
{{ 'budget'|_ }}{{ journal.budget_name }}
{{ 'bill'|_ }}{{ journal.bill_name }}
{{ trans('list.'~dateField) }}{{ journalGetMetaDate(journal.transaction_journal_id, dateField).formatLocalized(monthAndDayFormat) }}
{{ trans('list.'~metaField) }}{{ journalGetMetaField(journal.transaction_journal_id, metaField) }}
{{ trans('list.notes') }}{{ journal.notes|markdown }}
{{ 'tags'|_ }} + {% for tag in journal.tags %} +

+ + {{ tag }} +

+ {% endfor %} +
-
-
-
-
- {% if splits > 1 %} -
-
-

{{ 'splits'|_ }}

-
-
- {% endif %} - {% set boxSize=12 %} - {% if(splits == 2) %} - {% set boxSize=6 %} - {% endif %} - {% if (splits > 2) %} - {% set boxSize = 4 %} - {% endif %} -
- {% for index,journal in groupArray.transactions %} -
+ + {% if links[journal.transaction_journal_id]|length > 0 %}

- {{ journal.description }} - {% if journal.reconciled %} - - {% endif %} - {% if splits > 1 %} - - {{ index+1 }} / {{ splits }} - - {% endif %} + {{ 'journal_links'|_ }}

- - + + - - {% if null != journal.category_id %} - - - - - {% endif %} - {% if null != journal.budget_id and type == 'Withdrawal' %} - - - - - {% endif %} - {% if null != journal.bill_id and type == 'Withdrawal' %} - - - - - {% endif %} - - {% for dateField in ['interest_date','book_date','process_date','due_date','payment_date','invoice_date'] %} - {% if journalHasMeta(journal.transaction_journal_id, dateField) %} - - - - - {% endif %} - {% endfor %} - {% for metaField in ['external_id','bunq_payment_id','internal_reference','sepa_batch_id','sepa_ct_id','sepa_ct_op','sepa_db','sepa_country','sepa_cc','sepa_ep','sepa_ci'] %} - {% if journalHasMeta(journal.transaction_journal_id, metaField) %} - - - - - {% endif %} - {% endfor %} - {% if null != journal.notes and '' != journal.notes %} - - - - - {% endif %} - {% if journal.tags|length > 0 %} - - - - {% endif %} + {% endfor %} +
- {{ journal.source_name }} → - {% if type == 'Withdrawal' or type == 'Deposit' %} - {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }} - {% elseif type == 'Transfer' %} - - {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places, false) }} - - {% endif %} + {% for link in links[journal.transaction_journal_id] %} +
+
+ + +
+
{{ link.link }} "{{ link.description }}" - - {% if null != journal.foreign_amount %} - {% if type == 'Withdrawal' or type == 'Deposit' %} - ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }}) - {% elseif type == 'Transfer' %} - - ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }}) - + ({{ link.amount|raw }}) + {% if '' != link.foreign_amount %} + ({{ link.foreign_amount|raw }}) {% endif %} - {% endif %} - - - → - {{ journal.destination_name }} -
{{ 'category'|_ }}{{ journal.category_name }}
{{ 'budget'|_ }}{{ journal.budget_name }}
{{ 'bill'|_ }}{{ journal.bill_name }}
{{ trans('list.'~dateField) }}{{ journalGetMetaDate(journal.transaction_journal_id, dateField).formatLocalized(monthAndDayFormat) }}
{{ trans('list.'~metaField) }}{{ journalGetMetaField(journal.transaction_journal_id, metaField) }}
{{ trans('list.notes') }}{{ journal.notes|markdown }}
{{ 'tags'|_ }} - {% for tag in journal.tags %} -

- - {{ tag }} -

- {% endfor %}
+ {% endif %} - - {% if links[journal.transaction_journal_id]|length > 0 %} -
-
-

- {{ 'journal_links'|_ }} -

-
-
- - {% for link in links[journal.transaction_journal_id] %} - - - - - {% endfor %} - -
-
- - -
-
{{ link.link }} "{{ link.description }}" - - ({{ link.amount|raw }}) - {% if '' != link.foreign_amount %} - ({{ link.foreign_amount|raw }}) - {% endif %} -
-
+ + {% if attachments[journal.transaction_journal_id]|length > 0 %} +
+
+

{{ 'attachments'|_ }}

- {% endif %} - - - {% if attachments[journal.transaction_journal_id]|length > 0 %} -
-
-

{{ 'attachments'|_ }}

-
-
- - {% for attachment in attachments[journal.transaction_journal_id] %} - - -
-
- - - {% if attachment.file_exists %} - - {% endif %} - {% if not attachment.file_exists %} - - {% endif %} -
-
+
+ + {% for attachment in attachments[journal.transaction_journal_id] %} + + + - - {% endfor %} -
+
+ + {% if attachment.file_exists %} - - - {% if attachment.title %} - {{ attachment.title }} - {% else %} - {{ attachment.filename }} - {% endif %} - - ({{ attachment.size|filesize }}) - {% if null != attachment.notes and '' != attachment.notes %} - {{ attachment.notes|markdown }} - {% endif %} + {% endif %} {% if not attachment.file_exists %} - + + {% endif %} +
+
+ {% if attachment.file_exists %} + + {% if attachment.title %} {{ attachment.title }} {% else %} {{ attachment.filename }} {% endif %} -
- {{ 'attachment_not_found'|_ }} - {% endif %} -
-
- - {% endif %} - - - {% if events[journal.transaction_journal_id]|length > 0 %} -
-
-

{{ 'piggy_events'|_ }}

-
-
- - {% for event in events[journal.transaction_journal_id] %} - - - - - - {% endfor %} -
{{ event.amount|raw }} - {{ event.piggy }}
-
-
- {% endif %} - - {% endfor %} - - -{% endblock %} -{% block scripts %} -{% endblock %} - - {# - - {% if links.count > 0 %} -
-
-

{{ 'journal_links'|_ }}

-
-
- - {% for link in links %} - - - @@ -418,135 +367,207 @@
-
- - -
-
- {{ ('this_'~(what|lower))|_ }} - {% if link.source.id == journal.id %} - {{ journalLinkTranslation('outward', link.linkType.outward) }} - - #{{ link.destination.id }}: {{ link.destination.description }} - ({{ link.destination|journalTotalAmount }}) - {% else %} - {{ journalLinkTranslation('inward', link.linkType.inward) }} - - #{{ link.source.id }}: {{ link.source.description }} - ({{ link.source|journalTotalAmount }}) + ({{ attachment.size|filesize }}) + {% if null != attachment.notes and '' != attachment.notes %} + {{ attachment.notes|markdown }} + {% endif %} {% endif %} - {% if link.notes.count == 1 %} -
- {{ link.notes.first.text|markdown }} + {% if not attachment.file_exists %} + + {% if attachment.title %} + {{ attachment.title }} + {% else %} + {{ attachment.filename }} + {% endif %} +
+ {{ 'attachment_not_found'|_ }} {% endif %}
-

+ {% endif %} -

+ + {% if events[journal.transaction_journal_id]|length > 0 %} +
+
+

{{ 'piggy_events'|_ }}

+
+
+ + {% for event in events[journal.transaction_journal_id] %} + + + + + + {% endfor %} +
{{ event.amount|raw }} + {{ event.piggy }}
+
+
{% endif %} - -
-
+ {% endfor %} + +
+{% endblock %} +{% block scripts %} +{% endblock %} + +{# + + {% if links.count > 0 %}
-

{{ 'transactions'|_ }}

+

{{ 'journal_links'|_ }}

-
- - - - - - - - - - - - - - {% set maxIdentifier = ((transactions|length) / 2) -1 %} - {% for x in 0..maxIdentifier %} +
+
{{ trans('list.source_account') }}{{ trans('list.destination_account') }}{{ trans('list.amount') }}
+ {% for link in links %} - {% for transaction in transactions %} - {% if - ((transaction.type == 'Withdrawal') and transaction.identifier == x and transaction.amount < 0) - or - ((transaction.type == 'Deposit' or transaction.type == 'Transfer') and transaction.identifier == x and transaction.amount > 0) %} - - - - - - + + {% endfor %} -
- {% if transaction.source_type == 'Cash account' %} - ({{ 'cash'|_ }}) - {% else %} - {{ transaction.source_name }} - {% endif %} - - {% if transaction.destination_type == 'Cash account' %} - ({{ 'cash'|_ }}) - {% else %} - {{ transaction.destination_name }} - {% endif %} - - - {{ transaction|transactionXArrayAmount }} - +
+ + +
+
+ {{ ('this_'~(what|lower))|_ }} + {% if link.source.id == journal.id %} + {{ journalLinkTranslation('outward', link.linkType.outward) }} + + #{{ link.destination.id }}: {{ link.destination.description }} + + ({{ link.destination|journalTotalAmount }}) + {% else %} + {{ journalLinkTranslation('inward', link.linkType.inward) }} + + #{{ link.source.id }}: {{ link.source.description }} + ({{ link.source|journalTotalAmount }}) {% endif %} - {% endfor %} - + {% if link.notes.count == 1 %} +
+ {{ link.notes.first.text|markdown }} + {% endif %} +
+

+ +

+ {% endif %} +
+ +
+
+
+
+

{{ 'transactions'|_ }}

+
+
+ + + + + + + + + + + + + + {% set maxIdentifier = ((transactions|length) / 2) -1 %} + {% for x in 0..maxIdentifier %} + + {% for transaction in transactions %} + {% if + ((transaction.type == 'Withdrawal') and transaction.identifier == x and transaction.amount < 0) + or + ((transaction.type == 'Deposit' or transaction.type == 'Transfer') and transaction.identifier == x and transaction.amount > 0) %} + + + + + + + {% endif %} + {% endfor %} + + + {% endfor %} + +
{{ trans('list.source_account') }}{{ trans('list.destination_account') }}{{ trans('list.amount') }}
+ {% if transaction.source_type == 'Cash account' %} + ({{ 'cash'|_ }}) + {% else %} + {{ transaction.source_name }} + {% endif %} + + {% if transaction.destination_type == 'Cash account' %} + ({{ 'cash'|_ }}) + {% else %} + {{ transaction.destination_name }} + {% endif %} + + + {{ transaction|transactionXArrayAmount }} +
+
+
-