private void SetDocDateByPeriods(PXCache cache, TaxAdjustment document) { if (document.TaxPeriod == null) { return; } var taxPeriod = ReportTaxProcess.FindTaxPeriodByKey(this, document.VendorID, document.TaxPeriod); if (taxPeriod == null) { return; } DateTime?docDate; if (vendor.Current.TaxReportFinPeriod == true) { var finPeriod = FinPeriodIDAttribute.FindMaxFinPeriodWithEndDataBelongToInterval(this, taxPeriod.StartDate, taxPeriod.EndDate); docDate = finPeriod != null ? finPeriod.FinDate : Accessinfo.BusinessDate; } else { docDate = taxPeriod.EndDateUI; } cache.SetValueExt <TaxAdjustment.docDate>(document, docDate); }