Creditmemo Tables in magento

Creditmemo Tables in magento:
After an order has been paid and invoiced, all of the order, or a portion of it, can be refunded by issuing a credit memo. A credit memo differs from a refund because the amount of the credit is restored to the customer’s account where it can be applied to future purchases, rather than returned to the customer as cash. In some cases, a refund can be given at the same time that the credit memo is issued, just as a payment can be made at the time of invoicing. (Thanks to magentocommerce.com, more information  http://www.magentocommerce.com/knowledge-base/entry/how-to-create-credit-memos)
Following tables are used for Creditmemo. As per my understanding i defined here,

1. sales_flat_creditmemo
2. sales_flat_creditmemo_item
3. sales_flat_creditmemo_grid
4. sales_flat_creditmemo_comment

Table :1 sales_flat_creditmemo:
This is the main table for creditmemo order in magento. Once credit memo is generated from admin (for order’s), the values will be reflect from this table. From this table, will get what is the refund (creditmemo amount) amount for this order. What is the adjust amount (positive or negative from the order amount) etc.

Table :2 sales_flat_creditmemo_item:
Credit memo is generated for which line item (if more than one line item is available in order).If only single line item only then only one row will create here else based on the line item row will create.

Table :3 sales_flat_creditmemo_grid:
This table is nothing but, it the grid purpose. All the creditmemo detail (entire website) will available from this table. This table mainly useful when admin check the creditmemo grid from admin section. Admin -> Sales -> Order -> creditmemo . Intead of referring all the tables, admin grid will refer only this table.

Table :4 sales_flat_creditmemo_comment:
When generate the creditmemo for the order, if any comment it provide by admin, those are available here.

Leave a Reply