@@ -190,15 +190,9 @@ export function ExpenseForm({
190190 title : expense . title ,
191191 expenseDate : expense . expenseDate ?? new Date ( ) ,
192192 amount : amountAsDecimal ( expense . amount , groupCurrency ) ,
193- originalCurrency :
194- expense . originalCurrency ??
195- group . currencyCode ??
196- ( '' as unknown as undefined ) ,
197- originalAmount :
198- expense . originalAmount ?? ( '' as unknown as undefined ) ,
199- conversionRate : expense . conversionRate
200- ? expense . conversionRate . toNumber ( )
201- : ( '' as unknown as undefined ) ,
193+ originalCurrency : expense . originalCurrency ?? group . currencyCode ,
194+ originalAmount : expense . originalAmount ?? undefined ,
195+ conversionRate : expense . conversionRate ?. toNumber ( ) ,
202196 category : expense . categoryId ,
203197 paidBy : expense . paidById ,
204198 paidFor : expense . paidFor . map ( ( { participantId, shares } ) => ( {
@@ -220,12 +214,12 @@ export function ExpenseForm({
220214 title : t ( 'reimbursement' ) ,
221215 expenseDate : new Date ( ) ,
222216 amount : amountAsDecimal (
223- Number ( searchParams . get ( 'amount' ) ) || 0 ,
224- groupCurrency ,
217+ Number ( searchParams . get ( 'amount' ) ) || 0 ,
218+ groupCurrency ,
225219 ) ,
226- originalCurrency : group . currencyCode ?? ( '' as unknown as undefined ) ,
227- originalAmount : '' as unknown as undefined ,
228- conversionRate : '' as unknown as undefined ,
220+ originalCurrency : group . currencyCode ,
221+ originalAmount : undefined ,
222+ conversionRate : undefined ,
229223 category : 1 , // category with Id 1 is Payment
230224 paidBy : searchParams . get ( 'from' ) ?? undefined ,
231225 paidFor : [
@@ -249,9 +243,9 @@ export function ExpenseForm({
249243 ? new Date ( searchParams . get ( 'date' ) as string )
250244 : new Date ( ) ,
251245 amount : Number ( searchParams . get ( 'amount' ) ) || 0 ,
252- originalCurrency : group . currencyCode ?? ( '' as unknown as undefined ) ,
253- originalAmount : '' as unknown as undefined ,
254- conversionRate : '' as unknown as undefined ,
246+ originalCurrency : group . currencyCode ?? undefined ,
247+ originalAmount : undefined ,
248+ conversionRate : undefined ,
255249 category : searchParams . get ( 'categoryId' )
256250 ? Number ( searchParams . get ( 'categoryId' ) )
257251 : 0 , // category with Id 0 is General
0 commit comments