PageSourceSearch

https://letsken.com/_next/static/chunks/pages/expenses-0412782ec1f26554.js

js letsken.com collected 2026-10-07 23:01:54 UTC 27,468 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4689],{3087:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/expenses",function(){return t(4314)}])},3193:function(e,s,t){"use strict";t.d(s,{Z:function(){return d}});var n=t(5893),r=t(1664),a=t.n(r);function l(){return(0,n.jsx)(a(),{href:"/discover",children:(0,n.jsx)("a",{children:(0,n.jsx)("img",{className:"w-32 inline-block",src:"/images/ken-logo-white.svg",alt:"Ken"})})})}function i(){return(0,n.jsxs)("div",{className:"flex space-x-2 mt-8",children:[(0,n.jsxs)("a",{href:"https://www.facebook.com/letsken",target:"_blank",rel:"noreferrer",className:"text-white",children:[(0,n.jsx)("span",{className:"sr-only",children:"Facebook"}),(0,n.jsx)("svg",{className:"h-7 w-7",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z",clipRule:"evenodd"})})]}),(0,n.jsxs)("a",{href:"http://instagram.com/letsken",target:"_blank",rel:"noreferrer",className:"text-white",children:[(0,n.jsx)("span",{className:"sr-only",children:"Instagram"}),(0,n.jsx)("svg",{className:"h-7 w-7",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z",clipRule:"evenodd"})})]}),(0,n.jsxs)("a",{href:"https://twitter.com/_letsken",target:"_blank",rel:"noreferrer",className:"text-white",children:[(0,n.jsx)("span",{className:"sr-only",children:"Twitter"}),(0,n.jsx)("svg",{className:"h-7 w-7",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84"})})]})]})}function c(){return(0,n.jsxs)("div",{className:"text-xs text-white mt-2",children:["\xa9 ",(new Date).getFullYear()," Ken ",(0,n.jsx)("span",{className:"text-pink",children:"/"})," All rights reserved."]})}function d(){return(0,n.jsx)("footer",{className:"bg-blue print:hidden",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-6 lg:px-8 py-12 lg:py-16 pb-24 sm:pb-12 lg:pb-16",children:[(0,n.jsx)("div",{className:"lg:hidden mb-8",children:(0,n.jsx)(l,{})}),(0,n.jsxs)("div",{className:"flex flex-wrap",children:[(0,n.jsxs)("div",{className:"hidden lg:block w-96",children:[(0,n.jsx)(l,{}),(0,n.jsx)(i,{}),(0,n.jsx)(c,{})]}),(0,n.jsx)("div",{className:"flex-shrink-0 flex-1",children:(0,n.jsx)("div",{className:"w-40 mb-8",children:(0,n.jsxs)("ul",{className:"mt-2 space-y-2 text-white italic font-medium",children:[(0,n.jsx)("li",{children:(0,n.jsx)(a(),{href:"/intro",children:(0,n.jsx)("a",{className:"text-base",children:"Intro"})})}),(0,n.jsx)("li",{children:(0,n.jsx)(a(),{href:"/discover",children:(0,n.jsx)("a",{className:"text-base",children:"Discover"})})})]})})}),(0,n.jsx)("div",{className:"min-w-48 flex-shrink-0 flex-1",children:(0,n.jsx)("div",{className:"w-40 mb-8",children:(0,n.jsxs)("ul",{className:"mt-2 space-y-2 text-white italic font-medium",children:[(0,n.jsx)("li",{children:(0,n.jsx)(a(),{href:"/michael/how-to-share-my-first-story-on-ken",children:(0,n.jsx)("a",{className:"text-base",children:"Writing Guide"})})}),(0,n.jsx)("li",{children:(0,n.jsx)(a(),{href:"/checklist",children:(0,n.jsx)("a",{className:"text-base",children:"Checklist"})})})]})})}),(0,n.jsx)("div",{className:"flex-shrink-0 flex-1",children:(0,n.jsx)("div",{className:"w-40 mb-8",children:(0,n.jsxs)("ul",{className:"mt-2 space-y-2 text-white italic font-medium",children:[(0,n.jsx)("li",{children:(0,n.jsx)(a(),{href:"/michael/a-space-to-express-not-impress",children:(0,n.jsx)("a",{className:"text-base",children:"About Ken"})})}),(0,n.jsx)("li",{children:(0,n.jsx)(a(),{href:"/terms",children:(0,n.jsx)("a",{className:"text-base",children:"Terms"})})}),(0,n.jsx)("li",{children:(0,n.jsx)(a(),{href:"/privacy",children:(0,n.jsx)("a",{className:"text-base",children:"Privacy"})})}),(0,n.jsx)("li",{children:(0,n.jsx)(a(),{href:"/imprint",children:(0,n.jsx)("a",{className:"text-base",children:"Imprint"})})})]})})})]}),(0,n.jsxs)("div",{className:"lg:hidden",children:[(0,n.jsx)(i,{}),(0,n.jsx)(c,{})]})]})})}},2969:function(e,s,t){"use strict";t.d(s,{Z:function(){return c}});var n=t(5893),r=t(2958),a=t(4601),l=t(1664),i=t.n(l);function c(e){var s=e.activeItem,t=(0,r.Z)().user;return(0,n.jsx)("div",{className:"flex items-center space-x-16 mt-20",children:(0,n.jsxs)("div",{className:"flex space-x-12 text-xl font-semibold",children:["manage"===s?(0,n.jsx)("div",{children:"Stories"}):(0,n.jsx)(i(),{href:"/manage",children:(0,n.jsx)("a",{className:"text-pink underline",children:"Stories"})}),"users"===s?(0,n.jsx)("div",{children:"Users"}):(0,n.jsx)(i(),{href:"/users",children:(0,n.jsx)("a",{className:"text-pink underline",children:"Users"})}),(0,a.SA)(t)?"expenses"===s?(0,n.jsx)("div",{children:"Expenses"}):(0,n.jsx)(i(),{href:"/expenses",children:(0,n.jsx)("a",{className:"text-pink underline",children:"Expenses"})}):"",(0,a.Bi)(t)?"state-of-ken"===s?(0,n.jsx)("div",{children:"State of Ken"}):(0,n.jsx)(i(),{href:"/state-of-ken",children:(0,n.jsx)("a",{className:"text-pink underline",children:"State of Ken"})}):""]})})}},2280:function(e,s,t){"use strict";t.d(s,{ZP:function(){return o}});var n=t(6042),r=t(9396),a=t(9534),l=t(5893),i=(t(7294),t(2615)),c=t(8163),d=t(4601);function o(e){var s=e.open,t=void 0===s||s,c=e.onClose,o=e.children,u=e.className,x=e.size,p=void 0===x?"default":x,h=(0,a.Z)(e,["open","onClose","children","className","size"]),m={large:"max-w-2xl",default:"max-w-xl",small:"max-w-md"}[p];return(0,l.jsx)(i.V,(0,r.Z)((0,n.Z)({as:"div",className:(0,d.AK)("fixed inset-0 z-[9999] overflow-y-auto",u),open:t,onClose:c},h),{children:(0,l.jsxs)("div",{className:"min-h-screen px-4 text-center",children:[(0,l.jsx)(i.V.Overlay,{className:"fixed inset-0 bg-slate-900/50 pr-10 backdrop-blur transition-colors duration-500"}),(0,l.jsx)("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200b"}),(0,l.jsx)("div",{className:(0,d.AK)("inline-block w-full my-8 text-left align-middle","transition-all transform bg-white shadow-xl rounded",m),children:o})]})}))}o.Header=function(e){var s=e.title,t=e.description,i=e.onClose,o=e.className,u=(0,a.Z)(e,["title","description","onClose","className"]);return(0,l.jsxs)("div",(0,r.Z)((0,n.Z)({className:(0,d.AK)("flex items-start border-0 border-solid border-b border-slate-100 p-6",o)},u),{children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("h1",{className:"antialiased font-sans font-semibold text-base sm:text-2xl text-gray-900 leading-8",children:s}),(0,l.jsx)("p",{className:"antialiased font-sans text-sm text-gray-900 leading-6",children:t})]}),(0,l.jsx)("button",{className:"bg-transparent box-border cursor-pointer border-solid border-0 p-2 text-slate-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue flex",type:"button","aria-label":"Close modal",onClick:i,children:(0,l.jsx)(c.Z,{className:"h-5 w-5","aria-hidden":"true"})})]}))},o.Content=function(e){var s=e.children,t=e.className,i=(0,a.Z)(e,["children","className"]);return(0,l.jsx)("div",(0,r.Z)((0,n.Z)({className:(0,d.AK)("p-6",t)},i),{children:s}))},o.Footer=function(e){var s=e.children,t=e.className,i=(0,a.Z)(e,["children","className"]);return(0,l.jsx)("div",(0,r.Z)((0,n.Z)({className:(0,d.AK)("p-6 border-0 border-solid border-t border-slate-100",t)},i),{children:s}))}},7022:function(e,s,t){"use strict";t.d(s,{Z:function(){return d}});var n=t(7568),r=t(4051),a=t.n(r);function l(e,s){return i.apply(this,arguments)}function i(){return(i=(0,n.Z)(a().mark((function e(s,t){var n,r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/presignedurl",{method:"POST",body:JSON.stringify({path:s,type:t}),headers:{"Content-Type":"application/json"}});case 2:return n=e.sent,e.next=5,n.json();case 5:return r=e.sent.signedUrl,e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function c(e,s,t){return new Promise((function(n,r){var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState&&(200===a.status?n(a):r(a))},t&&(a.upload.onprogress=function(e){if(e.lengthComputable){var n=e.loaded/s.size*100;t(parseInt(n,10))}}),a.open("put",e),a.setRequestHeader("Content-Type",s.type),a.setRequestHeader("x-amz-acl","public-read"),a.send(s)}))}function d(e,s,t){return o.apply(this,arguments)}function o(){return(o=(0,n.Z)(a().mark((function e(s,t,n){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l(t,s.type);case 2:return r=e.sent,e.next=5,c(r,s,n);case 5:return e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},7883:function(e,s,t){"use strict";
1function n(e,s){e&&"-"!==e[e.length-1]&&(e=e.concat("-"));var t,n,r="0123456789abcdefghijklmnopqrstuvwxyz".split(""),a=[];if(s=s||32)for(t=0;t<s;t++)a[t]=r[0|16*Math.random()];else for(a[8]=a[13]=a[18]=a[23]="-",a[14]="4",t=0;t<36;t++)a[t]||(n=0|16*Math.random(),a[t]=r[19===t?3&n|8:n]);return(e||"")+a.join("")}t.d(s,{Z:function(){return n}})},4314:function(e,s,t){"use strict";t.r(s),t.d(s,{__N_SSP:function(){return k},default:function(){return C}});var n=t(6042),r=t(5893),a=t(7568),l=t(4051),i=t.n(l),c=t(1463),d=t(3193),o=t(9008),u=t.n(o),x=t(7294),p=t(4601),h=t(2077),m=t(2280),f=t(7022),v=t(7883),b=t(34);function j(e){var s=e.expense,t=e.data,n=e.onExpensesUpdated,l=e.onCancel,c=t.expenseCategories,d=t.accounts,o=t.vendors,u=(0,x.useRef)(),j=(0,x.useRef)(),g=(0,x.useRef)(),N=(0,x.useRef)(),w=(0,x.useRef)(),y=(0,x.useRef)(),k=(0,x.useRef)(),C=(0,x.useRef)(),Z=(0,x.useRef)(),z=(0,x.useRef)(),_=(0,x.useRef)(),P=(0,x.useRef)(),S=(new Date).toISOString().slice(0,10);function O(){return R.apply(this,arguments)}function R(){return(R=(0,a.Z)(i().mark((function e(){var s,t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=_.current.files[0]){e.next=4;break}return console.log("skipping file upload..."),e.abrupt("return",null);case 4:return t=s.name.split(".").pop(),n=[["invoices",(0,v.Z)()].join("/"),t].join("."),e.prev=6,e.next=9,(0,f.Z)(s,n);case 9:return e.abrupt("return",n);case 12:e.prev=12,e.t0=e.catch(6),console.error(e.t0),window.alert("Etwas ist schiefgelaufen.");case 16:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function A(){return A=(0,a.Z)(i().mark((function e(s){var t,r,a,l,c,d,o,x,h,m,f,v,_,S;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.preventDefault(),t=g.current.value,r=u.current.value,a=j.current.value,l=(0,p.z)(C.current.value),c=(0,p.z)(Z.current.value),d=(d=(0,p.z)(z.current.value))>0?d:null,o=k.current.value||null,x=w.current.value||null,h=P.current.value||null,m=y.current.value||null,f=N.current.checked,v=null,e.next=16,O();case 16:return _=e.sent,e.prev=17,e.next=20,(0,b.Z)("/api/create-expense",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invoicedOn:t,invoiceNumber:r,description:a,amount:l,vatPercentage:c,rcVatPercentage:d,vendor:o,expenseCategory:x,paidOn:h,account:m,platformExpense:f,userId:v,invoicePath:_})});case 20:S=e.sent,n(S),e.next=28;break;case 24:e.prev=24,e.t0=e.catch(17),console.error(e.t0),window.alert("Ein Fehler ist aufgetreten. Versuche es n
1ocheinmal.");case 28:case"end":return e.stop()}}),e,null,[[17,24]])}))),A.apply(this,arguments)}function V(){return V=(0,a.Z)(i().mark((function e(t){var r,a,l,c,d,o,x,h,m,f,v,_,S,R,A;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),r=s.expenseId,a=g.current.value,l=u.current.value,c=j.current.value,d=(0,p.z)(C.current.value),o=(0,p.z)(Z.current.value),x=(x=(0,p.z)(z.current.value))>0?x:null,h=k.current.value||null,m=w.current.value||null,f=P.current.value||null,v=y.current.value||null,_=N.current.checked,S=null,e.next=17,O();case 17:return R=e.sent,e.prev=18,e.next=21,(0,b.Z)("/api/update-expense",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expenseId:r,invoicedOn:a,invoiceNumber:l,description:c,amount:d,vatPercentage:o,rcVatPercentage:x,vendor:h,expenseCategory:m,paidOn:f,account:v,platformExpense:_,userId:S,invoicePath:R})});case 21:A=e.sent,console.log("done updated expense"),n(A),e.next=30;break;case 26:e.prev=26,e.t0=e.catch(18),console.error(e.t0),window.alert("Ein Fehler ist aufgetreten. Versuche es n
1ocheinmal.");case 30:case"end":return e.stop()}}),e,null,[[18,26]])}))),V.apply(this,arguments)}return(0,r.jsxs)(m.ZP,{onClose:l,children:[(0,r.jsxs)("div",{className:"p-8",children:[(0,r.jsx)("h1",{children:s?"Ausgabe bearbeiten":"Neue Ausgabe"}),(0,r.jsxs)("div",{className:"",children:[(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"invoiced_on",className:"block text-sm font-medium text-gray-700",children:"Rechnung vom"}),(0,r.jsx)("div",{className:"mt-1",children:(0,r.jsx)("input",{type:"date",id:"invoiced_on",ref:g,defaultValue:(null===s||void 0===s?void 0:s.invoicedOn)||S,className:"shadow-sm focus:ring-blue focus:border-blue block w-full sm:text-sm border-slate-300 rounded-md"})})]}),(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700",children:"Rechnungsnummer"}),(0,r.jsx)("div",{className:"mt-1",children:(0,r.jsx)("input",{type:"text",ref:u,defaultValue:null===s||void 0===s?void 0:s.invoiceNumber,className:"shadow-sm focus:ring-blue focus:border-blue block w-full sm:text-sm border-slate-300 rounded-md",placeholder:"325"})})]}),(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700",children:"Beleg"}),(0,r.jsxs)("div",{className:"mt-1",children:[(null===s||void 0===s?void 0:s.invoicePath)&&(0,r.jsx)("a",{className:"text-pink underline",target:"_blank",rel:"noreferrer",href:"https://ken.fra1.digitaloceanspaces.com/".concat(s.invoicePath),children:"Rechnungsbeleg"}),(0,r.jsx)("input",{id:"file-upload",ref:_,name:"file-upload",type:"file",className:""})]})]}),(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700",children:"Kurze Bezeichnung"}),(0,r.jsx)("div",{className:"mt-1",children:(0,r.jsx)("input",{type:"text",ref:j,defaultValue:null===s||void 0===s?void 0:s.description,className:"shadow-sm focus:ring-blue focus:border-blue block w-full sm:text-sm border-slate-300 rounded-md",placeholder:"Ads"})})]}),(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"vendor",className:"block text-sm font-medium text-gray-700",children:"Lieferant"}),(0,r.jsxs)("select",{id:"vendor",ref:k,defaultValue:null===s||void 0===s?void 0:s.vendorId,className:"mt-1 block w-full pl-3 pr-10 py-2 text-base border-slate-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md",children:[(0,r.jsx)("option",{readOnly:!0,value:"",children:"\u2014"}),o.map((function(e){return(0,r.jsx)("option",{readOnly:!0,value:e.vendorId,children:e.name},e.vendorId)}))]})]}),(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"amount",className:"block text-sm font-medium text-gray-700",children:"Betrag"}),(0,r.jsxs)("div",{className:"mt-1 relative rounded-md shadow-sm",children:[(0,r.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,r.jsx)("span",{className:"text-gray-500 sm:text-sm",children:"\u20ac"})}),(0,r.jsx)("input",{type:"text",id:"amount",ref:C,defaultValue:void 0!==(null===s||void 0===s?void 0:s.amount)?(0,p.G9)(null===s||void 0===s?void 0:s.amount):void 0,className:"focus:ring-indigo-500 focus:border-blue block w-full pl-7 pr-12 sm:text-sm border-slate-300 rounded-md",placeholder:"0,00"})]})]}),(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"vat_percentage",className:"block text-sm font-medium text-gray-700",children:"Abziehbare MwSt (Steuersatz um Netto zu berechnen)"}),(0,r.jsxs)("div",{className:"mt-1 relative rounded-md shadow-sm",children:[(0,r.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,r.jsx)("span",{className:"text-gray-500 sm:text-sm",children:"%"})}),(0,r.jsx)("input",{type:"text",id:"vat_percentage",ref:Z,defaultValue:void 0!==(null===s||void 0===s?void 0:s.vatPercentage)?(0,p.G9)(null===s||void 0===s?void 0:s.vatPercentage):void 0,className:"focus:ring-indigo-500 focus:border-blue block w-full pl-7 pr-12 sm:text-sm border-slate-300 rounded-md",placeholder:"0"})]})]}),(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"rc_vat_percentage",className:"block text-sm font-medium text-gray-700",children:"Rever
1se Charge MwSt (\xf6sterreichischer Steuersatz bei Reverse Charge)"}),(0,r.jsxs)("div",{className:"mt-1 relative rounded-md shadow-sm",children:[(0,r.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,r.jsx)("span",{className:"text-gray-500 sm:text-sm",children:"%"})}),(0,r.jsx)("input",{type:"text",id:"rc_vat_percentage",ref:z,defaultValue:(null===s||void 0===s?void 0:s.rcVatPercentage)>0?(0,p.G9)(null===s||void 0===s?void 0:s.rcVatPercentage):null,className:"focus:ring-indigo-500 focus:border-blue block w-full pl-7 pr-12 sm:text-sm border-slate-300 rounded-md",placeholder:"20"})]})]}),(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"expense_category",className:"block text-sm font-medium text-gray-700",children:"Kategorie"}),(0,r.jsxs)("select",{id:"expense_category",ref:w,defaultValue:null===s||void 0===s?void 0:s.expenseCategoryId,className:"mt-1 block w-full pl-3 pr-10 py-2 text-base border-slate-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md",children:[(0,r.jsx)("option",{readOnly:!0,value:"",children:"\u2014"}),c.map((function(e){return(0,r.jsx)("option",{readOnly:!0,value:e.expenseCategoryId,children:e.name},e.expenseCategoryId)}))]})]}),(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"paid_on",className:"block text-sm font-medium text-gray-700",children:"Bezahlt am"}),(0,r.jsx)("div",{className:"mt-1",children:(0,r.jsx)("input",{type:"date",id:"paid_on",ref:P,defaultValue:null===s||void 0===s?void 0:s.paidOn,className:"shadow-sm focus:ring-blue focus:border-blue block w-full sm:text-sm border-slate-300 rounded-md"})})]}),(0,r.jsxs)("div",{className:"pt-6",children:[(0,r.jsx)("label",{htmlFor:"account",className:"block text-sm font-medium text-gray-700",children:"Konto"}),(0,r.jsxs)("select",{id:"account",ref:y,defaultValue:null===s||void 0===s?void 0:s.accountId,className:"mt-1 block w-full pl-3 pr-10 py-2 text-base border-slate-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md",children:[(0,r.jsx)("option",{readOnly:!0,value:"",children:"\u2014"}),d.map((function(e){return(0,r.jsx)("option",{readOnly:!0,value:e.accountId,children:e.name},e.accountId)}))]})]}),(0,r.jsxs)("div",{className:"pt-6 relative flex items-start",children:[(0,r.jsx)("div",{className:"flex items-center h-5",children:(0,r.jsx)("input",{id:"platform_expense",ref:N,type:"checkbox",defaultChecked:!s||s.platformExpense,className:"focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-slate-300 rounded"})}),(0,r.jsx)("div",{className:"ml-3 text-sm",children:(0,r.jsx)("label",{htmlFor:"platform_expense",className:"font-medium text-gray-700",children:"Plattform-Ausgabe"})})]})]})]}),(0,r.jsxs)("div",{className:"border-t-2 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse space-x-2 space-x-reverse",children:[!s&&(0,r.jsx)(h.Z,{size:"md",type:"primary",onClick:function(e){return A.apply(this,arguments)},children:"Ausgabe hinzuf\xfcgen"}),s&&(0,r.jsx)(h.Z,{size:"md",type:"primary",onClick:function(e){return V.apply(this,arguments)},children:"\xc4nderungen speichern"}),(0,r.jsx)(h.Z,{onClick:l,size:"md",children:"Abbrechen"})]})]})}var g=t(2969),N=t(7814),w=t(1436);function y(e){var s=function(){o(null)},t=function(e){v(e),o(null)},n=(0,x.useState)(null),l=n[0],o=n[1],m=(0,x.useState)(e),f=m[0],v=m[1],y=f.expenses;function k(){return(k=(0,a.Z)(i().mark((function e(s){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.confirm("Bist du dir sicher dass du diese Ausgabe l\xf6schen m\xf6chtest?")){e.next=12;break}return e.prev=1,e.next=4,(0,b.Z)("/api/delete-expense",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expenseId:s})});case 4:t=e.sent,v(t),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.error(e.t0),window.alert("Ein Fehler ist aufgetreten. Versuche es n
1ocheinmal.");case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u(),{children:(0,r.jsx)("title",{children:"Ausgaben / Ken"})}),(0,r.jsx)(c.Z,{}),(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6 lg:px-6 print:px-0 mb-24",children:[(0,r.jsxs)("div",{className:"max-w-full overflow-auto",children:[(0,r.jsx)(g.Z,{activeItem:"expenses"}),(0,r.jsx)("div",{className:"flex space-x-16",children:(0,r.jsx)("div",{className:"text-right flex-1",children:(0,r.jsx)(h.Z,{size:"lg",type:"primary",onClick:function(){return o({type:"create-expense"})},children:"Neue Ausgabe"})})}),(0,r.jsxs)("table",{style:{borderSpacing:0},className:"table-auto w-full border-separate mt-16 mb-16",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{colSpan:"2",className:"bg-pink text-left px-6 py-4 rounded-tl-lg text-white text-xs print:bg-white print:text-pink print:border-b-2 print:border-t-2 print:border-l-2",children:[y.length," Ausgaben"]}),(0,r.jsx)("th",{className:"bg-pink text-left px-6 py-4 text-xs text-white print:bg-white print:text-pink print:border-b-2 print:border-t-2",children:"RechnungsNr."}),(0,r.jsx)("th",{className:"bg-pink text-left px-6 py-4 text-xs text-white print:bg-white print:text-pink print:border-b-2 print:border-t-2",children:"Kurzbezeichnung"}),(0,r.jsx)("th",{className:"bg-pink text-right px-6 py-4 text-xs text-white print:bg-white print:text-pink print:border-b-2 print:border-t-2",children:"MwSt."}),(0,r.jsx)("th",{className:"bg-pink text-right px-6 py-4 text-xs text-white print:bg-white print:text-pink print:border-b-2 print:border-t-2",children:"Konto"}),(0,r.jsx)("th",{className:"bg-pink text-right px-6 py-4 text-xs text-white print:bg-white print:text-pink print:border-b-2 print:border-t-2",children:"Betrag"}),(0,r.jsx)("th",{className:"bg-pink text-right px-6 py-4 rounded-tr-lg text-white text-xs print:bg-white print:text-pink print:border-b-2 print:border-t-2 print:border-r-2",children:"\xa0"})]})}),(0,r.jsxs)("tbody",{children:[0===y.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:"7",className:"border-b-2 border-r-2 border-l-2 px-6 py-4 whitespace-nowrap",children:"Derzeit noch keine Ausgaben."})}),y.map((function(e){return(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"border-b-2 border-l-2 pl-6 py-4 whitespace-nowrap",children:e.platformExpense?"\u2713":""}),(0,r.jsxs)("td",{className:"px-6 pl-2 py-4 border-b-2 whitespace-nowrap",children:[e.invoicedOn,"\xa0",e.invoicePath&&(0,r.jsx)("a",{className:"text-pink",target:"_blank",rel:"noreferrer",href:"https://ken.fra1.digitaloceanspaces.com/".concat(e.invoicePath),children:(0,r.jsx)(N.G,{icon:w.q7m})})]}),(0,r.jsx)("td",{className:"px-6 py-4 border-b-2 whitespace-nowrap",children:e.invoiceNumber}),(0,r.jsxs)("td",{className:"px-6 py-4 border-b-2 whitespace-nowrap",children:[(0,r.jsx)("div",{children:e.description}),(0,r.jsxs)("div",{className:"text-sm",children:[e.vendor&&(0,r.jsxs)(r.Fragment,{children:[" von ",(0,r.jsx)("span",{className:"text-pink underline",children:e.vendor})]}),e.expenseCategory&&(0,r.jsxs)(r.Fragment,{children:[" in ",(0,r.jsx)("span",{className:"text-pink underline",children:e.expenseCategory})]})]})]}),(0,r.jsxs)("td",{className:"px-6 py-4 text-right border-b-2 whitespace-nowrap",children:[(0,p.T4)(e.vatPercentage),"%",e.rcVatPercentage&&(0,r.jsxs)(r.Fragment,{children:[" (",(0,p.T4)(e.rcVatPercentage),"%)"]})]}),(0,r.jsxs)("td",{className:"px-6 py-4 text-right border-b-2 whitespace-nowrap",children:[(0,r.jsx)("div",{children:e.account}),(0,r.jsx)("div",{className:"text-sm",children:e.paidOn})]}),(0,r.jsx)("td",{className:"px-6 py-4 text-right border-b-2 whitespace-nowrap",children:(0,p.T4)(e.amount,"EUR")}),(0,r.jsxs)("td",{className:"px-6 py-4 text-right border-b-2 border-r-2 whitespace-nowrap",children:[(0,r.jsx)(h.Z,{type:"primary",size:"sm",onClick:function(){return o({type:"edit-expense",expense:e})},children:(0,r.jsx)(N.G,{icon:w.UJf})}),"\xa0",(0,r.jsx)(h.Z,{type:"primary",size:"sm",onClick:function(){return function(e){return k.apply(this,arguments)}(e.expenseId)},children:(0,r.jsx)(N.G,{icon:w.$aW})})]})]},e.expenseId)}))]})]})]}),"create-expense"===(null===l||void 0===l?void 0:l.type)&&(0,r.jsx)(j,{data:f,onExpensesUpdated:t,onCancel:s}),"edit-expense"===(null===l||void 0===l?void 0:l.type)&&(0,r.jsx)(j,{expense:l.expense,data:f,onExpensesUpdated:t,onCancel:s})]}),(0,r.jsx)(d.Z,{})]})}var k=!0;function C(e){return(0,r.jsx)(y,(0,n.Z)({},e))}}},function(e){e.O(0,[8523,1664,9879,4080,1463,9774,2888,179],(function(){return s=3087,e(e.s=s);var s}));var s=e.O();_N_E=s}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.