private void InitialiseLedgerControls()
        {
            //Set the valid date range label
            TLedgerSelection.GetCurrentPostingRangeDates(FLedgerNumber,
                                                         out FStartDateCurrentPeriod,
                                                         out FEndDateLastForwardingPeriod,
                                                         out FDefaultDate);

            lblValidDateRange.Text = String.Format(Catalog.GetString("Valid between {0} and {1}"),
                                                   StringHelper.DateToLocalizedString(FStartDateCurrentPeriod, false, false),
                                                   StringHelper.DateToLocalizedString(FEndDateLastForwardingPeriod, false, false));

            // Get the current year/period and pass on to the filter logic object
            ALedgerRow LedgerRow =
                ((ALedgerTable)TDataCache.TMFinance.GetCacheableFinanceTable(TCacheableFinanceTablesEnum.LedgerDetails, FLedgerNumber))[0];

            FCurrentLedgerYear   = LedgerRow.CurrentFinancialYear;
            FCurrentLedgerPeriod = LedgerRow.CurrentPeriod;
            FLoadAndFilterLogicObject.CurrentLedgerYear   = FCurrentLedgerYear;
            FLoadAndFilterLogicObject.CurrentLedgerPeriod = FCurrentLedgerPeriod;

            TFrmGLBatch myParentForm = (TFrmGLBatch)this.ParentForm;

            myParentForm.GetJournalsControl().LedgerBaseCurrency = LedgerRow.BaseCurrency;
        }
Beispiel #2
0
        private void PeriodEndButtonClick(object btn, EventArgs e)
        {
            RunPeriodEnd(CALCULATION_MODE);
            tbxMessage.Text = Catalog.GetString("The server returned this message:") +
                              "\r\n\r\n" +
                              FverificationResult.BuildVerificationResultString();
            btnPeriodEnd.Visible = false;
            btnCancel.Text       = Catalog.GetString("Done");

            // reset valid dates as they may have changed: next time this object is called values are refreshed from server
            TLedgerSelection.ResetValidDates(FLedgerNumber);
        }
        private static void AsyncOpEnd(IAsyncResult ar)
        {
            AsyncResult   result  = (AsyncResult)ar;
            TPeriodEnd    TheForm = (TPeriodEnd)result.AsyncState;
            AsyncOpCaller caller  = (AsyncOpCaller)result.AsyncDelegate;

            TheForm.FOperationResult = caller.EndInvoke(ar);
            TLogging.Log("AsyncOpEnd: " + TheForm.FOperationResult);

            // Reset valid posting dates as they will have changed.
            TLedgerSelection.ResetValidDates(TheForm.FLedgerNumber);
            TheForm.TidyUpAfterAsyncOperation();
        }
Beispiel #4
0
        /// <summary>
        /// constructor with some parameters
        /// </summary>
        public TDlgGLEnterDateEffective(Int32 ALedgerNumber, string ACaption, string ALabel)
        {
            InitializeComponent();

            DateTime DefaultDate;

            TLedgerSelection.GetCurrentPostingRangeDates(ALedgerNumber,
                                                         out FStartDateCurrentPeriod,
                                                         out FEndDateLastForwardingPeriod,
                                                         out DefaultDate);
            lblDateEffective.Text  = ALabel;
            this.Text              = ACaption;
            lblValidDateRange.Text = String.Format(Catalog.GetString(
                                                       "Valid dates from {0} to {1}"),
                                                   StringHelper.DateToLocalizedString(FStartDateCurrentPeriod),
                                                   StringHelper.DateToLocalizedString(FEndDateLastForwardingPeriod));

            dtpDateEffective.Date = DefaultDate;

            this.Activated += new EventHandler(TDlgGLEnterDateEffective_Activated);
        }
        private void InitialiseLedgerControls()
        {
            // Load Motivation detail in this central place; it will be used by UC_GiftTransactions
            AMotivationDetailTable motivationDetail = (AMotivationDetailTable)TDataCache.TMFinance.GetCacheableFinanceTable(
                TCacheableFinanceTablesEnum.MotivationList,
                FLedgerNumber);

            motivationDetail.TableName = FMainDS.AMotivationDetail.TableName;
            FMainDS.Merge(motivationDetail);

            FMainDS.AcceptChanges();

            FMainDS.AGiftBatch.DefaultView.Sort = String.Format("{0}, {1} DESC",
                                                                AGiftBatchTable.GetLedgerNumberDBName(),
                                                                AGiftBatchTable.GetBatchNumberDBName()
                                                                );

            SetupExtraGridFunctionality();
            FAccountAndCostCentreLogicObject.RefreshBankAccountAndCostCentreData(FLoadAndFilterLogicObject);

            // if this form is readonly, then we need all codes, because old codes might have been used
            bool ActiveOnly = this.Enabled;

            SetupAccountAndCostCentreCombos(ActiveOnly);

            cmbDetailMethodOfPaymentCode.AddNotSetRow("", "");
            TFinanceControls.InitialiseMethodOfPaymentCodeList(ref cmbDetailMethodOfPaymentCode, ActiveOnly);

            TLedgerSelection.GetCurrentPostingRangeDates(FLedgerNumber,
                                                         out FStartDateCurrentPeriod,
                                                         out FEndDateLastForwardingPeriod,
                                                         out FDefaultDate);
            lblValidDateRange.Text = String.Format(Catalog.GetString("Valid between {0} and {1}"),
                                                   FStartDateCurrentPeriod.ToShortDateString(), FEndDateLastForwardingPeriod.ToShortDateString());

            FLoadAndFilterLogicObject.InitialiseDataSources(cmbDetailBankCostCentre, cmbDetailBankAccountCode);
        }