コード例 #1
0
        private void StopPaymentIfOutstandingLienWaiversExist(PXCache cache, APRegister document)
        {
            var originalDocument = cache.GetOriginal(document) as APRegister;

            if (originalDocument?.Status != document.Status && document.Hold == false &&
                PXContext.GetScreenID() == Constants.ScreenIds.ChecksAndPayments)
            {
                if (originalDocument?.Status == APDocStatus.Hold)
                {
                    lienWaiverProcessingValidationService.ValidateLienWaiversOnManualStatusChange(document,
                                                                                                  LienWaiverSetup.Current?.ShouldStopPayments);
                }
                else
                {
                    lienWaiverProcessingValidationService.ValidateLienWaivers(document,
                                                                              LienWaiverSetup.Current?.ShouldStopPayments);
                }
            }
        }