Esempio n. 1
0
        protected virtual void StatusSet(PXCache sender, ARRegister doc)
        {
            var docExt = doc.GetExtension <MXARRegisterExtension>();

            if (docExt == null)
            {
                return;
            }

            var status = CfdiStatus.Clean;

            if (docExt.CancelDate.HasValue)
            {
                status = CfdiStatus.Canceled;
            }
            else if (docExt.StampDate.HasValue)
            {
                status = CfdiStatus.Stamped;
            }
            else if (docExt.Uuid.HasValue)
            {
                status = CfdiStatus.Blocked;
            }
            else
            {
                status = CfdiStatus.Clean;
            }

            sender.SetValue <MXARRegisterExtension.stampStatus>(doc, status);
        }
Esempio n. 2
0
        protected void _(Events.FieldSelecting <ARTranForDirectInvoiceExt.usrGUINbr> e)
        {
            var row = e.Row as ARTranForDirectInvoice;

            if (row != null)
            {
                ARRegister register = SelectFrom <ARRegister> .Where <ARRegister.docType.IsEqual <@P.AsString>
                                                                      .And <ARRegister.refNbr.IsEqual <@P.AsString> > > .View.ReadOnly.Select(Base, row.TranType, row.RefNbr);

                e.ReturnValue = register.GetExtension <ARRegisterExt>().UsrGUINbr;
            }
        }
Esempio n. 3
0
        protected virtual void StatusSet(PXCache sender, ARRegister doc)
        {
            // Solo seguimos si tenemos el registro
            var cfdi = doc.GetExtension <MXARRegisterExtension>();

            if (cfdi == null)
            {
                return;
            }
            var check = false;

            // Si el documento está timbrado o cancelado limpiamos la bandera
            if (cfdi.StampStatus == CfdiStatus.Stamped || cfdi.StampStatus == CfdiStatus.Canceled)
            {
                check = false;
            }
            // Si tiene valor en ceros
            else if (cfdi.Uuid.HasValue && cfdi.Uuid == Guid.Empty)
            {
                check = true;
            }

            sender.SetValue <MXARRegisterExtension.notStampable>(doc, check);
        }