mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-11 01:32:16 +01:00
Compare commits
1 Commits
main
...
feature/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d80896e0b8 |
@@ -4,7 +4,6 @@ import { formatCents } from '@/packages/ui/src/utils/money';
|
|||||||
import GroupedItemsCountButton from '@/packages/ui/src/GroupedItemsCountButton.vue';
|
import GroupedItemsCountButton from '@/packages/ui/src/GroupedItemsCountButton.vue';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { twMerge } from 'tailwind-merge';
|
import { twMerge } from 'tailwind-merge';
|
||||||
import { getOrganizationCurrencyString } from '@/utils/money';
|
|
||||||
|
|
||||||
type AggregatedGroupedData = GroupedData & {
|
type AggregatedGroupedData = GroupedData & {
|
||||||
grouped_data?: GroupedData[] | null;
|
grouped_data?: GroupedData[] | null;
|
||||||
@@ -19,6 +18,7 @@ type GroupedData = {
|
|||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
entry: AggregatedGroupedData;
|
entry: AggregatedGroupedData;
|
||||||
indent?: boolean;
|
indent?: boolean;
|
||||||
|
currency: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const expanded = ref(false);
|
const expanded = ref(false);
|
||||||
@@ -48,7 +48,7 @@ const expanded = ref(false);
|
|||||||
{{ formatHumanReadableDuration(entry.seconds) }}
|
{{ formatHumanReadableDuration(entry.seconds) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="justify-end pr-6 flex items-center">
|
<div class="justify-end pr-6 flex items-center">
|
||||||
{{entry.cost ? formatCents(entry.cost, getOrganizationCurrencyString()) : '--' }}
|
{{entry.cost ? formatCents(entry.cost, props.currency) : '--' }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -58,6 +58,7 @@ const expanded = ref(false);
|
|||||||
<ReportingRow
|
<ReportingRow
|
||||||
v-for="subEntry in entry.grouped_data"
|
v-for="subEntry in entry.grouped_data"
|
||||||
:key="subEntry.description ?? 'none'"
|
:key="subEntry.description ?? 'none'"
|
||||||
|
:currency="props.currency"
|
||||||
indent
|
indent
|
||||||
:entry="subEntry"></ReportingRow>
|
:entry="subEntry"></ReportingRow>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -446,6 +446,7 @@ const tableData = computed(() => {
|
|||||||
<ReportingRow
|
<ReportingRow
|
||||||
v-for="entry in tableData"
|
v-for="entry in tableData"
|
||||||
:key="entry.description ?? 'none'"
|
:key="entry.description ?? 'none'"
|
||||||
|
:currency="getOrganizationCurrencyString()"
|
||||||
:entry="entry"
|
:entry="entry"
|
||||||
:type="
|
:type="
|
||||||
aggregatedTableTimeEntries.grouped_type
|
aggregatedTableTimeEntries.grouped_type
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { ChartBarIcon } from '@heroicons/vue/20/solid';
|
|||||||
import ReportingChart from '@/Components/Common/Reporting/ReportingChart.vue';
|
import ReportingChart from '@/Components/Common/Reporting/ReportingChart.vue';
|
||||||
import { formatHumanReadableDuration } from '@/packages/ui/src/utils/time';
|
import { formatHumanReadableDuration } from '@/packages/ui/src/utils/time';
|
||||||
import ReportingRow from '@/Components/Common/Reporting/ReportingRow.vue';
|
import ReportingRow from '@/Components/Common/Reporting/ReportingRow.vue';
|
||||||
import { getOrganizationCurrencyString } from '@/utils/money';
|
|
||||||
import ReportingPieChart from '@/Components/Common/Reporting/ReportingPieChart.vue';
|
import ReportingPieChart from '@/Components/Common/Reporting/ReportingPieChart.vue';
|
||||||
import { formatCents } from '@/packages/ui/src/utils/money';
|
import { formatCents } from '@/packages/ui/src/utils/money';
|
||||||
import { computed, onMounted, ref } from 'vue';
|
import { computed, onMounted, ref } from 'vue';
|
||||||
@@ -41,6 +40,13 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const reportCurrency = computed(() => {
|
||||||
|
if (sharedReportResponseData.value) {
|
||||||
|
return sharedReportResponseData.value?.currency;
|
||||||
|
}
|
||||||
|
return 'EUR';
|
||||||
|
});
|
||||||
|
|
||||||
const aggregatedTableTimeEntries = computed(() => {
|
const aggregatedTableTimeEntries = computed(() => {
|
||||||
if (sharedReportResponseData.value) {
|
if (sharedReportResponseData.value) {
|
||||||
return sharedReportResponseData.value?.data;
|
return sharedReportResponseData.value?.data;
|
||||||
@@ -193,6 +199,7 @@ onMounted(async () => {
|
|||||||
<ReportingRow
|
<ReportingRow
|
||||||
v-for="entry in tableData"
|
v-for="entry in tableData"
|
||||||
:key="entry.description ?? 'none'"
|
:key="entry.description ?? 'none'"
|
||||||
|
:currency="reportCurrency"
|
||||||
:entry="entry"
|
:entry="entry"
|
||||||
:type="
|
:type="
|
||||||
aggregatedTableTimeEntries.grouped_type
|
aggregatedTableTimeEntries.grouped_type
|
||||||
@@ -206,7 +213,7 @@ onMounted(async () => {
|
|||||||
class="justify-end flex items-center font-medium">
|
class="justify-end flex items-center font-medium">
|
||||||
{{
|
{{
|
||||||
formatHumanReadableDuration(
|
formatHumanReadableDuration(
|
||||||
aggregatedTableTimeEntries.seconds
|
aggregatedTableTimeEntries.seconds,
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
@@ -215,7 +222,7 @@ onMounted(async () => {
|
|||||||
{{
|
{{
|
||||||
formatCents(
|
formatCents(
|
||||||
aggregatedTableTimeEntries.cost,
|
aggregatedTableTimeEntries.cost,
|
||||||
getOrganizationCurrencyString()
|
reportCurrency,
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user