Document printing logic By admin / May 01, 2021 / Developers guide share Facebook Twitter Google + LinkedIn Pinterest Email Share... Document TypesInvoice=2,Invoice_Receipt=3,Receipt=4,Price quote=5,Refund Invoice=6,Shipping Label=7,Return Label=8,Receipt Cancel=9,on_line_templates=10 Template names:entity_forgot_passwordentity_email_Verificationstock_level_low_notificationwelcome_new_customer.restaurant_kitchen_bonrestaurant_temporery_billcredit_card_slip Purchase Order=11 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.