Fix bug when flashing old input for storing generic shoes and add migration total purchase