protected virtual void SOLine_RUTROTType_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e) { SOLineRUTROT row = RUTROTHelper.GetExtensionNullable <SOLine, SOLineRUTROT>((SOLine)e.Row); if (row != null) { row.RUTROTWorkTypeID = null; } }
protected virtual void SOLine_RowInserting(PXCache sender, PXRowInsertingEventArgs e) { if (e.Row == null) { return; } var row = (SOLine)e.Row; SOLineRUTROT rowRR = RUTROTHelper.GetExtensionNullable <SOLine, SOLineRUTROT>(row); rowRR.CuryRUTROTTaxAmountDeductible = decimal.Zero; }
protected virtual void SOLine_RUTROTItemType_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e) { SOLine row = (SOLine)e.Row; SOLineRUTROT rowRR = RUTROTHelper.GetExtensionNullable <SOLine, SOLineRUTROT>(row); if (row != null) { PXUIFieldAttribute.SetEnabled <SOLineRUTROT.rUTROTWorkTypeID>(sender, row, rowRR.RUTROTItemType != RUTROTItemTypes.OtherCost); if (rowRR.RUTROTItemType == RUTROTItemTypes.OtherCost) { sender.SetValueExt <SOLineRUTROT.rUTROTWorkTypeID>(row, null); } } }
public virtual ARTran CreateTranFromShipLine(ARInvoice newdoc, SOOrderType ordertype, string operation, SOLine orderline, ref SOShipLine shipline, CreateTranFromShipLineDelegate baseMethod) { ARTran tran = baseMethod(newdoc, ordertype, operation, orderline, ref shipline); SOLine line = PXSelect <SOLine, Where <SOLine.orderType, Equal <Required <SOLine.orderType> >, And <SOLine.orderNbr, Equal <Required <SOLine.orderNbr> >, And <SOLine.lineNbr, Equal <Required <SOLine.lineNbr> > > > > > .Select(Base, orderline.OrderType, orderline.OrderNbr, orderline.LineNbr); SOLineRUTROT lineRR = PXCache <SOLine> .GetExtension <SOLineRUTROT>(line); ARTranRUTROT tranRR = PXCache <ARTran> .GetExtension <ARTranRUTROT>(tran); tranRR.IsRUTROTDeductible = lineRR.IsRUTROTDeductible; tranRR.RUTROTItemType = lineRR.RUTROTItemType; tranRR.RUTROTWorkTypeID = lineRR.RUTROTWorkTypeID; return(tran); }
public virtual ARTran CreateTranFromMiscLine(SOOrderShipment orderShipment, SOMiscLine2 orderline, CreateTranFromMiscLineDelegate baseMethod) { ARTran tran = baseMethod(orderShipment, orderline); SOLine line = PXSelect <SOLine, Where <SOLine.orderType, Equal <Required <SOLine.orderType> >, And <SOLine.orderNbr, Equal <Required <SOLine.orderNbr> >, And <SOLine.lineNbr, Equal <Required <SOLine.lineNbr> > > > > > .Select(Base, orderline.OrderType, orderline.OrderNbr, orderline.LineNbr); SOLineRUTROT lineRR = PXCache <SOLine> .GetExtension <SOLineRUTROT>(line); ARTranRUTROT tranRR = PXCache <ARTran> .GetExtension <ARTranRUTROT>(tran); tranRR.IsRUTROTDeductible = lineRR.IsRUTROTDeductible; tranRR.RUTROTItemType = lineRR.RUTROTItemType; tranRR.RUTROTWorkTypeID = lineRR.RUTROTWorkTypeID; return(tran); }
protected virtual void SOLine_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } SOLine row = e.Row as SOLine; SOLineRUTROT rowRR = RUTROTHelper.GetExtensionNullable <SOLine, SOLineRUTROT>(row); RUTROTWorkType workType = PXSelect <RUTROTWorkType, Where <RUTROTWorkType.workTypeID, Equal <Required <RUTROTWorkType.workTypeID> > > > .Select(this.Base, rowRR.RUTROTWorkTypeID); if (rowRR?.IsRUTROTDeductible == true && Base.Document.Current.Completed != true && rowRR?.RUTROTItemType != RUTROTItemTypes.OtherCost && Base.Document.Current.Rejected != true && !RUTROTHelper.IsUpToDateWorkType(workType, Base.Document.Current.OrderDate ?? DateTime.Now)) { sender.RaiseExceptionHandling <SOLineRUTROT.rUTROTWorkTypeID>(row, workType?.Description, new PXSetPropertyException(RUTROTMessages.ObsoleteWorkType)); } else { sender.RaiseExceptionHandling <SOLineRUTROT.rUTROTWorkTypeID>(row, workType?.Description, null); } PXUIFieldAttribute.SetEnabled <SOLineRUTROT.isRUTROTDeductible>(Base.Transactions.Cache, row, row.IsStockItem != true); }
protected virtual void SOLine_RowPersisting(PXCache sender, PXRowPersistingEventArgs e) { SOLineRUTROT row = RUTROTHelper.GetExtensionNullable <SOLine, SOLineRUTROT>(e.Row as SOLine); CheckRUTROTLine(sender, RUTROTHelper.GetExtensionNullable <SOOrder, SOOrderRUTROT>(Base.Document.Current), row, Rutrots.Current); }