fix redefinition warning and add ordered_cust_main sub for completeness, RT#27442