コード例 #1
0
        protected virtual void NewOrganizationCalendarParameters_StartMasterFinPeriodID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
        {
            NewOrganizationCalendarParameters row = (NewOrganizationCalendarParameters)e.Row;

            row.StartDate = FinPeriodRepository
                            .FindByID(FinPeriod.organizationID.MasterValue, row.StartMasterFinPeriodID)
                            ?.StartDate;
        }
コード例 #2
0
        protected virtual void InventoryTranByAcctEnqFilter_PeriodEndDate_FieldDefaulting(PXCache cache, PXFieldDefaultingEventArgs e)
        {
            var row = e.Row as InventoryTranByAcctEnqFilter;

            if (row != null)
            {
                FinPeriod period = FinPeriodRepository.FindByID(FinPeriod.organizationID.MasterValue, row.FinPeriodID);
                e.NewValue = period?.EndDate;
            }
        }
コード例 #3
0
        protected virtual void ResetFilterDates(InventoryTranByAcctEnqFilter aRow)
        {
            FinPeriod period = FinPeriodRepository.FindByID(FinPeriod.organizationID.MasterValue, aRow.FinPeriodID);

            if (period != null)
            {
                aRow.PeriodStartDate = period.StartDate;
                aRow.PeriodEndDate   = period.EndDate;
                aRow.EndDate         = null;
                aRow.StartDate       = null;
            }
        }
コード例 #4
0
        public virtual ProcessingResult CheckFinPeriod(string finPeriodID, int?branchID)
        {
            ProcessingResult result  = new ProcessingResult();
            int?      organizationID = PXAccess.GetParentOrganizationID(branchID);
            FinPeriod period         = FinPeriodRepository.FindByID(organizationID, finPeriodID);

            if (period == null)
            {
                result.AddErrorMessage(GL.Messages.FinPeriodDoesNotExistForCompany,
                                       FinPeriodIDFormattingAttribute.FormatForError(finPeriodID),
                                       PXAccess.GetOrganizationCD(PXAccess.GetParentOrganizationID(branchID)));
            }
            else
            {
                result = FinPeriodUtils.CanPostToPeriod(period);
            }

            if (!result.IsSuccess)
            {
                PXProcessing <THistory> .SetError(new PXException(result.GetGeneralMessage()));
            }

            return(result);
        }