Fixes bug in sale model. Model was using tmp file. Now uses database field