0

I need to add custom diiscount to credit memo grid, I added to invoice grid as data populated from sales_invoice table but unable to find table to credit memo.

4 Answers 4

0

sales_creditmemo_grid : this table is responsible for populating credit memo admin grid.

1
0

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.

1
  • I am using Magento 2 and "sales_flat_creditmemo_grid" table is not present in my DB Oct 8, 2018 at 8:18
0

Theses are the tables which stores credit memo records :

sales_flat_creditmemo Once credit memo is generated from admin for sales orders, the values will be reflect from this table.

sales_flat_creditmemo_item contains items of the credit memo,If only single line item only then only one row will be created.

sales_flat_creditmemo_grid This table is used for grid . All the credit memo detail will available from this table. ( Instead of referring all the tables, admin grid will refer only this table. )

sales_flat_creditmemo_comment if any comment it provide by admin, those are available here.

8
  • I am using Magento 2 and "sales_flat_creditmemo_grid" table is not present in my DB Oct 8, 2018 at 8:18
  • do you have creditmemo created in admin ? if no then create one and check Oct 8, 2018 at 9:07
  • I already created around 30 for different different orders, when i place order from COD then credit memo grid populates correctly , but when i use my custom online payment method, credit memo grid does not shows my custom discount Oct 8, 2018 at 9:11
  • okay, could you share snapshot of your sales_flat_credit table. ? Oct 8, 2018 at 9:19
  • sales_flat_credit also not present in DB Oct 8, 2018 at 9:23
0

My horse is a bit late for this race, but here's my input anyway.

Customer's store credit can use Credit Memo and Customer Balance tables:

Credit memo:

select * from sales_creditmemo;
select * from sales_creditmemo_item;
select * from sales_creditmemo_grid;
select * from sales_creditmemo_comment;

In regards to customer balance:

select * from magento_customerbalance;
select * from magento_customerbalance_history;

Please note the customer balance tables keep tabs on records added via Credit Memo as well as manual amounts added directly to the customer via Magento Admin.

The same logic is used in both M1 and M2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.