• Home
  • /blog
  • /Database Diagram Quote/Order/Invoice

Database Diagram Quote/Order/Invoice

Yesterday I read a Inchoo’s post that expain very good how Magento store information about an invoice workflow, from quote until invoice, clearly explaining what tables are used that can serve us very well for reporting and make our sales information.

To summarize and I like to put relational diagrams, the first thing is stored is an order whose primary table is sales_flat_quote, here is stored cart data, either a guest or a user.

sales_flat_quote

As the user clicks on the cart to order, an order is generated which is sales_flat_order main table with information shipment (sales_flat_shipment) and payment method information (sales_flat_order_payment).

sales_flat_order

The order will remain pending payment and the amount still will not appear in the dashboard. As the user pays the order, an invoice is generated whose primary table is sales_flat_invoice and here is where it should base all our reports about sales, and that until an order arrives here, has not been charged.

sales_flat_invoice