protected void Page_Load(object sender, EventArgs e)
        {
            var printable = SessionWrapper.Instance.Get.PrintBag as PrintableRetentionSchedule;

            if (printable != null)
            {
                RetentionSchedule retentionSchedule = printable.RetentionSchedule;
                if (retentionSchedule != null)
                {
                    EndOfMonthLiteral.Text = retentionSchedule.EndOfMonth.ToString();
                    clientNameLiteral.Text = retentionSchedule.ClientName;

                    RetentionDetails retnDetails = printable.RetentionDetails;
                    if (retnDetails != null)
                    {
                        if (retnDetails.Hold > 1)
                        {
                            RetnStatementTitleLiteral.Text = "Estimated Retention Release";
                        }
                        else
                        {
                            RetnStatementTitleLiteral.Text = "Retention Statement";
                        }
                        Title = string.Format("{0} - End of month: {1} {2}", RetnStatementTitleLiteral.Text, retentionSchedule.EndOfMonth, retentionSchedule.ClientName);
                    }
                }
                retentionDetailsPanel.DisplayRetentionDetails(printable.RetentionDetails);
            }
        }
Example #2
0
        public RetentionDetails LoadRetentionDetails(int retentionId)
        {
            RetentionDetails retentionDetails = null;
            ChargeCollection charges          = LoadCharges(retentionId);

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader reader = SqlHelper.ExecuteReader(connection,
                                                                      "stGetRetentionDetails",
                                                                      CreateRetentionIdParameter(retentionId)))
                {
                    CleverReader cleverReader = new CleverReader(reader);
                    if (cleverReader.Read())
                    {
                        RetentionInfo               retentionInfo               = new RetentionInfoBuilder(cleverReader).Build();
                        RetentionDeductable         retentionDeductable         = new RetentionDeductableBuilder(cleverReader).Build();
                        TransactionsAfterEndOfMonth transactionsAfterEndOfMonth = new TransactionsAfterEndOfMonthBuilder(cleverReader).Build();
                        RetentionSummary            retentionSummary            = new RetentionSummaryBuilder(cleverReader).Build();
                        OverdueFee overdueFee = new OverdueFeeBuidler(cleverReader).Build();

                        retentionDetails = new RetentionDetailsBuilder(cleverReader).Build(retentionInfo,
                                                                                           retentionDeductable,
                                                                                           transactionsAfterEndOfMonth,
                                                                                           retentionSummary,
                                                                                           charges,
                                                                                           overdueFee);
                    }
                }
            }
            return(retentionDetails);
        }
Example #3
0
        public void DisplayRetentionDetails(RetentionDetails retentionDetails)
        {
            ViewState.Add("RetentionDetails", retentionDetails);

            if (retentionDetails != null)
            {
                retentionDetailsPanel.DisplayRetentionDetails(retentionDetails);
            }
        }
Example #4
0
        public void DisplayRetentionDetails(RetentionDetails retentionDetails)
        {
            if (retentionDetails != null)
            {
                //int facilityType = 0;
                facilityType = retentionDetails.ClientFacilityType;
                RetentionDeductable retentionDeductable = retentionDetails.RetentionDeductable;

                if (facilityType == 1)
                {
                    RetentionPanel.Visible         = true;
                    SpaceerPanel.Visible           = false;
                    Disc_Cr_PrepayPanel.Visible    = true;
                    NFRec_PostEOM_etcPanel.Visible = true;
                    ReleasePanel.Visible           = true;

                    //ReleasePanel2.Visible = false;

                    AdjustmentsLiteral.Visible = true;
                    CA_DrMgt_AdjustmentsLiteralLiteral.Visible = false;
                    summarySection.Visible = true;
                    //LessLabel.Text = "Less:";
                    DebtorsLedgerLabel.Text  = "Debtors Ledger:";
                    NonFundedLabel.Text      = "Non Funded:";
                    FundedInvoicesLabel.Text = "Funded Invoices:";
                    RepaymentLabel.Text      = "Repayment:";
                    OverdueChargesLabel.Text = "Interest & Charges**:";
                    EstimatedRetentionReleaseLiteral.Text = retentionDetails.CalculateEstimatedRetentionRelease().ToString("C");
                    RepaymentLiteral.Font.Underline       = true;
                    if (retentionDetails.Hold > 1)
                    {//Ref: CFF-21
                        LikelyRepurchasesAmountLiteral.Text = retentionDeductable.LikelyRepurchases.ToString("C");
                        LikelyRepurchasesLiteral.Visible    = true;

                        LikelyRepurchasesAmountLiteral.Visible = true;
                        ReleaseLiteral.Text = "Estimated Release:";
                        if (retentionDetails.Hold == 3)
                        {
                            heldLiteral.Text    = "Hold";
                            heldLiteral.Visible = true;
                        }
                    }
                    else
                    {
                        LikelyRepurchasesLiteral.Visible       = false;
                        LikelyRepurchasesAmountLiteral.Visible = false;
                        ReleaseLiteral.Text = "Retention Release:";
                        heldLiteral.Text    = "Held";
                    }
                }
                else
                {
                    RetentionPanel.Visible         = false;
                    SpaceerPanel.Visible           = true;
                    Disc_Cr_PrepayPanel.Visible    = false;
                    NFRec_PostEOM_etcPanel.Visible = false;
                    ReleasePanel.Visible           = false;

                    //ReleasePanel2.Visible = true;

                    AdjustmentsLiteral.Visible = false;
                    CA_DrMgt_AdjustmentsLiteralLiteral.Visible = true;
                    summarySection.Visible = false;
                    showSummary            = false;

                    //LessLabel.Text = "Sum Charged Via Current Account";
                    //SumChargedHeaderLabel.Text = "Sum Charged Via Current Account";
                    OverdueChargesLabel.Text = "Charges Where Funding Period Exceeded**:";
                    EstimatedRetentionReleaseLiteral.Text = retentionDetails.CalculateSumChargedViaCA().ToString("C");
                    RepaymentLiteral.Font.Underline       = false;
                    ReleaseLiteral.Text = "";
                    if (facilityType == 2)//Dr Mgt
                    {
                        DebtorsLedgerLabel.Text  = "Debtors Ledger Summary:";
                        FundedInvoicesLabel.Text = "Funding Invoices:";
                        NonFundedLabel.Text      = "Non Funding Invoices:";
                        RepaymentLabel.Text      = "Monthly Administration Fee:";
                    }
                    else // Current Account
                    {
                        DebtorsLedgerLabel.Text  = "Current Account Summary:";
                        FundedInvoicesLabel.Text = "Drawings:";
                        NonFundedLabel.Text      = "Non Funding Transactions:";
                        RepaymentLabel.Text      = "Scheduled Repayment:";
                    }
                }

                heldLiteral.Visible       = retentionDetails.IsHeld;
                endOfMonthLiteralTwo.Text = retentionDetails.EndOfMonth.ToString();

                NonFactoredLiteral.Text = retentionDetails.NonFactored.ToString("C");
                FactoredLiteral.Text    = retentionDetails.Factored.ToString("C");
                totalLedgerLiteral.Text = retentionDetails.CalculateTotalLedger().ToString("C");

                RetentionInfo retentionInfo = retentionDetails.RetentionInfo;
                RetentionHeldLiteral.Text              = retentionInfo.RetentionHeld.ToString("C");
                PercentageHeldLiteral.Text             = retentionInfo.FactoredInvoicesPercentage.ToString();
                FactoredInvoicesPercentageLiteral.Text = retentionInfo.FactoredRetention.ToString("C");
                NetRetentionLiteral.Text = retentionInfo.Surplus.ToString("C");

                //RetentionDeductable retentionDeductable = retentionDetails.RetentionDeductable;
                OverdueChargesLiteral.Text   = retentionDeductable.OverdueCharges.ToString("C");
                PostageRateLiteral.Text      = retentionDeductable.PostRate.ToString("C");
                PostageAmountLiteral.Text    = retentionDeductable.PostAmount.ToString("C");
                BankFeesLiteral.Text         = retentionDeductable.BankFees.ToString("C");
                DiscountsLiteral.Text        = retentionDeductable.Discounts.ToString("C");
                RepurchasesLiteral.Text      = retentionDeductable.Repurchases.ToString("C");
                CreditNotesLiteral.Text      = retentionDeductable.CreditNotes.ToString("C");
                TollsLiteral.Text            = retentionDeductable.Tolls.ToString("C");
                LettersSentLiteral.Text      = retentionDeductable.LettersSent.ToString("C");
                RepaymentLiteral.Text        = retentionDeductable.Repayment.ToString("C");
                TotalDeductablesLiteral.Text = retentionDeductable.CalculateTotal().ToString("C");

                RetnNotes.Text  = retentionDeductable.RetentionNotes;
                GstLiteral.Text = retentionDetails.CalculateGst().ToString("C");
                SurplusLessDeductablesLiteral.Text     = retentionDetails.CalculateSurplusLessDeductables().ToString("C");
                NonFactoredReceiptsLiteral.Text        = retentionDetails.NonFactoredReceipts.ToString("C");
                RetentionPriorToEndOfMonthLiteral.Text = retentionDetails.CalculateRetentionReleasePriorToEndOfMonth().ToString("C");

                //if (retentionDetails.Hold>1)
                //{//Ref: CFF-21
                //    LikelyRepurchasesAmountLiteral.Text = retentionDeductable.LikelyRepurchases.ToString("C");
                //    LikelyRepurchasesLiteral.Visible = true;

                //    LikelyRepurchasesAmountLiteral.Visible = true;
                //    ReleaseLiteral.Text = "Estimated";
                //    if (retentionDetails.Hold==3)
                //    {
                //        heldLiteral.Text = "Hold";
                //        heldLiteral.Visible = true;
                //    }
                //}
                //else
                //{
                //    LikelyRepurchasesLiteral.Visible = false;
                //    LikelyRepurchasesAmountLiteral.Visible = false;
                //    ReleaseLiteral.Text = "Retention";
                //    heldLiteral.Text = "Held";
                //}

                TransactionsAfterEndOfMonth transactionsAfterEndOfMonth = retentionDetails.TransactionsAfterEndOfMonth;
                RepurchasesAfterEOMLiteral.Text  = transactionsAfterEndOfMonth.Repurchases.ToString("C");
                CreditNotesAfterEOMLiteral.Text  = transactionsAfterEndOfMonth.CreditNotes.ToString("C");
                NetRetentionAfterEOMLiteral.Text = transactionsAfterEndOfMonth.Balance.ToString("C");

                AdjustmentsLiteral.Text = retentionDetails.Adjustments.ToString("C");
                CA_DrMgt_AdjustmentsLiteralLiteral.Text = retentionDetails.Adjustments.ToString("C");
                //EstimatedRetentionReleaseLiteral.Text = retentionDetails.CalculateEstimatedRetentionRelease().ToString("C");


                summarySection.Visible = showSummary;
                if (showSummary)
                {
                    RetentionSummary retentionSummary = retentionDetails.RetentionSummary;
                    FactorDaysLiteral.Text         = retentionSummary.FactorDays.ToString() + " Days";
                    OpeningBalanceLiteral.Text     = retentionSummary.OpeningBalance.ToString("C");
                    InvoicesPurchasedLiteral.Text  = retentionSummary.InvoicesPurchased.ToString("C");
                    CreditTransactionsLiteral.Text = retentionSummary.CalculateCreditTransactions().ToString("C");
                    ClosingBalanceLiteral.Text     = retentionSummary.CalculateClosingBalance().ToString("C");
                }
            }
        }