private void DisplayCurrentLoanInfo(/*int iLoanIndex*/) { this.submitButton.Enabled = false; this.calculateButton.Enabled = false; this.renewalAmountLabel.Visible = false; this.renewalAmountValue.Visible = false; this.radRenew.Enabled = false; this.totalReceivedFromCustomerTextBox.Enabled = false; this.totalReceivedFromCustomerTextBox.Text = ""; this.totalReceivedFromCustomerLabel.Visible = false; this.totalReceivedFromCustomerTextBox.Visible = false; this.radPaydown.Enabled = false; this.pawnLoan = this.pawnLoans[this.currentLoanIndex]; this.rolloverLoanHeaderLabel.Text = "Rollover Pawn Loan " + this.pawnLoan.TicketNumber; //Calculate current loan fee amount decimal currentLoanFee = 0.0M; currentLoanFee = (from ploan in pawnLoan.Fees where ploan.FeeType != FeeTypes.INTEREST select ploan).Sum(s => s.Value); //Update UI this.amountFinanced_CurrentLoan.Text = String.Format("{0:C}", this.pawnLoan.Amount); this.interest_CurrentLoan.Text = String.Format("{0:C}", this.pawnLoan.InterestAmount); this.service_CurrentLoan.Text = String.Format("{0:C}", this.pawnLoan.ServiceCharge); this.fee_CurrentLoan.Text = String.Format("{0:C}", currentLoanFee); this.pickupAmount_CurrentLoan.Text = String.Format("{0:C}", this.pawnLoan.PickupAmount); this.apr_CurrentLoan.Text = CashlinxDesktopSession.Instance.CurrentSiteId.Alias == "OK" ? String.Format("{0:N2}%", this.pawnLoan.InterestRate) : String.Format("{0}%", this.pawnLoan.InterestRate); this.dueDate_CurrentLoan.Text = this.pawnLoan.DueDate.ToShortDateString(); this.lastDatePickup_CurrentLoan.Text = this.pawnLoan.PfiEligible.ToShortDateString(); this.radPaydown.Enabled = paydownServiceAllowed; this.calculateButton.Enabled = paydownServiceAllowed; this.totalReceivedFromCustomerLabel.Visible = paydownServiceAllowed; this.totalReceivedFromCustomerTextBox.Visible = paydownServiceAllowed; this.radRenew.Enabled = pawnLoanRenewalAllowed; this.renewalAmountLabel.Visible = pawnLoanRenewalAllowed; this.renewalAmountValue.Visible = pawnLoanRenewalAllowed; pawnLoan.RenewalAmount = pawnLoan.PickupAmount - pawnLoan.Amount; this.renewalAmountValue.Text = String.Format("{0:C}", this.pawnLoan.RenewalAmount); /* if (this.pawnLoan.RenewalAmount > 0.00M) * { * this.newPawnLoanAmount = this.pawnLoan.RenewalAmount; * }*/ if (this.rolloverLoanPageIndexHeaderLabel.Visible) { this.rolloverLoanPageIndexHeaderLabel.Text = "Loan " + (this.currentLoanIndex + 1) + " of " + this.pawnLoans.Count; } }
private void ShowPawnItemDetail(DataGridViewCellMouseEventArgs e) { DataGridViewRow myRow = MerchandiseDataGridView.Rows[e.RowIndex]; if (e.ColumnIndex == 1 && e.RowIndex >= 0) { PawnLoan pawnLoan = GlobalDataAccessor.Instance.DesktopSession.CurrentPawnLoan; string icn = Utilities.GetStringValue(myRow.Cells[ICN.Index].Value, ""); int iDx = pawnLoan.Items.FindIndex(p => p.Icn == icn); if (iDx >= 0) { // Need to populate pawnLoan from GetCat5 int iCategoryMask = GlobalDataAccessor.Instance.DesktopSession.CategoryXML.GetCategoryMask(pawnLoan.Items[iDx].CategoryCode); DescribedMerchandise dmPawnItem = new DescribedMerchandise(iCategoryMask); Item pawnItem = pawnLoan.Items[iDx]; Item.PawnItemMerge(ref pawnItem, dmPawnItem.SelectedPawnItem, true); pawnLoan.Items.RemoveAt(iDx); pawnLoan.Items.Insert(iDx, pawnItem); // End GetCat5 populate //Add the current loan as the active pawn loan GlobalDataAccessor.Instance.DesktopSession.PawnLoans.Insert(0, pawnLoan); // Placeholder for ReadOnly DescribedItem.cs DescribeItem myForm = new DescribeItem(GlobalDataAccessor.Instance.DesktopSession, CurrentContext.READ_ONLY, iDx) { SelectedProKnowMatch = pawnLoan.Items[iDx].SelectedProKnowMatch }; myForm.ShowDialog(this); } } }
public VoidReceiptSummary(PawnLoan pLoan, PawnAppVO pApp) { InitializeComponent(); //this.NavControlBox = new NavBox(); this.pwnApp = pApp; this.pwnLoan = pLoan; }
public PfiPickupCalculator(PawnLoan pawnLoan, SiteId currentSiteId, DateTime pickupDate) { ApplicableFees = new List <Fee>(); PawnLoan = pawnLoan; PickupDate = pickupDate; CurrentSiteId = currentSiteId; }
public DynamicProductHistory_Dialog(PawnLoan pawnLoan, int receiptIdx) { InitializeComponent(); _pawnLoan = pawnLoan; _receiptIdx = receiptIdx; }
public LoanBasicInfoPanel(PawnLoan pawnLoan, int receiptIdx) : base(pawnLoan, receiptIdx) { InitializeComponent(); Setup(); }
/// <summary> /// Builds a small generic panel based on the panel type specified. /// </summary> /// <param name="pawnLoan"></param> /// <param name="receiptIdx"></param> /// <param name="panelType"></param> public LoanGenericPanel(PawnLoan pawnLoan, int receiptIdx, PanelType panelType) : base(pawnLoan, receiptIdx) { InitializeComponent(); _panelType = panelType; Setup(); }
public static void GetExtensionAmountSplit(PawnLoan pawnLoan, out decimal refundAmt, out int extensionsPaid, out decimal extensionInterestAmount, out decimal extensionServiceAmount) { extensionInterestAmount = 0; extensionServiceAmount = 0; refundAmt = 0; extensionsPaid = 0; decimal originalInterestAmount = (from f in pawnLoan.Fees where (f.FeeType == FeeTypes.INTEREST && f.FeeRefType == FeeRefTypes.PAWN) select f.Value).Sum(); decimal originalServiceAmount = (from f in pawnLoan.Fees where (f.FeeType == FeeTypes.STORAGE || f.FeeType == FeeTypes.SERVICE) && f.FeeRefType == FeeRefTypes.PAWN select f.Value).Sum(); if (pawnLoan.IsExtended && pawnLoan.PartialPaymentPaid) { var extnReceipts = (from r in pawnLoan.Receipts where r.Event == ReceiptEventTypes.Extend.ToString() && r.RefTime > pawnLoan.LastPartialPaymentDate select r).Except(from r in pawnLoan.Receipts where r.Event == ReceiptEventTypes.VEX.ToString() && r.RefTime > pawnLoan.LastPartialPaymentDate select r); refundAmt = (from rcpt in extnReceipts select rcpt.Amount).Sum(); extensionsPaid = extnReceipts.Count(); decimal lastInterestAmount = (from ppmt in pawnLoan.PartialPayments where ppmt.Time_Made == pawnLoan.LastPartialPaymentDate select ppmt.CUR_FIN_CHG).FirstOrDefault(); decimal lastServiceAmount = (from ppmt in pawnLoan.PartialPayments where ppmt.Time_Made == pawnLoan.LastPartialPaymentDate select ppmt.Cur_Srv_Chg).FirstOrDefault(); foreach (Receipt rp in extnReceipts) { decimal interestValue = (lastInterestAmount / (lastInterestAmount + lastServiceAmount)) * rp.Amount; decimal serviceValue = (lastServiceAmount / (lastInterestAmount + lastServiceAmount)) * rp.Amount; extensionInterestAmount += interestValue; extensionServiceAmount += serviceValue; } } else if (pawnLoan.IsExtended) { var extnReceipts = (from r in pawnLoan.Receipts where r.Event == ReceiptEventTypes.Extend.ToString() select r).Except(from r in pawnLoan.Receipts where r.Event == ReceiptEventTypes.VEX.ToString() select r); refundAmt = pawnLoan.ExtensionAmount; extensionsPaid = extnReceipts.Count(); foreach (Receipt rp in extnReceipts) { decimal interestValue = (originalInterestAmount / (originalInterestAmount + originalServiceAmount)) * rp.Amount; decimal serviceValue = (originalServiceAmount / (originalInterestAmount + originalServiceAmount)) * rp.Amount; extensionInterestAmount += interestValue; extensionServiceAmount += serviceValue; } } }
public PartialPawnPaymentHistory(PartialPawnPaymentHistoryFormMode mode, PartialPayment pPayment, PawnLoan loan) { InitializeComponent(); Mode = mode; Payment = pPayment; Loan = loan; SetFormFields(); }
public void Setup() { PickupDate = new DateTime(2011, 10, 1); PawnLoan = new PawnLoan(); PawnLoan.InterestAmount = 3.75M; // Interest Amount before Partial Payment PawnLoan.ServiceCharge = 4M; // Service Amount before Partial Payment PawnLoan.DateMade = new DateTime(2011, 8, 1); PfiPickupCalculator = new PfiPickupCalculator(PawnLoan, TestSiteIds.Store00901, PickupDate); }
private void Setup() { int iDx = GlobalDataAccessor.Instance.DesktopSession.PawnLoans.FindIndex(p => p.TicketNumber == ticketNumber); if (iDx < 0) { iDx = GlobalDataAccessor.Instance.DesktopSession.PawnLoans_Auxillary.FindIndex(p => p.TicketNumber == ticketNumber); if (iDx < 0) { MessageBox.Show( "Ticket Number is not associated to a Loan.", "Ticket Number Lookup", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.Close(); return; } } rolloverLoanHeaderLabel.Text = "Rollover Pawn Loan " + ticketNumber; pawnLoan = GlobalDataAccessor.Instance.DesktopSession.PawnLoans[iDx]; pawnLoanAmount = pawnLoan.Amount; decimal currLoanFee = (from ploan in pawnLoan.Fees where ploan.FeeType != FeeTypes.INTEREST select ploan).Sum(s => s.Value); decimal intFee = (from ploan in pawnLoan.Fees where ploan.FeeType == FeeTypes.INTEREST select ploan).Sum(s => s.Value); decimal srvFee = (from ploan in pawnLoan.Fees where ploan.FeeType == FeeTypes.SERVICE select ploan).Sum(s => s.Value); // populate form fields if (new BusinessRulesProcedures(GlobalDataAccessor.Instance.DesktopSession).IsPartialPaymentAllowed(GlobalDataAccessor.Instance.DesktopSession.CurrentSiteId)) { currentPrincipal_CurrentLoan.Text = pawnLoan.CurrentPrincipalAmount.ToString("c"); } else { currentPrincipal_CurrentLoan.Visible = false; currentPrincipalLabel.Visible = false; } amountFinanced_CurrentLoan.Text = String.Format("{0:C}", pawnLoanAmount); interest_CurrentLoan.Text = String.Format("{0:C}", intFee); service_CurrentLoan.Text = String.Format("{0:C}", srvFee); fee_CurrentLoan.Text = String.Format("{0:C}", currLoanFee); pickupAmount_CurrentLoan.Text = String.Format("{0:C}", pawnLoan.PickupAmount); apr_CurrentLoan.Text = String.Format("{0}%", pawnLoan.InterestRate); dueDate_CurrentLoan.Text = pawnLoan.DueDate.ToShortDateString(); lastDatePickup_CurrentLoan.Text = pawnLoan.PfiEligible.ToShortDateString(); CalculateNewLoan(); }
public LoanFees(PawnLoan currentLoan, PawnLoan newLoan) { InitializeComponent(); pawnLoan = Utilities.CloneObject(currentLoan); newPawnLoan = Utilities.CloneObject(newLoan); //Check to make sure that the cloning worked and if it //did not set it to be the same as newLoan if (newPawnLoan.TicketNumber == 0) { newPawnLoan = newLoan; } feeTypes = new List <TupleType <FeeTypes, string, string> >(); }
private static void UpdatePawnLoanFee(PawnLoan pawnLoan, Fee fee) { var iDx = pawnLoan.Fees.FindIndex(l => l.FeeType == fee.FeeType); if (iDx < 0) { pawnLoan.Fees.Add(fee); } else { pawnLoan.Fees.RemoveAt(iDx); pawnLoan.Fees.Insert(iDx, fee); } }
private void CalculateNewLoan() { int Idx = GlobalDataAccessor.Instance.DesktopSession.ServiceLoans.FindIndex(pl => pl.TicketNumber == ticketNumber); if (Idx >= 0) { newPawnLoan = GlobalDataAccessor.Instance.DesktopSession.ServiceLoans[Idx]; } else { newPawnLoan = Utilities.CloneObject(pawnLoan); } decimal newLoanFee = (from ploan in newPawnLoan.Fees where ploan.FeeType != FeeTypes.INTEREST select ploan).Sum(s => s.Value); decimal intFee = (from ploan in newPawnLoan.Fees where ploan.FeeType == FeeTypes.INTEREST select ploan).Sum(s => s.Value); decimal srvFee = (from ploan in newPawnLoan.Fees where ploan.FeeType == FeeTypes.SERVICE select ploan).Sum(s => s.Value); decimal dPickupAmount = newPawnLoan.PickupAmount; // populate form fields if (new BusinessRulesProcedures(GlobalDataAccessor.Instance.DesktopSession).IsPartialPaymentAllowed(GlobalDataAccessor.Instance.DesktopSession.CurrentSiteId)) { currentPrincipal_NewLoan.Text = newPawnLoan.CurrentPrincipalAmount.ToString("c"); } else { currentPrincipal_NewLoan.Visible = false; currentPrincipalLabel.Visible = false; } amountFinanced_NewLoan.Text = String.Format("{0:C}", newPawnLoan.Amount); interest_NewLoan.Text = String.Format("{0:C}", intFee); service_NewLoan.Text = String.Format("{0:C}", srvFee); fee_NewLoan.Text = String.Format("{0:C}", newLoanFee); pickupAmount_NewLoan.Text = String.Format("{0:C}", dPickupAmount); apr_NewLoan.Text = String.Format("{0}%", Math.Round(newPawnLoan.InterestRate, 0)); dueDate_NewLoan.Text = newPawnLoan.DueDate.ToShortDateString(); lastDatePickup_NewLoan.Text = newPawnLoan.PfiEligible.ToShortDateString(); }
private void AddFee(PawnLoan loan, FeeTypes feeType, FeeStates state, decimal value, bool waived) { loan.OriginalFees.Add(new Fee { FeeType = feeType, CanBeProrated = false, CanBeWaived = false, FeeDate = DateTime.MinValue, FeeRef = 0, FeeRefType = FeeRefTypes.PAWN, FeeState = state, OriginalAmount = value, Prorated = false, Tag = string.Empty, Value = value, Waived = waived }); }
private void LoadData() { decimal totalPickupAmt = 0.0M; List <PawnLoan> pawnloanToView = GlobalDataAccessor.Instance.DesktopSession.PawnLoans; PawnLoan _pawnLoan = (from pawnloan in pawnloanToView where pawnloan.TicketNumber == _ticketNumber select pawnloan).First(); if (_pawnLoan != null) { labelLoanNumber.Text = _ticketNumber.ToString(); totalPickupAmt += _pawnLoan.Amount; labelLoanAmount.Text = string.Format("{0:C}", _pawnLoan.Amount); totalPickupAmt += _pawnLoan.InterestAmount; labelInterestAmount.Text = string.Format("{0:C}", _pawnLoan.InterestAmount); labelPickupAmount.Text = string.Format("{0:C}", totalPickupAmt); } }
private void waiveFeeChkBox_CheckedChanged(object sender, EventArgs e) { CheckBox selectedCheckBox = (CheckBox)sender; PawnLoan pl = pawnloansToView[currIndex]; string checkBoxName = selectedCheckBox.Name; Fee feedata; //get the fee from the pawnloan object int idx = pl.OriginalFees.FindIndex(loanfee => loanfee.FeeType.ToString() == checkBoxName); if (idx >= 0) { feedata = pl.OriginalFees[idx]; if (selectedCheckBox.Checked) { if (pl.TempStatus == StateStatus.PD) { if (!(checkPaydownAmount(pl.Amount, pl.OriginalFees, feedata.OriginalAmount, pl.PaydownAmount))) { MessageBox.Show(Commons.GetMessageString("RollOverWaiveFeeMessage")); return; } } feedata.Waived = true; feedata.Value = 0; pl.OriginalFees.RemoveAt(idx); pl.OriginalFees.Insert(idx, feedata); pl.PickupAmount -= feedata.OriginalAmount; } else { feedata.Waived = false; feedata.Value = feedata.OriginalAmount; pl.OriginalFees.RemoveAt(idx); pl.OriginalFees.Insert(idx, feedata); pl.PickupAmount += feedata.Value; } } pawnloansToView.RemoveAt(currIndex); pawnloansToView.Insert(currIndex, pl); customLabelTotalPickupAmt.Text = string.Format("{0:C}", pl.PickupAmount); }
public ProductHistory_Dialog(PawnLoan pawnLoan, int receiptIdx) { InitializeComponent(); //Does not need this. -- Removed by TLR 6/14/2010 //this.NavControlBox = new NavBox(); //this.NavControlBox.Owner = this; _PawnLoan = pawnLoan; if (_PawnLoan == null) { MessageBox.Show("Pass in a Pawn Loan to display page.", "Pawn Loan Validation", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { Setup(); } }
public Extension_Dialog(PawnLoan pawn, DataRow extensionData) { InitializeComponent(); //Does not need this. -- Removed by TLR 6/14/2010 //this.NavControlBox = new NavBox(); //this.NavControlBox.Owner = this; _PawnLoan = pawn; _Data = extensionData; if (_Data == null) { MessageBox.Show("Pass in a Pawn Loan to display page.", "Pawn Loan Validation", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { Setup(); } }
public void TestGetDaysAlreadyPaid_3() { PickupDate = new DateTime(2012, 3, 31); PawnLoan = new PawnLoan { DateMade = new DateTime(2011, 12, 31), DueDate = new DateTime(2012, 1, 31) }; PfiPickupCalculator = new PfiPickupCalculator(PawnLoan, TestSiteIds.Store00901, PickupDate); PawnLoan.PartialPayments.Add(new PartialPayment { Date_Made = new DateTime(2012, 3, 31) }); PfiPickupCalculator.DeterminePartialPaymentInfo(); Assert.AreEqual(0, PfiPickupCalculator.GetDaysAlreadyPaid()); Assert.AreEqual(2, PfiPickupCalculator.GetMonthsAlreadyPaid()); }
public void TestwithPartialPaymentBZ1494() { /**********************************************/ /*****SETUP OF LOAN****************************/ /*****NOT USING SAME LOAN AS OTHER TESTS*******/ /**********************************************/ PickupDate = new DateTime(2012, 3, 26); PawnLoan = new PawnLoan(); PawnLoan.InterestAmount = 14.48M; PawnLoan.ServiceCharge = 4M; PawnLoan.DateMade = new DateTime(2011, 10, 25); PawnLoan.DueDate = new DateTime(2012, 3, 25); PfiPickupCalculator = new PfiPickupCalculator(PawnLoan, TestSiteIds.Store00901, PickupDate); /**********************************************/ PawnLoan.CurrentPrincipalAmount = 289.5M; PawnLoan.PickupLateFinAmount = 30M; // not accurate values, but should sum correctly PawnLoan.PickupLateServAmount = 43.92M; // not accurate values, but should sum correctly AddFee(PawnLoan, FeeTypes.INTEREST, FeeStates.ASSESSED, 15M, false); AddFee(PawnLoan, FeeTypes.STORAGE, FeeStates.ASSESSED, 4M, false); AddFee(PawnLoan, FeeTypes.LATE, FeeStates.ASSESSED, 73.92M, false); PawnLoan.PartialPayments.Add(new PartialPayment { Date_Made = new DateTime(2011, 11, 9) }); Assert.AreEqual(0, PfiPickupCalculator.ApplicableFees.Count); PfiPickupCalculator.Calculate(); //WriteValues(); Assert.IsTrue(PfiPickupCalculator.HasPartialPayment); Assert.AreEqual(4, PfiPickupCalculator.MonthsToPay); Assert.AreEqual(15, PfiPickupCalculator.DaysToPay); Assert.AreEqual(3, PfiPickupCalculator.ApplicableFees.Count); Assert.AreEqual(372.66M, Math.Round(PfiPickupCalculator.PickupAmount, 2)); }
public void TestTicket115417_2() { /**********************************************/ /*****SETUP OF LOAN****************************/ /*****NOT USING SAME LOAN AS OTHER TESTS*******/ /**********************************************/ PickupDate = new DateTime(2012, 3, 29); PawnLoan = new PawnLoan(); PawnLoan.InterestAmount = 4M; PawnLoan.ServiceCharge = 4M; PawnLoan.DateMade = new DateTime(2011, 12, 31); PawnLoan.DueDate = new DateTime(2012, 1, 31); PfiPickupCalculator = new PfiPickupCalculator(PawnLoan, TestSiteIds.Store00901, PickupDate); /**********************************************/ PawnLoan.CurrentPrincipalAmount = 80M; PawnLoan.PickupLateFinAmount = 4M; PawnLoan.PickupLateServAmount = 4M; AddFee(PawnLoan, FeeTypes.INTEREST, FeeStates.ASSESSED, 4M, false); AddFee(PawnLoan, FeeTypes.STORAGE, FeeStates.ASSESSED, 4M, false); AddFee(PawnLoan, FeeTypes.LATE, FeeStates.ASSESSED, 0M, false); PawnLoan.PartialPayments.Add(new PartialPayment { Date_Made = new DateTime(2012, 2, 14) }); Assert.AreEqual(0, PfiPickupCalculator.ApplicableFees.Count); PfiPickupCalculator.Calculate(); //WriteValues(); Assert.IsTrue(PfiPickupCalculator.HasPartialPayment); Assert.AreEqual(0, PfiPickupCalculator.MonthsAlreadyPaid); Assert.AreEqual(14, PfiPickupCalculator.DaysAlreadyPaid); Assert.AreEqual(1, PfiPickupCalculator.ApplicableFees.Count); Assert.AreEqual(88M, Math.Round(PfiPickupCalculator.PickupAmount, 2)); }
private void LoadData() { decimal totalPickupAmt = 0.0M; List <PawnLoan> pawnloanToView = GlobalDataAccessor.Instance.DesktopSession.PawnLoans; PawnLoan pawnLoan = (from pawnloan in pawnloanToView where pawnloan.TicketNumber == _ticketNumber select pawnloan).First(); if (pawnLoan != null) { labelLoanNumber.Text = _ticketNumber.ToString(); totalPickupAmt += pawnLoan.Amount; labelLoanAmount.Text = string.Format("{0:C}", pawnLoan.Amount); totalPickupAmt += pawnLoan.InterestAmount; labelInterest.Text = string.Format("{0:C}", pawnLoan.InterestAmount); var feeData = (from pawnloanFee in pawnLoan.Fees where pawnloanFee.FeeType == FeeTypes.LATE select pawnloanFee).First(); labelLateFees.Text = string.Format("{0:C}", feeData.Value); totalPickupAmt += feeData.Value; if (pawnLoan.LostTicketInfo != null) { decimal lostTicketFeeAmt = pawnLoan.LostTicketInfo.LostTicketFee; labelLostTicketFeeAmount.Text = string.Format("{0:C}", lostTicketFeeAmt); labelLostTktFeeHeading.Visible = true; labelLostTicketFeeAmount.Visible = true; totalPickupAmt += lostTicketFeeAmt; } else { labelLostTktFeeHeading.Visible = false; labelLostTicketFeeAmount.Visible = false; } labelPickupAmount.Text = string.Format("{0:C}", totalPickupAmt); } }
public static bool ComputeDescription(PawnLoan pLoan, out string desc) { desc = string.Empty; if (pLoan == null || pLoan.Items == null || pLoan.Items.Count <= 0) { if (FileLogger.Instance.IsLogError) { FileLogger.Instance.logMessage(LogLevel.ERROR, "LoanTicketLengthCalculator", "Cannot compute loan description - invalid method inputs"); } return(false); } //Generate place holder gun numbers for pre-process tender line length computation var gunNumberIndices = new List <PairType <int, long> >(); for (int i = 0; i < pLoan.Items.Count; ++i) { Item p = pLoan.Items[i]; if (p == null) { continue; } gunNumberIndices.Add(new PairType <int, long>(-1, -1L)); if (!p.IsGun) { continue; } gunNumberIndices.Last().Left = i; //No valid gun number yet, use place holder gunNumberIndices.Last().Right = GUN_NUM_HOLD; } return(ComputeDescription(pLoan, gunNumberIndices, out desc)); }
private void waiveFeeRadButton_CheckedChanged(object sender, EventArgs e) { RadioButton selectedButton = (RadioButton)sender; PawnLoan pl = pawnloansToView[currIndex]; string radioButtonName = selectedButton.Name; Fee feedata; //get the fee from the pawnloan object int idx = pl.OriginalFees.FindIndex(loanfee => loanfee.FeeType.ToString() == radioButtonName); if (idx >= 0) { feedata = pl.Fees[idx]; if (selectedButton.Checked) { feedata.Waived = true; feedata.Value = 0; pl.OriginalFees.RemoveAt(idx); pl.OriginalFees.Insert(idx, feedata); pl.PickupAmount -= feedata.Value; } else { feedata.Waived = false; feedata.Value = feedata.OriginalAmount; pl.OriginalFees.RemoveAt(idx); pl.OriginalFees.Insert(idx, feedata); pl.PickupAmount += feedata.Value; } } pawnloansToView.RemoveAt(currIndex); pawnloansToView.Insert(currIndex, pl); customLabelTotalPickupAmt.Text = string.Format("{0:C}", pl.PickupAmount); }
//protected ReceiptEventTypes _eventType; public LoanDetailsBasePanel(PawnLoan pawnLoan, int receiptIdx) : this() { _pawnLoan = pawnLoan; _receiptIdx = receiptIdx; }
private void LookupTicketResults_Load(object sender, EventArgs e) { _ownerfrm = Owner; NavControlBox.Owner = this; //Show customer data using the customer object stored in session CustomerVO custdata = GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer; if (custdata != null) { customDataGridViewTicketResults.Rows.Add(1); customDataGridViewTicketResults.Rows[0].Cells["custlastname"].Value = custdata.LastName; customDataGridViewTicketResults.Rows[0].Cells["custfirstname"].Value = custdata.FirstName; customDataGridViewTicketResults.Rows[0].Cells["dob"].Value = custdata.DateOfBirth.FormatDate(); AddressVO custAddr = custdata.getHomeAddress(); if (custAddr != null) { customDataGridViewTicketResults.Rows[0].Cells["address"].Value = custAddr.Address1 + " " + custAddr.UnitNum + " " + custAddr.City + "," + custAddr.State_Code + " " + custAddr.ZipCode; } IdentificationVO currentId = custdata.getIdentity(0); if (GlobalDataAccessor.Instance.DesktopSession.TicketTypeLookedUp == ProductType.LAYAWAY) { customDataGridViewTicketResults.Rows[0].Cells["IDData"].Value = currentId.IdType + "-" + currentId.IdIssuer + "-" + currentId.IdValue; //Get the layaway from session to get the ticket number List <LayawayVO> layaway = GlobalDataAccessor.Instance.DesktopSession.Layaways; var tktNumber = string.Empty; if (layaway != null) { LayawayVO layawayObj = layaway.First(); if (layawayObj != null) { tktNumber = layawayObj.TicketNumber.ToString(); } } tktNumberLabel.Text = tktNumber; } else { //Get ID data from the pawn app object List <PawnAppVO> pawnApplications = GlobalDataAccessor.Instance.DesktopSession.PawnApplications; long pawnAppId; try { pawnAppId = Convert.ToInt64(GlobalDataAccessor.Instance.DesktopSession.CurPawnAppId); } catch (Exception) { pawnAppId = 0; } if (pawnAppId != 0 && pawnApplications != null) { PawnAppVO pawnApplication = pawnApplications.First (papp => papp.PawnAppID == pawnAppId); if (pawnApplication != null) { customDataGridViewTicketResults.Rows[0].Cells["IDData"].Value = pawnApplication.PawnAppCustIDType + "-" + pawnApplication.PawnAppCustIDIssuer + "-" + pawnApplication.PawnAppCustIDNumber; } //Get the pawn loan from session to get the ticket number //Only 1 pawn loan for this application id List <PawnLoan> pawnLoans = GlobalDataAccessor.Instance.DesktopSession.PawnLoans; var tktNumber = string.Empty; if (pawnLoans != null) { PawnLoan pawnLoanObj = pawnLoans.First (ploan => ploan.PawnAppId == pawnAppId.ToString()); if (pawnLoanObj != null) { tktNumber = pawnLoanObj.TicketNumber.ToString(); } } tktNumberLabel.Text = tktNumber; } else { BasicExceptionHandler.Instance.AddException("Pawn Application Data is not found in Lookup Ticket Results ", new ApplicationException()); NavControlBox.Action = NavBox.NavAction.CANCEL; } } } else { BasicExceptionHandler.Instance.AddException("Customer object is missing in session ", new ApplicationException()); //NavControlBox.Action = NavBox.NavAction.CANCEL; } }
//public LoanChargesPanel() //{ // InitializeComponent(); //} public LoanChargesPanel(PawnLoan pawnLoan, int receiptIdx) : base(pawnLoan, receiptIdx) { InitializeComponent(); Setup(); }
//------- public static PawnLoan GetCurrentLoanFees(SiteId siteId, PawnLoan pawnLoan, out UnderwritePawnLoanVO underwritePawnLoanVO) { decimal currentValue; PawnLoan _PawnLoan = Utilities.CloneObject(pawnLoan); // call UnderWrite Pawn Loan var upw = new UnderwritePawnLoanUtility(GlobalDataAccessor.Instance.DesktopSession); upw.RunUWP(siteId); underwritePawnLoanVO = upw.PawnLoanVO; // CL_PWN_0013_MININTAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0013_MININTAMT", out currentValue); Fee fee = new Fee { FeeType = FeeTypes.MINIMUM_INTEREST, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0018_SETUPFEEAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0018_SETUPFEEAMT", out currentValue); fee = new Fee { FeeType = FeeTypes.SETUP, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0022_CITYFEEAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0022_CITYFEEAMT", out currentValue); fee = new Fee { FeeType = FeeTypes.CITY, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0026_FIREARMFEEAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0026_FIREARMFEEAMT", out currentValue); fee = new Fee { FeeType = FeeTypes.FIREARM, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0040_PFIMAILFEE underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0040_PFIMAILFEE", out currentValue); fee = new Fee { FeeType = FeeTypes.MAILER_CHARGE, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0101_LOANFEEAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0101_LOANFEEAMT", out currentValue); fee = new Fee { FeeType = FeeTypes.LOAN, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0103_ORIGINFEEAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0103_ORIGINFEEAMT", out currentValue); fee = new Fee { FeeType = FeeTypes.ORIGIN, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0104_ADMINFEEAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0104_ADMINFEEAMT", out currentValue); fee = new Fee { FeeType = FeeTypes.ADMINISTRATIVE, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0105_INITCHGFEEAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0105_INITCHGFEEAMT", out currentValue); fee = new Fee { FeeType = FeeTypes.INITIAL, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0106_PROCFEEAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0106_PROCFEEAMT", out currentValue); fee = new Fee { FeeType = FeeTypes.PROCESS, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0115_PPCITYFEEAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0115_PPCITYFEEAMT", out currentValue); fee = new Fee { FeeType = FeeTypes.PREPAID_CITY, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0030_STRGFEE underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0030_STRGFEE", out currentValue); fee = new Fee { FeeType = FeeTypes.STORAGE, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0033_MAXSTRGFEE underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0033_MAXSTRGFEE", out currentValue); fee = new Fee { FeeType = FeeTypes.STORAGE_MAXIMUM, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0037_TICKETFEE underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0037_TICKETFEE", out currentValue); fee = new Fee { FeeType = FeeTypes.TICKET, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); // CL_PWN_0102_PREPFEEAMT underwritePawnLoanVO.feeDictionary.TryGetValue("CL_PWN_0102_PREPFEEAMT", out currentValue); fee = new Fee { FeeType = FeeTypes.PREPARATION, Value = currentValue }; UpdatePawnLoanFee(_PawnLoan, fee); BusinessRuleVO businessRule = GlobalDataAccessor.Instance.DesktopSession.PawnBusinessRuleVO["PWN_BR-054"]; var sComponentValue = string.Empty; if (sComponentValue.Equals("ROUNDED")) { businessRule.getComponentValue("CL_PWN_0021_APRCALCTODEC", ref sComponentValue); underwritePawnLoanVO.APR = Math.Round(underwritePawnLoanVO.APR, Convert.ToInt32(sComponentValue)); } else { businessRule.getComponentValue("CL_PWN_0025_APRCALCRNDFAC", ref sComponentValue); } return(_PawnLoan); }
//public LoanStatusInfoPanel() //{ // InitializeComponent(); //} public LoanStatusInfoPanel(PawnLoan pawnLoan, int receiptIdx) : base(pawnLoan, receiptIdx) { InitializeComponent(); }