@@ -2302,17 +2302,38 @@ TransactionSplitUpdate txFilterSameFields(
2302
2302
'destination_id', 'destination_name', 'destination_number', 'destination_iban',
2303
2303
];
2304
2304
*/
2305
- return txU.copyWith (
2306
- amount: tx.amount == txU.amount ? null : txU.amount,
2307
- foreignAmount:
2308
- tx.foreignAmount == txU.foreignAmount ? null : txU.foreignAmount,
2305
+ final String ? amount =
2306
+ (txU.amount == null ||
2307
+ double .parse (tx.amount) == double .parse (txU.amount! ))
2308
+ ? null
2309
+ : txU.amount;
2310
+ String ? foreignAmount;
2311
+ if (txU.foreignAmount != null ) {
2312
+ if (tx.foreignAmount == null ) {
2313
+ foreignAmount = txU.foreignAmount;
2314
+ } else if (double .parse (tx.foreignAmount! ) ==
2315
+ double .parse (txU.foreignAmount! )) {
2316
+ foreignAmount = null ;
2317
+ } else {
2318
+ foreignAmount = txU.foreignAmount;
2319
+ }
2320
+ }
2321
+
2322
+ return txU.copyWithWrapped (
2323
+ amount: Wrapped <String ?>.value (amount),
2324
+ foreignAmount: Wrapped <String ?>.value (foreignAmount),
2309
2325
foreignCurrencyId:
2310
2326
tx.foreignCurrencyId == txU.foreignCurrencyId
2311
- ? null
2312
- : txU.foreignCurrencyId,
2313
- sourceName: tx.sourceName == txU.sourceName ? null : txU.sourceName,
2327
+ ? Wrapped <String ?>.value (null )
2328
+ : Wrapped <String ?>.value (txU.foreignCurrencyId),
2329
+ sourceName:
2330
+ tx.sourceName == txU.sourceName
2331
+ ? Wrapped <String ?>.value (null )
2332
+ : Wrapped <String ?>.value (txU.sourceName),
2314
2333
destinationName:
2315
- tx.destinationName == txU.destinationName ? null : txU.destinationName,
2334
+ tx.destinationName == txU.destinationName
2335
+ ? Wrapped <String ?>.value (null )
2336
+ : Wrapped <String ?>.value (txU.destinationName),
2316
2337
);
2317
2338
}
2318
2339
0 commit comments