Service Contract Invoice Amount

farrelfarrel Member Posts: 25
HI All,
I just want to confirm if the Amount Per Period on Service Contract Header should be the same on Line Amount on the Service Invoice Detail? Because when we try to use the function of NAV on creating service invoice we did not get the same amount on the Amount per Period on the service contract header against on the amount on the invoice detail created especially if the period covered is not the whole month.

Computation on Amount Per Period on service contract:
"Annual Amount" / ServContractMgt.NoOfDayInYear(InvTo)) * DaysInThisInvPeriod
Where DaysInThisInvPeriod = InvoiceFrom – InvoiceTo + 1



Computation of service invoice amount on function create service invoice:
AmountCalculated := AnnualAmount / 12 * NoOfMonthsAndMPartsInPeriod(PeriodStarts,PeriodEnds)
NoOfMonthsAndMPartsInPeriod =
{
IF Day1 > Day2 THEN
EXIT;
IF (Day1 = 0D) OR (Day2 = 0D) THEN
EXIT;
MonthsAndMParts := 0;

WDate := CALCDATE('<-CM>',Day1);
REPEAT
OldWDate := CALCDATE('<CM>',WDate);
IF WDate < Day1 THEN
WDate := Day1;
IF OldWDate > Day2 THEN
OldWDate := Day2;
IF (WDate <> CALCDATE('<-CM>',WDate)) OR (OldWDate <> CALCDATE('<CM>',OldWDate)) THEN
MonthsAndMParts := MonthsAndMParts +
(OldWDate - WDate + 1)/(CALCDATE('<CM>',OldWDate) - CALCDATE('<-CM>',WDate) + 1)
ELSE
MonthsAndMParts := MonthsAndMParts + 1;
WDate := CALCDATE('<CM>',OldWDate) + 1;
UNTIL WDate > Day2;
} meaning if the period covered is less than the total number of days in a particular month it will compute for a percentage.
i.e. 26/31 where 26 is the difference of day1 and day2 + 1 and 31 is the total days on that month.

In short, what should be followed? Is this really the nature of NAV?

Any response would be much appreciated.

Regards,
Farrel
Sign In or Register to comment.