Hi @untsrikanth,
I have checked this piece of code and found that you are totally right. If found an old solution where it’s explained as following (It seems that this code was created when the E-Invoice functionality was designed in old App 7.5 version.):
When sending e-invoice there is an option to send invoice connected documents with the usage of "Add Invoice Connected Objects" of the Send Customer Invoice dialog. It's help text describes as below:
"If this check box is selected, files that are connected to the invoice and saved in IFS/Document Management with the same document class defined in the Company/Invoice/Document Management tab will be fetched and included in the message. The check box is selected by default and it is editable only when one or more of the invoices being sent at a given time uses the E-INVOICE media code."
“All the documents are transferred from CO to CO Invoice, but outside customer usually doesn't have access to that. If you check the XML created with E-INVOICE, you can see attachments under XML tag <InvoiceAttachments><FileName>. Only Doc class defined in the company will be there.
If we stop transferring attachments from CO to CO Invoice, there can be other customers who are affected if they are using this as a functionality.”
I also found another knowledge source with pretty much the same explanation:
“The connection between documents in customer orders and invoices can be explained as follows:
1. Automatic Attachment: All documents attached in the Customer Order window are automatically linked to the Customer Invoice upon creation. This functionality was introduced to enhance the E-Invoice process
2. Customer Demand: The feature was implemented in response to customer requests, allowing for better document management and visibility across order and invoice processes
3. Manual Exclusion: If there are specific documents that should not be included in the invoice, it is recommended to manually remove those attachments after the invoice is created, as the system does not currently provide an automatic exclusion option (except for the Document Class defined at Company level)
4. Reviewing Attachments: It is advisable to review the documents attached to customer orders regularly to ensure that only relevant documents are carried over to invoices.
5. System Configuration: Understanding the system's configuration regarding document handling can help in managing how documents are treated during the order-to-invoice process.
In conclusion, the automatic linking of documents from customer orders to invoices is a designed feature to streamline processes. If certain documents need to be excluded, manual intervention is required to remove them post-creation. This functionality aims to meet customer needs for efficient document management.”
I hope this helps!
Regards,
Pilar