コード例 #1
0
ファイル: OpportunityMaint.cs プロジェクト: JeffJave/Antenova
        /// <summary> RowInserting CROpportunity </summary>
        public void _(Events.RowInserting <CROpportunity> e, PXRowInserting baseMethod)
        {
            baseMethod?.Invoke(e.Cache, e.Args);
            var row = e.Row;

            if (row != null && row.LeadID.HasValue)
            {
                var leads = SelectFrom <CRLead>
                            .Where <CRLead.noteID.IsEqual <P.AsGuid> >
                            .View.Select(Base, row.LeadID).RowCast <CRLead>().FirstOrDefault();

                // UsrEndCust
                row.GetExtension <CROpportunityExt>().UsrEndCust =
                    string.IsNullOrEmpty(row.GetExtension <CROpportunityExt>().UsrEndCust)
                        ? leads.GetExtension <CRLeadExt>().UsrEndCust
                        : row.GetExtension <CROpportunityExt>().UsrEndCust;
                // UsrSource
                row.GetExtension <CROpportunityExt>().UsrSource =
                    string.IsNullOrEmpty(row.GetExtension <CROpportunityExt>().UsrSource)
                        ? leads.GetExtension <CRLeadExt>().UsrSource
                        : row.GetExtension <CROpportunityExt>().UsrSource;
                // UsrSalesPerson
                row.GetExtension <CROpportunityExt>().UsrSalesPerson =
                    row.GetExtension <CROpportunityExt>().UsrSalesPerson == null
                        ? leads.GetExtension <CRLeadExt>().UsrSalesPerson
                        : row.GetExtension <CROpportunityExt>().UsrSalesPerson;
            }
        }
コード例 #2
0
        protected virtual void GLTran_RowInserting(PXCache sender, PXRowInsertingEventArgs e, PXRowInserting baseHandler)
        {
            if (!(e.Row is GLTran row))
            {
                return;
            }
            InventoryItem product = KCGetProductById.SelectSingle(row.InventoryID);

            if (product == null)
            {
                return;
            }
            InventoryItemPCExt productPCExt = product.GetExtension <InventoryItemPCExt>();

            if (productPCExt == null)
            {
                return;
            }
            if (productPCExt.UsrKNCompositeType != null)
            {
                SetToDef(row);
            }
            baseHandler.Invoke(sender, e);
        }
コード例 #3
0
 protected virtual void SOTaxTran_PXRowInserting(PXCache sender, PXRowInserting e)
 {
 }
コード例 #4
0
        protected virtual void DRScheduleDetail_RowInserting(PXCache sender, PXRowInsertingEventArgs e, PXRowInserting baseDelegate)
        {
            if (Base.Schedule.Current?.Module == BatchModule.AP)
            {
                baseDelegate.Invoke(sender, e);
            }

            DRScheduleDetail scheduleDetail = e.Row as DRScheduleDetail;

            if (scheduleDetail == null || Base.Schedule.Current == null)
            {
                return;
            }

            scheduleDetail.ComponentID = scheduleDetail.ComponentID ?? DRScheduleDetail.EmptyComponentID;
            scheduleDetail.ScheduleID  = Base.Schedule.Current.ScheduleID;
        }
コード例 #5
0
        protected virtual void ARTaxTran_RowInserting(PXCache sender, PXRowInsertingEventArgs e, PXRowInserting baseHandler)
        {
            if (!(e.Row is ARTaxTran row))
            {
                return;
            }
            baseHandler?.Invoke(sender, e);

            row.CuryTaxableAmt = 0;

            foreach (ARTran tran in Base.Transactions.Select())
            {
                SOLine line = PXSelect <
                    SOLine,
                    Where <SOLine.orderNbr, Equal <Required <SOLine.orderNbr> > > >
                              .Select(Base, tran.SOOrderNbr);

                SOLinePCExt   linePCExt = line.GetExtension <SOLinePCExt>();
                InventoryItem product   = KCInventoryItem.SelectSingle(tran.InventoryID);
                if (product != null)
                {
                    InventoryItemPCExt productPCExt = product.GetExtension <InventoryItemPCExt>();
                    if (productPCExt != null)
                    {
                        if (productPCExt.UsrKNCompositeType == null)
                        {
                            row.CuryTaxableAmt += tran.CuryTranAmt;
                        }
                    }
                }
            }
            baseHandler.Invoke(sender, e);
        }