nimasdj Posted May 1, 2014 Share Posted May 1, 2014 If understood correctly. I see even if we order multiple products, we will have only one order record with one invoice. In order table we have invoice_id coloumn, but in invoice table there is no reference to order, so this is one way from order to invoice. On time of ordering, there will be separate record in hosting table for each item with recurring cycle and end_date e.g. 'Monthly' , '01-05-2014'. this table has reference to order table. when cron runs, I think it is reading cycle and due date from hosting table and create a new invoice. Only a new invoice will be created, nothing else will be re-created. this invoice has only reference to client, there is no reference to order table nor to hosting table nor vice versa. Did I understand correctly? If yes, then question is that if invoice will be overdue, then how the system understand which hosting package should be suspended as there is no reference from invoice to order nor to hosting? 0 Quote Link to comment Share on other sites More sharing options...
nimasdj Posted May 1, 2014 Author Share Posted May 1, 2014 Please read post above first. If I understood whmcs correctly, here is the scenario: user orders several items in a cart. when finished ordering, regardless how many items are purchased, only one Order and One invoice records will be added in the appropriate tables. in order we have a invoice_id field to map with invoice. mapping between Order to Invoice is OneToOne. upon ordering, when a new order record and a new invoice record are added, new records will be added in OrderItems, a record for each item on cart, so mapping between Order and OrderItems is OneToMany. When cron runs, it checks the Due Date and billing cycle of items in OrderItems and generate a new invoice for each item as appropriate. There is no mapping from Invoice to Order nor to OrderItems. As it cannot be mapped to Order and OrderItems at the same time, but there is OneToOne mapping from Order to Invoice. When cron runs, only a new invoice will be generated as explained above in #6, and NO new Order nor new OrderItem will be created. Is this the scenario of invoice creation of WHMCS? If yes, then if an invoice is overdue, how the system will know which hosting account should be suspended as there is no association from Invoice to OrderItems? PS. OrderItems above is called 'hosting' in whmcs. 0 Quote Link to comment Share on other sites More sharing options...
nimasdj Posted May 2, 2014 Author Share Posted May 2, 2014 No answer yet? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.