fix(ERP-248): move $store lookup before if/else to fix undefined variable
$store was defined only inside the "new order" block (line 1252), but
referenced in 5 places inside the "existing order" else-block (lines
1692, 1735, 1770, 1828, 2017), causing "Undefined variable $store"
on production.
Moved $warehouseGuid and $store assignment before the if/else split
so both branches share the same variable scope.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>