Tank percentage incorrect after gauge read from date before season reset

Issue No: TM-2451
Created 7/13/2017 3:07:52 PM
Type Bug
Priority Major
Status Closed
Resolution Fixed
Fixed Version 17.1
Description *Scenario* :   A Gauge read was entered and posted after the season reset, but backdated to before the season reset. Afterwards the tank % full was over 100%.   It appears that when calculating est. % full we are taking the Accumulated value from the clock reading and using those values. However if a season reset has been issued between the two clock reading dates then the degree day difference between the two dates would be negative, resulting in an invalid estimation.   If a season reset has occurred then we need to subtract the clock reading days from the invoice date from the clock reasong days from the last day of the season, then add those to the posting dates clock reading.   In the attached example the clock reading for 6/26/2017 was 6084. The clock reading for the posted date, 7/12/2017, was 5. The season reset was on 7/1/2017. The clock reading for the last day of the season, 6/30/2017 was 6097.   What it appears may have happened was 5-6084 = -6079   6097-6084 + 5 = 18 is the correct number of degree days between in this scenario.     *Issue* : Estimated % is not computed correctly when an invoice is created and posted after season reset.   *Steps* :   1. Select a specific site with delivery details.   2. Proceed with a season reset by entering 0 in clock reading.   3. On Sales > create a tank delivery invoice. Enter an invoice date where date is before the season reset. Save. Post.   4. Select the specific site in #1   5. Checked delivery details > Estimated %. It is displaying the value from Last Degree Day Entry(After Reset) - Last Delivery Date   *Acceptance* : Should compute the correct number of degree days in order to display the correct Est % for site delivery that has invoice posted after season reset.   _Formula_: Accum Value of Last Degree Day Entry(Before Reset) - Accum Value of Last Delivery Date + Accum Value of Last Degree Day Entry (After Reset)