Closed Chuucommie closed 9 months ago
Let's get the issue to a team who will fix and backport it, as this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.
To open a support case, you can:
If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.
Please include the following with each issue:
1. Describe the bug in the Italian version, When generating Vendor Bill Lines from Suggest Payments the field "Withholding Amount" is recalculated and the Withholding Code Lines are retrieved with a Findfirst() without checking for their dates or their validity, a Withholding Tax Code could have more than one Withholding Code Line with different dates and percentages.
this, in case you have more than one Withholding Code Line, uses the "Taxable Base %" from the Withholding Code Line and the "Withholding Tax %" from the Vendor Bill Lines's Withholding Tax table, this can and will cause an error during the recalculation and the Withholding Amount field will be wrongly populated.
2. To Reproduce To reproduce this behaviour: 1- Choose a Withholding Tax Code from the list page 2- Related --> Withhold Rates --> Withholding Code Lines 3- Create two Withholding Code Lines the first with a Start Date lower than the second line, in the first set the "Withholding Tax %" to 0 and the "Taxable Base %" to 100 in the second one the "Withholding Tax %" to 20 and the "Taxable Base %" to 0 4- Create a Purchase Invoice with a Vendor that has the Withholding Code you choose at the start, check that the Withholding Tax exists for the Purchase Invoice: Actions- Request Approval- Withhold Taxes Soc. Sec., check the Withholding Tax Amount 5- Post the Invoice 6- Create a Vendor Bill Line and Suggest Payments to get the line from the invoice you just posted 7- The withholding tax amount field will be different from the one you saw in the invoice's Withholding Tax 8- if you open the Withholding Tax for that Vendor Bill Line you can see the Withholding Tax Amount is the correct one, when you close the page it will update the vendor bill line correctly, the users can't do this for every single line every single time though.
Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.
3. Expected behavior The recalculation should check the Invoice Posting Date and then choose the right Withholding Code Line
4. Actual behavior The recalculation just takes the first Withholding Code Line for that Withholding Code.
5. Versions:
Final Checklist
Please remember to do the following:
[✅ ] Search the issue repository to ensure you are reporting a new issue
[✅ ] Reproduce the issue after disabling all extensions except the AL Language extension
[✅ ] Simplify your code around the issue to better isolate the problem