- Template names:
Documents are stored in table MessageName, when generated document is insert into outgoing with MessageType depending on how will the message be sent. (Campaign types).
When printing documents related to orders, like Invoice, receipts etc.. a copy of the document is insert into orders_documents. when insert into orders_documents body should be copied after processing all macros so final generated document will be stored in orders_documents.body (legal rules).
orders_documents.documentID_prefix should be preset with device that generate the document or empty.
orders_documents.documentID must be incremented +1 after the last same type generated document. (legal rules). document ID can't have duplicate number or skipped numbers per business, per message type.
when generating invoice Order_DocumentID must be set in orders_products.InvoiceID, ShippingLabelID, ReturnLabelID, refund invoice must be set in orders_products.RefundID, receipts must be set in orders_payment.ReciptID for all products and documents generated for selected products.