private void UpdateGraphCache(PXGraph targetGraph, PXSelectBase <APPayment> paymentView, IEnumerable <APAdjust> adjustments) { if (targetGraph != null && paymentView != null) { var references = adjustments.Select(adjustment => (adjustment.AdjdRefNbr, adjustment.AdjdDocType)).Distinct(); var payments = references.SelectMany(reference => PaymentDataProvider.GetGeneratedPayments(Base, reference.AdjdRefNbr)) .Where(p => p != null).Distinct(); payments.ForEach(p => UpdatePayment(paymentView, p)); paymentView.Cache.IsDirty = false; } }
public void HoldPaymentsIfNeeded(string invoiceReferenceNumber, bool?shouldStopPayments) { var payments = PaymentDataProvider.GetGeneratedPayments(graph, invoiceReferenceNumber); payments.ForEach(payment => HoldPaymentIfNeeded(payment, shouldStopPayments)); }