#!/usr/bin/perl
# script: wcinterest.pl
# Copyright (C) 2004 J. William Snyder, Jr.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
use strict;
use CGI qw/:standard/;
use POSIX;
my $versiondate = "August 1, 2004";
my $ttdstartmon;
my $ttdstartday;
my $ttdstartyear;
my $ttdstartraw;
my $doihmon;
my $doihday;
my $doihyear;
my $doihraw;
my $dopmon;
my $dopday;
my $dopyear;
my $dopraw;
my @dopsraw;
my $ttdthruhg;
my $ttdthruhgint;
my $ttdfromhg;
my $ttdfromhgint;
my $ttdthruhgnumsecs;
my $ttdthruhgnumweeks;
my $ttdfromhgnumsecs;
my @ttdfromhgnumweeks;
my $comprate;
my @interest;
my $intratewkly = 0.001538462; # 8% per annum reduced to a weekly rate
my $secondsinday = 86400;
my $secondsinweek = 604800;
my $n;
my $i;
my $datesop;
sub legalbackground
{
print hr;
print "";
print "This program calculates the interest due on total disability compensation due on awards ";
print "of the NCIC full Commission pursuant to N.C. Gen. Stat. Sec. 97-86.2,
which mandates ";
print "that an employer that is ordered to pay compensation pursuant to an award of the ";
print "full Commission pay interest on the award at the legal rate prescribed by N.C. Gen. Stat. Sec. ";
print "24-1. The rate prescribed by N.C. Gen. Stat. Sec. 24-1
is \"eight \(8\%\) per annum\". Although the statutes ";
print "are silent about whether simple or compound interest is to be paid, the Commission ";
print "in Tracy
W. Moore v. Standard Mineral Company, I.C. File No. 177919 (March ";
print "19, 1998) held that 8% simple interest (Math formula: Interest = Principal X Rate X Time) ";
print "is to be paid unless the plaintiff can prove that s/he could have obtained a greater ";
print "return than 8% simple interest on the compensation awarded. ";
print "The method used by this program is modeled after the method used by Commissioner Thomas ";
print "Bolch to calculate the interest on compensation due in Robert
Moore v. Foam Ex, ";
print "I.C. File No. 241740 (April 1, 1999) except that 1. the program handles fractional ";
print "weeks, and 2. the program takes account of the fact that workers' compensation benefits
are paid in arrears and not in advance. This program assumes a
continuous period of ";
print "total disability between the initial date of disability and the date of payment. ";
print "
";
print "";
print "
";
print "";
print "| ";
print "First date of disability (start of award) (MM/DD/YYYY): ";
print " | ";
print "";
print textfield('ttdstartmon','',2,2), "/", textfield('ttdstartday','',2,2),"/", textfield('ttdstartyear','',4,4);
print " | ";
print "
";
print "";
print "| ";
print "Date of initial hearing (MM/DD/YYYY): ";
print " | ";
print "";
print textfield('doihmon','',2,2), "/", textfield('doihday','',2,2),"/", textfield('doihyear','',4,4);
print " | ";
print "
";
print "";
print "| ";
print "First potential date of payment (MM/DD/YYYY): ";
print " | ";
print "";
print textfield('dopmon','',2,2), "/", textfield('dopday','',2,2), "/", textfield('dopyear','',4,4);
print " | ";
print "
";
print "";
print "| ";
print "Number of days from first potential date of payment over which to calculate interest due: ";
print " | ";
print "";
print textfield('datesop','',10,10);
print " | ";
print "
";
print "";
print "| ";
print "Employee\'s weekly compensation rate: ";
print " | ";
print "";
print textfield('comprate','', 9,9);
print " | ";
print "
";
print "
";
print br;
print submit("Run interest calculation");
print " ";
print reset("Clear Form");
print end_form;
print hr;
}
if (param()) {
print header;
print "\n";
print "