Esempio n. 1
0
        protected virtual void INRegister_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
        {
            if (insetup.Current.RequireControlTotal == false)
            {
                if (PXCurrencyAttribute.IsNullOrEmpty(((INRegister)e.Row).TotalQty) == false)
                {
                    sender.SetValue <INRegister.controlQty>(e.Row, ((INRegister)e.Row).TotalQty);
                }
                else
                {
                    sender.SetValue <INRegister.controlQty>(e.Row, 0m);
                }
            }

            if (((INRegister)e.Row).Hold == false && ((INRegister)e.Row).Released == false)
            {
                if ((bool)insetup.Current.RequireControlTotal)
                {
                    if (((INRegister)e.Row).TotalQty != ((INRegister)e.Row).ControlQty)
                    {
                        sender.RaiseExceptionHandling <INRegister.controlQty>(e.Row, ((INRegister)e.Row).ControlQty, new PXSetPropertyException(Messages.DocumentOutOfBalance));
                    }
                    else
                    {
                        sender.RaiseExceptionHandling <INRegister.controlQty>(e.Row, ((INRegister)e.Row).ControlQty, null);
                    }
                }
            }
        }