Commit 4280cb6
committed
Extract shared expense-report sign helper and normalize converted amounts
Move the IOU-to-expense-report transaction sign conversion into a single
getExpenseReportSignedTransaction helper in TransactionUtils so the logic
is no longer duplicated between convertIOUReportToExpenseReport and
createWorkspaceFromIOUPayment.
IOU transactions can be stored with either sign, so negate the absolute
value of convertedAmount/convertedTaxAmount. The expense-report convention
flips the stored sign for display, so a negative magnitude keeps the table
total positive even when the source IOU stored the converted amounts
negative. Added a regression test covering that case.1 parent 37c689e commit 4280cb6
4 files changed
Lines changed: 72 additions & 16 deletions
File tree
- src/libs
- TransactionUtils
- actions
- Policy
- Report
- tests/actions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
639 | 659 | | |
640 | 660 | | |
641 | 661 | | |
| |||
2991 | 3011 | | |
2992 | 3012 | | |
2993 | 3013 | | |
| 3014 | + | |
2994 | 3015 | | |
2995 | 3016 | | |
2996 | 3017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
4461 | 4461 | | |
4462 | 4462 | | |
4463 | 4463 | | |
4464 | | - | |
4465 | | - | |
4466 | | - | |
4467 | | - | |
4468 | | - | |
4469 | | - | |
4470 | | - | |
| 4464 | + | |
4471 | 4465 | | |
4472 | 4466 | | |
4473 | 4467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
6781 | 6781 | | |
6782 | 6782 | | |
6783 | 6783 | | |
6784 | | - | |
6785 | | - | |
6786 | | - | |
6787 | | - | |
6788 | | - | |
6789 | | - | |
6790 | | - | |
| 6784 | + | |
6791 | 6785 | | |
6792 | 6786 | | |
6793 | 6787 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3991 | 3991 | | |
3992 | 3992 | | |
3993 | 3993 | | |
| 3994 | + | |
| 3995 | + | |
| 3996 | + | |
| 3997 | + | |
| 3998 | + | |
| 3999 | + | |
| 4000 | + | |
| 4001 | + | |
| 4002 | + | |
| 4003 | + | |
| 4004 | + | |
| 4005 | + | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + | |
| 4010 | + | |
| 4011 | + | |
| 4012 | + | |
| 4013 | + | |
| 4014 | + | |
| 4015 | + | |
| 4016 | + | |
| 4017 | + | |
| 4018 | + | |
| 4019 | + | |
| 4020 | + | |
| 4021 | + | |
| 4022 | + | |
| 4023 | + | |
| 4024 | + | |
| 4025 | + | |
| 4026 | + | |
| 4027 | + | |
| 4028 | + | |
| 4029 | + | |
| 4030 | + | |
| 4031 | + | |
| 4032 | + | |
| 4033 | + | |
| 4034 | + | |
| 4035 | + | |
| 4036 | + | |
| 4037 | + | |
| 4038 | + | |
| 4039 | + | |
| 4040 | + | |
3994 | 4041 | | |
3995 | 4042 | | |
3996 | 4043 | | |
| |||
0 commit comments