示例#1
0
        private bool DoesAnyOutstandingLienWaiverExistForJointPayees(APAdjust adjustment, List <int?> projectsIds)
        {
            var jointPayeePayments = JointPayeePaymentDataProvider.GetJointPayeePayments(Base, adjustment.AdjdRefNbr,
                                                                                         adjustment.AdjdDocType, adjustment.AdjdLineNbr);
            var jointPayees = JointPayeeDataProvider.GetJointPayees(Base, jointPayeePayments, adjustment.AdjdLineNbr);

            return(jointPayees.Any(jp => lienWaiverDataProvider
                                   .DoesAnyOutstandingComplianceExistForJointVendor(jp, projectsIds)));
        }
        protected void AddRevertingJointPayeePayments(APAdjust originalAdjustment, APAdjust revertedAdjustment)
        {
            var originalJointPayeePayments =
                JointPayeePaymentDataProvider.GetJointPayeePayments(Base, originalAdjustment);

            foreach (var jointPayeePayment in originalJointPayeePayments)
            {
                AddRevertingJointPayeePayment(jointPayeePayment, revertedAdjustment);
            }
        }
示例#3
0
        private void CheckJointVendorsForOutstandingLienWaivers(APAdjust adjustment, List <int?> projectIds)
        {
            var jointPayeePayments = JointPayeePaymentDataProvider.GetJointPayeePayments(graph, adjustment)
                                     .Where(jpp => jpp.JointAmountToPay > 0);
            var jointPayees =
                JointPayeeDataProvider.GetJointPayees(graph, jointPayeePayments);

            if (jointPayees.Any(jp =>
                                lienWaiverDataProvider.DoesAnyOutstandingComplianceExistForJointVendor(jp, projectIds)))
            {
                throw new PXException(exceptionMessage);
            }
        }
        public void ValidateJointAmountToPayExceedBalance()
        {
            var actualJointPayeePayments = ActualAdjustments
                                           .SelectMany(adjustment => JointPayeePaymentDataProvider.GetJointPayeePayments(Graph, adjustment))
                                           .ToList();

            foreach (var jointPayeePayment in actualJointPayeePayments)
            {
                ValidateJointAmountToPayExceedJointBalance(jointPayeePayment);
                ValidateJointAmountToPayExceedBillBalance(jointPayeePayment);
                ValidateJointAmountToPayExceedJointPreparedBalance(jointPayeePayment);
                ValidateJointPayeePaymentTotalAmountToPayExceedBillAmount(actualJointPayeePayments, jointPayeePayment);
            }
        }
        private void ReverseJointPayeePayments(APAdjust originalAdjustment)
        {
            var reversedAdjustment = AdjustmentDataProvider.GetReversedAdjustment(Base, originalAdjustment);

            if (reversedAdjustment == null)
            {
                return;
            }
            var jointPayeePayments = JointPayeePaymentDataProvider.GetJointPayeePayments(Base, reversedAdjustment);

            if (jointPayeePayments.IsEmpty())
            {
                AddRevertingJointPayeePayments(originalAdjustment, reversedAdjustment);
            }
        }
        public void DeleteJointPayeePayments(APAdjust adjustment)
        {
            var jointPayeePayments = JointPayeePaymentDataProvider.GetJointPayeePayments(graph, adjustment);

            graph.Caches <JointPayeePayment>().DeleteAll(jointPayeePayments);
        }
示例#7
0
 public decimal?GetTotalJointAmountToPay(APAdjust apAdjust)
 {
     return(JointPayeePaymentDataProvider.GetJointPayeePayments(Graph, apAdjust)
            .Sum(x => x.JointAmountToPay));
 }