示例#1
0
        public List<BESVTD_COTI> Get_SVPR_DETA(BESVTD_COTI oBe)
        {
            if (HttpContext.Current.Session["COD_COMP"] == null)
                return new List<BESVTD_COTI>();

            var oBr = new BRSVTD_COTI();

            oBe.COD_TIPO_DOCU = 1;
            var oList = oBr.Get_SVPR_COTI_DETA_LIST(oBe);

            return oList;
        }
示例#2
0
        /// <summary>
        /// INVOCAR EL CUADRO DE BUSQUEDA PARA LA NOTA DE CREDITO
        /// </summary>
        public void SearchSalesCreditNote()
        {
            ClearControl();
            using (var oForm = new xfSearchQuote(5, SESSION_COMP))
            {
                if (oForm.ShowDialog() == DialogResult.OK)
                {
                    LoadBranch(oForm.oBe.COD_SOCI_NEGO);
                    txtCOD_SOCI_NEGO.Text = oForm.oBe.COD_SOCI_NEGO.ToString();
                    beALF_NOMB.Text = oForm.oBe.ALF_NOMB;
                    txtALF_DIRE_FISC.Text = oForm.oBe.ALF_DIRE;
                    txtALF_TELE.Text = "";
                    txtALF_FAXX.Text = "";
                    txtALF_CONT.Text = oForm.oBe.ALF_CONT;
                    lueCOD_SUCU.EditValue = oForm.oBe.COD_SUCU;
                    txtNUM_DESC.Text = oForm.oBe.NUM_DESC.ToString("#,##0.00");
                    txtALF_NUME_FACT.Text = oForm.oBe.ALF_NUME_DOCU;
                    beALF_GUIA_REMI_STOR.Text = oForm.oBe.ALF_NUME_DOCU;
                    COD_DVEN = oForm.oBe.COD_DVEN;
                    txtNUM_NCRE.Text = oForm.oBe.COD_NCRE.ToString();
                    deFEC_REGI.EditValue = oForm.oBe.FEC_REGI;
                    deFEC_DOCU.EditValue = oForm.oBe.FEC_DOCU;
                    deFEC_VENC.EditValue = oForm.oBe.FEC_PAGO;
                    txtALF_ESTA.Text = oForm.oBe.ALF_ESTA;
                    lueCOD_MONE.EditValue = oForm.oBe.COD_MONE;
                    lueALF_SERI.EditValue = oForm.oBe.ALF_SERI;
                    txtNUM_CORR.Text = oForm.oBe.NUM_CORR.ToString("0000000");
                    lueCOD_ALMA.EditValue = oForm.oBe.COD_ALMA;
                    txtALF_NUME_IDEN.Text = oForm.oBe.ALF_NUME_IDEN;
                    chkIGV.Checked = oForm.oBe.IND_IMPU;
                    chkIND_LIQU.Checked = oForm.oBe.IND_LIQU;

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

                    txtNUM_SUBT.Text = oForm.oBe.NUM_SUBT.ToString("#,##0.00");
                    txtNUM_IGVV.Text = oForm.oBe.NUM_IGVV.ToString("#,##0.00");
                    txtNUM_TOTA.Text = oForm.oBe.NUM_TOTA.ToString("#,##0.00");

                    var oBeSu = new BESVMD_SOCI_NEGO_SUCU();
                    var oBrSu = new BRSVMD_SOCI_NEGO_SUCU();

                    oBeSu.NUM_ACCI = 5;
                    oBeSu.COD_SOCI_NEGO = oForm.oBe.COD_SOCI_NEGO;
                    var oListTC = oBrSu.Get_SVPR_SOCI_NEGO_SUCU_LIST(oBeSu);

                    lueCOD_SUCU.Properties.DataSource = oListTC;
                    lueCOD_SUCU.Properties.Columns.Clear();
                    lueCOD_SUCU.Properties.Columns.Add(new LookUpColumnInfo("ALF_SUCU", 100, "Sucursal"));
                    lueCOD_SUCU.Properties.DisplayMember = "ALF_SUCU";
                    lueCOD_SUCU.Properties.ValueMember = "COD_SOCI_NEGO_SUCU";
                    lueCOD_SUCU.EditValue = oForm.oBe.COD_SUCU;

                    var oBe = new BESVTD_COTI();
                    var oBr = new BRSVTD_COTI();

                    oBe.COD_COTI = oForm.oBe.COD_DVEN;
                    oBe.NUM_ACCI = 5;
                    oBe.COD_TIPO_DOCU = 4;
                    var oList = oBr.Get_SVPR_COTI_DETA_LIST(oBe);

                    oList.ForEach(obj =>
                    {
                        oListArti.Add(obj);
                    });
                    gdvArticles.RefreshData();

                    var oBeG = new BESVTD_COTI_GROU();
                    var oBrG = new BRSVTD_COTI_GROU();

                    oBeG.COD_COTI = oForm.oBe.COD_DVEN;
                    oBeG.NUM_ACCI = 5;
                    oBeG.COD_TIPO_DOCU = 4;
                    var oListG = oBrG.Get_SVPR_COTI_GROU_LIST(oBeG);

                    oListG.ForEach(obj =>
                    {
                        oListGroup.Add(obj);
                    });
                    gdvGroups.RefreshData();

                    var oBeDG = new BESVTD_COTI();
                    var oBrDG = new BRSVTD_COTI_GROU_DETA();

                    oBeDG.COD_COTI = oForm.oBe.COD_DVEN;
                    oBeDG.NUM_ACCI = 5;
                    oBeDG.COD_TIPO_DOCU = 4;
                    var oListDG = oBrDG.Get_SVPR_COTI_GROU_DETA_LIST(oBeDG);

                    oListDG.ForEach(obj =>
                    {
                        oListArtiGroup.Add(obj);
                    });
                    ListArticleCompletedUpdate();
                    gdvArticlesCompleted.RefreshData();
                    gdvArticlesGroup.RefreshData();
                }
            }
        }
示例#3
0
        /// <summary>
        /// PRESENTAR LA ORDEN DE VENTA CON LA INFORMACION PROVENIENTE DE LA COTIZACION
        /// </summary>
        /// <param name="COD_COTI"></param>
        public void SearchInvoice(int COD_DVENp)
        {
            ClearControl();
            StateControl(false);

            beALF_NOMB.Enabled = false;
            lueCOD_SUCU.Properties.ReadOnly = true;
            lueCOD_MONE.Properties.ReadOnly = true;
            lueCOD_ALMA.Properties.ReadOnly = true;
            txtNUM_DESC.Properties.ReadOnly = true;
            gcaNUM_CANT.OptionsColumn.AllowEdit = false;
            gcaNUM_CANT.OptionsColumn.AllowFocus = false;
            gcaNUM_CANT.OptionsColumn.ReadOnly = true;
            var oBe = new BESVTC_COTI();
            var oBr = new BRSVTC_COTI();
            oBe.ALF_NUME_IDEN = COD_DVENp.ToString();
            oBe.COD_TIPO_DOCU = 4;
            oBe.COD_COMP = SESSION_COMP;
            oBe.NUM_ACCI = 9;

            var oListDV = oBr.Get_SVPR_COTI_BUSC(oBe);
            LoadBranch(oListDV[0].COD_SOCI_NEGO);
            txtCOD_SOCI_NEGO.Text = oListDV[0].COD_SOCI_NEGO.ToString();
            beALF_NOMB.Text = oListDV[0].ALF_NOMB;
            txtALF_DIRE_FISC.Text = oListDV[0].ALF_DIRE;
            txtALF_TELE.Text = "";
            txtALF_FAXX.Text = "";
            txtALF_CONT.Text = oListDV[0].ALF_CONT;
            lueCOD_SUCU.EditValue = oListDV[0].COD_SUCU;
            txtNUM_DESC.Text = oListDV[0].NUM_DESC.ToString("#,##0.00");
            txtALF_NUME_FACT.Text = oListDV[0].ALF_NUME_SUNA;
            beALF_GUIA_REMI_STOR.Text = oListDV[0].ALF_NUME_DOCU;
            COD_DVEN = oListDV[0].COD_DVEN;
            txtNUM_NCRE.Text = string.Empty;
            deFEC_REGI.EditValue = DateTime.Today;
            deFEC_DOCU.EditValue = DateTime.Today;
            deFEC_VENC.EditValue = DateTime.Today;
            txtALF_ESTA.Text = oListDV[0].ALF_ESTA;
            lueCOD_MONE.EditValue = oListDV[0].COD_MONE;
            lueCOD_ALMA.EditValue = oListDV[0].COD_ALMA;
            txtALF_NUME_IDEN.Text = oListDV[0].ALF_NUME_IDEN;
            chkIGV.Checked = oListDV[0].IND_IMPU;
            chkIND_LIQU.Checked = oListDV[0].IND_LIQU;

            meALF_OBSE.Text = oListDV[0].ALF_OBSE;
            lblALF_SONN.Text = oListDV[0].ALF_TOTA;

            txtNUM_SUBT.Text = oListDV[0].NUM_SUBT.ToString("#,##0.00");
            txtNUM_IGVV.Text = oListDV[0].NUM_IGVV.ToString("#,##0.00");
            txtNUM_TOTA.Text = oListDV[0].NUM_TOTA.ToString("#,##0.00");

            var oBeSu = new BESVMD_SOCI_NEGO_SUCU();
            var oBrSu = new BRSVMD_SOCI_NEGO_SUCU();

            oBeSu.NUM_ACCI = 5;
            oBeSu.COD_SOCI_NEGO = oListDV[0].COD_SOCI_NEGO;
            var oListTC = oBrSu.Get_SVPR_SOCI_NEGO_SUCU_LIST(oBeSu);

            lueCOD_SUCU.Properties.DataSource = oListTC;
            lueCOD_SUCU.Properties.Columns.Clear();
            lueCOD_SUCU.Properties.Columns.Add(new LookUpColumnInfo("ALF_SUCU", 100, "Sucursal"));
            lueCOD_SUCU.Properties.DisplayMember = "ALF_SUCU";
            lueCOD_SUCU.Properties.ValueMember = "COD_SOCI_NEGO_SUCU";
            lueCOD_SUCU.EditValue = oListDV[0].COD_SUCU;

            var oBeD = new BESVTD_COTI();
            var oBrD = new BRSVTD_COTI();

            oBeD.COD_COTI = oListDV[0].COD_DVEN;
            oBeD.NUM_ACCI = 5;
            oBeD.COD_TIPO_DOCU = 4;
            var oList = oBrD.Get_SVPR_COTI_DETA_LIST(oBeD);

            oList.ForEach(obj =>
            {
                oListArti.Add(obj);
            });
            gdvArticles.RefreshData();

            var oBeG = new BESVTD_COTI_GROU();
            var oBrG = new BRSVTD_COTI_GROU();

            oBeG.COD_COTI = oListDV[0].COD_DVEN;
            oBeG.NUM_ACCI = 5;
            oBeG.COD_TIPO_DOCU = 4;
            var oListG = oBrG.Get_SVPR_COTI_GROU_LIST(oBeG);

            oListG.ForEach(obj =>
            {
                oListGroup.Add(obj);
            });
            gdvGroups.RefreshData();

            var oBeDG = new BESVTD_COTI();
            var oBrDG = new BRSVTD_COTI_GROU_DETA();

            oBeDG.COD_COTI = oListDV[0].COD_DVEN;
            oBeDG.NUM_ACCI = 5;
            oBeDG.COD_TIPO_DOCU = 4;
            var oListDG = oBrDG.Get_SVPR_COTI_GROU_DETA_LIST(oBeDG);

            oListDG.ForEach(obj =>
            {
                oListArtiGroup.Add(obj);
            });
            ListArticleCompletedUpdate();
            gdvArticlesCompleted.RefreshData();
            gdvArticlesGroup.RefreshData();
        }
示例#4
0
        public void SearchDetailReferralGuide(int COD_GREM)
        {
            var oBeC = new BESVTD_COTI();
            var oBrC = new BRSVTD_COTI();

            oBeC.COD_COTI = COD_GREM;
            oBeC.NUM_ACCI = 5;
            oBeC.COD_TIPO_DOCU = 3;
            var oListC = oBrC.Get_SVPR_COTI_DETA_LIST(oBeC);

            oListC.ForEach(obj =>
            {
                //if (oListArti.Count(objA => objA.COD_ARTI == obj.COD_ARTI) > 0)
                //{
                //    var NUM_CANT = oListArti.Find(objIi => objIi.COD_ARTI == obj.COD_ARTI).NUM_CANT;
                //    var NUM_IMPO = oListArti.Find(objIi => objIi.COD_ARTI == obj.COD_ARTI).NUM_IMPO;

                //    oListArti.Find(objIi => objIi.COD_ARTI == obj.COD_ARTI).NUM_CANT = NUM_CANT + obj.NUM_CANT;
                //    oListArti.Find(objIi => objIi.COD_ARTI == obj.COD_ARTI).NUM_IMPO = NUM_IMPO + obj.NUM_IMPO;
                //}
                //else
                //{
                oListArti.Add(obj);
                //}
            });
            gdvArticles.RefreshData();
            ListArticleCompletedUpdate();
            gdvArticlesCompleted.RefreshData();
            txtNUM_SUBT.Text = (oListArtiCompleted.Sum(obj => obj.NUM_IMPO)).ToString("#,##0.00");
            txtNUM_IGVV.Text = (Convert.ToDecimal(txtNUM_SUBT.Text) * (chkIGV.Checked ? SESSION_PORC_IMPU : Convert.ToDecimal("0.00"))).ToString("#,##0.00");
            txtNUM_TOTA.Text = (Convert.ToDecimal(txtNUM_SUBT.Text) + Convert.ToDecimal(txtNUM_IGVV.Text)).ToString("#,##0.00");
            ALF_TOTA(Convert.ToDecimal(txtNUM_TOTA.Text));
        }
示例#5
0
        public void SearchQuote()
        {
            ClearControl();
            using (var oForm = new xfSearchQuote(1,SESSION_COMP))
            {
                if (oForm.ShowDialog() == DialogResult.OK)
                {
                    LoadBranch(oForm.oBe.COD_SOCI_NEGO);
                    txtCOD_SOCI_NEGO.Text = oForm.oBe.COD_SOCI_NEGO.ToString();
                    beALF_NOMB.Text = oForm.oBe.ALF_NOMB;
                    txtALF_DIRE_FISC.Text = oForm.oBe.ALF_DIRE;
                    txtALF_TELE.Text = "";
                    txtALF_FAXX.Text = "";
                    txtALF_CONT.Text = oForm.oBe.ALF_CONT;
                    lueCOD_SUCU.EditValue = oForm.oBe.COD_SUCU;
                    txtNUM_DESC.Text = oForm.oBe.NUM_DESC.ToString("#,##0.00");
                    txtNUM_COTI.Text = oForm.oBe.COD_COTI.ToString();
                    deFEC_REGI.EditValue = oForm.oBe.FEC_REGI;
                    deFEC_DOCU.EditValue = oForm.oBe.FEC_DOCU;
                    deFEC_VENC.EditValue = oForm.oBe.FEC_VENC;
                    txtALF_ESTA.Text = oForm.oBe.ALF_ESTA;
                    lueCOD_MONE.EditValue = oForm.oBe.COD_MONE;
                    lueCOD_PROY.EditValue = oForm.oBe.COD_PROY;
                    ALF_EJEC_COME = oForm.oBe.ALF_EJEC_COME;
                    txtALF_ATEN.Text = oForm.oBe.ALF_ATEN;
                    lkeCOD_MOTI.EditValue = oForm.oBe.COD_MOTI;
                    mmoALF_COND_COME.Text = oForm.oBe.ALF_COND_COME;
                    lueCOD_EJEC_COME.EditValue = oForm.oBe.COD_EJEC_COME;
                    chkIGV.Checked = oForm.oBe.IND_IMPU;

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

                    txtNUM_SUBT.Text = oForm.oBe.NUM_SUBT.ToString("#,##0.00");
                    txtNUM_IGVV.Text = oForm.oBe.NUM_IGVV.ToString("#,##0.00");
                    txtNUM_TOTA.Text = oForm.oBe.NUM_TOTA.ToString("#,##0.00");

                    var oBe = new BESVTD_COTI();
                    var oBr = new BRSVTD_COTI();

                    oBe.COD_COTI = oForm.oBe.COD_COTI;
                    oBe.NUM_ACCI = 5;
                    oBe.COD_TIPO_DOCU = 1;
                    var oList = oBr.Get_SVPR_COTI_DETA_LIST(oBe);

                    oList.ForEach(obj =>
                    {
                        oListArti.Add(obj);
                    });
                    gdvArticles.RefreshData();

                    var oBeG = new BESVTD_COTI_GROU();
                    var oBrG = new BRSVTD_COTI_GROU();

                    oBeG.COD_COTI = oForm.oBe.COD_COTI;
                    oBeG.NUM_ACCI = 5;
                    oBeG.COD_TIPO_DOCU = 1;
                    var oListG = oBrG.Get_SVPR_COTI_GROU_LIST(oBeG);

                    oListG.ForEach(obj =>
                    {
                        oListGroup.Add(obj);
                    });
                    gdvGroups.RefreshData();

                    var oBeDG = new BESVTD_COTI();
                    var oBrDG = new BRSVTD_COTI_GROU_DETA();

                    oBeDG.COD_COTI = oForm.oBe.COD_COTI;
                    oBeDG.NUM_ACCI = 5;
                    oBeDG.COD_TIPO_DOCU = 1;
                    var oListDG = oBrDG.Get_SVPR_COTI_GROU_DETA_LIST(oBeDG);

                    oListDG.ForEach(obj =>
                    {
                        oListArtiGroup.Add(obj);
                    });
                    gdvArticlesGroup.RefreshData();

                    var oBeTC = new BESVMD_SOCI_NEGO_SUCU();
                    var oBrTC = new BRSVMD_SOCI_NEGO_SUCU();

                    oBeTC.NUM_ACCI = 5;
                    oBeTC.COD_SOCI_NEGO = oForm.oBe.COD_SOCI_NEGO;
                    var oListTC = oBrTC.Get_SVPR_SOCI_NEGO_SUCU_LIST(oBeTC);

                    lueCOD_SUCU.Properties.DataSource = oListTC;
                    lueCOD_SUCU.Properties.Columns.Clear();
                    lueCOD_SUCU.Properties.Columns.Add(new LookUpColumnInfo("ALF_SUCU", 100, "Sucursal"));
                    lueCOD_SUCU.Properties.DisplayMember = "ALF_SUCU";
                    lueCOD_SUCU.Properties.ValueMember = "COD_SOCI_NEGO_SUCU";

                    lueCOD_SUCU.EditValue = oForm.oBe.COD_SUCU;
                }
            }
        }
示例#6
0
        /// <summary>
        /// PRESENTAR LA ORDEN DE VENTA CON LA INFORMACION PROVENIENTE DE LA COTIZACION
        /// </summary>
        /// <param name="COD_COTI"></param>
        public void SearchSalesOrder(int COD_COTI)
        {
            ClearControl();
            StateControl(false);
            var oBe = new BESVTC_COTI();
            var oBr = new BRSVTC_COTI();
            oBe.ALF_NUME_IDEN = COD_COTI.ToString();
            oBe.COD_COMP = SESSION_COMP;
            oBe.COD_TIPO_DOCU = 1;
            oBe.NUM_ACCI = 6;

            var oList = oBr.Get_SVPR_COTI_BUSC(oBe);
            LoadBranch(oList[0].COD_SOCI_NEGO);
            txtCOD_SOCI_NEGO.Text = oList[0].COD_SOCI_NEGO.ToString();
            beALF_NOMB.Text = oList[0].ALF_NOMB;
            txtALF_DIRE_FISC.Text = oList[0].ALF_DIRE;
            txtALF_TELE.Text = "";
            txtALF_FAXX.Text = "";
            txtALF_CONT.Text = oList[0].ALF_CONT;
            lueCOD_SUCU.EditValue = oList[0].COD_SUCU;
            txtNUM_DESC.Text = oList[0].NUM_DESC.ToString("#,##0.00");
            txtCOD_COTI.Text = oList[0].COD_COTI.ToString();
            deFEC_REGI.EditValue = DateTime.Today;
            deFEC_DOCU.EditValue = DateTime.Today;
            deFEC_VENC.EditValue = DateTime.Today.AddDays(oList[0].NUM_DIAS);
            lueCOD_MONE.EditValue = oList[0].COD_MONE;
            lkeCOD_MOTI.EditValue = oList[0].COD_MOTI;
            chkIGV.Checked = oList[0].IND_IMPU;

            meALF_OBSE.Text = oList[0].ALF_OBSE;
            lblALF_SONN.Text = oList[0].ALF_TOTA;

            txtNUM_SUBT.Text = oList[0].NUM_SUBT.ToString("#,##0.00");
            txtNUM_IGVV.Text = oList[0].NUM_IGVV.ToString("#,##0.00");
            txtNUM_TOTA.Text = oList[0].NUM_TOTA.ToString("#,##0.00");

            var oBeSu = new BESVMD_SOCI_NEGO_SUCU();
            var oBrSu = new BRSVMD_SOCI_NEGO_SUCU();

            oBeSu.NUM_ACCI = 5;
            oBeSu.COD_SOCI_NEGO = oList[0].COD_SOCI_NEGO;
            var oListSu = oBrSu.Get_SVPR_SOCI_NEGO_SUCU_LIST(oBeSu);

            lueCOD_SUCU.Properties.DataSource = oListSu;
            lueCOD_SUCU.Properties.Columns.Clear();
            lueCOD_SUCU.Properties.Columns.Add(new LookUpColumnInfo("ALF_SUCU", 100, "Sucursal"));
            lueCOD_SUCU.Properties.DisplayMember = "ALF_SUCU";
            lueCOD_SUCU.Properties.ValueMember = "COD_SOCI_NEGO_SUCU";
            lueCOD_SUCU.EditValue = oList[0].COD_SUCU;

            var oBeC = new BESVTD_COTI();
            var oBrC = new BRSVTD_COTI();

            oBeC.COD_COTI = oList[0].COD_COTI;
            oBeC.NUM_ACCI = 5;
            oBeC.COD_TIPO_DOCU = 1;
            var oListC = oBrC.Get_SVPR_COTI_DETA_LIST(oBeC);

            oListC.ForEach(obj =>
            {
                oListArti.Add(obj);
            });
            gdvArticles.RefreshData();

            var oBeG = new BESVTD_COTI_GROU();
            var oBrG = new BRSVTD_COTI_GROU();

            oBeG.COD_COTI = oList[0].COD_COTI;
            oBeG.NUM_ACCI = 5;
            oBeG.COD_TIPO_DOCU = 1;
            var oListG = oBrG.Get_SVPR_COTI_GROU_LIST(oBeG);

            oListG.ForEach(obj =>
            {
                oListGroup.Add(obj);
            });
            gdvGroups.RefreshData();

            var oBeDG = new BESVTD_COTI();
            var oBrDG = new BRSVTD_COTI_GROU_DETA();

            oBeDG.COD_COTI = oList[0].COD_COTI;
            oBeDG.NUM_ACCI = 5;
            oBeDG.COD_TIPO_DOCU = 1;
            var oListDG = oBrDG.Get_SVPR_COTI_GROU_DETA_LIST(oBeDG);

            oListDG.ForEach(obj =>
            {
                oListArtiGroup.Add(obj);
            });
            ListArticleCompletedUpdate();
            gdvArticlesCompleted.RefreshData();
            gdvArticlesGroup.RefreshData();
        }
示例#7
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);
            }
        }
        /// <summary>
        /// INVOCAR EL CUADRO DE BUSQUEDA PARA LA NOTA DE CREDITO
        /// </summary>
        public void SearchSalesCreditNote()
        {
            ClearControl();
            using (var oForm = new xfSearchQuote(6, SESSION_COMP))
            {
                if (oForm.ShowDialog() == DialogResult.OK)
                {
                    txtCOD_SOCI_NEGO.Text = oForm.oBe.COD_SOCI_NEGO.ToString();
                    beALF_NOMB.Text = oForm.oBe.ALF_NOMB;
                    txtALF_DIRE_FISC.Text = oForm.oBe.ALF_DIRE;
                    txtALF_TELE.Text = "";
                    txtALF_FAXX.Text = "";
                    txtALF_CONT.Text = oForm.oBe.ALF_CONT;
                    txtNUM_DESC.Text = oForm.oBe.NUM_DESC.ToString("#,##0.00");
                    COD_DVEN = oForm.oBe.COD_DVEN;
                    txtNUM_NCRE.Text = oForm.oBe.COD_NCRE.ToString();
                    deFEC_REGI.EditValue = oForm.oBe.FEC_REGI;
                    deFEC_DOCU.EditValue = oForm.oBe.FEC_DOCU;
                    deFEC_VENC.EditValue = oForm.oBe.FEC_PAGO;
                    txtALF_ESTA.Text = oForm.oBe.ALF_ESTA;
                    lueCOD_MONE.EditValue = oForm.oBe.COD_MONE;
                    lueALF_SERI.EditValue = oForm.oBe.ALF_SERI;
                    txtNUM_CORR.Text = oForm.oBe.NUM_CORR.ToString("0000000");
                    txtALF_NUME_IDEN.Text = oForm.oBe.ALF_NUME_IDEN;
                    chkIGV.Checked = oForm.oBe.IND_IMPU;

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

                    txtNUM_SUBT.Text = oForm.oBe.NUM_SUBT.ToString("#,##0.00");
                    txtNUM_IGVV.Text = oForm.oBe.NUM_IGVV.ToString("#,##0.00");
                    txtNUM_TOTA.Text = oForm.oBe.NUM_TOTA.ToString("#,##0.00");

                    var oBe = new BESVTD_COTI();
                    var oBr = new BRSVTD_COTI();

                    oBe.COD_COTI = oForm.oBe.COD_DVEN;
                    oBe.NUM_ACCI = 5;
                    oBe.COD_TIPO_DOCU = 4;
                    var oList = oBr.Get_SVPR_COTI_DETA_LIST(oBe);

                }
            }
        }