I have trouble matching the settlement to invoice, I have two documents, one is bill summary, another one is settlement summary as shown below.
Since the settlement is paid in a lump sum, I can't simply match the billed amount using the bill number.
| Bill Summary | | |
| Bill Number | Tasks No. | Bill No. + tasks No. | Amount |
| 123456 | A001 | 123456A001 | 100 |
| 123456 | A002 | 123456A002 | 200 |
| 234567 | A001 | 234567A001 | 200 |
| 345678 | A001 | 345678A001 | 300 |
| Settlement | |
| Bill Number | Settlement amount |
| 123456 | 300 |
| 234567 | 200 |
| What I would like to achieve is like: | | | |
| Bill Number | Tasks No. | Bill No. + tasks No. | Amount | Settlement amount | Outstanding balance |
| 123456 | A001 | 123456A001 | 100 | 100 | - |
| 123456 | A002 | 123456A002 | 200 | 200 | - |
| 234567 | A001 | 234567A001 | 200 | 200 | - |
| 345678 | A001 | 345678A001 | 300 | 0 | 300.00 |
Thanks for your help in advance!