Hello,
I have orders which pass 2 times to the "acccepted" status. It's a real problem because, my script which export my orders in my ERP use statuses to know which order it has to send.
So I have orders sended 2 times!
I found the code that delete history:

Can you fix it please?
I use the module for PrestaShop (1.7.7.4) and Sogecommerce 1.19.3.
Besides, I have an other question: why order_payment table row is created BEFORE orders table row?

My other payment's module don't work like this, they create orders before payment.
Thanks for your help.