Ejemplo n.º 1
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("");
                }
            }
        }
Ejemplo n.º 2
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);
            }
        }
        /// <summary>
        /// Init the grid
        /// </summary>
        /// <param name="ALedgerNumber"></param>
        public void InitialiseCostCentreList(int ALedgerNumber)
        {
            FLedgerNumber = ALedgerNumber;

            TFinanceControls.InitialiseCostCentreList(ref clbCostCentres, ALedgerNumber, false, false, chkExcludeInactiveCostCentres.Checked, true);

            if (FCostCenterCodesDuringLoad.Length > 0)
            {
                clbCostCentres.SetCheckedStringList(FCostCenterCodesDuringLoad);
                FCostCenterCodesDuringLoad = "";
            }
            else
            {
                clbCostCentres.SetCheckedStringList("");
            }
        }
Ejemplo n.º 5
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;
        }
        /// 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;
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Init the grid
        /// </summary>
        private void InitialiseCostCentreList()
        {
            TFinanceControls.InitialiseCostCentreList(
                ref clbCostCentres,
                FLedgerNumber,
                true,  // postingonly
                false, // excludeposting
                chkExcludeInactiveCostCentres.Checked,
                rbtFields.Checked,
                rbtDepartments.Checked,
                rbtPersonalCostcentres.Checked);

            if (FCostCenterCodesDuringLoad.Length > 0)
            {
                clbCostCentres.SetCheckedStringList(FCostCenterCodesDuringLoad);
                FCostCenterCodesDuringLoad = "";
            }
            else
            {
                clbCostCentres.SetCheckedStringList("");
            }
        }