コード例 #1
0
    public decimal GetDueFrom(Person person)
    {
        decimal due = 0;

        AmountDue.TryGetValue(person.Id, out due);
        return(due);
    }
コード例 #2
0
            public XElement GenerateModRq(bool?ClearExpenseLines = null)
            {
                XElement xElement = new XElement(nameof(Bill) + "Mod");

                xElement.Add(TxnID?.ToQBXML(nameof(TxnID)));
                xElement.Add(TimeCreated?.ToQBXML(nameof(TimeCreated)));
                xElement.Add(TimeModified?.ToQBXML(nameof(TimeModified)));
                xElement.Add(EditSequence?.ToQBXML(nameof(EditSequence)));
                xElement.Add(TxnNumber?.ToQBXML(nameof(TxnNumber)));
                xElement.Add(VendorRef?.ToQBXML(nameof(VendorRef)));
                xElement.Add(VendorAddress?.ToQBXML(nameof(VendorAddress)));
                xElement.Add(APAccountRef?.ToQBXML(nameof(APAccountRef)));
                xElement.Add(TxnDate?.ToQBXML(nameof(TxnDate)));
                xElement.Add(DueDate?.ToQBXML(nameof(DueDate)));
                xElement.Add(AmountDue?.ToQBXML(nameof(AmountDue)));
                xElement.Add(CurrencyRef?.ToQBXML(nameof(CurrencyRef)));
                xElement.Add(ExchangeRate?.ToQBXML(nameof(ExchangeRate)));
                xElement.Add(AmountDueInHomeCurrency?.ToQBXML(nameof(AmountDueInHomeCurrency)));
                xElement.Add(RefNumber?.ToQBXML(nameof(RefNumber)));
                xElement.Add(TermsRef?.ToQBXML(nameof(TermsRef)));
                xElement.Add(Memo?.ToQBXML(nameof(Memo)));
                xElement.Add(IsTaxIncluded?.ToQBXML(nameof(IsTaxIncluded)));
                xElement.Add(SalesTaxCodeRef?.ToQBXML(nameof(SalesTaxCodeRef)));
                xElement.Add(IsPaid?.ToQBXML(nameof(IsPaid)));
                xElement.Add(ExternalGUID?.ToQBXML(nameof(ExternalGUID)));
                xElement.Add(LinkedTxnList?.ToQBXML(nameof(LinkedTxnList)));
                xElement.Add(ExpenseLineList?.ToQBXML(nameof(ExpenseLineList)));
                xElement.Add(ItemLineList?.ToQBXML(nameof(ItemLineList)));
                xElement.Add(OpenAmount?.ToQBXML(nameof(OpenAmount)));
                xElement.Add(DataExtList?.ToQBXML(nameof(DataExtList)));

                return(xElement);
            }
コード例 #3
0
 /// <summary>
 /// Creator: Robert Holmes
 /// Created: 04/20/2020
 /// Approver: Jaeho Kim
 ///
 /// Constructor that utilizes AmountDue to persist data between windows.
 /// </summary>
 /// <remarks>
 /// Updater:
 /// Updated:
 /// Update:
 ///
 /// </remarks>
 /// <param name="due"></param>
 /// <param name="transaction"></param>
 public frmCardEntry(AmountDue due, Transaction transaction)
 {
     InitializeComponent();
     lblChargeAmount.Content = "Amount Due: " + due.Amount.ToString("C");
     _due         = due;
     _transaction = transaction;
 }
コード例 #4
0
        /// <summary>
        /// Creator: Robert Holmes
        /// Created: 04/20/2020
        /// Approver: Jaeho Kim
        ///
        /// Handles payment recieved from customer.
        /// </summary>
        /// <remarks>
        /// Updater:
        /// Updated:
        /// Update:
        ///
        /// </remarks>
        /// <param name="transaction"></param>
        /// <returns></returns>
        private bool collectPayment(Transaction transaction)
        {
            bool        result      = false;
            PaymentType paymentType = PaymentType.Cancel;
            var         due         = new AmountDue(transaction.Total);

            while (due.Amount != 0)
            {
                var frmPayment = new frmPayment(paymentType, due);
                frmPayment.ShowDialog();
                paymentType = frmPayment.PaymentType;
                if (paymentType == PaymentType.Card)
                {
                    var frmCardEntry = new frmCardEntry(due, transaction);
                    frmCardEntry.ShowDialog();
                    result = true;
                }
                else if (paymentType == PaymentType.Cash)
                {
                    var frmCashEntry = new frmCashEntry(due);
                    frmCashEntry.ShowDialog();
                    result = true;
                }
                else
                {
                    result = false;
                    break;
                }
            }
            return(result);
        }
コード例 #5
0
 /// <summary>
 /// Creator: Robert Holmes
 /// Created: 04/20/2020
 /// Approver: Jaeho Kim
 ///
 /// Constructor that utilizes AmountDue to persist data between windows.
 /// </summary>
 /// <remarks>
 /// Updater:
 /// Updated:
 /// Update:
 ///
 /// </remarks>
 /// <param name="due"></param>
 public frmCashEntry(AmountDue due)
 {
     InitializeComponent();
     _rawRecieved     = 0;
     _due             = due;
     _total           = due.Amount;
     lblTotal.Content = _total.ToString("C");
 }
コード例 #6
0
        public override int GetHashCode()
        {
            var hashCode = -272501761;

            hashCode = hashCode * -1521134295 + InstallmentNumber.GetHashCode();
            hashCode = hashCode * -1521134295 + AmountDue.GetHashCode();
            hashCode = hashCode * -1521134295 + Principal.GetHashCode();
            hashCode = hashCode * -1521134295 + Interest.GetHashCode();
            return(hashCode);
        }
コード例 #7
0
 /// <summary>
 /// Handles the Click event of the btnCancel control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 protected void btnCancel_Click(object sender, EventArgs e)
 {
     base.Session.Remove("paymentInformation");
     btnFinish.Enabled             = false;
     this.labelAmountDue.InnerText = AmountDue.ToString();
     lblChange.InnerText           = lblPaid.InnerText = textTenderedAmount.Text = "";
     textAmountToPay.Text          = AmountDue.ToString();
     textReferenceNo.Text          = "";
     ddlPaymentMode.SelectedIndex  = -1;
     this.Init_page();
 }
コード例 #8
0
 /// <summary>
 /// Clears this instance.
 /// </summary>
 /// <exception cref="System.NotImplementedException"></exception>
 public void Clear()
 {
     base.Session.Remove("paymentInformation");
     btnFinish.Enabled             = false;
     this.labelAmountDue.InnerText = AmountDue.ToString();
     lblChange.InnerText           = lblPaid.InnerText = "";
     lblAmountToPay.Text           = textAmountToPay.Text = AmountDue.ToString();
     textReferenceNo.Text          = "";
     panelCompute.Visible          = true;
     panelFinish.Visible           = false;
     base.Session.Remove("ItemsToPay");
 }
コード例 #9
0
 public void AddDueFrom(Person otherParty, decimal amount)
 {
     if (otherParty.Id == this.Id)
     {
     }
     else if (AmountDue.ContainsKey(otherParty.Id))
     {
         AmountDue[otherParty.Id] += amount;
     }
     else
     {
         AmountDue.Add(otherParty.Id, amount);
     }
 }
コード例 #10
0
 /// <summary>
 /// Clears the controls.
 /// </summary>
 public void Clear()
 {
     base.Session.Remove("paymentInformation");
     btnFinish.Enabled             = false;
     this.labelAmountDue.InnerText = AmountDue.ToString();
     lblChange.InnerText           = lblPaid.InnerText = "";
     //lblAmountToPay.Text = textAmountToPay.Text = AmountDue.ToString();
     lblAmountToPay.Text  = textAmountToPay.Text = NetAmountToPay.ToString();
     textReferenceNo.Text = "";
     //ddlPaymentMode.SelectedIndex = -1;
     textTenderedAmount.Text     = "0.0";
     panelCompute.Visible        = true;
     panelDeposit.Visible        = false;
     panelTenderedAmount.Visible = true;
     panelFinish.Visible         = false;
     base.Session.Remove("ItemsToPay");
 }
コード例 #11
0
ファイル: ReSub.cs プロジェクト: EmadHussien/Shahid
        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {
            theDate = dateTimePicker1.Value.ToShortDateString();
            DateTime dt1 = DateTime.Parse(theDate);

            if (Sub == "Annually")
            {
                theDate = dt1.AddDays(365).ToShortDateString();
            }

            else if (Sub == "Monthly")
            {
                theDate = dt1.AddDays(30).ToShortDateString();
            }
            else if (Sub == "Weekly")
            {
                theDate = dt1.AddDays(7).ToShortDateString();
            }

            textBox5.Text = theDate;
            textBox1.Text = AmountDue.ToString();
        }
コード例 #12
0
        /// <summary>
        /// Gets the checked items total.
        /// </summary>
        void GetCheckedItemsTotal()
        {
            decimal _total        = 0;
            int     selectedCount = 0;

            foreach (GridViewRow gridRow in this.grdPayItems.Rows)
            {
                if (gridRow.RowType == DataControlRowType.DataRow)
                {
                    CheckBox chk = gridRow.FindControl("chkBxItem") as CheckBox;

                    if (chk != null && chk.Checked)
                    {
                        decimal amount = decimal.Parse(grdPayItems.DataKeys[gridRow.RowIndex].Values["amount"].ToString());
                        _total        += amount;
                        selectedCount += 1;
                    }
                }
            }
            buttonCompute.Enabled = selectedCount > 0;
            if (selectedCount > 0)
            {
                labelAmountDue.InnerText   = textAmountToPay.Text = _total.ToString();
                rgAmountToPay.MaximumValue = _total.ToString();
            }
            else
            {
                labelAmountDue.InnerText   = textAmountToPay.Text = AmountDue.ToString();
                rgAmountToPay.MaximumValue = AmountDue.ToString();
            }
            CheckBox chkHeader = grdPayItems.HeaderRow.FindControl("chkBxHeader") as CheckBox;

            if (chkHeader != null)
            {
                chkHeader.Checked = selectedCount == grdPayItems.Rows.Count;
            }
        }
コード例 #13
0
        // To calaculate the whole amount
        private void claculateButton_Click(object sender, EventArgs e)
        {
            Double BasePrice = Convert.ToDouble(textBox1.Text);
            Double SubTotal, Total, Allownace, AmountDue;
            Double AdditionalOptions = 0;

            if (checkBox1.Checked == true)
            {
                AdditionalOptions = AdditionalOptions + 425.76;
            }
            if (checkBox2.Checked == true)
            {
                AdditionalOptions = AdditionalOptions + 987.41;
            }
            if (checkBox3.Checked == true)
            {
                AdditionalOptions = AdditionalOptions + 1741.23;
            }
            if (radioButton2.Checked == true)
            {
                AdditionalOptions = AdditionalOptions + 345.72;
            }
            if (radioButton3.Checked == true)
            {
                AdditionalOptions = AdditionalOptions + 599.99;
            }
            textBox2.Text = AdditionalOptions.ToString();
            SubTotal      = AdditionalOptions + BasePrice;
            textBox3.Text = SubTotal.ToString();
            textBox4.Text = CalTax(SubTotal).ToString();
            Total         = CalTax(SubTotal) + SubTotal;
            textBox5.Text = Total.ToString();
            Allownace     = Convert.ToDouble(textBox6.Text);
            AmountDue     = Total - Allownace;
            textBox7.Text = AmountDue.ToString();
        }
コード例 #14
0
ファイル: OverdueInvoice.cs プロジェクト: DevBveasey/Code
 // ----- Overrided ToString -----
 // returns a string that is dispalyed to the user
 public override string ToString()
 {
     return("From: " + CompanyName + "\n      Amount Due: " + AmountDue.ToString("c") + "\n      Days Overdue: " + DaysOverdue);
 }
コード例 #15
0
        void ReleaseDesignerOutlets()
        {
            if (AmountDue != null)
            {
                AmountDue.Dispose();
                AmountDue = null;
            }

            if (btnAddNewCard != null)
            {
                btnAddNewCard.Dispose();
                btnAddNewCard = null;
            }

            if (btnRetry != null)
            {
                btnRetry.Dispose();
                btnRetry = null;
            }

            if (DateOfTransaction != null)
            {
                DateOfTransaction.Dispose();
                DateOfTransaction = null;
            }

            if (IbsOrder != null)
            {
                IbsOrder.Dispose();
                IbsOrder = null;
            }

            if (lblAmountDue != null)
            {
                lblAmountDue.Dispose();
                lblAmountDue = null;
            }

            if (lblDate != null)
            {
                lblDate.Dispose();
                lblDate = null;
            }

            if (lblInstructions != null)
            {
                lblInstructions.Dispose();
                lblInstructions = null;
            }

            if (lblOrderId != null)
            {
                lblOrderId.Dispose();
                lblOrderId = null;
            }

            if (lblTransactionId != null)
            {
                lblTransactionId.Dispose();
                lblTransactionId = null;
            }

            if (TransactionId != null)
            {
                TransactionId.Dispose();
                TransactionId = null;
            }

            if (lblSelectedCreditCard != null)
            {
                lblSelectedCreditCard.Dispose();
                lblSelectedCreditCard = null;
            }

            if (lblNoCreditCard != null)
            {
                lblNoCreditCard.Dispose();
                lblNoCreditCard = null;
            }

            if (lblCompany != null)
            {
                lblCompany.Dispose();
                lblCompany = null;
            }

            if (Company != null)
            {
                Company.Dispose();
                Company = null;
            }

            if (lblLast4 != null)
            {
                lblLast4.Dispose();
                lblLast4 = null;
            }

            if (Last4 != null)
            {
                Last4.Dispose();
                Last4 = null;
            }
        }
コード例 #16
0
 /// <summary>
 /// Creator: Robert Holmes
 /// Created: 04/20/2020
 /// Approver: Jaeho Kim
 ///
 /// Initializes a window with the amount due and payment type (defaults to Cancel).
 /// </summary>
 /// <remarks>
 /// Updater:
 /// Updated:
 /// Update:
 ///
 /// </remarks>
 /// <param name="paymentType"></param>
 /// <param name="due"></param>
 public frmPayment(PaymentType paymentType, AmountDue due)
 {
     InitializeComponent();
     this.PaymentType     = paymentType;
     lblRemaining.Content = "Amount Remaining: " + due.Amount.ToString("C");
 }