Beispiel #1
0
        protected void _(Events.RowPersisting <ARInvoice> e, PXRowPersisting InvokeBaseHandler)
        {
            InvokeBaseHandler?.Invoke(e.Cache, e.Args);

            if (e.Operation == PXDBOperation.Insert || e.Operation == PXDBOperation.Update)
            {
                ARRegisterExt regisExt = PXCache <ARRegister> .GetExtension <ARRegisterExt>(e.Row);

                //if (e.Row.CuryDocBal == decimal.Zero && string.IsNullOrEmpty(regisExt.UsrGUINbr))
                //{
                //    regisExt.UsrVATOutCode = string.Empty;
                //}
                //else
                if (string.IsNullOrEmpty(regisExt.UsrGUINbr) && (regisExt.UsrVATOutCode == TWGUIFormatCode.vATOutCode31 ||
                                                                 regisExt.UsrVATOutCode == TWGUIFormatCode.vATOutCode32 ||
                                                                 regisExt.UsrVATOutCode == TWGUIFormatCode.vATOutCode35))
                {
                    TWNGUIPreferences gUIPreferences = SelectFrom <TWNGUIPreferences> .View.Select(Base);

                    regisExt.UsrGUINbr = ARGUINbrAutoNumAttribute.GetNextNumber(e.Cache, e.Row, regisExt.UsrVATOutCode == TWGUIFormatCode.vATOutCode32 ? gUIPreferences.GUI2CopiesNumbering : gUIPreferences.GUI3CopiesNumbering,
                                                                                regisExt.UsrGUIDate);

                    tWNGUIValidation.CheckGUINbrExisted(Base, regisExt.UsrGUINbr, regisExt.UsrVATOutCode);
                }
            }
        }
Beispiel #2
0
        protected void _(Events.FieldVerifying <TWNManualGUIExpense, TWNManualGUIExpense.gUINbr> e)
        {
            var row = (TWNManualGUIExpense)e.Row;

            tWNGUIValidation.CheckGUINbrExisted(Base, (string)e.NewValue, row.VATInCode);
        }
Beispiel #3
0
        protected void _(Events.FieldVerifying <TWNManualGUIAPBill.gUINbr> e)
        {
            var row = e.Row as TWNManualGUIAPBill;

            tWNGUIValidation.CheckGUINbrExisted(Base, (string)e.NewValue, row.VATInCode);
        }