@ossy/consultancy 3.16.0 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -3
- package/src/ConsultancyNav.jsx +6 -5
- package/src/Definition.js +1 -0
- package/src/Forecast.jsx +191 -5
- package/src/admin-leakage.component.jsx +12 -0
- package/src/assignment-margin-results.component.jsx +12 -0
- package/src/current-month.component.jsx +66 -0
- package/src/en.translations.json +26 -14
- package/src/forecasts.page.jsx +39 -3
- package/src/margin-panels.jsx +216 -0
- package/src/margins.page.jsx +49 -3
- package/src/sv.translations.json +26 -14
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/consultancy",
|
|
3
3
|
"description": "Consultancy feature package — schemas, forecasts UI, and assignment margins",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.18.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"module": "./src/index.js",
|
|
@@ -25,16 +25,18 @@
|
|
|
25
25
|
"README.md"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ossy/schema": "^3.
|
|
28
|
+
"@ossy/schema": "^3.18.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@ossy/calendar": "*",
|
|
32
|
+
"@ossy/dashboard": "*",
|
|
32
33
|
"@ossy/design-system": "*",
|
|
33
34
|
"@ossy/router-react": "*",
|
|
35
|
+
"@ossy/sdk-react": "*",
|
|
34
36
|
"react": "*"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
39
|
"jest": "^30.2.0"
|
|
38
40
|
},
|
|
39
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "8ceef98795a01c3b3486034db1d3b72b4350ccf1"
|
|
40
42
|
}
|
package/src/ConsultancyNav.jsx
CHANGED
|
@@ -2,19 +2,20 @@ import React from 'react'
|
|
|
2
2
|
import { Tabs } from '@ossy/design-system'
|
|
3
3
|
import { useRouter } from '@ossy/router-react'
|
|
4
4
|
|
|
5
|
+
/** KPI Overview first, Margins middle, Org Details last. Route ids stay unchanged. */
|
|
5
6
|
const TABS = [
|
|
6
|
-
{
|
|
7
|
-
id: 'consultancy/home',
|
|
8
|
-
label: 'consultancy.nav.overview',
|
|
9
|
-
},
|
|
10
7
|
{
|
|
11
8
|
id: 'consultancy/forecasts',
|
|
12
|
-
label: 'consultancy.nav.
|
|
9
|
+
label: 'consultancy.nav.overview',
|
|
13
10
|
},
|
|
14
11
|
{
|
|
15
12
|
id: 'consultancy/margins',
|
|
16
13
|
label: 'consultancy.nav.margins',
|
|
17
14
|
},
|
|
15
|
+
{
|
|
16
|
+
id: 'consultancy/home',
|
|
17
|
+
label: 'consultancy.nav.orgDetails',
|
|
18
|
+
},
|
|
18
19
|
]
|
|
19
20
|
|
|
20
21
|
/**
|
package/src/Definition.js
CHANGED
package/src/Forecast.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, Text, Separator, useLocale } from '@ossy/design-system'
|
|
3
|
-
import { CalendarDaySurfaceStyles, useForecast } from '@ossy/calendar'
|
|
1
|
+
import React, { useMemo } from 'react'
|
|
2
|
+
import { View, Text, Separator, useLocale } from '@ossy/design-system'
|
|
3
|
+
import { CalendarDaySurfaceStyles, sumFiscalYearTotals, useForecast } from '@ossy/calendar'
|
|
4
4
|
|
|
5
5
|
const grid = {
|
|
6
6
|
width: '100%',
|
|
@@ -33,6 +33,189 @@ const calendarDayLayout = {
|
|
|
33
33
|
margin: 0,
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
const KPI_SERIES = [
|
|
37
|
+
{ key: 'projectedIncome', label: 'consultancy.forecasts.income', color: 'var(--color-primary)' },
|
|
38
|
+
{ key: 'monthlyCostOfEmployees', label: 'consultancy.forecasts.salaryCost', color: 'var(--separator-primary, var(--separator))' },
|
|
39
|
+
{ key: 'revenue', label: 'consultancy.forecasts.revenue', color: 'var(--color-accent, hsl(167, 89%, 43%))' },
|
|
40
|
+
{ key: 'hoursWorked', label: 'consultancy.forecasts.hoursWorked', color: 'var(--fg-secondary, hsl(220, 10%, 45%))' },
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
function SectionPanel ({ title, children }) {
|
|
44
|
+
return (
|
|
45
|
+
<View surface="primary" roundness="xs" style={{ minWidth: 0, overflow: 'hidden', height: '100%' }}>
|
|
46
|
+
<View stack bordered>
|
|
47
|
+
<View.Item
|
|
48
|
+
data-surface="primary"
|
|
49
|
+
layout="row"
|
|
50
|
+
style={{
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
justifyContent: 'space-between',
|
|
53
|
+
padding: 'var(--space-s) var(--space-m)',
|
|
54
|
+
gap: 'var(--space-m)',
|
|
55
|
+
height: '48px',
|
|
56
|
+
flexShrink: 0,
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
<Text variant="small" as="h2" style={{ fontWeight: 'bold' }}>{title}</Text>
|
|
60
|
+
</View.Item>
|
|
61
|
+
<View.Item>
|
|
62
|
+
{children}
|
|
63
|
+
</View.Item>
|
|
64
|
+
</View>
|
|
65
|
+
</View>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Hand-rolled multi-series line chart for fiscal-year KPIs.
|
|
71
|
+
* Matches the no-dependency SVG approach from analytics DailyBarChart (#917).
|
|
72
|
+
* Each series is normalized to its own max so money and hours can share one chart.
|
|
73
|
+
*/
|
|
74
|
+
function ForecastKpiChart ({ months }) {
|
|
75
|
+
const chart = useMemo(() => {
|
|
76
|
+
if (!months?.length) return null
|
|
77
|
+
|
|
78
|
+
const width = Math.max(280, months.length * 36)
|
|
79
|
+
const height = 120
|
|
80
|
+
const padX = 8
|
|
81
|
+
const padY = 10
|
|
82
|
+
const innerW = width - padX * 2
|
|
83
|
+
const innerH = height - padY * 2
|
|
84
|
+
const step = months.length === 1 ? 0 : innerW / (months.length - 1)
|
|
85
|
+
|
|
86
|
+
const seriesPaths = KPI_SERIES.map((series) => {
|
|
87
|
+
let min = Infinity
|
|
88
|
+
let max = -Infinity
|
|
89
|
+
for (const month of months) {
|
|
90
|
+
const value = Number(month[series.key]) || 0
|
|
91
|
+
if (value < min) min = value
|
|
92
|
+
if (value > max) max = value
|
|
93
|
+
}
|
|
94
|
+
if (!Number.isFinite(min) || !Number.isFinite(max)) {
|
|
95
|
+
return { ...series, path: null }
|
|
96
|
+
}
|
|
97
|
+
if (min === max) {
|
|
98
|
+
min -= 1
|
|
99
|
+
max += 1
|
|
100
|
+
}
|
|
101
|
+
const span = max - min
|
|
102
|
+
const points = months.map((month, index) => {
|
|
103
|
+
const value = Number(month[series.key]) || 0
|
|
104
|
+
const x = padX + index * step
|
|
105
|
+
const y = padY + innerH - ((value - min) / span) * innerH
|
|
106
|
+
return `${x},${y}`
|
|
107
|
+
})
|
|
108
|
+
return { ...series, path: `M ${points.join(' L ')}` }
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
return { width, height, seriesPaths }
|
|
112
|
+
}, [months])
|
|
113
|
+
|
|
114
|
+
if (!chart) {
|
|
115
|
+
return (
|
|
116
|
+
<View inset="m">
|
|
117
|
+
<Text variant="small" text="consultancy.forecasts.yearChartEmpty" />
|
|
118
|
+
</View>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<View gap="s" inset="m">
|
|
124
|
+
<View layout="row-wrap" gap="m" style={{ alignItems: 'center' }}>
|
|
125
|
+
{KPI_SERIES.map((series) => (
|
|
126
|
+
<View key={series.key} layout="row" gap="s" style={{ alignItems: 'center' }}>
|
|
127
|
+
<span
|
|
128
|
+
aria-hidden
|
|
129
|
+
style={{
|
|
130
|
+
width: 10,
|
|
131
|
+
height: 10,
|
|
132
|
+
borderRadius: 2,
|
|
133
|
+
background: series.color,
|
|
134
|
+
display: 'inline-block',
|
|
135
|
+
flexShrink: 0,
|
|
136
|
+
}}
|
|
137
|
+
/>
|
|
138
|
+
<Text variant="small" style={{ marginBottom: 0 }} text={series.label} />
|
|
139
|
+
</View>
|
|
140
|
+
))}
|
|
141
|
+
</View>
|
|
142
|
+
<View style={{ overflowX: 'auto' }}>
|
|
143
|
+
<svg
|
|
144
|
+
data-consultancy-kpi-chart
|
|
145
|
+
viewBox={`0 0 ${chart.width} ${chart.height}`}
|
|
146
|
+
width={chart.width}
|
|
147
|
+
height={chart.height}
|
|
148
|
+
style={{ display: 'block', maxWidth: '100%' }}
|
|
149
|
+
>
|
|
150
|
+
{chart.seriesPaths.map((series) => (
|
|
151
|
+
series.path ? (
|
|
152
|
+
<path
|
|
153
|
+
key={series.key}
|
|
154
|
+
d={series.path}
|
|
155
|
+
fill="none"
|
|
156
|
+
stroke={series.color}
|
|
157
|
+
strokeWidth={2}
|
|
158
|
+
strokeLinejoin="round"
|
|
159
|
+
strokeLinecap="round"
|
|
160
|
+
/>
|
|
161
|
+
) : null
|
|
162
|
+
))}
|
|
163
|
+
</svg>
|
|
164
|
+
</View>
|
|
165
|
+
<View layout="row" gap="s" style={{ justifyContent: 'space-between' }}>
|
|
166
|
+
<Text variant="small" style={{ marginBottom: 0 }}>
|
|
167
|
+
{months[0]?.month}
|
|
168
|
+
</Text>
|
|
169
|
+
<Text variant="small" style={{ marginBottom: 0 }}>
|
|
170
|
+
{months[months.length - 1]?.month}
|
|
171
|
+
</Text>
|
|
172
|
+
</View>
|
|
173
|
+
</View>
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function YearSummary ({ months, money, hours }) {
|
|
178
|
+
const { t } = useLocale()
|
|
179
|
+
const totals = useMemo(() => sumFiscalYearTotals(months), [months])
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<View
|
|
183
|
+
data-consultancy-year-summary
|
|
184
|
+
layout="row-wrap"
|
|
185
|
+
gap="m"
|
|
186
|
+
style={{ alignItems: 'stretch', width: '100%' }}
|
|
187
|
+
>
|
|
188
|
+
<View style={{ flex: '2 1 320px', minWidth: 0 }}>
|
|
189
|
+
<SectionPanel title={t('consultancy.forecasts.yearChart')}>
|
|
190
|
+
<ForecastKpiChart months={months} />
|
|
191
|
+
</SectionPanel>
|
|
192
|
+
</View>
|
|
193
|
+
<View style={{ flex: '1 1 240px', minWidth: 0 }}>
|
|
194
|
+
<SectionPanel title={t('consultancy.forecasts.yearSummary')}>
|
|
195
|
+
<View gap="s" inset="m">
|
|
196
|
+
<View layout="row" gap="s" style={{ justifyContent: 'space-between' }}>
|
|
197
|
+
<Text variant="m" style={{ marginBottom: 0 }} text="consultancy.forecasts.income" />
|
|
198
|
+
<Text variant="m" style={{ marginBottom: 0 }}>{money(totals.projectedIncome)}</Text>
|
|
199
|
+
</View>
|
|
200
|
+
<View layout="row" gap="s" style={{ justifyContent: 'space-between' }}>
|
|
201
|
+
<Text variant="m" style={{ marginBottom: 0 }} text="consultancy.forecasts.salaryCost" />
|
|
202
|
+
<Text variant="m" style={{ marginBottom: 0 }}>{money(totals.monthlyCostOfEmployees)}</Text>
|
|
203
|
+
</View>
|
|
204
|
+
<View layout="row" gap="s" style={{ justifyContent: 'space-between' }}>
|
|
205
|
+
<Text variant="m" style={{ marginBottom: 0 }} text="consultancy.forecasts.revenue" />
|
|
206
|
+
<Text variant="m" style={{ marginBottom: 0 }}>{money(totals.revenue)}</Text>
|
|
207
|
+
</View>
|
|
208
|
+
<View layout="row" gap="s" style={{ justifyContent: 'space-between' }}>
|
|
209
|
+
<Text variant="m" style={{ marginBottom: 0 }} text="consultancy.forecasts.hoursWorked" />
|
|
210
|
+
<Text variant="m" style={{ marginBottom: 0 }}>{hours(totals.hoursWorked)}</Text>
|
|
211
|
+
</View>
|
|
212
|
+
</View>
|
|
213
|
+
</SectionPanel>
|
|
214
|
+
</View>
|
|
215
|
+
</View>
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
|
|
36
219
|
export const Forecast = () => {
|
|
37
220
|
const months = useForecast()
|
|
38
221
|
const { language } = useLocale()
|
|
@@ -49,7 +232,9 @@ export const Forecast = () => {
|
|
|
49
232
|
}
|
|
50
233
|
`}
|
|
51
234
|
</style>
|
|
52
|
-
<
|
|
235
|
+
<View gap="m" style={{ width: '100%' }}>
|
|
236
|
+
<YearSummary months={months} money={money} hours={hours} />
|
|
237
|
+
<div style={grid}>
|
|
53
238
|
|
|
54
239
|
{months.map(month => {
|
|
55
240
|
const startPad = month.days[0].isoWeekday - 1
|
|
@@ -130,7 +315,8 @@ export const Forecast = () => {
|
|
|
130
315
|
</View>
|
|
131
316
|
)
|
|
132
317
|
})}
|
|
133
|
-
|
|
318
|
+
</div>
|
|
319
|
+
</View>
|
|
134
320
|
</>
|
|
135
321
|
)
|
|
136
322
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AdminLeakagePanel } from './margin-panels.jsx'
|
|
2
|
+
|
|
3
|
+
export const metadata = {
|
|
4
|
+
id: '@ossy/consultancy/view/admin-leakage',
|
|
5
|
+
widget: {
|
|
6
|
+
title: 'consultancy.widgets.adminLeakage.title',
|
|
7
|
+
description: 'consultancy.widgets.adminLeakage.description',
|
|
8
|
+
},
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Slot widget — standalone admin leakage panel for dashboards. */
|
|
12
|
+
export default AdminLeakagePanel
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssignmentMarginResultsPanel } from './margin-panels.jsx'
|
|
2
|
+
|
|
3
|
+
export const metadata = {
|
|
4
|
+
id: '@ossy/consultancy/view/assignment-margin-results',
|
|
5
|
+
widget: {
|
|
6
|
+
title: 'consultancy.widgets.marginResults.title',
|
|
7
|
+
description: 'consultancy.widgets.marginResults.description',
|
|
8
|
+
},
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Slot widget — standalone assignment margin panel for dashboards. */
|
|
12
|
+
export default AssignmentMarginResultsPanel
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View, Text, useLocale } from '@ossy/design-system'
|
|
3
|
+
import { DataLoader, useForecast } from '@ossy/calendar'
|
|
4
|
+
|
|
5
|
+
function MetricRow ({ label, value }) {
|
|
6
|
+
return (
|
|
7
|
+
<View layout="row" gap="s" style={{ justifyContent: 'space-between' }}>
|
|
8
|
+
<Text variant="m" style={{ marginBottom: 0 }} text={label} />
|
|
9
|
+
<Text variant="m" style={{ marginBottom: 0 }}>{value}</Text>
|
|
10
|
+
</View>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Compact current-month forecast metrics (standalone dashboard panel).
|
|
16
|
+
*/
|
|
17
|
+
export function CurrentMonthForecastPanel () {
|
|
18
|
+
const months = useForecast()
|
|
19
|
+
const { language } = useLocale()
|
|
20
|
+
const money = (value) => new Intl.NumberFormat(language === 'sv' ? 'sv-SE' : 'en-SE', {
|
|
21
|
+
style: 'currency',
|
|
22
|
+
currency: 'SEK',
|
|
23
|
+
}).format(value)
|
|
24
|
+
const hours = (value) => new Intl.NumberFormat(language === 'sv' ? 'sv-SE' : 'en-GB', {
|
|
25
|
+
style: 'unit',
|
|
26
|
+
unit: 'hour',
|
|
27
|
+
}).format(value)
|
|
28
|
+
|
|
29
|
+
const current = (Array.isArray(months) ? months : []).find((m) => m.isCurrentMonth)
|
|
30
|
+
?? (Array.isArray(months) ? months[0] : null)
|
|
31
|
+
|
|
32
|
+
if (!current) {
|
|
33
|
+
return (
|
|
34
|
+
<Text
|
|
35
|
+
color="secondary"
|
|
36
|
+
text="consultancy.forecasts.widget.empty"
|
|
37
|
+
data-forecasts-widget="current-month"
|
|
38
|
+
/>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<View gap="s" data-forecasts-widget="current-month">
|
|
44
|
+
<Text variant="heading-tertiary" as="h3">
|
|
45
|
+
{current.year} {current.month}
|
|
46
|
+
</Text>
|
|
47
|
+
<MetricRow label="consultancy.forecasts.income" value={money(current.projectedIncome)} />
|
|
48
|
+
<MetricRow label="consultancy.forecasts.salaryCost" value={money(current.monthlyCostOfEmployees)} />
|
|
49
|
+
<MetricRow label="consultancy.forecasts.revenue" value={money(current.revenue)} />
|
|
50
|
+
<MetricRow label="consultancy.forecasts.hoursWorked" value={hours(current.hoursWorked)} />
|
|
51
|
+
</View>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const metadata = {
|
|
56
|
+
id: '@ossy/consultancy/view/current-month',
|
|
57
|
+
widget: {
|
|
58
|
+
title: 'consultancy.widgets.forecastCurrentMonth.title',
|
|
59
|
+
description: 'consultancy.widgets.forecastCurrentMonth.description',
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Slot widget — current-month forecast panel for dashboards. */
|
|
64
|
+
export default function CurrentMonthForecastWidget () {
|
|
65
|
+
return <DataLoader content={<CurrentMonthForecastPanel />} />
|
|
66
|
+
}
|
package/src/en.translations.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"consultancy/home.documentTitle": "
|
|
3
|
-
"consultancy/forecasts.documentTitle": "
|
|
2
|
+
"consultancy/home.documentTitle": "Org Details",
|
|
3
|
+
"consultancy/forecasts.documentTitle": "Overview",
|
|
4
4
|
"consultancy/margins.documentTitle": "Margins",
|
|
5
|
-
"consultancy.home.title": "
|
|
6
|
-
"consultancy.home.description": "
|
|
5
|
+
"consultancy.home.title": "Org Details",
|
|
6
|
+
"consultancy.home.description": "Company and fiscal-year details",
|
|
7
|
+
"consultancy.nav.title": "Consultancy",
|
|
7
8
|
"consultancy.nav.overview": "Overview",
|
|
8
9
|
"consultancy.nav.forecasts": "Forecasts",
|
|
9
10
|
"consultancy.nav.margins": "Margins",
|
|
10
|
-
"consultancy.forecasts.title": "
|
|
11
|
-
"consultancy.forecasts.description": "
|
|
11
|
+
"consultancy.forecasts.title": "Overview",
|
|
12
|
+
"consultancy.forecasts.description": "Fiscal-year KPIs, year totals, and monthly capacity from contracts, employees, and vacations",
|
|
12
13
|
"consultancy.forecasts.income": "Income",
|
|
13
14
|
"consultancy.forecasts.salaryCost": "Salary cost",
|
|
14
15
|
"consultancy.forecasts.revenue": "Revenue",
|
|
@@ -39,7 +40,6 @@
|
|
|
39
40
|
"consultancy.overview.noFiscalYears": "No fiscal years yet.",
|
|
40
41
|
"consultancy.empty.title": "Looks empty",
|
|
41
42
|
"consultancy.empty.text": "Add company info, employees, contracts, and vacations to get started.",
|
|
42
|
-
|
|
43
43
|
"@ossy/consultancy/form/calculator.label": "Assignment margin calculator",
|
|
44
44
|
"@ossy/consultancy/schema/calculator.hourlyRate.label": "Client hourly rate (SEK)",
|
|
45
45
|
"@ossy/consultancy/schema/calculator.billableHours.label": "Billable hours this period",
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
"@ossy/consultancy/schema/calculator.availableHours.label": "Available hours this month",
|
|
48
48
|
"@ossy/consultancy/schema/calculator.teamSize.label": "Team size",
|
|
49
49
|
"@ossy/consultancy/schema/calculator.adminHoursPerWeek.label": "Admin hours per person / week",
|
|
50
|
-
|
|
51
50
|
"@ossy/consultancy/schema/company-basic-info.name.label": "Company name",
|
|
52
51
|
"@ossy/consultancy/schema/company-basic-info.name.description": "The registered legal name of the company.",
|
|
53
52
|
"@ossy/consultancy/schema/company-basic-info.registrationDate.label": "Registration date",
|
|
@@ -69,7 +68,6 @@
|
|
|
69
68
|
"@ossy/consultancy/schema/company-basic-info.financialYearEnd.description": "Month the financial year ends.",
|
|
70
69
|
"@ossy/consultancy/schema/company-basic-info.holidayLocale.label": "Holiday calendar",
|
|
71
70
|
"@ossy/consultancy/schema/company-basic-info.holidayLocale.description": "Country used for public holidays and red days in forecasts and timesheets.",
|
|
72
|
-
|
|
73
71
|
"@ossy/consultancy/schema/employee.name.label": "Name",
|
|
74
72
|
"@ossy/consultancy/schema/employee.name.description": "The employee’s full name.",
|
|
75
73
|
"@ossy/consultancy/schema/employee.email.label": "Email",
|
|
@@ -84,7 +82,6 @@
|
|
|
84
82
|
"@ossy/consultancy/schema/employee.startDate.description": "First day of employment. Forecasts start from this date.",
|
|
85
83
|
"@ossy/consultancy/schema/employee.endDate.label": "Employment end",
|
|
86
84
|
"@ossy/consultancy/schema/employee.endDate.description": "Last day of employment. Leave empty if still employed.",
|
|
87
|
-
|
|
88
85
|
"@ossy/consultancy/schema/contract.employeeId.label": "Employee",
|
|
89
86
|
"@ossy/consultancy/schema/contract.employeeId.description": "Who this contract belongs to.",
|
|
90
87
|
"@ossy/consultancy/schema/contract.clientName.label": "Client",
|
|
@@ -105,14 +102,12 @@
|
|
|
105
102
|
"@ossy/consultancy/schema/contract.paymentTermsDueDate.description": "When the invoice is due, e.g. net 30 days.",
|
|
106
103
|
"@ossy/consultancy/schema/contract.paymentTermsInvoiceDate.label": "Invoice date",
|
|
107
104
|
"@ossy/consultancy/schema/contract.paymentTermsInvoiceDate.description": "When the invoice is issued relative to the service period.",
|
|
108
|
-
|
|
109
105
|
"@ossy/consultancy/schema/vacation.employeeId.label": "Employee",
|
|
110
106
|
"@ossy/consultancy/schema/vacation.employeeId.description": "Who is taking time off.",
|
|
111
107
|
"@ossy/consultancy/schema/vacation.start.label": "First day off",
|
|
112
108
|
"@ossy/consultancy/schema/vacation.start.description": "First day of vacation (inclusive). These days are not billed.",
|
|
113
109
|
"@ossy/consultancy/schema/vacation.end.label": "Last day off",
|
|
114
110
|
"@ossy/consultancy/schema/vacation.end.description": "Last day of vacation (inclusive).",
|
|
115
|
-
|
|
116
111
|
"@ossy/consultancy/schema/opportunity.title.label": "Title",
|
|
117
112
|
"@ossy/consultancy/schema/opportunity.title.description": "Short name for this lead or opportunity.",
|
|
118
113
|
"@ossy/consultancy/schema/opportunity.source.label": "Source",
|
|
@@ -133,7 +128,6 @@
|
|
|
133
128
|
"@ossy/consultancy/schema/opportunity.linkedProposalId.description": "Related proposal, if one exists.",
|
|
134
129
|
"@ossy/consultancy/schema/opportunity.feedRef.label": "Feed reference",
|
|
135
130
|
"@ossy/consultancy/schema/opportunity.feedRef.description": "Id or URL from the original listing.",
|
|
136
|
-
|
|
137
131
|
"@ossy/consultancy/schema/proposal.opportunityId.label": "Opportunity",
|
|
138
132
|
"@ossy/consultancy/schema/proposal.opportunityId.description": "The opportunity this proposal belongs to.",
|
|
139
133
|
"@ossy/consultancy/schema/proposal.title.label": "Title",
|
|
@@ -147,5 +141,23 @@
|
|
|
147
141
|
"@ossy/consultancy/schema/proposal.timeline.label": "Timeline",
|
|
148
142
|
"@ossy/consultancy/schema/proposal.timeline.description": "When the work would start and finish.",
|
|
149
143
|
"@ossy/consultancy/schema/proposal.body.label": "Body",
|
|
150
|
-
"@ossy/consultancy/schema/proposal.body.description": "Full proposal text."
|
|
144
|
+
"@ossy/consultancy/schema/proposal.body.description": "Full proposal text.",
|
|
145
|
+
"consultancy.nav.orgDetails": "Org Details",
|
|
146
|
+
"consultancy.forecasts.yearChart": "KPI trend",
|
|
147
|
+
"consultancy.forecasts.yearSummary": "Fiscal year totals",
|
|
148
|
+
"consultancy.forecasts.yearChartEmpty": "No forecast months to chart yet.",
|
|
149
|
+
"consultancy.margins.pin.done": "Pinned to dashboard",
|
|
150
|
+
"consultancy.margins.pin.error": "Pin failed — try again",
|
|
151
|
+
"consultancy.margins.pin.results": "Pin margin panel",
|
|
152
|
+
"consultancy.margins.pin.leakage": "Pin leakage panel",
|
|
153
|
+
"consultancy.forecasts.pin.done": "Pinned to dashboard",
|
|
154
|
+
"consultancy.forecasts.pin.error": "Pin failed — try again",
|
|
155
|
+
"consultancy.forecasts.pin.forecast": "Pin this month",
|
|
156
|
+
"consultancy.forecasts.widget.empty": "No forecast month available yet.",
|
|
157
|
+
"consultancy.widgets.marginResults.title": "Assignment margin",
|
|
158
|
+
"consultancy.widgets.marginResults.description": "Gross margin and utilization for a consulting assignment.",
|
|
159
|
+
"consultancy.widgets.adminLeakage.title": "Admin leakage",
|
|
160
|
+
"consultancy.widgets.adminLeakage.description": "Annual hours and revenue lost to recurring admin work.",
|
|
161
|
+
"consultancy.widgets.forecastCurrentMonth.title": "This month forecast",
|
|
162
|
+
"consultancy.widgets.forecastCurrentMonth.description": "Projected income, salary cost, revenue, and hours for the current month."
|
|
151
163
|
}
|
package/src/forecasts.page.jsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Text, View, Page, Tags } from '@ossy/design-system'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { Button, Text, View, Page, Tags } from '@ossy/design-system'
|
|
3
|
+
import { useSdk } from '@ossy/sdk-react'
|
|
4
|
+
import { PinWidget } from '@ossy/dashboard'
|
|
3
5
|
import { Forecast } from './Forecast.jsx'
|
|
4
6
|
import { DataLoader } from '@ossy/calendar'
|
|
5
7
|
import { Definition } from './Definition.js'
|
|
@@ -14,18 +16,52 @@ export const metadata = {
|
|
|
14
16
|
},
|
|
15
17
|
}
|
|
16
18
|
|
|
19
|
+
const FORECAST_WIDGET_ID = '@ossy/consultancy/view/current-month'
|
|
20
|
+
|
|
17
21
|
export const ForecastsPage = () => {
|
|
22
|
+
const sdk = useSdk()
|
|
23
|
+
const [pinState, setPinState] = useState('idle')
|
|
24
|
+
|
|
18
25
|
const statusTags = (Definition.status ?? [])
|
|
19
26
|
.map((s) => ({ beta: 'Beta', 'coming-soon': 'Coming Soon' }[s]))
|
|
20
27
|
.filter(Boolean)
|
|
21
28
|
|
|
29
|
+
const pinToDashboard = async () => {
|
|
30
|
+
if (pinState === 'pending') return
|
|
31
|
+
setPinState('pending')
|
|
32
|
+
try {
|
|
33
|
+
await sdk.invoke(PinWidget, { componentId: FORECAST_WIDGET_ID })
|
|
34
|
+
setPinState('done')
|
|
35
|
+
} catch {
|
|
36
|
+
setPinState('error')
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
22
40
|
return (
|
|
23
41
|
<Page
|
|
24
42
|
data-forecasts-status="on"
|
|
25
43
|
title="consultancy.forecasts.title"
|
|
26
44
|
near={statusTags.length > 0 ? <Tags tags={statusTags} size="s" /> : undefined}
|
|
27
45
|
description="consultancy.forecasts.description"
|
|
28
|
-
far={
|
|
46
|
+
far={(
|
|
47
|
+
<View layout="row" gap="s" style={{ flexWrap: 'wrap' }}>
|
|
48
|
+
<Button
|
|
49
|
+
{...PinWidget}
|
|
50
|
+
variant="primary"
|
|
51
|
+
disabled={pinState === 'pending' || pinState === 'done'}
|
|
52
|
+
label={
|
|
53
|
+
pinState === 'done'
|
|
54
|
+
? 'consultancy.forecasts.pin.done'
|
|
55
|
+
: pinState === 'error'
|
|
56
|
+
? 'consultancy.forecasts.pin.error'
|
|
57
|
+
: 'consultancy.forecasts.pin.forecast'
|
|
58
|
+
}
|
|
59
|
+
onClick={pinToDashboard}
|
|
60
|
+
data-forecasts-pin
|
|
61
|
+
/>
|
|
62
|
+
<CreateConsultancyButton />
|
|
63
|
+
</View>
|
|
64
|
+
)}
|
|
29
65
|
>
|
|
30
66
|
<View gap="m">
|
|
31
67
|
<ConsultancyNav active="consultancy/forecasts" />
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
Separator,
|
|
6
|
+
Input,
|
|
7
|
+
useLocale,
|
|
8
|
+
} from '@ossy/design-system'
|
|
9
|
+
import {
|
|
10
|
+
DEFAULT_AVAILABLE_HOURS_PER_MONTH,
|
|
11
|
+
DEFAULT_WEEKS_PER_YEAR,
|
|
12
|
+
calculateAssignmentMargin,
|
|
13
|
+
estimateAdminLeakage,
|
|
14
|
+
} from './assignment-margin.js'
|
|
15
|
+
|
|
16
|
+
export const MARGIN_RESULTS_DEFAULTS = {
|
|
17
|
+
hourlyRate: '900',
|
|
18
|
+
billableHours: '120',
|
|
19
|
+
monthlySalary: '47000',
|
|
20
|
+
availableHours: String(DEFAULT_AVAILABLE_HOURS_PER_MONTH),
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const LEAKAGE_DEFAULTS = {
|
|
24
|
+
hourlyRate: '900',
|
|
25
|
+
teamSize: '10',
|
|
26
|
+
adminHoursPerWeek: '5',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function parseNumber (value, fallback = 0) {
|
|
30
|
+
const trimmed = String(value ?? '').replace(/\s/g, '').replace(',', '.')
|
|
31
|
+
if (trimmed === '') return fallback
|
|
32
|
+
const parsed = Number(trimmed)
|
|
33
|
+
return Number.isFinite(parsed) ? parsed : fallback
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function SectionPanel ({ title, children, ...props }) {
|
|
37
|
+
return (
|
|
38
|
+
<View surface="primary" roundness="xs" style={{ minWidth: 0, overflow: 'hidden' }} {...props}>
|
|
39
|
+
<View stack bordered>
|
|
40
|
+
<View.Item
|
|
41
|
+
data-surface="primary"
|
|
42
|
+
layout="row"
|
|
43
|
+
style={{
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
justifyContent: 'space-between',
|
|
46
|
+
padding: 'var(--space-s) var(--space-m)',
|
|
47
|
+
gap: 'var(--space-m)',
|
|
48
|
+
height: '48px',
|
|
49
|
+
flexShrink: 0,
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
<Text variant="small" as="h2" style={{ fontWeight: 'bold' }} text={title} />
|
|
53
|
+
</View.Item>
|
|
54
|
+
<View.Item>
|
|
55
|
+
{children}
|
|
56
|
+
</View.Item>
|
|
57
|
+
</View>
|
|
58
|
+
</View>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function MetricRow ({ label, value }) {
|
|
63
|
+
return (
|
|
64
|
+
<View layout="row" justifyContent="space-between" gap="s">
|
|
65
|
+
<Text variant="small" text={label} />
|
|
66
|
+
<Text variant="small">{value}</Text>
|
|
67
|
+
</View>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function Field ({ label, value, onChange, name }) {
|
|
72
|
+
return (
|
|
73
|
+
<View gap="xs">
|
|
74
|
+
<Text variant="small" text={label} />
|
|
75
|
+
<Input
|
|
76
|
+
name={name}
|
|
77
|
+
value={value}
|
|
78
|
+
onChange={(event) => onChange(event?.target?.value ?? event)}
|
|
79
|
+
/>
|
|
80
|
+
</View>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function useMoneyFormatters () {
|
|
85
|
+
const { language } = useLocale()
|
|
86
|
+
const locale = language === 'sv' ? 'sv-SE' : 'en-SE'
|
|
87
|
+
return useMemo(() => ({
|
|
88
|
+
money: (value) => new Intl.NumberFormat(locale, {
|
|
89
|
+
style: 'currency',
|
|
90
|
+
currency: 'SEK',
|
|
91
|
+
maximumFractionDigits: 0,
|
|
92
|
+
}).format(Number.isFinite(value) ? value : 0),
|
|
93
|
+
percent: (value) => new Intl.NumberFormat(locale, {
|
|
94
|
+
style: 'percent',
|
|
95
|
+
maximumFractionDigits: 1,
|
|
96
|
+
}).format(Number.isFinite(value) ? value : 0),
|
|
97
|
+
hoursFormat: (value) => `${new Intl.NumberFormat(locale, {
|
|
98
|
+
maximumFractionDigits: 1,
|
|
99
|
+
}).format(Number.isFinite(value) ? value : 0)} h`,
|
|
100
|
+
}), [locale])
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Standalone assignment-margin panel for dashboard pinning.
|
|
105
|
+
*/
|
|
106
|
+
export function AssignmentMarginResultsPanel () {
|
|
107
|
+
const [data, setData] = useState(MARGIN_RESULTS_DEFAULTS)
|
|
108
|
+
const { money, percent, hoursFormat } = useMoneyFormatters()
|
|
109
|
+
const setField = (name) => (value) => setData((prev) => ({ ...prev, [name]: value }))
|
|
110
|
+
|
|
111
|
+
const margin = calculateAssignmentMargin({
|
|
112
|
+
hourlyRate: parseNumber(data.hourlyRate, 900),
|
|
113
|
+
billableHours: parseNumber(data.billableHours, 120),
|
|
114
|
+
monthlySalary: parseNumber(data.monthlySalary, 47000),
|
|
115
|
+
availableHoursPerMonth: parseNumber(data.availableHours, DEFAULT_AVAILABLE_HOURS_PER_MONTH),
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<View gap="m" data-margins-widget="results">
|
|
120
|
+
<SectionPanel title="consultancy.margins.inputs.title">
|
|
121
|
+
<View inset="m" gap="m">
|
|
122
|
+
<Field
|
|
123
|
+
name="hourlyRate"
|
|
124
|
+
label="@ossy/consultancy/schema/calculator.hourlyRate.label"
|
|
125
|
+
value={data.hourlyRate}
|
|
126
|
+
onChange={setField('hourlyRate')}
|
|
127
|
+
/>
|
|
128
|
+
<Field
|
|
129
|
+
name="billableHours"
|
|
130
|
+
label="@ossy/consultancy/schema/calculator.billableHours.label"
|
|
131
|
+
value={data.billableHours}
|
|
132
|
+
onChange={setField('billableHours')}
|
|
133
|
+
/>
|
|
134
|
+
<Field
|
|
135
|
+
name="monthlySalary"
|
|
136
|
+
label="@ossy/consultancy/schema/calculator.monthlySalary.label"
|
|
137
|
+
value={data.monthlySalary}
|
|
138
|
+
onChange={setField('monthlySalary')}
|
|
139
|
+
/>
|
|
140
|
+
<Field
|
|
141
|
+
name="availableHours"
|
|
142
|
+
label="@ossy/consultancy/schema/calculator.availableHours.label"
|
|
143
|
+
value={data.availableHours}
|
|
144
|
+
onChange={setField('availableHours')}
|
|
145
|
+
/>
|
|
146
|
+
</View>
|
|
147
|
+
</SectionPanel>
|
|
148
|
+
<SectionPanel
|
|
149
|
+
title="consultancy.margins.results.title"
|
|
150
|
+
data-margins-status={margin.isProfitable ? 'profitable' : 'unprofitable'}
|
|
151
|
+
>
|
|
152
|
+
<View gap="s" inset="m">
|
|
153
|
+
<MetricRow label="consultancy.margins.results.revenue" value={money(margin.revenue)} />
|
|
154
|
+
<MetricRow label="consultancy.margins.results.deliveryCost" value={money(margin.deliveryCost)} />
|
|
155
|
+
<MetricRow label="consultancy.margins.results.grossMargin" value={money(margin.grossMargin)} />
|
|
156
|
+
<MetricRow label="consultancy.margins.results.marginPercent" value={percent(margin.marginPercent)} />
|
|
157
|
+
<Separator />
|
|
158
|
+
<MetricRow label="consultancy.margins.results.employerCost" value={money(margin.employerCost)} />
|
|
159
|
+
<MetricRow label="consultancy.margins.results.monthPnl" value={money(margin.monthPnl)} />
|
|
160
|
+
<MetricRow label="consultancy.margins.results.breakEvenHours" value={hoursFormat(margin.breakEvenHours)} />
|
|
161
|
+
<MetricRow label="consultancy.margins.results.utilization" value={percent(margin.utilization)} />
|
|
162
|
+
<MetricRow label="consultancy.margins.results.forgoneRevenue" value={money(margin.forgoneRevenue)} />
|
|
163
|
+
<Text
|
|
164
|
+
variant="small"
|
|
165
|
+
color="secondary"
|
|
166
|
+
text={margin.coversEmployerCost ? 'consultancy.margins.results.coversCost' : 'consultancy.margins.results.missesCost'}
|
|
167
|
+
/>
|
|
168
|
+
</View>
|
|
169
|
+
</SectionPanel>
|
|
170
|
+
</View>
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Standalone admin-leakage panel for dashboard pinning.
|
|
176
|
+
*/
|
|
177
|
+
export function AdminLeakagePanel () {
|
|
178
|
+
const [data, setData] = useState(LEAKAGE_DEFAULTS)
|
|
179
|
+
const { money, hoursFormat } = useMoneyFormatters()
|
|
180
|
+
const setField = (name) => (value) => setData((prev) => ({ ...prev, [name]: value }))
|
|
181
|
+
|
|
182
|
+
const leakage = estimateAdminLeakage({
|
|
183
|
+
teamSize: parseNumber(data.teamSize, 10),
|
|
184
|
+
adminHoursPerPersonPerWeek: parseNumber(data.adminHoursPerWeek, 5),
|
|
185
|
+
hourlyRate: parseNumber(data.hourlyRate, 900),
|
|
186
|
+
weeksPerYear: DEFAULT_WEEKS_PER_YEAR,
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<SectionPanel title="consultancy.margins.leakage.title" data-margins-widget="leakage">
|
|
191
|
+
<View gap="m" inset="m">
|
|
192
|
+
<Text variant="small" color="secondary" text="consultancy.margins.leakage.description" />
|
|
193
|
+
<Field
|
|
194
|
+
name="hourlyRate"
|
|
195
|
+
label="@ossy/consultancy/schema/calculator.hourlyRate.label"
|
|
196
|
+
value={data.hourlyRate}
|
|
197
|
+
onChange={setField('hourlyRate')}
|
|
198
|
+
/>
|
|
199
|
+
<Field
|
|
200
|
+
name="teamSize"
|
|
201
|
+
label="@ossy/consultancy/schema/calculator.teamSize.label"
|
|
202
|
+
value={data.teamSize}
|
|
203
|
+
onChange={setField('teamSize')}
|
|
204
|
+
/>
|
|
205
|
+
<Field
|
|
206
|
+
name="adminHoursPerWeek"
|
|
207
|
+
label="@ossy/consultancy/schema/calculator.adminHoursPerWeek.label"
|
|
208
|
+
value={data.adminHoursPerWeek}
|
|
209
|
+
onChange={setField('adminHoursPerWeek')}
|
|
210
|
+
/>
|
|
211
|
+
<MetricRow label="consultancy.margins.leakage.hours" value={hoursFormat(leakage.leakedHours)} />
|
|
212
|
+
<MetricRow label="consultancy.margins.leakage.revenue" value={money(leakage.leakedRevenue)} />
|
|
213
|
+
</View>
|
|
214
|
+
</SectionPanel>
|
|
215
|
+
)
|
|
216
|
+
}
|
package/src/margins.page.jsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, Page, Tags } from '@ossy/design-system'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { Button, View, Page, Tags } from '@ossy/design-system'
|
|
3
|
+
import { useSdk } from '@ossy/sdk-react'
|
|
4
|
+
import { PinWidget } from '@ossy/dashboard'
|
|
3
5
|
import { AssignmentMarginCalculator } from './AssignmentMarginCalculator.jsx'
|
|
4
6
|
import { Definition } from './Definition.js'
|
|
5
7
|
import { CreateConsultancyButton } from './CreateConsultancyButton.jsx'
|
|
@@ -13,18 +15,62 @@ export const metadata = {
|
|
|
13
15
|
},
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
const MARGIN_RESULTS_WIDGET_ID = '@ossy/consultancy/view/assignment-margin-results'
|
|
19
|
+
const LEAKAGE_WIDGET_ID = '@ossy/consultancy/view/admin-leakage'
|
|
20
|
+
|
|
16
21
|
export const MarginsPage = () => {
|
|
22
|
+
const sdk = useSdk()
|
|
23
|
+
const [pinState, setPinState] = useState({})
|
|
24
|
+
|
|
17
25
|
const statusTags = (Definition.status ?? [])
|
|
18
26
|
.map((s) => ({ beta: 'Beta', 'coming-soon': 'Coming Soon' }[s]))
|
|
19
27
|
.filter(Boolean)
|
|
20
28
|
|
|
29
|
+
const pin = async (componentId) => {
|
|
30
|
+
if (pinState[componentId] === 'pending') return
|
|
31
|
+
setPinState((prev) => ({ ...prev, [componentId]: 'pending' }))
|
|
32
|
+
try {
|
|
33
|
+
await sdk.invoke(PinWidget, { componentId })
|
|
34
|
+
setPinState((prev) => ({ ...prev, [componentId]: 'done' }))
|
|
35
|
+
} catch {
|
|
36
|
+
setPinState((prev) => ({ ...prev, [componentId]: 'error' }))
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const pinLabel = (componentId, idleKey) => {
|
|
41
|
+
const state = pinState[componentId]
|
|
42
|
+
if (state === 'done') return 'consultancy.margins.pin.done'
|
|
43
|
+
if (state === 'error') return 'consultancy.margins.pin.error'
|
|
44
|
+
return idleKey
|
|
45
|
+
}
|
|
46
|
+
|
|
21
47
|
return (
|
|
22
48
|
<Page
|
|
23
49
|
scroll
|
|
24
50
|
title="consultancy.margins.title"
|
|
25
51
|
near={statusTags.length > 0 ? <Tags tags={statusTags} size="s" /> : undefined}
|
|
26
52
|
description="consultancy.margins.description"
|
|
27
|
-
far={
|
|
53
|
+
far={(
|
|
54
|
+
<View layout="row" gap="s" style={{ flexWrap: 'wrap' }}>
|
|
55
|
+
<Button
|
|
56
|
+
{...PinWidget}
|
|
57
|
+
variant="primary"
|
|
58
|
+
disabled={pinState[MARGIN_RESULTS_WIDGET_ID] === 'pending' || pinState[MARGIN_RESULTS_WIDGET_ID] === 'done'}
|
|
59
|
+
label={pinLabel(MARGIN_RESULTS_WIDGET_ID, 'consultancy.margins.pin.results')}
|
|
60
|
+
onClick={() => pin(MARGIN_RESULTS_WIDGET_ID)}
|
|
61
|
+
data-margins-pin="results"
|
|
62
|
+
/>
|
|
63
|
+
<Button
|
|
64
|
+
{...PinWidget}
|
|
65
|
+
variant="default"
|
|
66
|
+
disabled={pinState[LEAKAGE_WIDGET_ID] === 'pending' || pinState[LEAKAGE_WIDGET_ID] === 'done'}
|
|
67
|
+
label={pinLabel(LEAKAGE_WIDGET_ID, 'consultancy.margins.pin.leakage')}
|
|
68
|
+
onClick={() => pin(LEAKAGE_WIDGET_ID)}
|
|
69
|
+
data-margins-pin="leakage"
|
|
70
|
+
/>
|
|
71
|
+
<CreateConsultancyButton />
|
|
72
|
+
</View>
|
|
73
|
+
)}
|
|
28
74
|
>
|
|
29
75
|
<View gap="m">
|
|
30
76
|
<ConsultancyNav active="consultancy/margins" />
|
package/src/sv.translations.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"consultancy/home.documentTitle": "
|
|
3
|
-
"consultancy/forecasts.documentTitle": "
|
|
2
|
+
"consultancy/home.documentTitle": "Orgdetaljer",
|
|
3
|
+
"consultancy/forecasts.documentTitle": "Översikt",
|
|
4
4
|
"consultancy/margins.documentTitle": "Marginaler",
|
|
5
|
-
"consultancy.home.title": "
|
|
6
|
-
"consultancy.home.description": "
|
|
5
|
+
"consultancy.home.title": "Orgdetaljer",
|
|
6
|
+
"consultancy.home.description": "Företags- och räkenskapsårsdetaljer",
|
|
7
|
+
"consultancy.nav.title": "Konsultverksamhet",
|
|
7
8
|
"consultancy.nav.overview": "Översikt",
|
|
8
9
|
"consultancy.nav.forecasts": "Prognoser",
|
|
9
10
|
"consultancy.nav.margins": "Marginaler",
|
|
10
|
-
"consultancy.forecasts.title": "
|
|
11
|
-
"consultancy.forecasts.description": "
|
|
11
|
+
"consultancy.forecasts.title": "Översikt",
|
|
12
|
+
"consultancy.forecasts.description": "KPIer för räkenskapsåret, års totalsummor och månadskapacitet från avtal, anställda och semester",
|
|
12
13
|
"consultancy.forecasts.income": "Intäkt",
|
|
13
14
|
"consultancy.forecasts.salaryCost": "Lönekostnad",
|
|
14
15
|
"consultancy.forecasts.revenue": "Resultat",
|
|
@@ -39,7 +40,6 @@
|
|
|
39
40
|
"consultancy.overview.noFiscalYears": "Inga räkenskapsår ännu.",
|
|
40
41
|
"consultancy.empty.title": "Här är tomt",
|
|
41
42
|
"consultancy.empty.text": "Lägg till företagsinfo, anställda, avtal och semester för att komma igång.",
|
|
42
|
-
|
|
43
43
|
"@ossy/consultancy/form/calculator.label": "Uppdragsmarginalkalkylator",
|
|
44
44
|
"@ossy/consultancy/schema/calculator.hourlyRate.label": "Kundens timpris (SEK)",
|
|
45
45
|
"@ossy/consultancy/schema/calculator.billableHours.label": "Fakturerbara timmar denna period",
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
"@ossy/consultancy/schema/calculator.availableHours.label": "Tillgängliga timmar denna månad",
|
|
48
48
|
"@ossy/consultancy/schema/calculator.teamSize.label": "Teamstorlek",
|
|
49
49
|
"@ossy/consultancy/schema/calculator.adminHoursPerWeek.label": "Admintimmar per person / vecka",
|
|
50
|
-
|
|
51
50
|
"@ossy/consultancy/schema/company-basic-info.name.label": "Företagsnamn",
|
|
52
51
|
"@ossy/consultancy/schema/company-basic-info.name.description": "Bolagets registrerade namn.",
|
|
53
52
|
"@ossy/consultancy/schema/company-basic-info.registrationDate.label": "Registreringsdatum",
|
|
@@ -69,7 +68,6 @@
|
|
|
69
68
|
"@ossy/consultancy/schema/company-basic-info.financialYearEnd.description": "Månad då räkenskapsåret slutar.",
|
|
70
69
|
"@ossy/consultancy/schema/company-basic-info.holidayLocale.label": "Helgdagskalender",
|
|
71
70
|
"@ossy/consultancy/schema/company-basic-info.holidayLocale.description": "Land som används för röda dagar och helgdagar i prognoser och tidrapporter.",
|
|
72
|
-
|
|
73
71
|
"@ossy/consultancy/schema/employee.name.label": "Namn",
|
|
74
72
|
"@ossy/consultancy/schema/employee.name.description": "Den anställdas fullständiga namn.",
|
|
75
73
|
"@ossy/consultancy/schema/employee.email.label": "E-post",
|
|
@@ -84,7 +82,6 @@
|
|
|
84
82
|
"@ossy/consultancy/schema/employee.startDate.description": "Första anställningsdagen. Prognosen räknas från detta datum.",
|
|
85
83
|
"@ossy/consultancy/schema/employee.endDate.label": "Anställningens slut",
|
|
86
84
|
"@ossy/consultancy/schema/employee.endDate.description": "Sista anställningsdagen. Lämna tomt om anställningen pågår.",
|
|
87
|
-
|
|
88
85
|
"@ossy/consultancy/schema/contract.employeeId.label": "Anställd",
|
|
89
86
|
"@ossy/consultancy/schema/contract.employeeId.description": "Vem avtalet gäller.",
|
|
90
87
|
"@ossy/consultancy/schema/contract.clientName.label": "Kund",
|
|
@@ -105,14 +102,12 @@
|
|
|
105
102
|
"@ossy/consultancy/schema/contract.paymentTermsDueDate.description": "När fakturan förfaller, t.ex. 30 dagar netto.",
|
|
106
103
|
"@ossy/consultancy/schema/contract.paymentTermsInvoiceDate.label": "Fakturadatum",
|
|
107
104
|
"@ossy/consultancy/schema/contract.paymentTermsInvoiceDate.description": "När fakturan ställs ut i förhållande till leveransperioden.",
|
|
108
|
-
|
|
109
105
|
"@ossy/consultancy/schema/vacation.employeeId.label": "Anställd",
|
|
110
106
|
"@ossy/consultancy/schema/vacation.employeeId.description": "Vem som är ledig.",
|
|
111
107
|
"@ossy/consultancy/schema/vacation.start.label": "Första lediga dagen",
|
|
112
108
|
"@ossy/consultancy/schema/vacation.start.description": "Första semesterdagen (inklusive). De här dagarna faktureras inte.",
|
|
113
109
|
"@ossy/consultancy/schema/vacation.end.label": "Sista lediga dagen",
|
|
114
110
|
"@ossy/consultancy/schema/vacation.end.description": "Sista semesterdagen (inklusive).",
|
|
115
|
-
|
|
116
111
|
"@ossy/consultancy/schema/opportunity.title.label": "Titel",
|
|
117
112
|
"@ossy/consultancy/schema/opportunity.title.description": "Kort namn på leadet eller möjligheten.",
|
|
118
113
|
"@ossy/consultancy/schema/opportunity.source.label": "Källa",
|
|
@@ -133,7 +128,6 @@
|
|
|
133
128
|
"@ossy/consultancy/schema/opportunity.linkedProposalId.description": "Relaterat anbud, om det finns.",
|
|
134
129
|
"@ossy/consultancy/schema/opportunity.feedRef.label": "Källreferens",
|
|
135
130
|
"@ossy/consultancy/schema/opportunity.feedRef.description": "Id eller URL från originalannonsen.",
|
|
136
|
-
|
|
137
131
|
"@ossy/consultancy/schema/proposal.opportunityId.label": "Möjlighet",
|
|
138
132
|
"@ossy/consultancy/schema/proposal.opportunityId.description": "Möjligheten det här anbudet tillhör.",
|
|
139
133
|
"@ossy/consultancy/schema/proposal.title.label": "Titel",
|
|
@@ -147,5 +141,23 @@
|
|
|
147
141
|
"@ossy/consultancy/schema/proposal.timeline.label": "Tidplan",
|
|
148
142
|
"@ossy/consultancy/schema/proposal.timeline.description": "När arbetet skulle starta och sluta.",
|
|
149
143
|
"@ossy/consultancy/schema/proposal.body.label": "Brödtext",
|
|
150
|
-
"@ossy/consultancy/schema/proposal.body.description": "Hela anbudstexten."
|
|
144
|
+
"@ossy/consultancy/schema/proposal.body.description": "Hela anbudstexten.",
|
|
145
|
+
"consultancy.nav.orgDetails": "Orgdetaljer",
|
|
146
|
+
"consultancy.forecasts.yearChart": "KPI-trend",
|
|
147
|
+
"consultancy.forecasts.yearSummary": "Totalsummor för räkenskapsåret",
|
|
148
|
+
"consultancy.forecasts.yearChartEmpty": "Inga prognosmånader att visa ännu.",
|
|
149
|
+
"consultancy.margins.pin.done": "Nålad på instrumentpanel",
|
|
150
|
+
"consultancy.margins.pin.error": "Nålning misslyckades — försök igen",
|
|
151
|
+
"consultancy.margins.pin.results": "Nåla marginalpanel",
|
|
152
|
+
"consultancy.margins.pin.leakage": "Nåla läckagepanel",
|
|
153
|
+
"consultancy.forecasts.pin.done": "Nålad på instrumentpanel",
|
|
154
|
+
"consultancy.forecasts.pin.error": "Nålning misslyckades — försök igen",
|
|
155
|
+
"consultancy.forecasts.pin.forecast": "Nåla denna månad",
|
|
156
|
+
"consultancy.forecasts.widget.empty": "Ingen prognosmånad tillgänglig ännu.",
|
|
157
|
+
"consultancy.widgets.marginResults.title": "Uppdragsmarginal",
|
|
158
|
+
"consultancy.widgets.marginResults.description": "Bruttomarginal och beläggning för ett konsultuppdrag.",
|
|
159
|
+
"consultancy.widgets.adminLeakage.title": "Adminläckage",
|
|
160
|
+
"consultancy.widgets.adminLeakage.description": "Årliga timmar och intäkter som går förlorade på återkommande admin.",
|
|
161
|
+
"consultancy.widgets.forecastCurrentMonth.title": "Prognos denna månad",
|
|
162
|
+
"consultancy.widgets.forecastCurrentMonth.description": "Prognostiserad intäkt, lönekostnad, omsättning och timmar för innevarande månad."
|
|
151
163
|
}
|