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; }
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; } }
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; } }
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); }