Example #1
0
        /// <summary>
        /// <Pre>PopulateDocs has already gotten all records and made them into tables.</Pre>
        /// <Post>A schema has been built around the relations of these tables.<br>
        /// Any relevant filters have been run, and reports have been made on bad data.</br></Post>
        /// </summary>
        /// <returns></returns>
        internal List<OutputDoc> ProcessRecords(
            out IEnumerable<DataRow> membersWithoutStatements
            , out IEnumerable<DataRow> balancesWithoutStatements
            , out IEnumerable<DataRow> statementsWithoutMembers)
        {
            // PopulateDocs has already:
            // Gotten All Invoices, Bal Fwd Records, Member Records, and made them into tables in a dataset.

            // Get the report lists out.
            // Datarows from members where there DOES NOT EXIST a statement with a matching Member ID.
            membersWithoutStatements = ClientBusinessRules.GetMembersWOStmts(this);
            // DataRows from balances where there DOES NOT EXIST statement with a matching account ID.
            balancesWithoutStatements = ClientBusinessRules.GetBalancesWOStmts(this);
            // DataRows from members where there DOES NOT EXIST a member to match a statement.
            statementsWithoutMembers = ClientBusinessRules.GetStmtsWOMembers(this);

            //var balancesWStms = ClientBusinessRules.GetBalancesWStmts(this);
            //var membersWithStatements = ClientBusinessRules.GetMembersWStmts(this);
            //var balancesWithMembers = ClientBusinessRules.GetBalancesWMembers(this);

            // Make outputDocs from each statement, its corresponding member, and any and all balances forward.
            List<OutputDoc> outputDocs = ClientBusinessRules.GetStatementRows(this).ToList();



            return outputDocs;
        }
Example #2
0
        /// <summary>
        /// Constructor with parameters
        /// </summary>
        /// <param name="statementData">A DataRow for a statement.</param>
        /// <param name="memberData">A DataRow for a member matching the statement.</param>
        /// <param name="balFwdData">A list of DataRows for balance details matching the member.</param>
        public OutputDoc(
            DataRow statementData
            , DataRow memberData
            , List <DataRow> balFwdData = null)
        {
            // statement items
            groupBillingAccountID_Statement = statementData.Field <string>("Group Billing Acct ID");
            invoiceNumber               = statementData.Field <string>("Invoice Number");
            invoiceAmount               = statementData.Field <decimal>("Invoice Amount");
            lowIncomeSubsidyAmount      = statementData.Field <decimal>("Low-Income Subsidy Amount");
            lateEnrollmentPenaltyAmount = statementData.Field <decimal>("Late-Enrollment Penalty Amount");
            invoicePeriodFromDate       = statementData.Field <DateTime>("Invoice Period From Date");
            invoicePeriodToDate         = statementData.Field <DateTime>("Invoice Period To Date");

            // member file items
            billingAccountNumber_MemberFile = memberData.Field <string>("Billing Account Number");
            firstName       = memberData.Field <string>("First Name");
            middleName      = memberData.Field <string>("Middle Name");
            lastName        = memberData.Field <string>("Last Name");
            address1        = memberData.Field <string>("Address1");
            address2        = memberData.Field <string>("Address2");
            city            = memberData.Field <string>("City");
            state           = memberData.Field <string>("State");
            zip             = memberData.Field <string>("Zip");
            memberID        = memberData.Field <string>("MemberID");
            premiumWithhold = memberData.Field <string>("Premium Withhold");

            dueDate = ClientBusinessRules.GetDueDate(
                statementData.Field <DateTime>("Invoice Period To Date")
                , ClientBusinessRules.StatementGracePeriod);

            fullBalance = invoiceAmount;
            foreach (var detail in balFwdData)
            {
                BalDetail det = (BalDetail)sample.Record(detail, new object[] { new Date(dueDate.Year, dueDate.Month, dueDate.Day) });
                details.Add(det);
                fullBalance += det.outstandingAmount;
            }
            lateBalance = BalDetail.GetLateBalance(details.ToArray());

            // TO DO: implement constructor.
        }