fix bug in generate_staged_work_order_from_resource