Document printing logic

Document Types
Invoice=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_password
    entity_email_Verification
    stock_level_low_notification
    welcome_new_customer.
    restaurant_kitchen_bon
    restaurant_temporery_bill
    credit_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.InvoiceIDShippingLabelID, 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.

 

 

Add comment