Jump to content

Ordering and invoicing


nimasdj

Recommended Posts

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?

Link to comment
Share on other sites

Please read post above first.

If I understood whmcs correctly, here is the scenario:

 

  1. user orders several items in a cart.
  2. when finished ordering, regardless how many items are purchased, only one Order and One invoice records will be added in the appropriate tables.
  3. in order we have a invoice_id field to map with invoice.
  4. mapping between Order to Invoice is OneToOne.
  5. 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.
  6. 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.
  7. 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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated