public void ValidateVendorAmountToPay(decimal?amountToPay) { ValidateNegativeAmount(amountToPay); ValidateAmountToPayExceedsVendorBalance(amountToPay); var totalAmountToPay = amountToPay + amountToPayCalculationService.GetJointAmountToPay( ApPayBills.APDocumentList.Current.AdjdLineNbr); var invoiceBalance = invoiceBalanceCalculationService.GetInvoiceBalance(ApPayBills.APDocumentList.Current); ValidateTotalAmountToPay(totalAmountToPay, invoiceBalance); }
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); }