public virtual void ProcessSOCommitments(PMProject project)
        {
            foreach (PXResult <SOLine, SOOrder> res in solines.Select(project.ContractID))
            {
                SOLine  soline = (SOLine)res;
                SOOrder order  = (SOOrder)res;
                PXParentAttribute.SetParent(solines.Cache, soline, typeof(SOOrder), order);

                PMCommitmentAttribute.Sync(solines.Cache, soline);
            }

            foreach (ARTran tran in artran.Select(project.ContractID))
            {
                SOLine soline = new SOLine();
                soline.OrderType = tran.SOOrderType;
                soline.OrderNbr  = tran.SOOrderNbr;
                soline.LineNbr   = tran.SOOrderLineNbr;

                soline = solines.Locate(soline);

                if (soline != null && soline.CommitmentID != null)
                {
                    decimal sign = (tran.DrCr == DrCr.Credit) ? Decimal.One : Decimal.MinusOne;

                    PMCommitment container = new PMCommitment();
                    container.CommitmentID   = soline.CommitmentID;
                    container.UOM            = tran.UOM;
                    container.InventoryID    = tran.InventoryID;
                    container.CostCodeID     = tran.CostCodeID.GetValueOrDefault(CostCodeAttribute.GetDefaultCostCode());
                    container.InvoicedAmount = sign * tran.TranAmt.GetValueOrDefault();
                    container.InvoicedQty    = sign * tran.Qty.GetValueOrDefault();

                    PMCommitmentAttribute.AddToInvoiced(solines.Cache, container);
                }
            }
        }
        public virtual void ProcessPOCommitments(PMProject project)
        {
            foreach (PXResult <POLine, POOrder> res in polines.Select(project.ContractID))
            {
                POLine  poline = (POLine)res;
                POOrder order  = (POOrder)res;
                PXParentAttribute.SetParent(polines.Cache, poline, typeof(POOrder), order);

                PMCommitmentAttribute.Sync(polines.Cache, poline);
            }

            foreach (APTran tran in aptran.Select(project.ContractID))
            {
                POLine poline = new POLine();
                poline.OrderType = tran.POOrderType;
                poline.OrderNbr  = tran.PONbr;
                poline.LineNbr   = tran.POLineNbr;

                poline = polines.Locate(poline);

                if (poline != null && poline.CommitmentID != null)
                {
                    decimal sign = (tran.DrCr == DrCr.Debit) ? Decimal.One : Decimal.MinusOne;

                    PMCommitment container = new PMCommitment();
                    container.CommitmentID   = poline.CommitmentID;
                    container.UOM            = tran.UOM;
                    container.InventoryID    = tran.InventoryID;
                    container.CostCodeID     = tran.CostCodeID.GetValueOrDefault(CostCodeAttribute.GetDefaultCostCode());
                    container.InvoicedAmount = sign * tran.LineAmt.GetValueOrDefault();
                    container.InvoicedQty    = sign * tran.Qty.GetValueOrDefault();

                    PMCommitmentAttribute.AddToInvoiced(polines.Cache, container);
                }
            }
        }