private bool IsJointPayeesInvoice(IDocumentKey document) { var invoice = InvoiceDataProvider.GetInvoice(Base, document.DocType, document.RefNbr); var invoiceExtension = PXCache <APInvoice> .GetExtension <APInvoiceJCExt>(invoice); return(invoiceExtension?.IsJointPayees == true); }
private IEnumerable <APAdjust> GetAdjustments(IDocumentKey payment) { return(SelectFrom <APAdjust> .Where <APAdjust.adjgDocType.IsEqual <P.AsString> .And <APAdjust.adjgRefNbr.IsEqual <P.AsString> > > .View .Select(Base, payment.DocType, payment.RefNbr).FirstTableItems); }
private void CreateZeroAmountJointPayeePayments(IDocumentKey payment, IEnumerable <int?> jointPayeeIds) { var jointPayeePayments = jointPayeeIds .Select(jointPayeeId => CreateJointPayeePayment(jointPayeeId, payment, 0)); JointPayeePayments.Cache.InsertAll(jointPayeePayments); }
private bool DoesAnyInvoiceJointPayeeExist(IDocumentKey document) { var noteId = InvoiceDataProvider.GetOriginalInvoice(Base, document.RefNbr, document.DocType)?.NoteID; return(SelectFrom <JointPayee> .Where <JointPayee.billId.IsEqual <P.AsGuid> > .View .Select(Base, noteId).Any()); }
private bool IsPaymentCycleWorkflow(IDocumentKey invoice) { var allRelatedBills = InvoiceDataProvider.GetAllBillsFromRetainageGroup(Base, invoice.RefNbr, invoice.DocType); return(allRelatedBills.Any(inv => JointPayeePaymentDataProvider.DoesAnyNonReleasedJointPayeePaymentExist(Base, inv))); }
private void ValidateEmptyInvoiceJointPayees(IDocumentKey document) { if (document.DocType == APDocType.Invoice && IsJointPayeesInvoice(document) && !DoesAnyInvoiceJointPayeeExist(document)) { throw new PXException(JointCheckMessages.JointPayeesRequired); } }
private static void InsertCashAccountId(PXFieldDefaultingEventArgs args, IDocumentKey invoice) { if (invoice.DocType != APDocType.Prepayment) { return; } args.NewValue = null; args.Cancel = true; }
public bool Equals(IDocumentKey other) { var otherPie = other as PieDocumentKey; if (otherPie != null) { return otherPie._pieId == this._pieId; } return false; }
public bool Equals(IDocumentKey other) { var otherPie = other as Key; if (otherPie != null) { return(otherPie._key == this._key); } return(false); }
public bool Equals(IDocumentKey other) { var otherPie = other as PieDocumentKey; if (otherPie != null) { return(otherPie._pieId == this._pieId); } return(false); }
public static ComplianceDocumentReference GetComplianceDocumentReference(PXGraph graph, IDocumentKey documentKey) { return(new PXSelect <ComplianceDocumentReference, Where <ComplianceDocumentReference.type, Equal <Required <ComplianceDocumentReference.type> >, And <ComplianceDocumentReference.referenceNumber, Equal <Required <ComplianceDocumentReference.referenceNumber> > > > >(graph) .SelectSingle(documentKey.DocType, documentKey.RefNbr)); }
private void UpdatePayment(PXSelectBase <APPayment> paymentView, IDocumentKey payment) { var resultPayment = (APPayment)paymentView .Search <APPayment.docType, APPayment.refNbr>(payment.DocType, payment.RefNbr); if (resultPayment != null) { resultPayment.Selected = true; paymentView.Cache.Update(resultPayment); } }
private void VoidJointPayeePayments(IDocumentKey check) { var checkAdjustments = GetAdjustments(check).ToList(); var voidCheckAdjustments = GetAdjustments(Base.Document.Current); foreach (var voidCheckAdjustment in voidCheckAdjustments) { var checkAdjustment = checkAdjustments.Single(adj => IsSameAdjustment(adj, voidCheckAdjustment)); AddRevertingJointPayeePayments(checkAdjustment, voidCheckAdjustment); } }
public bool TryGetTrackedDocument(IDocumentKey key, out T tracked) { tracked = default(T); if (key.Empty) { return(false); } return(byKey.TryGetValue(key, out tracked)); }
private APPayment CreateApPayment(IDocumentKey invoice) { var documentType = invoice.DocType == APDocType.DebitAdj ? APDocType.Refund : APDocType.Check; var payment = new APPayment { DocType = documentType }; return(PaymentEntry.Document.Insert(payment)); }
private JointPayeePayment CreateJointPayeePayment(int?payeeId, IDocumentKey payment, decimal?amount) { return(new JointPayeePayment { JointPayeeId = payeeId, PaymentDocType = payment.DocType, PaymentRefNbr = payment.RefNbr, InvoiceDocType = InvoiceEntry.Document.Current.DocType, InvoiceRefNbr = InvoiceEntry.Document.Current.RefNbr, JointAmountToPay = amount, AdjustmentNumber = 0 }); }
public SessionOperationIntent(IDocumentKey key, bool shouldDelete = true) { Key = key; ShouldDelete = shouldDelete; }
private void SuppressDefaultEvents(IDocumentKey invoice) { PaymentEntry.FieldDefaulting.AddHandler <APPayment.cashAccountID>( (cache, args) => InsertCashAccountId(args, invoice)); PaymentEntry.FieldDefaulting.AddHandler <CurrencyInfo.curyID>((cache, args) => InsertCurrencyId(args)); }
private void CreateZeroAmountJointPayeePaymentsForVendorCheck(IDocumentKey vendorCheck) { var jointPayeeIds = InvoiceJointPayeePayments.Select(jpp => jpp.JointPayeeId); CreateZeroAmountJointPayeePayments(vendorCheck, jointPayeeIds); }
internal TrackedDocument(T document, T hiddenCopy, IDocumentKey key) { this.document = document; this.hiddenCopy = hiddenCopy; this.key = key; }
private bool IsExistingOrderSelected(IDocumentKey salesOrder) { return(Base.Document.Cache.GetStatus(salesOrder) != PXEntryStatus.Inserted); }
/// <summary> /// Returns <c>true</c> if and only if the calling application corresponds to the /// specified document (on either the adjusting or the adjusted side). /// </summary> public static bool IsApplicationFor(this IDocumentAdjustment application, IDocumentKey document) => application.IsOutgoingApplicationFor(document) || application.IsIncomingApplicationFor(document);
/// <summary> /// Returns <c>true</c> if the specified document is on the adjusted side of the /// specified application, <c>false</c> otherwise. For example, this method will /// return <c>true</c> if you call it on an application of a payment to an invoice, /// and specify the invoice as the argument. /// </summary> public static bool IsIncomingApplicationFor(this IDocumentAdjustment application, IDocumentKey document) => document.DocType == application.AdjdDocType && document.RefNbr == application.AdjdRefNbr;
/// <summary> /// Returns <c>true</c> if the specified document is on the adjusting side of the /// specified application, <c>false</c> otherwise. For example, this method will /// return <c>true</c> if you call it on an application of a payment to an invoice, /// and specify the payment as the argument. /// </summary> public static bool IsOutgoingApplicationFor(this IDocumentAdjustment application, IDocumentKey document) => document.DocType == application.AdjgDocType && document.RefNbr == application.AdjgRefNbr;
public void MarkForDeletion(IDocumentKey key) { deletedKeys.Add(key); }
public bool IsMarkedForDeletion(IDocumentKey key) { return(deletedKeys.Contains(key)); }
public void TrackDocument(IDocumentKey key, T item, Document doc) { byKey.Add(key, item); items.Add(new TrackedDocument(item, doc, key)); }
public static Guid?GetComplianceDocumentReferenceId(PXGraph graph, IDocumentKey documentKey) { return(GetComplianceDocumentReference(graph, documentKey)?.ComplianceDocumentReferenceId); }
private static bool IsCheckOrVoidCheck(IDocumentKey document) { return(document.DocType.IsIn(APDocType.Check, APDocType.VoidCheck)); }
public bool Equals(IDocumentKey other) { return(Equals((object)other)); }
internal TrackedDocument(T item, Document document, IDocumentKey key) { this.item = item; this.document = document; this.key = key; }