/// <summary>
        /// This method is called as soon as the ledger number has been set on the main form, which follows immediately after the constructor.
        /// It is used to initialize the controls on the form, based on the values in FMainDS
        /// </summary>
        /// <param name="AMainForm"></param>
        /// <param name="ALedgerNumber"></param>
        public void InitializeScreenData(TFrmLedgerSettingsDialog AMainForm, Int32 ALedgerNumber)
        {
            FLedgerNumber = ALedgerNumber;

            // Now we can populate the controls with data
            // This form does not need to know about ALedgerRow (at present) so we can call ShowData with null as parameter
            ShowData(null);
        }
Пример #2
0
        /// <summary>
        /// This method is called as soon as the ledger number has been set on the main form, which follows immediately after the constructor.
        /// It is used to initialize the controls on the form, based on the values in FMainDS
        /// </summary>
        /// <param name="AMainForm"></param>
        /// <param name="ALedgerNumber"></param>
        public void InitializeScreenData(TFrmLedgerSettingsDialog AMainForm, Int32 ALedgerNumber)
        {
            FLedgerNumber = ALedgerNumber;

            // Now we can populate the controls with data
            // This form does not need to know about ALedgerRow (at present) so we can call ShowData with null as parameter
            ShowData(null);
        }
Пример #3
0
        /// <summary>
        /// This method is called as soon as the ledger number has been set on the main form, which follows immediately after the constructor.
        /// It is used to initialize the controls on the form, based on the values in FMainDS
        /// </summary>
        /// <param name="AMainForm"></param>
        /// <param name="ALedgerNumber"></param>
        public void InitializeScreenData(TFrmLedgerSettingsDialog AMainForm, Int32 ALedgerNumber)
        {
            FMainForm     = AMainForm;
            FLedgerNumber = ALedgerNumber;

            // In OM we do not allow a change to international currency.  It will always be USD.
            cmbIntlCurrency.Enabled = false;

            if (!FMainForm.CurrencyChangeAllowed)
            {
                cmbBaseCurrency.Enabled = false;
            }

            if (!FMainForm.CalendarChangeAllowed)
            {
                rgrCalendarModeRadio.Enabled         = false;
                nudNumberOfAccountingPeriods.Enabled = false;
                dtpFinancialYearStartDate.Enabled    = false;
                nudCurrentPeriod.Enabled             = false;
                btnViewCalendar.Text = MCommonResourcestrings.StrFinanceViewCalendarTitle;
                FEditCalendar        = false;
            }
            else
            {
                FEditCalendar = true;
            }

            // Now we can populate the controls with data
            if (FMainDS.ALedger.Rows.Count > 0)
            {
                // check if number of forward posting periods is set to 0. This should not be allowed, therefore the value has to be changed here.
                if (((ALedgerRow)FMainDS.ALedger.Rows[0]).IsNumberFwdPostingPeriodsNull() ||
                    (((ALedgerRow)FMainDS.ALedger.Rows[0]).NumberFwdPostingPeriods == 0))
                {
                    int DefaultNumber = MFinanceConstants.GL_DEFAULT_FWD_POSTING_PERIODS;

                    MessageBox.Show(String.Format(Catalog.GetString("Number of Forward Posting Periods for this ledger must not be 0 and will " +
                                                                    "therefore be set to the default value of {0} unless you cancel the Ledger Settings Screen."),
                                                  DefaultNumber.ToString()),
                                    Catalog.GetString("Number of Forward Posting Periods"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                    ((ALedgerRow)FMainDS.ALedger.Rows[0]).NumberFwdPostingPeriods = DefaultNumber;
                }

                ShowData((ALedgerRow)FMainDS.ALedger.Rows[0]);
            }
        }
        /// <summary>
        /// This method is called as soon as the ledger number has been set on the main form, which follows immediately after the constructor.
        /// It is used to initialize the controls on the form, based on the values in FMainDS
        /// </summary>
        /// <param name="AMainForm"></param>
        /// <param name="ALedgerNumber"></param>
        public void InitializeScreenData(TFrmLedgerSettingsDialog AMainForm, Int32 ALedgerNumber)
        {
            FMainForm = AMainForm;
            FLedgerNumber = ALedgerNumber;

            if (!FMainForm.CurrencyChangeAllowed)
            {
                cmbBaseCurrency.Enabled = false;
                cmbIntlCurrency.Enabled = false;
            }

            if (!FMainForm.CalendarChangeAllowed)
            {
                rgrCalendarModeRadio.Enabled = false;
                nudNumberOfAccountingPeriods.Enabled = false;
                dtpFinancialYearStartDate.Enabled = false;
                nudCurrentPeriod.Enabled = false;
                btnViewCalendar.Text = MCommonResourcestrings.StrFinanceViewCalendarTitle;
                FEditCalendar = false;
            }
            else
            {
                FEditCalendar = true;
            }

            // Now we can populate the controls with data
            if (FMainDS.ALedger.Rows.Count > 0)
            {
                // check if number of forward posting periods is set to 0. This should not be allowed, therefore the value has to be changed here.
                if (((ALedgerRow)FMainDS.ALedger.Rows[0]).IsNumberFwdPostingPeriodsNull()
                    || (((ALedgerRow)FMainDS.ALedger.Rows[0]).NumberFwdPostingPeriods == 0))
                {
                    int DefaultNumber = MFinanceConstants.GL_DEFAULT_FWD_POSTING_PERIODS;

                    MessageBox.Show(String.Format(Catalog.GetString("Number of Forward Posting Periods for this ledger must not be 0 and will " +
                                "therefore be set to the default value of {0} unless you cancel the Ledger Settings Screen."),
                            DefaultNumber.ToString()),
                        Catalog.GetString("Number of Forward Posting Periods"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                    ((ALedgerRow)FMainDS.ALedger.Rows[0]).NumberFwdPostingPeriods = DefaultNumber;
                }

                ShowData((ALedgerRow)FMainDS.ALedger.Rows[0]);
            }
        }
        /// <summary>
        /// Load the supplier and all the transactions (invoices and payments) that relate to it.
        /// </summary>
        /// <param name="ALedgerNumber"></param>
        /// <param name="APartnerKey"></param>
        public void LoadSupplier(Int32 ALedgerNumber, Int64 APartnerKey)
        {
            this.Cursor = Cursors.WaitCursor;

            FLedgerNumber = ALedgerNumber;
            FPartnerKey = APartnerKey;
            FMainDS = TRemote.MFinance.AP.WebConnectors.LoadAApSupplier(ALedgerNumber, APartnerKey);

            FSupplierRow = FMainDS.AApSupplier[0];

            // Get our AP ledger settings and enable/disable the corresponding search option on the filter panel
            TFrmLedgerSettingsDialog settings = new TFrmLedgerSettingsDialog(this, ALedgerNumber);
            FRequireApprovalBeforePosting = settings.APRequiresApprovalBeforePosting;
            Control rbtForApproval = FFilterAndFindObject.FilterPanelControls.FindControlByName("rbtForApproval");
            rbtForApproval.Enabled = FRequireApprovalBeforePosting;

            //
            // Transactions older than
            DateTime AgedOlderThan = DateTime.Now;

            if (!FSupplierRow.IsPreferredScreenDisplayNull())
            {
                AgedOlderThan = AgedOlderThan.AddMonths(0 - FSupplierRow.PreferredScreenDisplay);
            }

            FAgedOlderThan = AgedOlderThan.ToString("u");

            txtSupplierName.Text = FMainDS.PPartner[0].PartnerShortName;
            txtSupplierCurrency.Text = FSupplierRow.CurrencyCode;
            FFindObject = TRemote.MFinance.AP.UIConnectors.Find();

            FFindObject.FindSupplierTransactions(FLedgerNumber, FPartnerKey);

            // Start thread that checks for the end of the search operation on the PetraServer
            FKeepUpSearchFinishedCheck = true;
            Thread FinishedCheckThread = new Thread(new ThreadStart(SearchFinishedCheckThread));
            FinishedCheckThread.Start();

            this.Text = Catalog.GetString("Supplier Transactions") + " - " + TFinanceControls.GetLedgerNumberAndName(FLedgerNumber);
        }
        private void ShowDataManual()
        {
            AccountsPayableTDSAApDocumentRow DocumentRow = FMainDS.AApDocument[0];

            FDocumentLedgerNumber = DocumentRow.LedgerNumber;

            // This will involve a trip to the server to access GLSetupTDS
            TFrmLedgerSettingsDialog settings = new TFrmLedgerSettingsDialog(this, FDocumentLedgerNumber);
            FRequireApprovalBeforePosting = settings.APRequiresApprovalBeforePosting;

            txtTotalAmount.CurrencyCode = DocumentRow.CurrencyCode;
            txtDetailAmount.CurrencyCode = DocumentRow.CurrencyCode;
            dtpDateDue.Date = DocumentRow.DateIssued.AddDays(Convert.ToDouble(nudCreditTerms.Value));

            this.Text += " - " + TFinanceControls.GetLedgerNumberAndName(FDocumentLedgerNumber);

            FLedgerRow =
                ((ALedgerTable)TDataCache.TMFinance.GetCacheableFinanceTable(TCacheableFinanceTablesEnum.LedgerDetails, FDocumentLedgerNumber))[0];
            txtDetailBaseAmount.CurrencyCode = FLedgerRow.BaseCurrency;
            //txtExchangeRateToBase.SetControlProperties(10);

            //
            // If this document's currency is that of my own ledger,
            // I need to disable the rate of exchange field.
            if (DocumentRow.CurrencyCode == FLedgerRow.BaseCurrency)
            {
                txtExchangeRateToBase.Enabled = false;
                btnLookupExchangeRate.Enabled = false;
            }

            if ((FMainDS.AApDocumentDetail == null) || (FMainDS.AApDocumentDetail.Rows.Count == 0)) // When the document is new, I need to create the first detail line.
            {
                NewDetail(null, null);
            }

            FMainDS.AApDocumentDetail.DefaultView.Sort = AApDocumentDetailTable.GetDetailNumberDBName();

            // Create Text description of Anal Attribs for each DetailRow..
            foreach (AccountsPayableTDSAApDocumentDetailRow DetailRow in FMainDS.AApDocumentDetail.Rows)
            {
                UpdateAttributeLabel(DetailRow);
            }

            EnableControls();
        }
Пример #7
0
        private void mniDefaults_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            TFrmLedgerSettingsDialog ledgerSettings = new TFrmLedgerSettingsDialog(this);
            ledgerSettings.LedgerNumber = this.FLedgerNumber;
            ledgerSettings.InitialTab = "AP";
            ledgerSettings.Show();

            this.Cursor = Cursors.Default;
        }