https://www.getcouped.com/_next/static/chunks/pages/rnd-reports/staff-cost-table-1ee0c6108739b86c.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1714],{10572:(e,t,r)=>{"use strict";r.d(t,{P:()=>a});var s=r(7822);function a(e,t){let[r,a]=(0,s.x)(e,t.start,t.end);return{start:r,end:a}}},15727:(e,t,r)=>{"use strict";r.d(t,{Y:()=>i,r:()=>l});var s=r(57677),a=r(43247);let n="dd.MM.yyyy";function i(e){return"string"==typeof e?(0,s.GP)((0,a.pp)(e),n):e instanceof Date?(0,s.GP)(e,n):null!==e&&"object"==typeof e?(0,s.GP)(e.toDate(),n):""}let o="dd.MM.yyyy, H:mm";function l(e){return"string"==typeof e?(0,s.GP)((0,a.pp)(e),o):e instanceof Date?(0,s.GP)(e,o):null!==e&&"object"==typeof e?(0,s.GP)(e.toDate(),o):""}},17506:(e,t,r)=>{"use strict";r.d(t,{k:()=>n});var s=r(10572),a=r(95498);function n(e,t){let{start:r,end:n}=(0,s.P)(t?.in,e),i=+r>+n,o=i?+r:+n,l=i?n:r;l.setHours(0,0,0,0);let u=t?.step??1;if(!u)return[];u<0&&(u=-u,i=!i);let c=[];for(;+l<=o;)c.push((0,a.w)(r,l)),l.setDate(l.getDate()+u),l.setHours(0,0,0,0);return i?c.reverse():c}},33340:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>A});var s=r(26514),a=r(32797),n=r(20292),i=r(15727),o=r(99869),l=r(85697),u=r(24222),c=r(63044),h=r(45964),d=r(25229),f=r(47578),m=r(33208),y=r(4992),p=r(75834),g=r(97700),x=r(46225);let b=()=>{let{status:e,staffCosts:t,year:r}=function(e){let{trackError:t}=(0,m.j)(),[r,s]=(0,p.useState)({status:f.n.Loading,staffCosts:null,year:null});async function n(e){try{let t=await (0,y.YE)("payoutApplications",e),r=t.data.projects.map(e=>e.id),[n,i,o]=await Promise.all([(0,y.HK)("projects",(0,d._M)("id","in",r),(0,d._M)("customerId","==",t.customerId)),(0,y.HK)("timesheets",(0,d._M)("projectId","in",r),(0,d._M)("customerId","==",t.customerId)),(0,y.HK)("users",(0,d._M)("customerId","==",t.customerId))]),l=new Map(o.map(e=>[e.id,e])),u=[];for(let e of n){let t=i.filter(t=>t.projectId===e.id).map(e=>{let t=l.get(e.userId);if(!t)throw Error(`User with id ${e.userId} not found for timesheet ${e.id}`);return{timesheet:e,user:t}}),{contributorsStats:r}=(0,c.yI)({project:e,contributors:t});u.push(r.map(e=>{let t=l.get(e.userId);if(!t)throw Error("No matching user found for contributor");return{...e,user:t}}))}let m=(0,h.Ue)(t.data).year;s({status:f.n.Success,staffCosts:function(e,t){let r={};for(let s of e)for(let e of s){let s=e.user.id,n=e.yearlyStats[t],i=e.user.yearlyExpenses?.[t];n&&i&&(s in r?(r[s].fundablePercentage=Math.min(1,r[s].fundablePercentage+n.fundablePercentage),r[s].hours+=n.hours,r[s].fundableCost=Math.min(r[s].grossCost,r[s].fundableCost+n.fundablePercentage*n.grossCost.total)):r[s]={userId:s,firstName:e.user.firstName,lastName:e.user.lastName,employmentStartDate:e.user.employmentStartDate,employmentEndDate:e.user.employmentEndDate,applicableContractualWorkingHours:n.applicableContractualWorkingHours,hours:n.hours,yearlyGrossSalary:i.yearlyGrossSalary,yearlyEmployerContribution:(0,a.e8)(e.user)?i.yearlyEmployerContribution:0,grossCost:n.grossCost.total,fundablePercentage:n.fundablePercentage,fundableCost:n.fundablePercentage*n.grossCost.total})}return Object.values(r)}(u,m),year:m})}catch(e){t("Error fetching staff cost data",e),s({status:f.n.Error,staffCosts:null,year:null})}}return(0,p.useEffect)(()=>{e&&"string"==typeof e&&n(e)},[e]),r}((0,x.useRouter)().query.payoutApplicationId);if(e!==f.n.Success||!t)return null;let i=t.filter(e=>e.hours>0).toSorted(a.H2),o=(0,n.X3)(i,30);return(0,s.jsxs)("section",{className:"h-full max-w-6xl print:pt-12",children:[(0,s.jsxs)(u.E,{className:"pb-2 text-xl font-bold",children:["\xdcbersicht der Lohn- und Vorsorgeaufwendungen in ",(0,s.jsx)("span",{children:r})]}),i.length>0?o.map((e,t)=>(0,s.jsx)("section",{className:t>0?"pt-12":"",children:(0,s.jsx)(D,{rows:e,allRows:t+1===o.length?i:void 0,isLast:t+1===o.length})},t)):(0,s.jsxs)(u.E,{className:"text-center text-tertiary-500 italic",children:["Keine Aufwendungen in ",r]})]})};function D({rows:e,allRows:t,isLast:r}){return(0,s.jsxs)("table",{className:(0,g.cn)("table-fixed border border-tertiary-300 pb-1 text-xxs",!r&&"break-after-page"),children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border border-tertiary-800 bg-tertiary-200",children:[(0,s.jsx)(j,{children:"Nachname"}),(0,s.jsx)(j,{children:"Vorname"}
1),(0,s.jsx)(j,{className:"w-40",children:"Besch\xe4ftigungszeitraum"}),(0,s.jsx)(j,{className:"w-28 text-right",children:"Max. j\xe4hrl. Arbeitsstunden"}),(0,s.jsx)(j,{className:"w-20 text-right",children:"Stunden in FuE"}),(0,s.jsx)(j,{className:"w-24 text-right",children:"Brutto Arbeitslohn"}),(0,s.jsx)(j,{className:"w-24 text-right",children:"Vorsorge-aufwendungen"}),(0,s.jsx)(j,{className:"w-24 text-right",children:"Lohn gesamt"}),(0,s.jsx)(j,{className:"w-16 text-right",children:"Anteil FuE"}),(0,s.jsx)(j,{className:"w-24 text-right",children:"F\xf6rderf\xe4higer Betrag"})]})}),(0,s.jsxs)("tbody",{children:[e.map((t,r)=>(0,s.jsxs)("tr",{className:e.length>2&&r%2==1?"bg-tertiary-50":"",children:[(0,s.jsx)(N,{children:(0,s.jsx)("div",{className:"w-32 truncate",children:t.lastName})}),(0,s.jsx)(N,{children:(0,s.jsx)("div",{className:"w-32 truncate",children:t.firstName})}),(0,s.jsxs)(N,{children:[t.employmentStartDate&&(0,s.jsx)("span",{children:(0,i.Y)(t.employmentStartDate)}),(0,s.jsx)("span",{children:" - "}),t.employmentEndDate?(0,s.jsx)("span",{children:(0,i.Y)(t.employmentEndDate)}):(0,s.jsx)(u.E,{as:"span",className:"text-tertiary-500",children:"heute"})]}),(0,s.jsx)(N,{className:"text-right",children:t.applicableContractualWorkingHours.toLocaleString("de-DE")}),(0,s.jsx)(N,{className:"text-right",children:t.hours.toLocaleString("de-DE")}),(0,s.jsx)(N,{className:"text-right",children:(0,o.v)(t.yearlyGrossSalary)}),(0,s.jsx)(N,{className:"text-right",children:(0,o.v)(t.yearlyEmployerContribution)}),(0,s.jsx)(N,{className:"text-right",children:(0,o.v)(t.grossCost)}),(0,s.jsxs)(N,{className:"text-right",children:["â",t.fundablePercentage.toLocaleString("de-DE",{style:"percent",maximumFractionDigits:1})]}),(0,s.jsx)(N,{className:"text-right",children:(0,o.v)(t.fundableCost)})]},t.userId+r)),t&&(0,s.jsxs)("tr",{className:"bg-tertiary-200",children:[(0,s.jsx)(N,{bold:!0,children:"Summen"}),(0,s.jsx)(N,{}),(0,s.jsx)(N,{}),(0,s.jsx)(N,{}),(0,s.jsx)(N,{}),(0,s.jsx)(N,{className:"text-right",bold:!0,children:(0,o.v)(t.reduce((e,t)=>e+(t.yearlyGrossSalary||0),0))}),(0,s.jsx)(N,{className:"text-right",bold:!0,children:(0,o.v)(t.reduce((e,t)=>e+(t.yearlyEmployerContribution||0),0))}),(0,s.jsx)(N,{className:"text-right",bold:!0,children:(0,o.v)(t.reduce((e,t)=>e+(t.grossCost||0),0))}),(0,s.jsx)(N,{}),(0,s.jsx)(N,{className:"text-right",bold:!0,children:(0,o.v)(t.reduce((e,t)=>e+(t.fundableCost||0),0))})]})]})]})}function j({children:e,className:t=""}){return(0,s.jsx)("th",{className:(0,g.cn)("border-x border-tertiary-300 px-1 text-left",t),children:(0,s.jsx)(u.E,{as:"span",className:"block py-1 text-xs leading-tight font-bold",children:e})})}function N({bold:e=!1,children:t,className:r=""}){return(0,s.jsx)("td",{className:(0,g.cn)("border-x border-tertiary-300 px-1 py-0.5 text-left",r),children:(0,s.jsx)(u.E,{as:"span",className:(0,g.cn)("text-xs",e?"font-bold":"font-normal"),children:t})})}b.getLayout=e=>(0,s.jsx)(l.j,{title:"Lohnaufwendungen",children:e});let A=b},41160:(e,t,r)=>{"use strict";r.d(t,{S:()=>a});var s=r(6792);function a(e,t){let r,a=(0,s.a)(e,t?.in);return Number.isNaN(+a)?NaN:(r=(0,s.a)(a,void 0).getFullYear())%400==0||r%4==0&&r%100!=0?366:365}},51193:(e,t,r)=>{"use strict";r.d(t,{EB:()=>n,FH:()=>o,K4:()=>u,Y2:()=>a,YQ:()=>c,eT:()=>s,s1:()=>l,vT:()=>i});let s=4e6,a=1e7,n=12e6,i=.25,o=.35,l=.6,u=.7,c=.2},53662:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/rnd-reports/staff-cost-table",function(){return r(33340)}])},63044:(e,t,r)=>{"use strict";r.d(t,{Rd:()=>A,yI:()=>N,LS:()=>j});var s=r(80036),a=r(43247),n=r(41160),i=r(51193),o=r(32797),l=r(99564);function u(){return{total:0,salaries:0,salariesShareholder:0,salariesDomestic:0,salariesAbroad:0,employerContributions:0}}function c(){return{applicableContractualWorkingHours:0,fundablePercentage:0,fte:0,fteDomestic:0,fteAbroad:0,fundingAmount:0,grossCost:u(),fundableCost:{...u(),totalBeforeMarch28th2024:0,totalAfterMarch27th2024:0,salariesDomesticBeforeJuly2020:0,salariesDomesticAfterJune2020:0,salariesDomesticBeforeMarch28th2024:0,salariesDomesticAfterMarch27th2024:0,salariesAbroadBeforeJuly2020:0,salariesAbroadAfterJune2020:0,salariesAbroadBeforeMarch28th2024:0,salariesAbroadAfterMarch27th2024:0,employerContributionsBeforeJuly2020:0,employerContributionsAfterJune2020:0,employerContributionsBeforeMarch28th2024:0,employerContributionsAfterMarch27th2024:0}}}var h=r(55158),d=r(80102),f=r(18133);function m(){return{otherDays:0,sickDays:0,vacationDays:0,publicHolidaysInYear:0,hours:0,hoursBeforeJuly2020:0,hoursAfterJune2020:0,hoursBeforeMarch28th2024:0,hoursAfterMarch27th2024:0,hoursPerMonth:function(e=0,t=11){let r={};if(null===e||null===t)return r;for(let s=e;s<=t;s++)r[`month_${s}`]=0;return r}()}}function y(e,t){let r=[...e];for(let e of t)r.find(t=>t.kind===e.kind&&t.id===e.id&&t.missing===e.missing&&(!("year"in t)||!("year"in e)||t.year===e.year))||r.push(e);return r}function p(e,t){if(!t)return structuredClone(e);
1let r=e.applicableContractualWorkingHours+t.applicableContractualWorkingHours,s=e.hours+t.hours,a=Math.min(1,r?s/r:0);return{applicableContractualWorkingHours:r,fte:e.fte+t.fte,fteAbroad:e.fteAbroad+t.fteAbroad,fteDomestic:e.fteDomestic+t.fteDomestic,fundableCost:g(e.fundableCost,t.fundableCost),fundablePercentage:a,fundingAmount:e.fundingAmount+t.fundingAmount,grossCost:g(e.grossCost,t.grossCost),hours:s,hoursAfterJune2020:e.hoursAfterJune2020+t.hoursAfterJune2020,hoursAfterMarch27th2024:e.hoursAfterMarch27th2024+t.hoursAfterMarch27th2024,hoursBeforeJuly2020:e.hoursBeforeJuly2020+t.hoursBeforeJuly2020,hoursBeforeMarch28th2024:e.hoursBeforeMarch28th2024+t.hoursBeforeMarch28th2024,hoursPerMonth:g(e.hoursPerMonth,t.hoursPerMonth),missingData:y(e.missingData,t.missingData),otherDays:e.otherDays+t.otherDays,sickDays:e.sickDays+t.sickDays,vacationDays:e.vacationDays+t.vacationDays,year:e.year}}function g(e,t){return Object.fromEntries(Object.entries(e).map(([e,r])=>[e,r+t[e]]))}function x(){return{...m(),...c(),missingData:[]}}function b(e,t){return t?e.filter(e=>t.includes(e)):e}function D(e){let{publicHolidaysInYear:t,...r}=x();return{...r,year:e}}function j({project:e,contributorsStats:t,years:r}){let n={missingData:[],totalStats:function(){let{publicHolidaysInYear:e,hoursPerMonth:t,...r}=m();return{...r,...c(),missingData:[]}}(),yearlyStats:{}},{startDate:i,endDate:o}=e.data;if(!i||!o)return n.missingData.push({kind:"project",id:e.id,missing:"project_duration"}),n;let l=b((0,s.R)((0,a.pp)(i),(0,a.pp)(o)),r),u=D("2020");for(let e of l){let r=D(e);for(let s of t)r=p(r,s.yearlyStats[e]);n.yearlyStats[e]=r,n.missingData=y(n.missingData,r.missingData),(u=p(u,r)).missingData=y(u.missingData,r.missingData)}let{hoursPerMonth:h,year:d,...f}=u;return n.totalStats=f,n.missingData=y(n.missingData,f.missingData),n}function N({project:e,contributors:t,years:r}){let n={missingData:[],contributorsStats:[]},{startDate:i,endDate:o}=e.data;if(!i||!o)return n.missingData.push({kind:"project",id:e.id,missing:"project_duration"}),n;let l=b((0,s.R)((0,a.pp)(i),(0,a.pp)(o)),r);for(let{timesheet:r,user:s}of t){if(r.projectId!==e.id)continue;let t={missingData:[],yearlyStats:{},userId:s.id,timesheetId:r.id};for(let a of l){let n=A({project:e,timesheet:r,user:s,year:a});t.missingData.push(...n.missingData),t.yearlyStats[a]={...n,year:a}}n.contributorsStats.push(t),n.missingData.push(...t.missingData)}return n}function A({project:e,timesheet:t,user:r,year:s}){let u=x();if(t.projectId!==e.id)return u;let{startDate:c,endDate:p}=e.data;if(!c||!p)return u.missingData.push({kind:"project",id:e.id,missing:"project_duration"}),u;if(!r.employmentStartDate)return u.missingData.push({kind:"user",id:r.id,missing:"employment_start_date"}),u;let{timesheetSummary:g,missingData:b}=function({user:e,timesheet:t,projectStartDate:r,projectEndDate:s,year:n}){let i=[];e.workLocation||i.push({kind:"user",id:e.id,missing:"work_location"});let o={...m(),publicHolidaysInYear:(0,l.h8)(n,e.workLocation)}
1,u=(0,l.w1)(e,n),c=0,y=e.yearlyExpenses?.[n]?.weeklyDaysWorked||0,p=0,g=5-y;for(let n of u){1===n.getDay()&&(p=0);let i=t.data.times[(0,a.sq)(n)];!i&&!(0,d.k)(n,e.workLocation)&&p++;let l=(0,a.pp)(r)<=n&&(0,a.pp)(s)>=n;if(i){let t=i.kind;if((t===f.qQ.Sick||t===f.qQ.Other||t===f.qQ.Vacation)&&(0,d.k)(n,e.workLocation)?o.publicHolidaysInYear=Math.max(0,o.publicHolidaysInYear-1):t===f.qQ.PublicHoliday&&!(0,d.k)(n,e.workLocation)&&o.publicHolidaysInYear++,t===f.qQ.Vacation)o.vacationDays++;else if(t===f.qQ.Sick)o.sickDays++;else if(t===f.qQ.Other)o.otherDays++;else if(t===f.qQ.Work){if(!l)continue;let e=i.hours;o.hours+=e,o.hoursPerMonth[`month_${n.getMonth()}`]+=e,n<(0,a.pp)("2020-07-01")?o.hoursBeforeJuly2020+=e:o.hoursAfterJune2020+=e,n<(0,a.pp)("2024-03-28")?o.hoursBeforeMarch28th2024+=e:o.hoursAfterMarch27th2024+=e}}(0,h.Y)(n,new Date)&&l&&!i&&!(0,d.k)(n,e.workLocation)&&p>g&&c++}return c>0&&i.push({kind:"timesheet",id:t.id,missing:"missing_timemap_entries",count:c,year:n}),{timesheetSummary:o,missingData:i}}({user:r,timesheet:t,projectStartDate:c,projectEndDate:p,year:s});if((u={...u,...g}).missingData=y(u.missingData,b),(0,l.g0)(r,s)&&g.hours>0)return u.missingData.push({kind:"user",id:r.id,missing:"yearly_expenses",year:s}),u;let{costBreakdown:D,missingData:j}=function({user:e,timesheetSummary:t,year:r,projectStartDate:s,isNotSME:u}){var c,h;let d,f,m,y,p,g,x=[];e.taxResidence||x.push({kind:"user",id:e.id,missing:"tax_residence"});let b=(0,l.yO)(e,t,r),D=Math.min(1,b?t.hours/b:0),j=e.yearlyExpenses?.[r],N=(0,l.aF)(e,r)/(0,n.S)(new Date(r))*D*((j?.weeklyHoursWorked||0)/40),A=(0,o.e8)(e)?N:0,M=(0,o.e8)(e)?0:N,k=(c=e,h=r,d=c.yearlyExpenses?.[h],f=d?.yearlyGrossSalary||0,m=c.isShareholderOfCustomer&&(0,o.e8)(c)?f:0,y=d?.yearlyEmployerContribution&&(0,o.e8)(c)?d.yearlyEmployerContribution:0,p=(0,o.e8)(c)?0:f,g=(0,o.e8)(c)?f:0,{total:f+y,employerContributions:y,salaries:f,
1salariesShareholder:m,salariesAbroad:p,salariesDomestic:g}),w=function(e,t,r){let s,a,n,i,o,l,u,c,{percentageBeforeJuly2020:h,percentageBeforeMarch28th2024:d}=(s=e.hours,a=e.hoursBeforeJuly2020,n=Math.min(1,s?a/s:0),i=e.hoursAfterJune2020,o=Math.min(1,s?i/s:0),l=e.hoursBeforeMarch28th2024,u=Math.min(1,s?l/s:0),c=e.hoursAfterMarch27th2024,{percentageBeforeJuly2020:n,percentageAfterJune2020:o,percentageBeforeMarch28th2024:u,percentageAfterMarch27th2024:Math.min(1,s?c/s:0)}),f=t.employerContributions*r,m=t.salaries*r,y=f+m,p=t.salariesShareholder*r,g=t.salariesAbroad*r,x=t.salariesDomestic*r,b=y*d,D=f*h,j=f*d,N=g*h,A=g*d,M=x*h,k=x*d;return{total:y,totalBeforeMarch28th2024:b,totalAfterMarch27th2024:y-b,employerContributions:f,employerContributionsBeforeJuly2020:D,employerContributionsAfterJune2020:f-D,employerContributionsBeforeMarch28th2024:j,employerContributionsAfterMarch27th2024:f-j,salaries:m,salariesShareholder:p,salariesAbroad:g,salariesAbroadBeforeJuly2020:N,salariesAbroadAfterJune2020:g-N,salariesAbroadBeforeMarch28th2024:A,salariesAbroadAfterMarch27th2024:g-A,salariesDomestic:x,salariesDomesticBeforeJuly2020:M,salariesDomesticAfterJune2020:x-M,salariesDomesticBeforeMarch28th2024:k,salariesDomesticAfterMarch27th2024:x-k}}(t,k,D),C=u?i.vT:i.FH,S=(0,a.pp)(s)>=(0,a.pp)("2026-01-01"),E=(w.totalBeforeMarch28th2024*i.vT+w.totalAfterMarch27th2024*C)*(S?1+i.YQ:1);return{costBreakdown:{applicableContractualWorkingHours:b,fundablePercentage:D,fte:N,fteDomestic:A,fteAbroad:M,grossCost:k,fundableCost:w,fundingAmount:E},missingData:x}}({timesheetSummary:g,user:r,year:s,projectStartDate:c,isNotSME:e.data.isNotSME});return(u={...u,...D}).missingData=y(u.missingData,j),u}},84824:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(26514),a=r(8505),n=r(97925);function i(){return(0,s.jsx)(a.P,{showNavigation:!1,showLanguageSelect:!1,showPublicLinks:!1,children:(0,s.jsx)("div",{className:"m-auto max-w-2xl py-6",children:(0,s.jsx)(n.R,{height:200,rows:3})})})}},85697:(e,t,r)=>{"use strict";r.d(t,{j:()=>l});var s=r(26514),a=r(2041),n=r(84824),i=r(25203),o=r(46225);function l({title:e="Coup",children:t}){let{loading:r,authUser:u}=(0,i.ZY)(),c=(0,o.useRouter)();return r?(0,s.jsx)(n.A,{}):u?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.p,{title:e}),(0,s.jsx)("main",{children:t})]}):(c.push({pathname:"/login",query:{returnTo:c.asPath}}),(0,s.jsx)(n.A,{}))}},97925:(e,t,r)=>{"use strict";r.d(t,{R:()=>a});var s=r(26514);function a({height:e=100,rows:t=1,fade:r=!1}){return(0,s.jsx)("div",{className:"flex animate-pulse flex-col gap-4",children:Array.from(Array(t).keys()).map(a=>(0,s.jsx)("div",{className:"rounded-lg bg-tertiary-100 dark:bg-night-700",style:{height:e,opacity:r?1-a/t:1}},a))})}}},e=>{e.O(0,[7061,1126,5551,4284,543,8505,6438,636,6593,8792],()=>e(e.s=53662)),_N_E=e.O()}]);
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.