public virtual void ARTran_UOM_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { var row = (ARTran)e.Row; PXResult <InventoryItem, INLotSerClass> item = ReadInventoryItem(sender, row.InventoryID); string inTranType = INTranType.TranTypeFromInvoiceType(row.TranType, row.Qty); if (item != null && INLotSerialNbrAttribute.IsTrackSerial(item, inTranType, row.InvtMult)) { object newval; sender.RaiseFieldDefaulting <ARTran.uOM>(e.Row, out newval); if (object.Equals(newval, e.NewValue) == false) { e.NewValue = newval; sender.RaiseExceptionHandling <ARTran.uOM>(e.Row, null, new PXSetPropertyException(IN.Messages.SerialItemAdjustment_UOMUpdated, PXErrorLevel.Warning, newval)); } } }
public override void Master_Qty_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { var row = (ARTran)e.Row; if (row.InvtMult == 0) { return; } PXResult <InventoryItem, INLotSerClass> item = ReadInventoryItem(sender, row.InventoryID); string inTranType = INTranType.TranTypeFromInvoiceType(row.TranType, row.Qty); if (item != null && INLotSerialNbrAttribute.IsTrackSerial(item, inTranType, row.InvtMult)) { if (e.NewValue != null && e.NewValue is decimal && (decimal)e.NewValue != 0m && (decimal)e.NewValue != 1m && (decimal)e.NewValue != -1m) { e.NewValue = (decimal)e.NewValue > 0 ? 1m : -1m; sender.RaiseExceptionHandling <ARTran.qty>(e.Row, null, new PXSetPropertyException(IN.Messages.SerialItemAdjustment_LineQtyUpdated, PXErrorLevel.Warning, ((InventoryItem)item).BaseUnit)); } } }
protected override bool IsTracked(ILSMaster row, INLotSerClass lotSerClass, string tranType, int?invMult) { string inTranType = INTranType.TranTypeFromInvoiceType(tranType, row.Qty); return((invMult == 0) ? false : base.IsTracked(row, lotSerClass, inTranType, invMult)); }
protected override INLotSerTrack.Mode GetTranTrackMode(ILSMaster row, INLotSerClass lotSerClass) { string inTranType = INTranType.TranTypeFromInvoiceType(row.TranType, row.Qty); return(INLotSerialNbrAttribute.TranTrackMode(lotSerClass, inTranType, row.InvtMult)); }