예제 #1
0
        private bool IsFinalAdjustment(APAdjust adjustment)
        {
            var invoice = InvoiceDataProvider.GetInvoice(Base, adjustment.AdjdDocType, adjustment.AdjdRefNbr);

            invoiceBalanceCalculationService = invoice.PaymentsByLinesAllowed == true
                ? new InvoiceLineBalanceCalculationService(Base)
                : new InvoiceBalanceCalculationService(Base);
            return(invoiceBalanceCalculationService.GetInvoiceBalance(adjustment) == adjustment.CuryAdjgAmt);
        }
예제 #2
0
        private void InitializeCalculationServices()
        {
            var isPaymentByLines = ApPayBillsExt.CurrentBill.Current?.PaymentsByLinesAllowed == true;

            jointPayeeAmountsCalculationService     = new JointPayeeAmountsCalculationService(ApPayBills);
            vendorPreparedBalanceCalculationService = new VendorPreparePaymentPreparedBalanceCalculationService(ApPayBills);
            amountToPayCalculationService           = isPaymentByLines
                                ? new AmountToPayPerLineCalculationService(ApPayBills, JointPayeePayments)
                                : new AmountToPayCalculationService(ApPayBills, JointPayeePayments);
            invoiceBalanceCalculationService = isPaymentByLines
                                ? new InvoiceLineBalanceCalculationService(ApPayBills)
                                : new InvoiceBalanceCalculationService(ApPayBills);
        }