Commit ef1024b
committed
Fix negative transaction total after moving IOU report to a workspace
When an IOU report is converted to an expense report, the optimistic
transaction data negated amount and modifiedAmount to match the
expense-report sign convention but left convertedAmount and
convertedTaxAmount untouched. Because getConvertedAmount flips the sign
for expense reports, the per-row TOTAL column rendered the still-positive
convertedAmount as a negative value.
Negate convertedAmount and convertedTaxAmount in the optimistic data in
both convertIOUReportToExpenseReport and createWorkspaceFromIOUPayment,
using a conditional spread so absent values are not overwritten.
Rollback data is built from the unmodified transaction, so failure
restores the original values.1 parent ed3aefa commit ef1024b
3 files changed
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4475 | 4475 | | |
4476 | 4476 | | |
4477 | 4477 | | |
| 4478 | + | |
| 4479 | + | |
4478 | 4480 | | |
4479 | 4481 | | |
4480 | 4482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6793 | 6793 | | |
6794 | 6794 | | |
6795 | 6795 | | |
| 6796 | + | |
| 6797 | + | |
6796 | 6798 | | |
6797 | 6799 | | |
6798 | 6800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3935 | 3935 | | |
3936 | 3936 | | |
3937 | 3937 | | |
| 3938 | + | |
| 3939 | + | |
| 3940 | + | |
| 3941 | + | |
| 3942 | + | |
| 3943 | + | |
| 3944 | + | |
| 3945 | + | |
| 3946 | + | |
| 3947 | + | |
| 3948 | + | |
| 3949 | + | |
| 3950 | + | |
| 3951 | + | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
| 3961 | + | |
| 3962 | + | |
| 3963 | + | |
| 3964 | + | |
| 3965 | + | |
| 3966 | + | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
| 3986 | + | |
| 3987 | + | |
| 3988 | + | |
| 3989 | + | |
| 3990 | + | |
| 3991 | + | |
| 3992 | + | |
| 3993 | + | |
| 3994 | + | |
| 3995 | + | |
3938 | 3996 | | |
3939 | 3997 | | |
3940 | 3998 | | |
| |||
0 commit comments