Exemple #1
0
        /// <summary>
        /// Call this to change the accounts being shown in the accounts combobox (used when changing the Recurring Gift type)
        /// </summary>
        /// <param name="AActiveOnly"></param>
        /// <param name="ABankAccountOnly"></param>
        /// <param name="ALblBankAccountCode"></param>
        /// <param name="ARow"></param>
        public void SetupAccountCombo(bool AActiveOnly,
                                      bool ABankAccountOnly,
                                      ref System.Windows.Forms.Label ALblBankAccountCode,
                                      ARecurringGiftBatchRow ARow)
        {
            FCmbBankAccountCode.Clear();
            TFinanceControls.InitialiseAccountList(ref FCmbBankAccountCode,
                                                   FLedgerNumber,
                                                   true,
                                                   false,
                                                   AActiveOnly,
                                                   ABankAccountOnly,
                                                   true,
                                                   FAccountTable);

            if (ABankAccountOnly)
            {
                ALblBankAccountCode.Text = Catalog.GetString("Bank Account:");
            }
            else
            {
                ALblBankAccountCode.Text = Catalog.GetString("Account Code:");
            }

            if (ARow != null)
            {
                FCmbBankAccountCode.SetSelectedString(ARow.BankAccountCode, -1);
            }
        }
Exemple #2
0
        void LateInitialise(object sender, System.EventArgs e)
        {
            if (((RadioButton)sender).Checked)
            {
                if ((sender == rbtAccountRange) && (cmbFromAccountCode.Count == 0))
                {
                    TFinanceControls.InitialiseAccountList(ref cmbFromAccountCode, FLedgerNumber, true, false, false, false);
                    TFinanceControls.InitialiseAccountList(ref cmbToAccountCode, FLedgerNumber, true, false, false, false);
                    cmbFromAccountCode.SelectedIndex = 1;
                    cmbToAccountCode.SelectedIndex   = cmbToAccountCode.Count - 1;
                }

                if ((sender == rbtAccountFromList) && (clbAccountCodes.Rows.Count == 1))
                {
                    TFinanceControls.InitialiseAccountList(ref clbAccountCodes, FLedgerNumber, true, false, false, false);
                    clbAccountCodes.SetCheckedStringList("");
                }

                if ((sender == rbtCostCentreRange) && (cmbFromCostCentre.Count == 0))
                {
                    TFinanceControls.InitialiseCostCentreList(ref cmbFromCostCentre, FLedgerNumber, true, false, false, false);
                    TFinanceControls.InitialiseCostCentreList(ref cmbToCostCentre, FLedgerNumber, true, false, false, false);
                    cmbFromCostCentre.SelectedIndex = 1;
                    cmbToCostCentre.SelectedIndex   = cmbToCostCentre.Count - 1;
                }

                if ((sender == rbtCostCentreFromList) && (clbCostCentres.Rows.Count == 1))
                {
                    TFinanceControls.InitialiseCostCentreList(ref cmbSummaryCostCentres, FLedgerNumber, false, true, false, false);
                    TFinanceControls.InitialiseCostCentreList(ref clbCostCentres, FLedgerNumber, true, false, false, false);
                    clbCostCentres.SetCheckedStringList("");
                }
            }
        }
        private void ShowDataManual()
        {
            TFinanceControls.InitialiseAccountList(ref cmbBankAccount, FMainDS.AApDocument[0].LedgerNumber, true, false, true, true, "");

//          grdDocuments.AddTextColumn("AP No", FMainDS.AApDocumentPayment.ColumnApNumber, 50);
            grdDocuments.AddTextColumn("Invoice No", FMainDS.AApDocumentPayment.ColumnDocumentCode, 180);
            grdDocuments.AddTextColumn("Type", FMainDS.AApDocumentPayment.ColumnDocType, 80);
//          grdDocuments.AddTextColumn("Discount used", FMainDS.AApDocumentPayment.ColumnUseDiscount, 80);
            grdDocuments.AddCurrencyColumn("Amount", FMainDS.AApDocumentPayment.ColumnAmount);
//          grdDocuments.AddTextColumn("Currency", FMainDS.AApPayment.ColumnCurrencyCode, 50);
            grdDocuments.Columns[2].Width = 120;
            grdDocuments.Columns.StretchToFit();

            grdPayments.AddTextColumn("Supplier", FMainDS.AApPayment.ColumnListLabel);

            FMainDS.AApDocumentPayment.DefaultView.AllowNew  = false;
            FMainDS.AApDocumentPayment.DefaultView.AllowEdit = false;
            FMainDS.AApPayment.DefaultView.AllowNew          = false;
            grdPayments.DataSource = new DevAge.ComponentModel.BoundDataView(FMainDS.AApPayment.DefaultView);
            grdPayments.Refresh();
            grdPayments.Selection.SelectRow(1, true);
            FocusedRowChanged(null, null);

            // If this payment has a payment number, it's because it's already been paid, so I need to display it read-only.
            if ((FMainDS.AApPayment.Rows.Count > 0) && (FMainDS.AApPayment[0].PaymentNumber > 0))
            {
                txtPaymntNum.Text                  = FMainDS.AApPayment[0].PaymentNumber.ToString();
                txtAmountToPay.Enabled             = false;
                txtChequeNumber.Enabled            = false;
                txtCurrency.Enabled                = false;
                txtExchangeRate.Enabled            = false;
                btnLookupExchangeRate.Enabled      = false;
                txtExchangeRate.NumberValueDecimal = FMainDS.AApPayment[0].ExchangeRateToBase;

                txtReference.Enabled   = false;
                txtTotalAmount.Enabled = false;
                cmbBankAccount.Enabled = false;
                cmbPaymentType.Enabled = false;

                grdDocuments.Enabled = false;
                grdPayments.Enabled  = false;

                tbbMakePayment.Enabled = false;

                rgrAmountToPay.Enabled     = false;
                tbbPrintReport.Enabled     = true;
                chkPrintRemittance.Enabled = true;
                chkClaimDiscount.Enabled   = false;
                chkPrintCheque.Enabled     = false;
                chkPrintLabel.Enabled      = false;
            }
            else
            {
                tbbPrintReport.Enabled = false;
            }
        }
Exemple #4
0
        /// <summary>
        /// Call this to do initial set up the Bank account and cost centre combo boxes
        /// </summary>
        /// <param name="AActiveOnly"></param>
        /// <param name="ARow"></param>
        public void SetupAccountAndCostCentreCombos(bool AActiveOnly, ARecurringGiftBatchRow ARow)
        {
            FCmbCostCentreCode.Clear();
            FCmbBankAccountCode.Clear();
            TFinanceControls.InitialiseAccountList(ref FCmbBankAccountCode, FLedgerNumber, true, false, AActiveOnly, true, true, FAccountTable);
            TFinanceControls.InitialiseCostCentreList(ref FCmbCostCentreCode, FLedgerNumber, true, false, AActiveOnly, true, true, FCostCentreTable);

            if (ARow != null)
            {
                FCmbCostCentreCode.SetSelectedString(ARow.BankCostCentre, -1);
                FCmbBankAccountCode.SetSelectedString(ARow.BankAccountCode, -1);
            }
        }
        private void SetupComboboxes()
        {
            if (FLedgerNumber != -1)
            {
                FPetraUtilsObject.SuppressChangeDetection = true;

                // populate combo boxes
                TFinanceControls.InitialiseCostCentreList(ref cmbFromCostCentreCode, FLedgerNumber, true, false, true, false);
                TFinanceControls.InitialiseAccountList(ref cmbFromAccountCode, FLedgerNumber,
                                                       true, false, true, false, FJournal.TransactionCurrency, true);
                TFinanceControls.InitialiseCostCentreList(ref cmbDetailCostCentreCode, FLedgerNumber, true, false, true, false);
                TFinanceControls.InitialiseAccountList(ref cmbDetailAccountCode, FLedgerNumber,
                                                       true, false, true, false, FJournal.TransactionCurrency, true);
            }
        }
Exemple #6
0
        private void SetupAccountAndCostCentreCombos(bool AActiveOnly = true, ARecurringGiftBatchRow ARow = null)
        {
            if (!FBatchLoaded || (FActiveOnly != AActiveOnly))
            {
                FActiveOnly = AActiveOnly;

                cmbDetailBankCostCentre.Clear();
                cmbDetailBankAccountCode.Clear();
                TFinanceControls.InitialiseAccountList(ref cmbDetailBankAccountCode, FLedgerNumber, true, false, AActiveOnly, true, true);
                TFinanceControls.InitialiseCostCentreList(ref cmbDetailBankCostCentre, FLedgerNumber, true, false, AActiveOnly, true, true);

                if (ARow != null)
                {
                    cmbDetailBankCostCentre.SetSelectedString(ARow.BankCostCentre, -1);
                    cmbDetailBankAccountCode.SetSelectedString(ARow.BankAccountCode, -1);
                }
            }
        }
        // populate the comboboxes
        private void SetupComboboxes()
        {
            TFinanceControls.InitialiseCostCentreList(ref cmbCostCentre, FLedgerNumber, true, false, false, false);
            cmbCostCentre.ColumnWidthCol2             = 300;
            cmbCostCentre.AttachedLabel.Width         = 280;
            cmbCostCentre.cmbCombobox.AllowBlankValue = true;

            TFinanceControls.InitialiseAccountList(ref cmbAccount, FLedgerNumber,
                                                   true, false, false, false, FCurrency, true);
            cmbAccount.ColumnWidthCol2             = 300;
            cmbAccount.AttachedLabel.Width         = 280;
            cmbAccount.cmbCombobox.AllowBlankValue = true;

            cmbStatus.AddStringItem(Catalog.GetString("All"));
            cmbStatus.AddStringItem(MFinanceConstants.BATCH_POSTED);
            cmbStatus.AddStringItem(MFinanceConstants.BATCH_UNPOSTED);
            cmbStatus.SelectedIndex = 0;
        }
Exemple #8
0
        /// <summary>
        /// Gift Type radiobutton selection changed
        /// </summary>
        private void GiftTypeChanged(Object sender, EventArgs e)
        {
            bool BankAccountOnly = true;

            // show all accounts for 'Gift In Kind' and 'Other'
            if (rbtGiftInKind.Checked || rbtOther.Checked)
            {
                BankAccountOnly = false;
            }

            if (BankAccountOnly != FBankAccountOnly)
            {
                cmbDetailBankAccountCode.Clear();
                TFinanceControls.InitialiseAccountList(ref cmbDetailBankAccountCode,
                                                       FLedgerNumber,
                                                       true,
                                                       false,
                                                       FActiveOnly,
                                                       BankAccountOnly,
                                                       true,
                                                       FAccountTable);

                if (BankAccountOnly)
                {
                    lblDetailBankAccountCode.Text = Catalog.GetString("Bank Account:");
                }
                else
                {
                    lblDetailBankAccountCode.Text = Catalog.GetString("Account Code:");
                }

                FBankAccountOnly = BankAccountOnly;

                if (FPreviouslySelectedDetailRow != null)
                {
                    cmbDetailBankAccountCode.SetSelectedString(FPreviouslySelectedDetailRow.BankAccountCode, -1);
                }
            }
        }
        /// initialise some comboboxes
        private void BeforeShowDetailsManual(AApDocumentDetailRow ARow)
        {
            if (ARow == null)
            {
                return;
            }

            grdDetails.Columns[1].Width = pnlDetailGrid.Width - 380;   // It doesn't really work having these here -
            grdDetails.Columns[0].Width = 90;                          // there's something else that overrides these settings.
            grdDetails.Columns[2].Width = 200;
            grdDetails.Columns[3].Width = 90;

            // if this document was already posted, then we need all account and cost centre codes, because old codes might have been used
            bool ActiveOnly = ("|POSTED|PARTPAID|PAID|".IndexOf("|" + FMainDS.AApDocument[0].DocumentStatus) < 0);

            FPetraUtilsObject.SuppressChangeDetection = true;
            TFinanceControls.InitialiseAccountList(ref cmbDetailAccountCode, ARow.LedgerNumber, true, false, ActiveOnly, false);
            TFinanceControls.InitialiseCostCentreList(ref cmbDetailCostCentreCode, ARow.LedgerNumber, true, false, ActiveOnly, false);
            FPetraUtilsObject.SuppressChangeDetection = false;
            EnableControls();

            Decimal ExchangeRateToBase = 0;

            if (txtExchangeRateToBase.NumberValueDecimal.HasValue)
            {
                ExchangeRateToBase = txtExchangeRateToBase.NumberValueDecimal.Value;
            }

            if (ARow.IsAmountNull() || (ExchangeRateToBase == 0))
            {
                txtDetailBaseAmount.NumberValueDecimal = null;
            }
            else
            {
                decimal DetailAmount = Convert.ToDecimal(ARow.Amount);
                DetailAmount /= ExchangeRateToBase;
                txtDetailBaseAmount.NumberValueDecimal = DetailAmount;
            }
        }
Exemple #10
0
        private void SetupTaxDeductibilityControls()
        {
            // increase the width of the screen from the default width (760)
            if (ClientSize.Width == 760)
            {
                ClientSize = new System.Drawing.Size(920, ClientSize.Height);
            }

            // new label
            Label lblAccounts = new Label();

            lblAccounts.Name      = "lblAccounts";
            lblAccounts.Location  = lblDetailAccountCode.Location;
            lblAccounts.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
            lblAccounts.Size      = lblDetailAccountCode.Size;
            lblAccounts.Text      = "Accounts:";
            lblAccounts.TextAlign = System.Drawing.ContentAlignment.TopRight;
            pnlDetails.Controls.Add(lblAccounts);

            // changes to DetailAccountCode control
            lblDetailAccountCode.Location = new System.Drawing.Point(lblDetailAccountCode.Location.X + 90, lblDetailAccountCode.Location.Y);
            lblDetailAccountCode.Text     = "Non-Deductible:";
            lblDetailAccountCode.Size     = new System.Drawing.Size(102, 17);
            cmbDetailAccountCode.Location = new System.Drawing.Point(cmbDetailAccountCode.Location.X + 105, cmbDetailAccountCode.Location.Y);

            // create new label and combobox for the Tax-Deductible Account Code
            Label lblDeductibleAccountCode = new Label();

            lblDeductibleAccountCode.Name     = "lblDeductibleAccountCode";
            lblDeductibleAccountCode.Location = new System.Drawing.Point(cmbDetailAccountCode.Location.X + 310, lblDetailAccountCode.Location.Y);
            lblDeductibleAccountCode.Anchor   =
                ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
            lblDeductibleAccountCode.Size      = new System.Drawing.Size(102, 17);
            lblDeductibleAccountCode.Text      = "Tax-Deductible:";
            lblDeductibleAccountCode.TextAlign = System.Drawing.ContentAlignment.TopRight;
            pnlDetails.Controls.Add(lblDeductibleAccountCode);

            cmbDeductibleAccountCode            = new TCmbAutoPopulated();
            cmbDeductibleAccountCode.Name       = "cmbDeductibleAccountCode";
            cmbDeductibleAccountCode.Location   = new System.Drawing.Point(cmbDetailAccountCode.Location.X + 415, cmbDetailAccountCode.Location.Y);
            cmbDeductibleAccountCode.Size       = new System.Drawing.Size(300, 22);
            cmbDeductibleAccountCode.ListTable  = TCmbAutoPopulated.TListTableEnum.UserDefinedList;
            cmbDeductibleAccountCode.TabIndex   = cmbDetailAccountCode.TabIndex + 1;
            cmbDeductibleAccountCode.Validated += ControlValidatedHandler;
            pnlDetails.Controls.Add(cmbDeductibleAccountCode);

            TFinanceControls.InitialiseAccountList(ref cmbDeductibleAccountCode, FLedgerNumber, true, false, false, false);

            if (FMainDS.AMotivationDetail != null)
            {
                FPetraUtilsObject.ValidationControlsDict.Add(FMainDS.AMotivationDetail.Columns[(short)FMainDS.AMotivationDetail.GetType().GetField(
                                                                                                   "ColumnTaxDeductibleAccountId",
                                                                                                   BindingFlags.Public | BindingFlags.Static |
                                                                                                   BindingFlags.FlattenHierarchy).GetValue(FMainDS.
                                                                                                                                           AMotivationDetail.GetType())],
                                                             new TValidationControlsData(cmbDeductibleAccountCode, Catalog.GetString("Tax Deductible Account")));
            }

            // add new column to grid (TaxDeductibleAccount)
            grdDetails.Columns.Clear();
            grdDetails.AddTextColumn(Catalog.GetString("Group"), FMainDS.AMotivationDetail.ColumnMotivationGroupCode);
            grdDetails.AddTextColumn(Catalog.GetString("Motivation Detail"), FMainDS.AMotivationDetail.ColumnMotivationDetailCode);
            grdDetails.AddTextColumn(Catalog.GetString("Description"), FMainDS.AMotivationDetail.ColumnMotivationDetailDesc);
            grdDetails.AddTextColumn(Catalog.GetString("Non-Deductible Account"), FMainDS.AMotivationDetail.ColumnAccountCode);
            grdDetails.AddTextColumn(Catalog.GetString("Tax-Deductible Account"), FMainDS.AMotivationDetail.ColumnTaxDeductibleAccount);
            grdDetails.AddTextColumn(Catalog.GetString("Cost Centre Code"), FMainDS.AMotivationDetail.ColumnCostCentreCode);
            grdDetails.AddCheckBoxColumn(Catalog.GetString("Active"), FMainDS.AMotivationDetail.ColumnMotivationStatus);
            grdDetails.AddCheckBoxColumn(Catalog.GetString("Print Receipt"), FMainDS.AMotivationDetail.ColumnReceipt);

            SelectRowInGrid(1);
        }