I'm using the code available here to generate orders programmatically (importing from an older in-house system) and its actually working quite well. I've made some changes to check/create customers as needed, but it makes the orders just fine with one exception. I'd like to set the order number of these imported orders to match the number they had in the old system (a simple 4 to 6 digit number) without affecting magento's normal order numbering (these imported orders will be in a different "store" from new orders anyway).
I've tried a few variations for setting the IncrementID right before saving the order, but nothing seems to stick.
Some of the things I've tried:
Mage::getModel('sales/order') ->setIncrementId('test1234'); Mage::getSingleton('eav/config') ->getEntityType('order') ->setIncrementId('test1234');