mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-05 12:16:13 +01:00
(cherry picked from commit 4e7733286a)
This commit is contained in:
@@ -190,15 +190,9 @@ export function ExpenseForm({
|
|||||||
title: expense.title,
|
title: expense.title,
|
||||||
expenseDate: expense.expenseDate ?? new Date(),
|
expenseDate: expense.expenseDate ?? new Date(),
|
||||||
amount: amountAsDecimal(expense.amount, groupCurrency),
|
amount: amountAsDecimal(expense.amount, groupCurrency),
|
||||||
originalCurrency:
|
originalCurrency: expense.originalCurrency ?? group.currencyCode,
|
||||||
expense.originalCurrency ??
|
originalAmount: expense.originalAmount ?? undefined,
|
||||||
group.currencyCode ??
|
conversionRate: expense.conversionRate?.toNumber(),
|
||||||
('' as unknown as undefined),
|
|
||||||
originalAmount:
|
|
||||||
expense.originalAmount ?? ('' as unknown as undefined),
|
|
||||||
conversionRate: expense.conversionRate
|
|
||||||
? expense.conversionRate.toNumber()
|
|
||||||
: ('' as unknown as undefined),
|
|
||||||
category: expense.categoryId,
|
category: expense.categoryId,
|
||||||
paidBy: expense.paidById,
|
paidBy: expense.paidById,
|
||||||
paidFor: expense.paidFor.map(({ participantId, shares }) => ({
|
paidFor: expense.paidFor.map(({ participantId, shares }) => ({
|
||||||
@@ -220,12 +214,12 @@ export function ExpenseForm({
|
|||||||
title: t('reimbursement'),
|
title: t('reimbursement'),
|
||||||
expenseDate: new Date(),
|
expenseDate: new Date(),
|
||||||
amount: amountAsDecimal(
|
amount: amountAsDecimal(
|
||||||
Number(searchParams.get('amount')) || 0,
|
Number(searchParams.get('amount')) || 0,
|
||||||
groupCurrency,
|
groupCurrency,
|
||||||
),
|
),
|
||||||
originalCurrency: group.currencyCode ?? ('' as unknown as undefined),
|
originalCurrency: group.currencyCode,
|
||||||
originalAmount: '' as unknown as undefined,
|
originalAmount: undefined,
|
||||||
conversionRate: '' as unknown as undefined,
|
conversionRate: undefined,
|
||||||
category: 1, // category with Id 1 is Payment
|
category: 1, // category with Id 1 is Payment
|
||||||
paidBy: searchParams.get('from') ?? undefined,
|
paidBy: searchParams.get('from') ?? undefined,
|
||||||
paidFor: [
|
paidFor: [
|
||||||
@@ -249,9 +243,9 @@ export function ExpenseForm({
|
|||||||
? new Date(searchParams.get('date') as string)
|
? new Date(searchParams.get('date') as string)
|
||||||
: new Date(),
|
: new Date(),
|
||||||
amount: Number(searchParams.get('amount')) || 0,
|
amount: Number(searchParams.get('amount')) || 0,
|
||||||
originalCurrency: group.currencyCode ?? ('' as unknown as undefined),
|
originalCurrency: group.currencyCode ?? undefined,
|
||||||
originalAmount: '' as unknown as undefined,
|
originalAmount: undefined,
|
||||||
conversionRate: '' as unknown as undefined,
|
conversionRate: undefined,
|
||||||
category: searchParams.get('categoryId')
|
category: searchParams.get('categoryId')
|
||||||
? Number(searchParams.get('categoryId'))
|
? Number(searchParams.get('categoryId'))
|
||||||
: 0, // category with Id 0 is General
|
: 0, // category with Id 0 is General
|
||||||
|
|||||||
Reference in New Issue
Block a user