protected POOrder GetCommitment(APTran transaction)
        {
            var originalTransaction  = TransactionDataProvider.GetOriginalTransaction(Graph, transaction);
            var transactionExtension = PXCache <APTran> .GetExtension <ApTranExt>(originalTransaction);

            return(transactionExtension.SubcontractNbr != null
                ? CommitmentDataProvider.GetCommitment(Graph, transactionExtension.SubcontractNbr,
                                                       POOrderType.RegularSubcontract)
                : originalTransaction.PONbr != null
                    ? CommitmentDataProvider.GetCommitment(Graph, originalTransaction.PONbr, POOrderType.RegularOrder)
                    : null);
        }
Ejemplo n.º 2
0
        private void SetPurchaseOrder()
        {
            var purchaseOrder =
                CommitmentDataProvider.GetCommitment(Graph, generationKey.OrderNumber, POOrderType.RegularOrder);

            if (purchaseOrder == null)
            {
                return;
            }
            ComplianceDocumentRefNoteAttribute.SetComplianceDocumentReference <ComplianceDocument.purchaseOrder>(
                Cache, lienWaiver, purchaseOrder.OrderType, purchaseOrder.OrderNbr, purchaseOrder.NoteID);
            Cache.Update(lienWaiver);
        }
        private object[] AppendCommitmentCondition(string commitmentNumber, PXSelectBase <ComplianceDocument> query,
                                                   object[] parameters)
        {
            var purchaseOrder =
                CommitmentDataProvider.GetCommitment(graph, commitmentNumber, POOrderType.RegularOrder);

            if (purchaseOrder == null)
            {
                query.WhereAnd <Where <ComplianceDocument.subcontract.IsEqual <P.AsString> > >();
                return(parameters.Append(commitmentNumber));
            }
            query.Join <InnerJoin <ComplianceDocumentReference, On <ComplianceDocumentReference.
                                                                    complianceDocumentReferenceId.IsEqual <ComplianceDocument.purchaseOrder> > > >();
            query.WhereAnd <Where <ComplianceDocumentReference.refNoteId.IsEqual <P.AsGuid> > >();
            return(parameters.Append(purchaseOrder.NoteID));
        }