Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DevertNet/1434b9f04ddda2a3329cb71f3582e7f5 to your computer and use it in GitHub Desktop.
Save DevertNet/1434b9f04ddda2a3329cb71f3582e7f5 to your computer and use it in GitHub Desktop.
Delete credit memo in magento. Tested with 1.7.0.2
DELETE FROM sales_flat_creditmemo WHERE entity_id=123;
UPDATE sales_flat_order_item SET qty_refunded='0.0000', amount_refunded='0.0000', base_amount_refunded='0.0000', hidden_tax_refunded=NULL, base_hidden_tax_refunded=NULL, tax_refunded=NULL, discount_refunded=NULL, base_discount_refunded=NULL WHERE order_id=54255;
UPDATE sales_flat_order SET state='complete', status='complete', base_discount_refunded=NULL, base_shipping_refunded=NULL, base_shipping_tax_refunded=NULL, base_subtotal_refunded=NULL, base_tax_refunded=NULL, base_total_offline_refunded=NULL, base_total_refunded=NULL, discount_refunded=NULL, shipping_refunded=NULL, shipping_tax_refunded=NULL, subtotal_refunded=NULL, tax_refunded=NULL, total_offline_refunded=NULL, total_refunded=NULL, adjustment_negative=NULL, adjustment_positive=NULL, base_adjustment_negative=NULL, base_adjustment_positive=NULL, base_total_due=NULL, total_due=NULL, hidden_tax_refunded=NULL, base_hidden_tax_refunded=NULL WHERE entity_id=54255;
UPDATE sales_flat_order_grid SET status = 'complete' WHERE entity_id=54255;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment