コード例 #1
0
        private IEnumerable <JointCheckGenerationModel> CreateCheckGenerationModels()
        {
            var jointPayeePayments = InvoiceJointPayeePayments.Where(jpp => jpp.JointAmountToPay > 0).ToList();
            var jointPayeeGroups   = GetJointPayeeGroups(jointPayeePayments);

            return(jointPayeeGroups.Select(jp => JointCheckGenerationModel.Create(jointPayeePayments, jp))
                   .OrderBy(gm => gm.InvoiceJointPayeePayments.Min(jpp => jpp.JointPayeeId)));
        }
コード例 #2
0
        private void CreateZeroAmountJointPayeePaymentsForJointCheck(
            JointCheckGenerationModel jointCheckGenerationModel)
        {
            var invoiceJointPayeePayments = jointCheckGenerationModel.InvoiceJointPayeePayments.ToList();
            var jointPayeeIds             = InvoiceJointPayeePayments
                                            .Where(jpp => !invoiceJointPayeePayments.Contains(jpp) &&
                                                   jointCheckGenerationModel.BillLineNumbers.Contains(jpp.BillLineNumber))
                                            .Select(jpp => jpp.JointPayeeId);

            CreateZeroAmountJointPayeePayments(jointCheckGenerationModel.CreatedPayment, jointPayeeIds);
        }
コード例 #3
0
        private IEnumerable <APAdjust> GetSortedAdjustments()
        {
            var billLinesWithJointAmountsToPay = InvoiceJointPayeePayments
                                                 .Where(jpp => jpp.JointAmountToPay.GetValueOrDefault() != 0)
                                                 .Select(x => x.BillLineNumber).Distinct();
            var adjustments       = PaymentEntry.Adjustments.SelectMain();
            var sortedAdjustments = billLinesWithJointAmountsToPay
                                    .Select(billLine => adjustments.FirstOrDefault(x => x.AdjdLineNbr == billLine)).ToList();

            sortedAdjustments.AddRange(adjustments.Where(adjustment => !sortedAdjustments.Contains(adjustment)));
            return(sortedAdjustments);
        }
コード例 #4
0
        private decimal?GetAdjustmentAmountPerLine(APAdjust adjustment)
        {
            var jointPayeePaymentsTotalAmountToPayForLine = InvoiceJointPayeePayments
                                                            .Where(jpp => jpp.BillLineNumber == adjustment.AdjdLineNbr)
                                                            .Sum(jpp => jpp.JointAmountToPay);
            var vendorBalancePerLine = vendorBalancePerLineCalculationService.GetVendorBalancePerLine(adjustment);
            var transactionBalance   = TransactionDataProvider.GetTransaction(
                PaymentEntry, adjustment.AdjdDocType, adjustment.AdjdRefNbr, adjustment.AdjdLineNbr).CuryTranBal;
            var minimumJointAmountToPay = transactionBalance - vendorBalancePerLine;

            return(jointPayeePaymentsTotalAmountToPayForLine > minimumJointAmountToPay
                ? transactionBalance - jointPayeePaymentsTotalAmountToPayForLine
                : vendorBalancePerLine);
        }
コード例 #5
0
        private void CreateZeroAmountJointPayeePaymentsForVendorCheck(IDocumentKey vendorCheck)
        {
            var jointPayeeIds = InvoiceJointPayeePayments.Select(jpp => jpp.JointPayeeId);

            CreateZeroAmountJointPayeePayments(vendorCheck, jointPayeeIds);
        }