-
Notifications
You must be signed in to change notification settings - Fork 319
Add Service Participants support for Company Information #6372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
|
Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234' |
|
@copilot Create a overload method that takes the service as argument and provides it on the table. Dont remove the filter after as well. |
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Done in 0e3a699. Created an overload |
|
@copilot dont use EDocument.GetEDocumentService().Code)). At the call site of check receiving company info, there is a known service. Use that one. |
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Done in 3bb73af. Updated |
|
|
||
| if EDocService."Validate Receiving Company" then | ||
| EDocImportHelper.ValidateReceivingCompanyInfo(EDocument); | ||
| EDocImportHelper.ValidateReceivingCompanyInfo(EDocument, EDocService.Code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Pass the record, not a code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 9b0657f. Now passes the EDocService record instead of EDocService.Code.
| /// <param name="EDocument">The E-Document record.</param> | ||
| procedure ValidateReceivingCompanyInfo(EDocument: Record "E-Document") | ||
| /// <param name="ServiceCode">The E-Document Service code to match against.</param> | ||
| procedure ValidateReceivingCompanyInfo(EDocument: Record "E-Document"; ServiceCode: Code[20]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot This is breaking. Please add an overload. Then call this original and do the new stuff before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 9b0657f. Added backward-compatible overload ValidateReceivingCompanyInfo(EDocument, EDocService) that first checks Service Participants, then calls the original ValidateReceivingCompanyInfo(EDocument) method.
…ss record not code Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
|
@copilot Make sure you add tests. |
…ngCompanyInfo Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Done in d7d4ce4. Added two tests in
|
Groenbech96
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build: ./src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al#L315
AA0175 Variable 'ServiceParticipant' queries the database in 'MatchCompanyByServiceParticipant' but does not use the queried record. Only find or get record if you need to access the values. Consider using ISEMPTY.
…ence Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Fixed in 2774d26. Changed |
|
@copilot Take a look at the new instructions |
Could you clarify what new instructions you're referring to? I don't see any additional instructions in the comments. |
|
@copilot revert my latest commit. |
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
| Build: ./src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al#L119AL0118 The name '"Service Integration"' does not exist in the current context. -- Build: ./src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al#L76AL0118 The name '"Service Integration"' does not exist in the current context. [Build: ./src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al#L119](https://github.com//pull/6372/files#annotation_44933495907) AL0118 The name '"Service Integration"' does not exist in the current context. [Build: ./src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al#L76](https://github.com//pull/6372/files#annotation_44933495917) AL0118 The name '"Service Integration"' does not exist in the current context. |
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Add Service Participants to Company Information
This PR enables Belgian companies using Peppol to configure Service Participants on Company Information, so that incoming eDocuments using Peppol Scheme 0208 (Enterprise Number) are correctly matched and received.
Changes Made
1. Extend E-Document Source Type Enum
2. Add Page Extension for Company Information
3. Update Matching Logic (Backward Compatible)
ValidateReceivingCompanyInfo(EDocument, EDocService)that checks Service Participants firstValidateReceivingCompanyInfo(EDocument)signature for backward compatibilityMatchCompanyByServiceParticipanttakesEDocServicerecord parameterEDocServicerecord4. Add Tests
ValidateReceivingCompanyInfoWithMatchingServiceParticipanttest: Verifies validation succeeds when a matching Company Service Participant existsValidateReceivingCompanyInfoFallsBackToVATWhenNoServiceParticipanttest: Verifies fallback to VAT/GLN matching when no Service Participant matches5. Fix Build Warnings/Errors
IsEmpty()instead ofFindFirst()when only checking record existenceusing Microsoft.eServices.EDocument.Integration;forService Integrationenum✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.