Created
July 6, 2016 09:47
-
-
Save larascasse/94d4fd663f82077bfc20947ecdc00a02 to your computer and use it in GitHub Desktop.
Delete Magento Order & Invoice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set @increment_id='300001114'; | |
select @order_id:=entity_id from sales_flat_order where increment_id=@increment_id; | |
delete from sales_flat_order where entity_id=@order_id; | |
delete from sales_flat_order_grid where increment_id=@increment_id; | |
delete from sales_flat_order_payment where parent_id=@order_id; | |
delete from sales_flat_order_status_history where parent_id=@order_id; | |
select @tax_id:=tax_id from `sales_order_tax` where order_id=@order_id; | |
delete from sales_order_tax_item where tax_id=@tax_id; | |
select @invoice_id:=entity_id from sales_flat_invoice where order_id=@order_id; | |
delete from sales_flat_invoice where order_id=@order_id; | |
delete from `sales_flat_invoice_item` where parent_id = @invoice_id; | |
delete from `sales_flat_invoice_grid` where `order_increment_id` = @increment_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment