Пример #1
0
        /// <summary>
        /// GUARDAR
        /// </summary>
        public void Save()
        {
            if (lueALF_SERI.Properties.ReadOnly) return;
            try
            {
                gdvArticles.CloseEditor();
                gdvArticles.RefreshData();
                gdvGroups.CloseEditor();
                gdvGroups.RefreshData();
                gdvArticlesCompleted.CloseEditor();
                gdvArticlesCompleted.RefreshData();
                if (string.IsNullOrEmpty(txtCOD_SOCI_NEGO.Text))
                    throw new ArgumentException("Seleccione un cliente");
                if (lueCOD_SUCU.EditValue == null)
                    throw new ArgumentException("Seleccione la sucursal");
                if (lueCOD_MONE.EditValue == null)
                    throw new ArgumentException("Seleccione la moneda");
                if (lueALF_SERI.EditValue == null)
                    throw new ArgumentException("Seleccione la serie");
                if (string.IsNullOrEmpty(txtNUM_CORR.Text))
                    throw new ArgumentException("Defina correctamente la numeracion del documento");
                if (oListArtiCompleted.Count == 0)
                    throw new ArgumentException("No existen articulos para el documento de venta");

                if (XtraMessageBox.Show("Esta seguro de guardar la nota de credito.?", "Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    return;

                var oBe = new BESVTC_COTI();
                var oBr = new BRSVTC_COTI();

                if (string.IsNullOrEmpty(txtNUM_NCRE.Text))
                {
                    oBe.NUM_ACCI = 1;
                }
                else
                {
                    oBe.NUM_ACCI = 2;
                    oBe.COD_OVEN = Convert.ToInt32(txtNUM_NCRE.Text);
                    oBe.COD_DOCU_SECU = oBe.COD_OVEN;
                }

                oBe.COD_SOCI_NEGO = Convert.ToInt32(txtCOD_SOCI_NEGO.Text);
                oBe.ALF_NOMB = beALF_NOMB.Text;
                oBe.ALF_DIRE = txtALF_DIRE_FISC.Text;
                oBe.ALF_CONT = txtALF_CONT.Text;
                oBe.COD_SUCU = Convert.ToInt32(lueCOD_SUCU.EditValue);
                oBe.COD_MONE = Convert.ToInt32(lueCOD_MONE.EditValue);
                oBe.NUM_DESC = Convert.ToDecimal(txtNUM_DESC.Text.Replace("%", ""));
                oBe.FEC_DOCU = deFEC_DOCU.DateTime;
                oBe.FEC_VENC = deFEC_VENC.DateTime;

                oBe.LST_COTI = oListArti;
                oBe.LST_COTI_DETA = oListArtiCompleted;
                oBe.LST_COTI_GROU = oListGroup;
                oBe.LST_COTI_ARTI_GROU = oListArtiGroup;
                oBe.LST_GREM = oListGrem;

                oBe.NUM_SUBT = decimal.Parse(txtNUM_SUBT.Text);
                oBe.NUM_IGVV = decimal.Parse(txtNUM_IGVV.Text);
                oBe.NUM_TOTA = decimal.Parse(txtNUM_TOTA.Text);

                oBe.ALF_OBSE = meALF_OBSE.Text;
                oBe.ALF_TOTA = lblALF_SONN.Text;
                oBe.COD_TIPO_DOCU = 5;
                oBe.COD_DOCU_INIC = COD_DVEN;
                oBe.ALF_SERI = lueALF_SERI.EditValue.ToString();
                oBe.NUM_CORR = Convert.ToInt32(txtNUM_CORR.Text);
                oBe.IND_IMPU = chkIGV.Checked;

                oBe.COD_USUA_CREA = SESSION_USER;
                oBe.COD_USUA_MODI = SESSION_USER;
                oBe.COD_COMP = SESSION_COMP;
                oBe.COD_ALMA = Convert.ToInt32(lueCOD_ALMA.EditValue);

                oBr.Set_SVPR_COTI(oBe);

                txtNUM_NCRE.Text = oBe.COD_DOCU_SECU.ToString();
                StateControl(true);

                XtraMessageBox.Show("Operación realizada con exito!!!!", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        /// <summary>
        /// ANULAR LA ORDEN DE VENTA
        /// </summary>
        public void Annul()
        {
            try
            {
                if (string.IsNullOrEmpty(txtNUM_NCRE.Text))
                    throw new ArgumentException("Seleccione un documento de venta");

                var oBe = new BESVTC_COTI();
                var oBr = new BRSVTC_COTI();
                oBe.ALF_NUME_IDEN = txtNUM_NCRE.Text;
                oBe.COD_TIPO_DOCU = 5;
                oBe.COD_COMP = SESSION_COMP;
                oBe.NUM_ACCI = 6;

                var oList = oBr.Get_SVPR_COTI_BUSC(oBe);
                txtALF_ESTA.Text = oList[0].ALF_ESTA;
                if (oList[0].ALF_ESTA.Equals("CANCELADA"))
                    throw new ArgumentException("La nota de crédito esta anulada");

                if (XtraMessageBox.Show("Seguro que desea anular la nota de crédito?", "Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    oBe.NUM_ACCI = 3;
                    oBe.COD_DOCU_SECU = Convert.ToInt32(txtNUM_NCRE.Text);
                    oBe.COD_DOCU_INIC = COD_DVEN;
                    oBe.COD_TIPO_DOCU = 5;

                    oBe.COD_USUA_CREA = SESSION_USER;
                    oBe.COD_USUA_MODI = SESSION_USER;
                    oBe.COD_COMP = SESSION_COMP;

                    oBr.Set_SVPR_COTI(oBe);
                    txtALF_ESTA.Text = "ANULADA";
                    StateControl(true);

                    XtraMessageBox.Show("Operación realizada con exito!!!!", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        public BESVTC_COTI Set_SVPR_COTI_ANUL(BESVTC_COTI oBe)
        {
            try
            {
                var oBr = new BRSVTC_COTI();

                oBe.COD_COMP = (int)HttpContext.Current.Session["COD_COMP"];

                oBr.Set_SVPR_COTI(oBe);

                oBe.ALF_ESTA = "CANCELADA";
                oBe.IND_ERRO = false;
                oBe.ALF_ERRO = "";
                return oBe;
            }
            catch (Exception ex)
            {
                oBe.IND_ERRO = true;
                oBe.ALF_ERRO = ex.Message;
                return oBe;
            }
        }
Пример #4
0
        public void Save()
        {
            try
            {
                gdvArticles.CloseEditor();
                gdvArticles.RefreshData();
                gdvGroups.CloseEditor();
                gdvGroups.RefreshData();
                if (txtALF_ESTA.Text.Equals("CANCELADA"))
                    throw new ArgumentException("La cotización esta cancelada");
                if (string.IsNullOrEmpty(txtCOD_SOCI_NEGO.Text))
                    throw new ArgumentException("Seleccione un cliente");
                if (lueCOD_SUCU.EditValue == null)
                    throw new ArgumentException("Seleccione la sucursal");
                if (string.IsNullOrEmpty(lueCOD_SUCU.Text))
                    throw new ArgumentException("Seleccione la sucursal");
                if (oListArti.Count == 0 && oListArtiGroup.Count == 0)
                    throw new ArgumentException("Agregar articulos a la lista");
                if (lueCOD_MONE.EditValue == null)
                    throw new ArgumentException("Seleccione la moneda");
                if (lueCOD_PROY.EditValue == null)
                    throw new ArgumentException("Seleccione el proyecto");
                if (lkeCOD_MOTI.EditValue == null)
                    throw new ArgumentException("Seleccione el motivo");
                if (lueCOD_EJEC_COME.EditValue == null)
                    throw new ArgumentException("Seleccione el ejecutivo comercial");
                if (string.IsNullOrEmpty(txtALF_ATEN.Text))
                    throw new ArgumentException("Ingrese el data correspondiente a atención con un minimo de 6 caracteres.");
                if (txtALF_ATEN.Text.Length<6)
                    throw new ArgumentException("Ingrese el data correspondiente a atención con un minimo de 6 caracteres.");

                var oBe = new BESVTC_COTI();
                var oBr = new BRSVTC_COTI();

                if (string.IsNullOrEmpty(txtNUM_COTI.Text))
                {
                    oBe.NUM_ACCI = 1;
                }
                else
                {
                    oBe.NUM_ACCI = 2;
                    oBe.COD_COTI = Convert.ToInt32(txtNUM_COTI.Text);
                    oBe.COD_DOCU_SECU = oBe.COD_COTI;
                }

                oBe.COD_SOCI_NEGO = Convert.ToInt32(txtCOD_SOCI_NEGO.Text);
                oBe.ALF_NOMB = beALF_NOMB.Text;
                oBe.ALF_DIRE = txtALF_DIRE_FISC.Text;
                oBe.ALF_CONT = txtALF_CONT.Text;
                oBe.COD_SUCU = Convert.ToInt32(lueCOD_SUCU.EditValue);
                oBe.COD_MONE = Convert.ToInt32(lueCOD_MONE.EditValue);
                oBe.NUM_DESC = Convert.ToDecimal(txtNUM_DESC.Text.Replace("%", ""));
                oBe.FEC_DOCU = deFEC_DOCU.DateTime;
                oBe.FEC_VENC = deFEC_VENC.DateTime;

                oBe.LST_COTI = oListArti;
                oBe.LST_COTI_GROU = oListGroup;
                oBe.LST_COTI_ARTI_GROU = oListArtiGroup;

                oBe.NUM_SUBT = decimal.Parse(txtNUM_SUBT.Text);
                oBe.NUM_IGVV = decimal.Parse(txtNUM_IGVV.Text);
                oBe.NUM_TOTA = decimal.Parse(txtNUM_TOTA.Text);

                oBe.ALF_OBSE = meALF_OBSE.Text;
                oBe.ALF_TOTA = lblALF_SONN.Text;
                oBe.COD_TIPO_DOCU = 1;
                oBe.COD_PROY=Convert.ToInt32(lueCOD_PROY.EditValue);
                oBe.ALF_ATEN = txtALF_ATEN.Text;
                oBe.COD_MOTI = Convert.ToInt32(lkeCOD_MOTI.EditValue);

                oBe.COD_USUA_CREA = SESSION_USER;
                oBe.COD_USUA_MODI = SESSION_USER;
                oBe.COD_COMP = SESSION_COMP;
                oBe.ALF_COND_COME = mmoALF_COND_COME.Text.Trim();
                oBe.COD_EJEC_COME = Convert.ToInt32(lueCOD_EJEC_COME.EditValue);
                oBe.IND_IMPU = chkIGV.Checked;

                oBr.Set_SVPR_COTI(oBe);

                txtNUM_COTI.Text = oBe.COD_DOCU_SECU.ToString();
                StateControl(true);

                XtraMessageBox.Show("Operación realizada con exito!!!!", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #5
0
        public void Annul()
        {
            try
            {
                if (txtALF_ESTA.Text.Equals("CANCELADA"))
                    throw new ArgumentException("La cotización esta cancelada");
                if (string.IsNullOrEmpty(txtNUM_COTI.Text))
                    throw new ArgumentException("Seleccione una cotización");
                if (string.IsNullOrEmpty(txtCOD_SOCI_NEGO.Text))
                    throw new ArgumentException("Seleccione un cliente");
                if (lueCOD_SUCU.EditValue == null)
                    throw new ArgumentException("Seleccione la sucursal");
                if (lueCOD_MONE.EditValue == null)
                    throw new ArgumentException("Seleccione la moneda");

                if (XtraMessageBox.Show("Seguro que desea cancelar la cotización?", "Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    var oBe = new BESVTC_COTI();
                    var oBr = new BRSVTC_COTI();

                    oBe.NUM_ACCI = 3;
                    oBe.COD_DOCU_SECU = Convert.ToInt32(txtNUM_COTI.Text);

                    oBe.COD_SOCI_NEGO = Convert.ToInt32(txtCOD_SOCI_NEGO.Text);
                    oBe.ALF_NOMB = beALF_NOMB.Text;
                    oBe.ALF_DIRE = txtALF_DIRE_FISC.Text;
                    oBe.ALF_CONT = txtALF_CONT.Text;
                    oBe.COD_SUCU = Convert.ToInt32(lueCOD_SUCU.EditValue);
                    oBe.COD_MONE = Convert.ToInt32(lueCOD_MONE.EditValue);
                    oBe.NUM_DESC = Convert.ToDecimal(txtNUM_DESC.Text.Replace("%", ""));
                    oBe.FEC_DOCU = deFEC_DOCU.DateTime;
                    oBe.FEC_VENC = deFEC_VENC.DateTime;

                    oBe.LST_COTI = oListArti;
                    oBe.LST_COTI_GROU = oListGroup;
                    oBe.LST_COTI_ARTI_GROU = oListArtiGroup;

                    oBe.NUM_SUBT = decimal.Parse(txtNUM_SUBT.Text);
                    oBe.NUM_IGVV = decimal.Parse(txtNUM_IGVV.Text);
                    oBe.NUM_TOTA = decimal.Parse(txtNUM_TOTA.Text);

                    oBe.ALF_OBSE = meALF_OBSE.Text;
                    oBe.ALF_TOTA = lblALF_SONN.Text;

                    oBe.COD_TIPO_DOCU = 1;
                    oBe.COD_USUA_CREA = SESSION_USER;
                    oBe.COD_USUA_MODI = SESSION_USER;
                    oBe.COD_COMP = SESSION_COMP;

                    oBr.Set_SVPR_COTI(oBe);

                    txtNUM_COTI.Text = oBe.COD_COTI.ToString();
                    txtALF_ESTA.Text = "CANCELADA";
                    StateControl(true);

                    XtraMessageBox.Show("Operación realizada con exito!!!!", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #6
0
        /// <summary>
        /// GUARDAR
        /// </summary>
        public void Save()
        {
            if (lueCOD_ALMA.Properties.ReadOnly) return;
            try
            {
                gdvArticles.CloseEditor();
                gdvArticles.RefreshData();
                gdvGroups.CloseEditor();
                gdvGroups.RefreshData();
                gdvArticlesCompleted.CloseEditor();
                gdvArticlesCompleted.RefreshData();
                if (string.IsNullOrEmpty(txtCOD_SOCI_NEGO.Text))
                    throw new ArgumentException("Seleccione un cliente");
                if (lueCOD_SUCU.EditValue==null)
                    throw new ArgumentException("Seleccione la sucursal");
                if (oListArti.Count == 0 && oListArtiGroup.Count==0)
                    throw new ArgumentException("Agregar articulos a la lista");
                if (lueCOD_MONE.EditValue == null)
                    throw new ArgumentException("Seleccione la moneda");
                if (lueCOD_ALMA.EditValue == null)
                    throw new ArgumentException("Seleccione almacén");

                var oBe = new BESVTC_COTI();
                var oBr = new BRSVTC_COTI();

                if (string.IsNullOrEmpty(txtNUM_OVEN.Text))
                {
                    oBe.NUM_ACCI = 1;
                }
                else
                {
                    oBe.NUM_ACCI = 2;
                    oBe.COD_OVEN=Convert.ToInt32(txtNUM_OVEN.Text);
                    oBe.COD_DOCU_SECU = oBe.COD_OVEN;
                }

                oBe.COD_SOCI_NEGO = Convert.ToInt32(txtCOD_SOCI_NEGO.Text);
                oBe.ALF_NOMB = beALF_NOMB.Text;
                oBe.ALF_DIRE = txtALF_DIRE_FISC.Text;
                oBe.ALF_CONT = txtALF_CONT.Text;
                oBe.COD_SUCU=Convert.ToInt32(lueCOD_SUCU.EditValue);
                oBe.COD_MONE = Convert.ToInt32(lueCOD_MONE.EditValue);
                oBe.COD_ALMA = Convert.ToInt32(lueCOD_ALMA.EditValue);
                oBe.NUM_DESC = Convert.ToDecimal(txtNUM_DESC.Text.Replace("%",""));
                oBe.FEC_DOCU = deFEC_DOCU.DateTime;
                oBe.FEC_VENC = deFEC_VENC.DateTime;
                oBe.FEC_ENTR = deFEC_ENTR.DateTime;

                oBe.LST_COTI = oListArti;
                oBe.LST_COTI_DETA = oListArtiCompleted;
                oBe.LST_COTI_GROU = oListGroup;
                oBe.LST_COTI_ARTI_GROU = oListArtiGroup;

                oBe.NUM_SUBT = decimal.Parse(txtNUM_SUBT.Text);
                oBe.NUM_IGVV = decimal.Parse(txtNUM_IGVV.Text);
                oBe.NUM_TOTA = decimal.Parse(txtNUM_TOTA.Text);

                oBe.ALF_OBSE = meALF_OBSE.Text;
                oBe.ALF_TOTA = lblALF_SONN.Text;
                oBe.COD_TIPO_DOCU = 2;
                oBe.COD_DOCU_INIC=Convert.ToInt32(txtCOD_COTI.Text);
                oBe.COD_MOTI = Convert.ToInt32(lkeCOD_MOTI.EditValue);
                oBe.IND_IMPU = chkIGV.Checked;

                oBe.COD_USUA_CREA = SESSION_USER;
                oBe.COD_USUA_MODI = SESSION_USER;
                oBe.COD_COMP = SESSION_COMP;

                oBe.IND_FACT = chkIND_FACT.Checked;

                oBr.Set_SVPR_COTI(oBe);

                txtNUM_OVEN.Text = oBe.COD_DOCU_SECU.ToString();
                XtraMessageBox.Show("Operación realizada con exito!!!!", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);
                StateControl(true);
                var oBe_ = new BESVTD_COTI();
                var oBr_ = new BRSVTD_COTI();

                oBe_.COD_COTI = Convert.ToInt32(txtNUM_OVEN.Text);
                oBe_.NUM_ACCI = 9;
                oBe_.COD_TIPO_DOCU = 2;
                var oList = oBr_.Get_SVPR_COTI_DETA_LIST(oBe_);
                oListArtiCompleted.Clear();
                oList.ForEach(obj =>
                {
                    oListArtiCompleted.Add(obj);
                });
                gdvArticlesCompleted.RefreshData();
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,"Sistema",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
        }