Exemplo n.º 1
0
        private void AbrirPArtidas(DocPartidasReq part)
        {
            //txtClaveArticulo.Text = part.CveArticulo;
            txtClaveArticulo.Text = (ParamSystem.HideCveArt == 1) ? part.CodigoBarra : part.CveArticulo;

            IdArt                        = part.CveArticulo;
            CodBa                        = part.CodigoBarra;
            CveImp                       = part.CveImpuesto;
            CveUmed                      = part.CveUmedida1;
            txtDescripcion.Text          = part.Descripcion;
            txtPrecio.Text               = part.Precio.ToString();
            txtDescuento.Text            = (part.Descuento > 0) ? part.Descuento.ToString() : "0.00";
            txtTotalDescuento.Text       = (part.TotalDscto > 0) ? part.TotalDscto.ToString() : "0.00";
            chkCalculaPorcentaje.Checked = (part.DsctoEsPorcentaje == 1) ? true : false;
            txtPrecioNeto.Text           = Util.FormtDouDec(part.PrecioNeto); //part.PrecioNeto.ToString();
            txtCantidad.Text             = part.Cantidad.ToString();
            txtImpuesto.Text             = Util.FormtDouDec(part.Impuesto);   //part.Impuesto.ToString();
            txtSubtotal.Text             = Util.FormtDouDec(part.SubTotal);   //part.SubTotal.ToString();
            txtTotal.Text                = Util.FormtDouDec(part.Total);      //part.Total.ToString();
            txtValorIVA.Text             = part.ImpuestoValor.ToString();

            CveImpIEPS        = part.CveImpIEPS;
            txtImpIEPS.Text   = Util.FormtDouDec(part.TotalIEPS); //part.Impuesto.ToString();
            txtValorIESP.Text = part.ImpIEPSValor.ToString();

            Linea = part.Linea;
            Marca = part.Marca;
        }
Exemplo n.º 2
0
        private void txtCantidad_KeyPress(object sender, KeyPressEventArgs e)
        {
            char ch = e.KeyChar;

            if (!Char.IsNumber(ch) && ch != 8 && ch != 13)
            {
                e.Handled = true;
                //ErrCalc = false;
            }
            else
            {
                if (ch == 13)
                {
                    if (Valida() == 0)
                    {
                        partida = new DocPartidasReq();
                        AbrirPArtidas();

                        if (partida != null)
                        {
                            if (!partida.CveArticulo.Equals(""))
                            {
                                double subTotal = 0, total = 0, ccant = 0;

                                PARTIDAS.Add(partida);
                                for (int i = 0; i < PARTIDAS.Count; i++)
                                {
                                    PARTIDAS[i].idMov        = idmovimiento;
                                    PARTIDAS[i].Serie        = serieticket;
                                    PARTIDAS[i].Partida      = i + 1;
                                    PARTIDAS[i].ClaveAlmacen = user.AlmacenUsa;
                                    PARTIDAS[i].Autorizado   = false;
                                    subTotal = subTotal + PARTIDAS[i].SubTotal;
                                    total    = total + PARTIDAS[i].Total;
                                    ccant    = ccant + PARTIDAS[i].Cantidad;
                                }
                                lblSubTotal.Text       = Util.FormtDouDec(subTotal); //subTotal.ToString("C2");
                                lblTotal.Text          = Util.FormtDouDec(total);    //total.ToString("C2");
                                lblTotalArticulos.Text = "Artículos: " + Convert.ToInt32(ccant);
                                LLenaGrid();
                                ResetControles(1);
                                InhControles(true, 1);
                                OptPartd = 1;
                            }
                        }
                        ShowLstArt();
                    }
                }

                //ErrCalc = true;
            }
        }
Exemplo n.º 3
0
 public DocPartidaRequisiciones(MsSql oDat, DatCfgParamSystem ParamS, DatCfgUsuario DatUsr, clsCfgDocumento CfgDoc,
                                clsCfgAlmacen PCfgAlma, clsStiloTemas NewColor, int op, DocPartidasReq part = null)
 {
     InitializeComponent();
     StiloColor  = NewColor;
     ParamSystem = ParamS;
     db          = oDat;
     Util        = new ClsUtilerias(ParamSystem.NumDec);
     user        = DatUsr;
     Opcion      = op;
     partida     = part;
     ConfigDoc   = CfgDoc;
     CfgAlma     = PCfgAlma;
 }
Exemplo n.º 4
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     try
     {
         int partida = Convert.ToInt32(grdViewD[6, grdViewD.CurrentRow.Index].Value);
         pr = PARTIDAS.Find(x => x.Partida.Equals(partida));
         int idx = PARTIDAS.IndexOf(pr);
         PARTIDAS.RemoveAt(idx);
         ReasgIdPart();
         LLenaGrid();
         OptPartd = 1;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Tienes que seleccionar una partida\n Error:" + ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Exemplo n.º 5
0
        private void AddPartida_Click(object sender, EventArgs e)
        {
            if (Valida(0) == 0)
            {
                DocPartidasReq          par = new DocPartidasReq();
                DocPartidaRequisiciones DP  = new DocPartidaRequisiciones(db, ParamSystem, user, ConfigDoc, cfgAlma, StiloColor, 1, par);
                DP.CaptionBarColor  = ColorTranslator.FromHtml(StiloColor.Encabezado);
                DP.CaptionForeColor = ColorTranslator.FromHtml(StiloColor.FontColor);
                DP.ShowDialog();

                DocPartidasReq partida = DP.partida;

                if (partida != null)
                {
                    if (partida.CveArticulo != null)
                    {
                        PARTIDAS.Add(partida);
                        for (int i = 0; i < PARTIDAS.Count; i++)
                        {
                            PARTIDAS[i].idMov        = idmovimiento;
                            PARTIDAS[i].Serie        = "";
                            PARTIDAS[i].Partida      = i + 1;
                            PARTIDAS[i].ClaveAlmacen = cboAlmacen.SelectedValue.ToString();
                            //PARTIDAS[i].ClaveAlmacen = ConfigDoc.UsaAlmTmp ==1 ?"999": cboAlmacen.SelectedValue.ToString();
                            PARTIDAS[i].Autorizado = false;

                            if (Opcion == 1)
                            {
                                PARTIDAS[i].FechaCaptura = user.FecServer;
                            }

                            PARTIDAS[i].FechaModificacion = user.FecServer;
                        }

                        cboAlmacen.Enabled  = false;
                        cboSucursal.Enabled = false;

                        LLenaGrid();
                    }
                }
            }
        }
Exemplo n.º 6
0
        private void ActAutoriza(Boolean chk)
        {
            try
            {
                int partida = Convert.ToInt32(grdViewD[6, grdViewD.CurrentRow.Index].Value);

                DocPartidasReq pr  = PARTIDAS.Find(x => x.Partida.Equals(partida));
                int            idx = PARTIDAS.IndexOf(pr);
                PARTIDAS.RemoveAt(idx);

                pr.Autorizado = chk ? true : false;

                PARTIDAS.Insert(idx, pr);

                LLenaGrid();
            }
            catch (Exception ex)
            {
                MessageBoxAdv.Show("Tienes que seleccionar una partida\n Error:" + ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 7
0
        private void DelPartida_Click(object sender, EventArgs e)
        {
            try
            {
                int partida = Convert.ToInt32(grdViewD[6, grdViewD.CurrentRow.Index].Value);

                DocPartidasReq pr  = PARTIDAS.Find(x => x.Partida.Equals(partida));
                int            idx = PARTIDAS.IndexOf(pr);
                PARTIDAS.RemoveAt(idx);

                LLenaGrid();

                if (grdViewD.RowCount <= 0)
                {
                    cboAlmacen.Enabled  = user.CambiaAlmacen == 1 ? true : false;
                    cboSucursal.Enabled = user.CambiaAlmacen == 1 ? true : false;
                }
            }
            catch (Exception ex)
            {
                MessageBoxAdv.Show("Tienes que seleccionar una partida\n Error:" + ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 8
0
        private void AbrirPArtidas(DocPartidasReq part)
        {
            txtClaveArticulo.Text = part.CveArticulo;
            IdArt   = part.CveArticulo;
            CveImp  = part.CveImpuesto;
            CveUmed = part.CveUmedida1;
            lblDescArticulo.Text = part.Descripcion;
            lblPrecioArt.Text    = part.Precio.ToString();
            //txtDescuento.Text = (part.Descuento > 0) ? part.Descuento.ToString() : "0.00";
            //lblPrecioArtNeto.Text = part.PrecioNeto.ToString();
            txtCantidad.Text = part.Cantidad.ToString();
            //txtImpuesto.Text = part.Impuesto.ToString();
            //txtSubtotal.Text = part.SubTotal.ToString();
            //txtTotal.Text = part.Total.ToString();
            //txtIva.Text = part.ImpuestoValor.ToString();

            InhControles(false, 1);
            txtCantidad.Enabled = true;
            ExistArt();


            OptPartd = 2;
        }
Exemplo n.º 9
0
        private void EditPartida_Click(object sender, EventArgs e)
        {
            try
            {
                if (Valida(0) == 0)
                {
                    int partida = Convert.ToInt32(grdViewD[6, grdViewD.CurrentRow.Index].Value);

                    DocPartidasReq pr  = PARTIDAS.Find(x => x.Partida.Equals(partida));
                    int            idx = PARTIDAS.IndexOf(pr);
                    PARTIDAS.RemoveAt(idx);

                    DocPartidaRequisiciones prV = new DocPartidaRequisiciones(db, ParamSystem, user, ConfigDoc, cfgAlma, StiloColor, 2, pr);
                    prV.CaptionBarColor  = ColorTranslator.FromHtml(StiloColor.Encabezado);
                    prV.CaptionForeColor = ColorTranslator.FromHtml(StiloColor.FontColor);

                    prV.ShowDialog();

                    if (prV.partida != null)
                    {
                        PARTIDAS.Insert(idx, prV.partida);
                        PARTIDAS[idx].FechaCaptura      = pr.FechaCaptura;
                        PARTIDAS[idx].FechaModificacion = user.FecServer;
                    }
                    else
                    {
                        PARTIDAS.Insert(idx, pr);
                    }

                    LLenaGrid();
                }
            }
            catch (Exception ex)
            {
                MessageBoxAdv.Show("Tienes que seleccionar una partida\n Error:" + ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 10
0
        private void getRegistro()
        {
            DocPuiRequisiciones sRq = new DocPuiRequisiciones(db);

            sRq.keyidMov = idmovimiento;
            sRq.GetDocumento();
            txtDocumento.Text = sRq.keyDocumento;
            if (ConfigDoc.UsaSerie == 1)
            {
                cboSerie.SelectedValue = sRq.cmpSerie;
            }
            txtNumDoc.Text           = Convert.ToString(sRq.cmpNumDoc);
            cboAlmacen.SelectedValue = sRq.cmpClaveAlmacen;
            FechaExpedicion.Value    = sRq.cmpFechaExpedicion;

            txtObservaciones.Text = sRq.cmpObservaciones;
            if (ConfigDoc.UsaProveedor == 1)
            {
                cboProveedor.SelectedValue = sRq.cmpCveProveedor;
            }

            if (ConfigDoc.UsaAlmDestino == 1)
            {
                cboProveedor.SelectedValue = sRq.cmpCveSucursal;
            }

            txtNoFactura.Text = "";
            if (ConfigDoc.UsaFactura == 1)
            {
                txtNoFactura.Text = sRq.cmpNoFactura;
            }

            SqlDataAdapter DatosTbl = sRq.GetDatelleDoc(idmovimiento);
            DataSet        ds       = new DataSet();

            DatosTbl.Fill(ds);
            DataTable dt = ds.Tables[0];


            //double subTotal = 0, impuesto = 0, total = 0, descpartida = 0, descuento = 0;

            foreach (DataRow row in dt.Rows)
            {
                DocPartidasReq partida = new DocPartidasReq();
                partida.idMov             = row["idMov"].ToString();
                partida.Documento         = row["Documento"].ToString();
                partida.Serie             = row["Serie"].ToString();
                partida.Numdoc            = long.Parse(row["Numdoc"].ToString());
                partida.ClaveAlmacen      = row["ClaveAlmacen"].ToString();
                partida.Partida           = int.Parse(row["Partida"].ToString());
                partida.CveArticulo       = row["CveArticulo"].ToString();
                partida.CodigoBarra       = row["CodigoBarra"].ToString();
                partida.Descripcion       = row["Descripcion"].ToString();
                partida.Cantidad          = double.Parse(row["Cantidad"].ToString());
                partida.CveUmedida1       = row["CveUmedida1"].ToString();
                partida.CveImpuesto       = row["CveImpuesto"].ToString();
                partida.ImpuestoValor     = Convert.ToDouble(row["ImpuestoValor"].ToString());
                partida.Precio            = Convert.ToDouble(row["Precio"].ToString());
                partida.Descuento         = Convert.ToDouble(row["Descuento"].ToString());
                partida.TotalDscto        = Convert.ToDouble(row["TotalDscto"].ToString());
                partida.DsctoEsPorcentaje = Convert.ToInt32(row["DsctoEsPorcentaje"].ToString());
                partida.PrecioNeto        = Convert.ToDouble(row["PrecioNeto"].ToString());
                partida.Impuesto          = Convert.ToDouble(row["Impuesto"].ToString());
                partida.SubTotal          = Convert.ToDouble(row["SubTotal"].ToString());
                partida.Total             = Convert.ToDouble(row["Total"].ToString());
                partida.Autorizado        = Boolean.Parse(row["Autorizado"].ToString());
                partida.FechaCaptura      = Convert.ToDateTime(row["FechaCaptura"].ToString());
                partida.FechaModificacion = Convert.ToDateTime(row["FechaModificacion"].ToString());

                partida.CveImpIEPS     = row["CveImpIEPS"].ToString();
                partida.ImpIEPSValor   = Convert.ToDouble(row["ImpIEPSValor"].ToString());
                partida.CveImpRetISR   = "";
                partida.ImpRetISRValor = 0;
                partida.CveImpRetIVA   = "";
                partida.ImpRetIVAValor = 0;
                partida.CveImpOtro     = "";
                partida.ImpValorOtro   = 0;
                partida.TotalIEPS      = Convert.ToDouble(row["TotalIEPS"].ToString());
                partida.TotalRetISR    = 0;
                partida.TotalRetIVA    = 0;
                partida.TotalImpOtro   = 0;


                PARTIDAS.Add(partida);
            }
            txtDescuento.Text = Convert.ToString(Util.FormtDouDec(sRq.cmpDescuento));

            LLenaGrid();
        }
Exemplo n.º 11
0
        private void getRegistro(String IdM)
        {
            DocPuiRequisiciones sRq = new DocPuiRequisiciones(db);

            sRq.keyidMov = IdM;
            sRq.GetDocumento();

            if (ConfigDoc.UsaSerie == 1)
            {
                serieticket = sRq.cmpSerie;
            }

            /*
             * txtNumDoc.Text = Convert.ToString(sRq.cmpNumDoc);
             * cboAlmacen.SelectedValue = sRq.cmpClaveAlmacen;
             * FechaExpedicion.Value = sRq.cmpFechaExpedicion;
             */
            txtDescuento.Text = Convert.ToString(sRq.cmpDescuento);

            /*
             * if (ConfigDoc.UsaProveedor == 1)
             * {
             *  cboProveedor.SelectedValue = sRq.cmpCveProveedor;
             * }
             * if (ConfigDoc.UsaCliente == 0)
             * {
             *  cboCliente.SelectedValue = sRq.cmpCveCliente;
             * }
             */

            SqlDataAdapter DatosTbl = sRq.GetDatelleDoc(IdM);
            DataSet        ds       = new DataSet();

            DatosTbl.Fill(ds);
            DataTable dt = ds.Tables[0];


            double subTotal = 0, impuesto = 0, total = 0, ccant = 0;

            foreach (DataRow row in dt.Rows)
            {
                DocPartidasReq partida = new DocPartidasReq();
                partida.idMov         = row["idMov"].ToString();
                partida.Documento     = row["Documento"].ToString();
                partida.Serie         = row["Serie"].ToString();
                partida.Numdoc        = long.Parse(row["Numdoc"].ToString());
                partida.ClaveAlmacen  = row["ClaveAlmacen"].ToString();
                partida.Partida       = int.Parse(row["Partida"].ToString());
                partida.CveArticulo   = row["CveArticulo"].ToString();
                partida.Descripcion   = row["Descripcion"].ToString();
                partida.Cantidad      = double.Parse(row["Cantidad"].ToString());
                partida.CveUmedida1   = row["CveUmedida1"].ToString();
                partida.CveImpuesto   = row["CveImpuesto"].ToString();
                partida.ImpuestoValor = Convert.ToDouble(row["ImpuestoValor"].ToString());
                partida.Precio        = Convert.ToDouble(row["Precio"].ToString());
                partida.Descuento     = Convert.ToDouble(row["Descuento"].ToString());
                partida.PrecioNeto    = Convert.ToDouble(row["PrecioNeto"].ToString());
                partida.Impuesto      = Convert.ToDouble(row["Impuesto"].ToString());
                partida.SubTotal      = Convert.ToDouble(row["SubTotal"].ToString());
                partida.Total         = Convert.ToDouble(row["Total"].ToString());
                partida.Autorizado    = Boolean.Parse(row["Autorizado"].ToString());

                subTotal = subTotal + Convert.ToDouble(row["SubTotal"].ToString());
                impuesto = impuesto + Convert.ToDouble(row["Impuesto"].ToString());
                total    = total + Convert.ToDouble(row["Total"].ToString());
                ccant    = ccant + Convert.ToDouble(row["Cantidad"].ToString());
                PARTIDAS.Add(partida);
            }

            lblSubTotal.Text       = Util.FormtDouDec(subTotal); //subTotal.ToString("C2");
            lblTotal.Text          = Util.FormtDouDec(total);    //total.ToString();
            lblTotalArticulos.Text = "Artículos: " + Convert.ToInt32(ccant);
            LLenaGrid();
        }
Exemplo n.º 12
0
 private void cmdCancelar_Click(object sender, EventArgs e)
 {
     partida = null;
     this.Close();
 }