Files
firefly-iii/public/build/assets/splice-errors-into-transactions-9c9b99c0.js

2 lines
9.9 KiB
JavaScript
Raw Normal View History

2024-01-13 20:34:09 +01:00
import{a as l}from"./format-money-43e05102.js";import{a as p,G as f}from"./get-94678769.js";import{n as m,i as _}from"./vendor-fca45885.js";function x(r,n){let a=[];for(let o in r)if(r.hasOwnProperty(o)){const t=r[o];let e={};e.description=t.description,e.source_name=t.source_account.name,e.destination_name=t.destination_account.name,e.amount=t.amount,e.currency_code=t.currency_code,e.date=t.date,e.interest_date=t.interest_date,e.book_date=t.book_date,e.process_date=t.process_date,e.due_date=t.due_date,e.payment_date=t.payment_date,e.invoice_date=t.invoice_date,e.budget_id=t.budget_id,e.category_name=t.category_name,e.piggy_bank_id=t.piggy_bank_id,e.bill_id=t.bill_id,e.tags=t.tags,e.notes=t.notes,e.internal_reference=t.internal_reference,e.external_url=t.external_url,e.store_location=!1,t.hasLocation&&(e.store_location=!0,e.longitude=t.longitude.toString(),e.latitude=t.latitude.toString(),e.zoom_level=t.zoomLevel),typeof t.foreign_currency_code<"u"&&t.foreign_currency_code.toString()!==""&&(e.foreign_currency_code=t.foreign_currency_code,typeof t.foreign_amount<"u"&&t.foreign_amount.toString()!==""&&(e.foreign_amount=t.foreign_amount),(typeof t.foreign_amount>"u"||t.foreign_amount.toString()==="")&&(delete e.foreign_amount,delete e.foreign_currency_code)),typeof t.source_account.id<"u"&&t.source_account.id.toString()!==""&&(e.source_id=t.source_account.id),typeof t.destination_account.id<"u"&&t.destination_account.id.toString()!==""&&(e.destination_id=t.destination_account.id),e.type=n,a.push(e)}return a}let g=class{list(n){return l.get("/api/v2/currencies",{params:n})}};function C(){let r={page:1,limit:1337};return new g().list(r).then(a=>{let o={defaultCurrency:{},nativeCurrencies:[],foreignCurrencies:[],enabledCurrencies:[]};o.foreignCurrencies.push({id:0,name:"(no foreign currency)",code:"",default:!1,symbol:"",decimal_places:2});for(let t in a.data.data)if(a.data.data.hasOwnProperty(t)){let e=a.data.data[t];if(e.attributes.enabled){let c={id:e.id,name:e.attributes.name,code:e.attributes.code,default:e.attributes.default,symbol:e.attributes.symbol,decimal_places:e.attributes.decimal_places};c.default&&(o.defaultCurrency=c),o.enabledCurrencies.push(c),o.nativeCurrencies.push(c),o.foreignCurrencies.push(c)}}return o})}class y{list(n){return l.get("/api/v2/budgets",{params:n})}}function $(){let r={page:1,limit:1337};return new y().list(r).then(a=>{let o=[{id:0,name:"(no budget)"}];for(let t in a.data.data)if(a.data.data.hasOwnProperty(t)){let e=a.data.data[t],c={id:e.id,name:e.attributes.name};o.push(c)}return o})}function O(){let r={page:1,limit:1337};return new p().list(r).then(a=>{let o={0:{id:0,name:"(no group)",order:0,piggyBanks:[{id:0,name:"(no piggy bank)",order:0}]}};for(let t in a.data.data)if(a.data.data.hasOwnProperty(t)){let e=a.data.data[t],c=e.attributes.object_group_id??"0",i=e.attributes.object_group_title??"(no group)",u={id:e.id,name:e.attributes.name,order:e.attributes.order};o.hasOwnProperty(c)||(o[c]={id:c,name:i,order:e.attributes.object_group_order??0,piggyBanks:[]}),o[c].piggyBanks.push(u),o[c].piggyBanks.sort((d,s)=>d.order-s.order)}return Object.keys(o).sort().reduce((t,e)=>(t[e]=o[e],t),{})})}function j(){let r={page:1,limit:1337};return new f().list(r).then(a=>{let o={0:{id:0,name:"(no group)",order:0,subscriptions:[{id:0,name:"(no subscription)",order:0}]}};for(let t in a.data.data)if(a.data.data.hasOwnProperty(t)){let e=a.data.data[t],c=e.attributes.object_group_id??"0",i=e.attributes.object_group_title??"(no group)",u={id:e.id,name:e.attributes.name,order:e.attributes.order};o.hasOwnProperty(c)||(o[c]={id:c,name:i,order:e.attributes.object_group_order??0,subscriptions:[]}),o[c].subscriptions.push(u),o[c].subscriptions.sort((d,s)=>d.order-s.order)}return Object.keys(o).sort().reduce((t,e)=>(t[e]=o[e],t),{})})}function A(){return{description:"/api/v2/autocomplete/transaction-descriptions",account:"/api/v2/autocomplete/accounts",category:"/api/v2/autocomplete/categories",tag:"/api/v2/autocomplete/tags"}}function P(r){const n={server:r.serverUrl,serverParams:{},fetchOptions:{headers:{"X-CSRF