Exemple #1
0
        private void DocPartidaRequisiciones_Load(object sender, EventArgs e)
        {
            txtDescuento.Text = Util.FormtStrDec("0");
            txtCantidad.Text  = Util.FormtStrDec("0");

            if (Opcion == 2)
            {
                AbrirPArtidas(partida);
            }

            txtPrecio.Enabled = (ConfigDoc.EditaPrecio == 1) ? true : false;
        }
Exemple #2
0
        private int getPrecio()
        {
            int Err = 0;
            PuiCatLstPrecios pui   = new PuiCatLstPrecios(db);
            SqlDataAdapter   Datos = null;
            DataSet          Ds    = new DataSet();

            object[] ObjA = null;

            pui.keyCveLstPrecio = LstPre_Clie;
            pui.cmpCveArticulo  = IdArt;

            Datos = pui.GetPrecioArticulo();

            Datos.Fill(Ds);

            if (Ds.Tables[0].Rows.Count > 0)
            {
                ObjA = Ds.Tables[0].Rows[0].ItemArray;
            }
            else
            {
                pui.keyCveLstPrecio = LstPre_Alm;
                pui.cmpNombre       = IdArt;

                Datos = pui.GetPrecioArticulo();
                Datos.Fill(Ds);
                if (Ds.Tables[0].Rows.Count > 0)
                {
                    ObjA = Ds.Tables[0].Rows[0].ItemArray;
                }
                else
                {
                    Err = 1;
                }
            }

            if (Err == 0)
            {
                double Ppre = Convert.ToDouble(ObjA[4]);
                int    rPre = Ppre.CompareTo(0);
                if (rPre > 0)
                {
                    PuiCatImpuestos I = new PuiCatImpuestos(db);
                    if (!String.IsNullOrEmpty(CveIEPS))
                    {
                        I.keyCveImpuesto = CveIEPS;
                        I.EditarImpuesto();
                        if (I.cmpValor > 0)
                        {
                            Ppre += Ppre * (I.cmpValor / 100);
                        }
                    }
                    if (!String.IsNullOrEmpty(CveImp))
                    {
                        I.keyCveImpuesto = CveImp;
                        I.EditarImpuesto();
                        if (I.cmpValor > 0)
                        {
                            Ppre += Ppre * (I.cmpValor / 100);
                        }
                    }
                    lblPrecioArt.Text = Util.FormtStrDec(ObjA[4].ToString());//ObjA[4].ToString();
                }
                else
                {
                    Err = 1;
                }
            }


            return(Err);
        }