private void ValidateDocDate(PXCache cache, TaxAdjustment doc)
        {
            if (doc.DocDate == null || doc.TaxPeriod == null)
            {
                return;
            }

            var taxPeriod = ReportTaxProcess.FindTaxPeriodByKey(this, doc.VendorID, doc.TaxPeriod);

            if (taxPeriod == null)
            {
                return;
            }

            string errorMessage = null;

            if (vendor.Current.TaxReportFinPeriod == true)
            {
                var finPeriod = FinPeriodIDAttribute.GetFinPeriodByID(this, doc.FinPeriodID);

                if (finPeriod.FinDate >= taxPeriod.EndDate)
                {
                    errorMessage = Messages.SelectedDateBelongsToTheTaxPeriodThatIsGreaterThanTheSpecifiedOne;
                }
            }
            else if (doc.DocDate >= taxPeriod.EndDate)
            {
                errorMessage = Messages.SelectedDateBelongsToTheTaxPeriodThatIsGreaterThanTheSpecifiedOne;
            }

            var ex = errorMessage != null
                                ? new PXSetPropertyException(errorMessage, PXErrorLevel.Warning)
                                : null;

            cache.RaiseExceptionHandling <TaxAdjustment.docDate>(doc, doc.DocDate, ex);
        }