in ecart, there are server behaviors called ecart store summary in database and ecart store details in database, usually in your checkout or confirm page.
this is where the order and order details are written to the appropriate tables.
if you wanted to store the modified order number, you could do it here, and remember you would need to modify orderid in both tables