mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-15 19:52:15 +01:00
add frontend format support for currencies, add currencies endpoint
This commit is contained in:
@@ -2,10 +2,14 @@
|
||||
import { getOrganizationCurrencyString } from '@/utils/money';
|
||||
import BillableRateModal from '@/packages/ui/src/BillableRateModal.vue';
|
||||
import { formatCents } from '@/packages/ui/src/utils/money';
|
||||
import { inject, type ComputedRef } from 'vue';
|
||||
import type { Organization } from '@/packages/api/src';
|
||||
|
||||
const show = defineModel('show', { default: false });
|
||||
const saving = defineModel('saving', { default: false });
|
||||
|
||||
const organization = inject<ComputedRef<Organization>>('organization');
|
||||
|
||||
defineProps<{
|
||||
newBillableRate?: number | null;
|
||||
memberName?: string;
|
||||
@@ -28,7 +32,10 @@ defineEmits<{
|
||||
newBillableRate
|
||||
? formatCents(
|
||||
newBillableRate,
|
||||
getOrganizationCurrencyString()
|
||||
getOrganizationCurrencyString(),
|
||||
organization?.currency_format,
|
||||
organization?.currency_symbol,
|
||||
organization?.number_format
|
||||
)
|
||||
: ' the default rate of the project'
|
||||
}}</strong
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { ProjectMember } from '@/packages/api/src';
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, ref, inject, type ComputedRef } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import TableRow from '@/Components/TableRow.vue';
|
||||
import { useMembersStore } from '@/utils/useMembers';
|
||||
@@ -10,10 +10,14 @@ import { formatCents } from '@/packages/ui/src/utils/money';
|
||||
import { capitalizeFirstLetter } from '@/utils/format';
|
||||
import ProjectMemberEditModal from '@/Components/Common/ProjectMember/ProjectMemberEditModal.vue';
|
||||
import { getOrganizationCurrencyString } from '@/utils/money';
|
||||
import type { Organization } from '@/packages/api/src';
|
||||
|
||||
const props = defineProps<{
|
||||
projectMember: ProjectMember;
|
||||
}>();
|
||||
|
||||
const organization = inject<ComputedRef<Organization>>('organization');
|
||||
|
||||
function deleteProjectMember() {
|
||||
useProjectMembersStore().deleteProjectMember(
|
||||
props.projectMember.project_id,
|
||||
@@ -51,7 +55,10 @@ const showEditModal = ref(false);
|
||||
projectMember.billable_rate
|
||||
? formatCents(
|
||||
projectMember.billable_rate,
|
||||
getOrganizationCurrencyString()
|
||||
getOrganizationCurrencyString(),
|
||||
organization?.currency_format,
|
||||
organization?.currency_symbol,
|
||||
organization?.number_format
|
||||
)
|
||||
: '--'
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user