-
Notifications
You must be signed in to change notification settings - Fork 631
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
[E-Document Core] - Allow to recreate unposted purchase documents from an incoming e-document #27973
base: main
Are you sure you want to change the base?
[E-Document Core] - Allow to recreate unposted purchase documents from an incoming e-document #27973
Conversation
[E-Document Core] - Code workspace
Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link. |
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.
.
RecRef: RecordRef; | ||
begin | ||
if this.GetRelatedRecord(EDocument, RecRef) then | ||
if RecRef.Number = Database::"Purchase Header" then |
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.
This model is insufficient.
Assumption should be that any document type can be deleted.
In case that document is posted it cannot.
How do you know document is posted? E-Doc state Completed should indicate that.
|
||
EDocumentLog.InsertLog(EDocument, EDocumentService, EDocServiceStatusDeleted); | ||
EDocumentProcessing.ModifyServiceStatus(EDocument, EDocumentService, EDocServiceStatusDeleted); | ||
EDocumentProcessing.ModifyEDocumentStatus(EDocument, EDocServiceStatusDeleted); |
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.
Not handled properly. This new status is not taken into account inside the function.
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.
The new status translates to "In Progress" E-Document status so it will be handled in this procedure
if IsNullGuid(Rec."E-Document Link") then | ||
exit; | ||
|
||
EDocument.GetBySystemId(Rec."E-Document Link"); |
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.
If we cant find it, lets just exit. We should probably not block delete of header.
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.
Added check to exit if EDocument not found.
This pull request does not have a related issue as it's part of the delivery for development agreed directly with @altotovi @Groenbech96
Implementation
A new feature allows users to recreate unposted purchase credit memos, purchase invoices, and purchase orders from incoming e-documents. This update addresses cases where a user mistakenly deletes a document (purchase credit memo, invoice, or order) created from an incoming e-document.
If a purchase credit memo, purchase invoice, or purchase order created from an incoming e-document is deleted before posting, the user can recreate it using the "Reprocess Document" action on the E-Document card. The system checks whether a connected document already exists. If not, a new document is automatically recreated with all the details from the original incoming e-document.
If a connected document exists, the user can use the "Delete Related Document" action to remove it, allowing the recreation process to proceed. After deletion, the "Document Status" is changed to "In Progress." Note that recreation applies only to unposted purchase credit memos, invoices, and orders.
Deletion of the related document is recorded in the E-Document Logs with the status "Imported document deleted." Meanwhile, recreation using the "Reprocess Document" action is recorded with the status "Imported document created." All these statuses are displayed on the Service Status fast tab as well.
Fixes #