mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 18:54:58 +00:00 
			
		
		
		
	Small edit and show updates
This commit is contained in:
		| @@ -32,9 +32,13 @@ export function parseDownloadedSplits(downloads) { | ||||
|  | ||||
|             // meta data | ||||
|             current.bill_id = download.bill_id; | ||||
|             current.bill_name = download.bill_name; | ||||
|             current.budget_id = download.budget_id; | ||||
|             current.budget_name = download.budget_name; | ||||
|             current.category_name = download.category_name; | ||||
|             current.category_id = download.category_id; | ||||
|             current.piggy_bank_id = download.piggy_bank_id; | ||||
|             current.piggy_bank_name = download.piggy_bank_name; | ||||
|  | ||||
|             // meta dates | ||||
|             current.book_date = download.book_date; | ||||
|   | ||||
| @@ -44,9 +44,10 @@ let show = function () { | ||||
|             transactionType: '', | ||||
|             transactionTypeTranslated: '', | ||||
|             title: '', | ||||
|             totalAmount: 0, | ||||
|             date: new Date, | ||||
|         }, | ||||
|         dateFields: ["book_date", "due_date", "interest_date", "invoice_date", "payment_date", "process_date"], | ||||
|         metaFields: ['external_id','internal_reference','sepa_batch_id','sepa_ct_id','sepa_ct_op','sepa_db','sepa_country','sepa_cc','sepa_ep','sepa_ci','external_url'], | ||||
|  | ||||
|         // parse amounts per currency | ||||
|         amounts: {}, | ||||
| @@ -72,7 +73,6 @@ let show = function () { | ||||
|                 this.groupProperties.transactionType = data.attributes.transactions[0].type; | ||||
|                 this.groupProperties.transactionTypeTranslated = i18next.t('firefly.' + data.attributes.transactions[0].type); | ||||
|                 this.groupProperties.title = data.attributes.title ?? data.attributes.transactions[0].description; | ||||
|                 this.groupProperties.totalAmount = 0; | ||||
|                 this.entries = parseDownloadedSplits(data.attributes.transactions); | ||||
|                 // remove waiting thing. | ||||
|                 this.notifications.wait.show = false; | ||||
| @@ -90,8 +90,6 @@ let show = function () { | ||||
|                             this.amounts[foreignCurrencyCode] = 0; | ||||
|                             this.amounts[foreignCurrencyCode] += parseFloat(this.entries[i].foreign_amount); | ||||
|                         } | ||||
|  | ||||
|                         this.groupProperties.totalAmount = this.groupProperties.totalAmount + parseFloat(this.entries[i].amount); | ||||
|                         if(0 === parseInt(i)) { | ||||
|                             this.groupProperties.date = this.entries[i].date; | ||||
|                         } | ||||
|   | ||||
| @@ -90,7 +90,9 @@ | ||||
|                                     </th> | ||||
|                                     <td> | ||||
|                                         <template x-for="entry in entries"> | ||||
|                                             <a :href="'./accounts/show/' + entry.source_account.id" :title="entry.source_account.name" x-text="entry.source_account.name"></a> | ||||
|                                             <a :href="'./accounts/show/' + entry.source_account.id" | ||||
|                                                :title="entry.source_account.name" | ||||
|                                                x-text="entry.source_account.name"></a> | ||||
|                                         </template> | ||||
|                                     </td> | ||||
|                                 </tr> | ||||
| @@ -101,7 +103,9 @@ | ||||
|                                     </th> | ||||
|                                     <td> | ||||
|                                         <template x-for="entry in entries"> | ||||
|                                             <a :href="'./accounts/show/' + entry.destination_account.id" :title="entry.destination_account.name" x-text="entry.destination_account.name"></a> | ||||
|                                             <a :href="'./accounts/show/' + entry.destination_account.id" | ||||
|                                                :title="entry.destination_account.name" | ||||
|                                                x-text="entry.destination_account.name"></a> | ||||
|                                         </template> | ||||
|                                     </td> | ||||
|                                 </tr> | ||||
| @@ -117,51 +121,127 @@ | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div class="row"> | ||||
|                 <template x-for="(entry, index) in entries"> | ||||
|                     <div class="col-xl-4 col-lg-6 col-md-12 col-sm-12 col-xs-12"> | ||||
|                         <div class="card mb-3"> | ||||
|                             <div class="card-header"> | ||||
|                             <h3 class="card-title">Description (X from X)</h3> | ||||
|                                 <h3 class="card-title"> | ||||
|                                     <span x-text="entry.description"></span> | ||||
|                                     <template x-if="entries.length > 1"> | ||||
|                                     <span class="badge bg-secondary"> | ||||
|                                         <span x-text="index + 1"></span> / <span x-text="entries.length"></span> | ||||
|                                     </span> | ||||
|                                     </template> | ||||
|                                 </h3> | ||||
|                             </div> | ||||
|                             <div class="card-body p-0"> | ||||
|                                 <table class="table table-x table-hover"> | ||||
|                                     <tbody> | ||||
|                                     <tr> | ||||
|                                     <td colspan="2"> | ||||
|                                         center | ||||
|                                         From A to B (summary) | ||||
|                                         <td colspan="2" class="text-center"> | ||||
|                                             <a :href="'./accounts/show/' + entry.source_account.id" | ||||
|                                                :title="entry.source_account.name" | ||||
|                                                x-text="entry.source_account.name"></a> | ||||
|                                             → | ||||
|                                             <template x-if="'Withdrawal' === groupProperties.transactionType"> | ||||
|                                                 <span class="text-danger" | ||||
|                                                       x-text="formatMoney(entry.amount*-1, entry.currency_code)"></span> | ||||
|                                             </template> | ||||
| 
 | ||||
|                                             <template x-if="'Deposit' === groupProperties.transactionType"> | ||||
|                                                 <span class="text-success" | ||||
|                                                       x-text="formatMoney(entry.amount, entry.currency_code)"></span> | ||||
|                                             </template> | ||||
| 
 | ||||
|                                             <template x-if="'Transfer' === groupProperties.transactionType"> | ||||
|                                                 <span class="text-info" | ||||
|                                                       x-text="formatMoney(entry.amount, entry.currency_code)"></span> | ||||
|                                             </template> | ||||
|                                             <template | ||||
|                                                 x-if="null !== entry.foreign_currency_code && 'Withdrawal' === groupProperties.transactionType"> | ||||
|                                                 <span class="text-muted" | ||||
|                                                       x-text="formatMoney(entry.foreign_amount*-1, entry.foreign_currency_code)"></span> | ||||
|                                             </template> | ||||
|                                             <template | ||||
|                                                 x-if="null !== entry.foreign_currency_code && 'Withdrawal' !== groupProperties.transactionType"> | ||||
|                                                 <span class="text-muted" | ||||
|                                                       x-text="formatMoney(entry.foreign_amount, entry.foreign_currency_code)"></span> | ||||
|                                             </template> | ||||
| 
 | ||||
|                                             <template | ||||
|                                                 x-if="'Transfer' !== groupProperties.transactionType && 'Deposit' !== groupProperties.transactionType && 'Withdrawal' !== groupProperties.transactionType"> | ||||
|                                                 <span>TODO PARSE MISSING AMOUNT</span> | ||||
|                                             </template> | ||||
|                                             → | ||||
|                                             <a :href="'./accounts/show/' + entry.destination_account.id" | ||||
|                                                :title="entry.destination_account.name" | ||||
|                                                x-text="entry.destination_account.name"></a> | ||||
|                                         </td> | ||||
|                                     </tr> | ||||
|                                     <template x-if="null !== entry.category_name"> | ||||
|                                         <tr> | ||||
|                                     <th>category icon</th> | ||||
|                                     <td>category</td> | ||||
|                                             <th style="width:10%;"> | ||||
|                                                 <em title="{{ __('firefly.category') }}" | ||||
|                                                     class="fa-solid fa-bookmark"></em> | ||||
|                                             </th> | ||||
|                                             <td><a :href="'./categories/show/' + entry.category_id" | ||||
|                                                    :title="entry.category_name" x-text="entry.category_name"></a></td> | ||||
|                                         </tr> | ||||
|                                     </template> | ||||
|                                     <template x-if="null !== entry.budget_name"> | ||||
|                                         <tr> | ||||
|                                     <th>budget icon</th> | ||||
|                                     <td>budget</td> | ||||
|                                             <th><em title="{{ __('firefly.budget') }}" | ||||
|                                                     class="fa-solid fa-chart-pie"></em></th> | ||||
|                                             <td> | ||||
|                                                 <a :href="'./budgets/show/' + entry.budget_id" | ||||
|                                                    :title="entry.budget_name" x-text="entry.budget_name"></a></td> | ||||
|                                         </tr> | ||||
|                                     </template> | ||||
|                                     <template x-if="null !== entry.bill_name"> | ||||
|                                         <tr> | ||||
|                                     <th>subscription icon</th> | ||||
|                                     <td>subscription</td> | ||||
|                                             <td><em title="{{ __('firefly.subscription') }}" | ||||
|                                                     class="fa-solid fa-calendar"></em></td> | ||||
|                                             <td> | ||||
|                                                 <a :href="'./bills/show/' + entry.bill_id" :title="entry.bill_name" | ||||
|                                                    x-text="entry.bill_name"></a></td> | ||||
|                                         </tr> | ||||
|                                     </template> | ||||
|                                     <template x-for="date in dateFields"> | ||||
|                                         <template x-if="null !== entry[date]"> | ||||
|                                             <tr> | ||||
|                                     <th>dates (x6) icon</th> | ||||
|                                     <td>subscription</td> | ||||
|                                                 <th><span x-text="date"></span></th> | ||||
|                                                 <td><span x-text="entry[date]"></span></td> | ||||
|                                             </tr> | ||||
|                                         </template> | ||||
|                                     </template> | ||||
|                                     <template x-for="meta in metaFields"> | ||||
|                                         <template x-if="null !== entry[meta] and '' !== entry[meta]"> | ||||
|                                             <tr> | ||||
|                                     <th>meta fields</th> | ||||
|                                     <td>meta</td> | ||||
|                                                 <th><span x-text="meta"></span></th> | ||||
|                                                 <td><span x-text="entry[meta]"></span></td> | ||||
|                                             </tr> | ||||
|                                         </template> | ||||
|                                     </template> | ||||
|                                     <tr> | ||||
|                                         <th>recurring things</th> | ||||
|                                         <td>meta</td> | ||||
|                                     </tr> | ||||
|                                     <template x-if="entry.tags.length > 0"> | ||||
|                                         <tr> | ||||
|                                     <th>tags</th> | ||||
|                                     <td>meta</td> | ||||
|                                             <th><em title="{{ __('firefly.tags') }}" class="fa-solid fa-tag"></em></th> | ||||
|                                             <td> | ||||
|                                                 <template x-for="tag in entry.tags"> | ||||
|                                                     <a class="badge text-bg-info" :href="'./tags/show/' + tag" | ||||
|                                                        :title="tag" x-text="tag"></a> | ||||
|                                                 </template> | ||||
|                                             </td> | ||||
|                                         </tr> | ||||
|                                     </template> | ||||
|                                     <template x-if="'' !== entry.notes && null !== entry.notes"> | ||||
|                                         <tr> | ||||
|                                     <td colspan="2">notes</td> | ||||
|                                             <td colspan="2" x-text="entry.notes"></td> | ||||
|                                         </tr> | ||||
|                                     </template> | ||||
|                                     </tbody> | ||||
|                                 </table> | ||||
|                             </div> | ||||
| @@ -195,11 +275,7 @@ | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     </div> | ||||
|             </div> | ||||
|             <div class="row mt-3"> | ||||
|                 <div class="col"> | ||||
|                     <h3>{{ __('firefly.audit_log_entries') }}</h3> | ||||
|                 </div> | ||||
|                 </template> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user