Hi,
I have a requirement to find out "Estimated Hours Total Calculation" with User input date range. I know little bit knowledge about Customer Exits please some one give me how to write code in CMOD. I have requirement how to get the Extimated Hours Total Calculation is follows ....
Actual hours are the Hour Meter Reading used by the truck, it's calculated based on the "from and to" date parameters.
Collect the initial hours and adjusted hours from EM.
Get the PMN and Service Order data close to or within the Date Range.
1) If the Fleet Management Date (Start-up Date on EM) started before the input date Date Range (From-Date), calculate the average usage (in hours) based on the initial hours and the first PMN (or SO) falls within the Date Range to estimate the hour usage at start of Date Range.
2) If the Fleet Management Date started after the From-Date, use the Hour Meter (EM) as the Estimated Hours Begin.
3)If the last PMN (or SO) fell short of the Date Range (To-Date), obtain the Estimated Hours End by applying the average usage to fill the time-gap.
4)If the last PMN (or SO) fell after the Date Range (To-Date), get the Estimated Hours End by getting the next to last PMN performed inside the window parameter,
calculate the average usage between the two PMN's (or SO's) then apply the weighted average to fill the time-gap.
Adjusted Hours, if not zero or null, needs to be added to the Ending Hours to achieve the real number.
For Example
User Input Date Range: Jan. 1, 2006 - Dec. 31, 2006
Initial Hour (Equipment Master): 10
Adjusted Hours (Equipment Master): 0
Fleet Management Date (Equipment Master): Dec. 1, 2005
1st PM Notification (Feb. 1, 2006): 410
Last PM Notification (Feb. 1, 2007): 2810
Second to last PMN (Dec. 1, 2006): 2410
Equipment was put into service (12/1/05) before the Date Range, needs to find the Estimated Hours Begin.
The first PM was performed (2/1/06) exactly two months from in-service date (12/1/05).
Average monthly usuage from first PMN = (410 - 10) / 2 = 200
Estimated Hours Begin = 200 + 10 = 210 (estimated Hour Meter Reading on Jan. 1, 2006)
Average monthly usuage from the last 2 PMN = (2810 - 2410) / 2 months = 200
Estimated Hours End = 2410 + 200 + 0 (adjusted hours) = 2610 (estimated Hour Meter Reading on Dec. 31, 2006)
Estimated Hours Total = 2610 - 210 = 2400
Please give me your valuable answers. Please let me know if you need any further information.
Thanks
Dave Sam.