Exemplo n.º 1
0
        public void update(MonthlyReport report, DateTime date)
        {
            report.setMonth(updateMonth(date));
            financeSystem funds = retrieveFinances(new DateTime(date.Year, date.Month, 1), new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month)));

            double amountOwedIHSP = 0;
            double amountOwedOHSP = 0;

            report.setBasicEnrollNum(funds.numBasicEnrollees);
            report.setExtendedErollNum(funds.numExtendedEnrollees);

            report.setBasicTotalIncome(funds.totalBasicIncome);
            report.setExtendTotalIncome(funds.totalExtendedIncome);
            report.setTotalEnrolleePayments(funds.numEnrolleeBills);

            report.setIHSPNumHospBills(funds.numIHSPHospitalBills);
            report.setOHSPNumHospBills(funds.numOHSPHospitalBills);

            report.setIHSPNumPhysBills(funds.numIHSPPhysicianBills);
            report.setOHSPNumPhysBills(funds.numOHSPPhysicianBills);

            report.setIHSPNumOtherBills(funds.numIHSPOtherBills);
            report.setOHSPNumOtherBills(funds.numOHSPOtherBills);

            report.setHospitalIHSP(funds.IHSPhospitalCosts);
            report.setHospitalOHSP(funds.OHSPhospitalCosts);
            amountOwedIHSP += funds.IHSPhospitalCosts;
            amountOwedOHSP += funds.OHSPhospitalCosts;

            report.setPhysicianIHSP(funds.IHSPPhysicianCosts);
            report.setPhysicianOHSP(funds.OHSPPhysicianCosts);
            amountOwedIHSP += funds.IHSPPhysicianCosts;
            amountOwedOHSP += funds.OHSPPhysicianCosts;

            report.setOtherIHSP(funds.IHSPOtherCosts);
            report.setOtherOHSP(funds.OHSPOtherCosts);
            amountOwedIHSP += funds.IHSPOtherCosts;
            amountOwedOHSP += funds.OHSPOtherCosts;

            report.setAmountOwedIHSP(amountOwedIHSP);
            report.setAmountOwedOHSP(amountOwedOHSP);

            double paidPercentage = 0;

            paidPercentage = (amountOwedIHSP + amountOwedOHSP) / (2000 * funds.numIHSPHospitalBills + 150 * funds.numIHSPPhysicianBills
                                                                  + 300 * funds.numIHSPOtherBills + amountOwedOHSP);

            paidPercentage = paidPercentage * 100;
            report.setMaxPercentBillable(paidPercentage);

            double totalCosts = 0;

            totalCosts += amountOwedIHSP;
            totalCosts += amountOwedOHSP;

            report.setTotalCosts(totalCosts);
        }