fix sample yml file
added toCodeString function
if <item>_id is not present, it tries to get <item>_code.
reset all indexes at the beginning not to reset more than one time