private void bt_ElimiJusti_Click(object sender, EventArgs e)
        {
            Frm_Advertencia  adv  = new Frm_Advertencia();
            Frm_Sino         sino = new Frm_Sino();
            Frm_Msm_Bueno    ok   = new Frm_Msm_Bueno();
            Frm_Filtro       fis  = new Frm_Filtro();
            RN_Justificacion obj  = new RN_Justificacion();

            if (lsv_justifi.SelectedIndices.Count == 0)
            {
                fis.Show();
                adv.Lbl_Msm1.Text = "Seleccione el registro que desea eliminar";
                adv.ShowDialog();
                fis.Hide();
                return;
            }
            else
            {
                var    lsv    = lsv_justifi.SelectedItems[0];
                string xidjus = lsv.SubItems[0].Text;

                sino.Lbl_msm1.Text = "¿Estás seguro que deseas eliminar esta justificación?" + "\n\r" + "Recuerda que este proceso es bajo su responsabilidad";
                fis.Show();
                sino.ShowDialog();
                fis.Hide();

                if (Convert.ToString(sino.Tag) == "Si")
                {
                    obj.RN_Eliminar_Justificacion(xidjus);
                    if (BD_Justificacion.tryed == true)
                    {
                        fis.Show();
                        ok.Lbl_msm1.Text = "Justificación Eliminada";
                        ok.ShowDialog();
                        fis.Hide();

                        Buscar_Justifiacion_porValor(xidjus);
                    }
                }
            }
        }
Beispiel #2
0
        private void btn_procesar_Click(object sender, EventArgs e)
        {
            Frm_Advertencia ver = new Frm_Advertencia();
            Frm_Filtro      fil = new Frm_Filtro();

            if (txtCuenta.Text == "")
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese un monto"; ver.ShowDialog(); fil.Hide(); txtCuenta.Focus(); return;
            }
            if (Convert.ToDouble(txtCuenta.Text) == Convert.ToDouble(lblTotalCuenta.Text))
            {
                fil.Show(); ver.lbl_Msm1.Text = "El importe no puede ser igual a el total a pagar. Por vafor realice una venta en efectivo"; ver.ShowDialog(); fil.Hide(); txtCuenta.Focus(); return;
            }
            if (Convert.ToDouble(txtCuenta.Text) > Convert.ToDouble(lblTotalCuenta.Text))
            {
                fil.Show(); ver.lbl_Msm1.Text = "El importe a cuenta no puede ser MAYOR al total a pagar"; ver.ShowDialog(); fil.Hide(); txtCuenta.Focus(); return;
            }

            this.Tag = "A";
            this.Close();
        }
Beispiel #3
0
        private void bt_copiarNroDNI_Click(object sender, EventArgs e)
        {
            Frm_Advertencia adver = new Frm_Advertencia();
            Frm_Filtro      fil   = new Frm_Filtro();

            if (lsv_person.SelectedIndices.Count == 0)
            {
                fil.Show();
                adver.Lbl_Msm1.Text = "Seleccione el Item que desea Copiar";
                adver.ShowDialog();
                fil.Hide(); return;
            }
            else
            {
                var    lsv  = lsv_person.SelectedItems[0];
                string xdin = lsv.SubItems[1].Text;

                Clipboard.Clear();
                Clipboard.SetText(xdin.Trim());
            }
        }
Beispiel #4
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            Frm_Filtro      fil   = new Frm_Filtro();
            Frm_Advertencia adver = new Frm_Advertencia();

            if (txt_cant.Text.Trim() == "")
            {
                return;
            }
            if (txt_cant.Text.Trim().Length == 0)
            {
                fil.Show(); adver.lbl_Msm1.Text = "Por favor agrege un precio"; fil.Hide(); return;
            }
            if (Convert.ToDouble(txt_cant.Text) == 0)
            {
                fil.Show(); adver.lbl_Msm1.Text = "Por favor agrege un precio"; fil.Hide(); txt_cant.Focus(); return;
            }

            this.Tag = "A";
            this.Close();
        }
Beispiel #5
0
        private void ltsProveedor_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Frm_Advertencia adv = new Frm_Advertencia();
            Frm_Filtro      fil = new Frm_Filtro();

            if (ltsProveedor.SelectedIndices.Count == 0)
            {
                fil.Show();
                adv.lbl_Msm1.Text = "Seleccionar un Proveedor";
                adv.ShowDialog();
                fil.Hide();
            }
            else
            {
                lblId.Text     = ltsProveedor.SelectedItems[0].SubItems[0].Text;
                lblNombre.Text = ltsProveedor.SelectedItems[0].SubItems[1].Text;

                this.Tag = "A";
                this.Close();
            }
        }
Beispiel #6
0
        private void bt_copiarIDProveedorTool_Click(object sender, EventArgs e)
        {
            Frm_Filtro      fil = new Frm_Filtro();
            Frm_Advertencia ver = new Frm_Advertencia();

            if (ltsProveedores.SelectedIndices.Count == 0)
            {
                fil.Show();
                ver.lbl_Msm1.Text = "Por vavor Seleccione un Proveedor";
                ver.ShowDialog();
                fil.Hide();
            }
            else
            {
                var    lis      = ltsProveedores.SelectedItems[0];
                string idprovee = lis.SubItems[0].Text;

                Clipboard.Clear();
                Clipboard.SetText(idprovee.Trim());
            }
        }
Beispiel #7
0
        private void Guardar_SalidaCaja()
        {
            RN_Caja         obj = new RN_Caja();
            EN_Caja         cja = new EN_Caja();
            Frm_Advertencia ver = new Frm_Advertencia();
            Frm_Filtro      fil = new Frm_Filtro();

            try
            {
                cja.FechaCaja      = dtp_fecha.Value;
                cja.TipoCaja       = "Salida";
                cja.Concepto       = txt_concepto.Text;
                cja.DePara_Cliente = txt_cliente.Text;
                cja.Nr_Documento   = txt_nroDoc.Text;
                cja.ImporteCaja    = Convert.ToDouble(txt_importe.Text);
                cja.IdUsu          = Convert.ToInt32(Cls_Libreria.IdUsu);
                cja.TotalUtilidad  = 0;
                cja.TipoPago       = cbo_tipoPago.Text;
                cja.GeneradoPor    = "Otros";
                obj.RN_Registrar_Movimiento_Caja(cja);

                if (BD_Caja.seguardo == true)
                {
                    fil.Show();
                    ver.lbl_Msm1.Text = "La salida de caja se guardo exitosamente";
                    ver.ShowDialog();
                    fil.Hide();

                    this.Tag = "A";
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                fil.Show();
                ver.lbl_Msm1.Text = "Ha ocurrido un error: " + ex.Message;
                ver.ShowDialog();
                fil.Hide();
            }
        }
        private void bt_CopiarNroJusti_Click(object sender, EventArgs e)
        {
            Frm_Advertencia adv = new Frm_Advertencia();
            Frm_Filtro      fil = new Frm_Filtro();

            if (lsv_justifi.SelectedIndices.Count == 0)
            {
                fil.Show();
                adv.Lbl_Msm1.Text = "Seleccione el registro que desea eliminar";
                adv.ShowDialog();
                fil.Hide();
                return;
            }
            else
            {
                var    lsv  = lsv_justifi.SelectedItems[0];
                string xdni = lsv.SubItems[0].Text;

                Clipboard.Clear();
                Clipboard.SetText(xdni.Trim());
            }
        }
Beispiel #9
0
        private void bt_ElimiJusti_Click(object sender, EventArgs e)
        {
            Frm_Advertencia  adv  = new Frm_Advertencia();
            Frm_Sino         sino = new Frm_Sino();
            Msm_Bueno        ok   = new Msm_Bueno();
            Frm_Filtro       fil  = new Frm_Filtro();
            RN_Justificacion obj  = new RN_Justificacion();

            if (lsv_justifi.SelectedIndices.Count == 0)
            {
                fil.Show();
                adv.Lbl_Msm1.Text = "Seleccione el item que desea Eliminar";
                adv.ShowDialog();
                fil.Hide(); return;
            }
            else
            {
                var    lsv    = lsv_justifi.SelectedItems[0];
                string xidjus = lsv.SubItems[0].Text;

                sino.Lbl_msm1.Text = "Estas Seguro de Eliminar la Justificacion?" + "\n\r" + "- Recuerda que este proceso esta bajo tu responsabilidad";
                fil.Show();
                sino.ShowDialog();
                fil.Hide();

                if (Convert.ToString(sino.Tag) == "Si")
                {
                    obj.RN_Eliminar_Justificacion(xidjus);
                    fil.Show();
                    ok.Lbl_msm1.Text = "Justificacion Desaprobada";
                    ok.ShowDialog();
                    fil.Hide();


                    BuscarJustificacion_porValor(xidjus);
                }
            }
        }
Beispiel #10
0
        private void lsv_Pedido_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Frm_Filtro      fil = new Frm_Filtro();
            Frm_Advertencia adv = new Frm_Advertencia();

            if (lsv_Pedido.SelectedIndices.Count == 0)
            {
                fil.Show();
                adv.lbl_Msm1.Text = "Selecciona un producto a quitar";
                adv.ShowDialog();
                fil.Hide();
            }
            else
            {
                int i;
                var lis = lsv_Pedido.SelectedItems[0];
                for (i = lsv_Pedido.SelectedItems.Count - 1; i >= 0; i--)
                {
                    lsv_Pedido.Items.Remove(lsv_Pedido.SelectedItems[i]);
                }
                Calcular();
            }
        }
Beispiel #11
0
        private void reimprimirDocumentoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Frm_Filtro         fil   = new Frm_Filtro();
            Frm_Advertencia    ver   = new Frm_Advertencia();
            Form_VerDet_Compra edi   = new Form_VerDet_Compra();
            Frm_Crear_Ventas   venta = new Frm_Crear_Ventas();

            if (ltsCompras.SelectedIndices.Count == 0)
            {
                fil.Show();
                ver.lbl_Msm1.Text = "Seleccione un producto";
                ver.ShowDialog();
                fil.Hide();
            }
            else
            {
                var    lis   = ltsCompras.SelectedItems[0];
                string idDoc = lis.SubItems[0].Text;

                fil.Show();
                venta.txtBuscar.Text = idDoc;
                venta.ShowDialog();
                fil.Hide();

                try
                {
                    if (edi.Tag.ToString() == "A")
                    {
                        Cargar_todos_Ventas();
                    }
                }
                catch (Exception)
                {
                    edi.Tag = "";
                }
            }
        }
Beispiel #12
0
        private bool Validar_Texbox()
        {
            Frm_Filtro      fil = new Frm_Filtro();
            Frm_Advertencia ver = new Frm_Advertencia();

            if (txtId.Text.Trim().Length < 2)
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese un id del Cliente"; ver.ShowDialog(); fil.Hide(); return(false);
            }
            if (txtNombre.Text.Trim().Length < 2)
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese la razon social del Cliente"; ver.ShowDialog(); fil.Hide(); txtNombre.Focus(); return(false);
            }
            if (txtRuc.Text.Trim().Length < 2)
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese el RFC del Cliente"; ver.ShowDialog(); fil.Hide(); txtRuc.Focus(); return(false);
            }
            if (txtDireccion.Text.Trim().Length < 2)
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese un id del Cliente"; ver.ShowDialog(); fil.Hide(); txtDireccion.Focus(); return(false);
            }

            return(true);
        }
Beispiel #13
0
        private void lblAbrir_Click(object sender, EventArgs e)
        {
            Frm_Filtro      fil      = new Frm_Filtro();
            Frm_Advertencia adv      = new Frm_Advertencia();
            var             FilePath = string.Empty;

            try
            {
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    xFotoruta = openFileDialog1.FileName;
                    piclogo.Load(xFotoruta);
                }
            }
            catch (Exception ex)
            {
                piclogo.Load(Application.StartupPath + @"\user.png");
                xFotoruta = Application.StartupPath + @"\user.png";
                fil.Show();
                adv.lbl_Msm1.Text = "Error al Guardar el Personal: " + ex.Message;
                adv.ShowDialog();
                fil.Hide();
            }
        }
Beispiel #14
0
        private void txt_cant_KeyDown(object sender, KeyEventArgs e)
        {
            Frm_Filtro      fil   = new Frm_Filtro();
            Frm_Advertencia adver = new Frm_Advertencia();

            if (e.KeyCode == Keys.Enter)
            {
                if (txt_cant.Text.Trim() == "")
                {
                    return;
                }

                if (txt_cant.Text.Trim().Length == 0)
                {
                    fil.Show(); adver.lbl_Msm1.Text = "La cantidad no puede ser 0"; txt_cant.Focus(); return;
                }
                if (Convert.ToDouble(txt_cant.Text) == 0)
                {
                    fil.Show(); adver.lbl_Msm1.Text = "La cantidad debe ser mayor a 0"; txt_cant.Focus(); return;
                }
                this.Tag = "A";
                this.Close();
            }
        }
        private void TimerFalta_Tick(object sender, EventArgs e)
        {
            RN_Asistencia   obj     = new RN_Asistencia();
            Frm_Filtro      fis     = new Frm_Filtro();
            Frm_Advertencia adver   = new Frm_Advertencia();
            Frm_Msm_Bueno   ok      = new Frm_Msm_Bueno();
            DataTable       dataper = new DataTable();
            RN_Personal     objper  = new RN_Personal();

            int HoLimite = Dtp_Hora_Limite.Value.Hour;
            int MiLimite = Dtp_Hora_Limite.Value.Minute;

            int horaCaptu   = DateTime.Now.Hour;
            int minutoCaptu = DateTime.Now.Minute;

            string Dniper         = "";
            int    Cant           = 0;
            int    TotalItem      = 0;
            string xidpersona     = "";
            string IdAsistencia   = "";
            string xjustificacion = "";

            if (horaCaptu >= HoLimite)
            {
                if (minutoCaptu > MiLimite)
                {
                    dataper = objper.RN_Leer_todoPersona();

                    if (dataper.Rows.Count <= 0)
                    {
                        return;
                    }
                    TotalItem = dataper.Rows.Count;

                    foreach (DataRow Registro in dataper.Rows)
                    {
                        Dniper     = Convert.ToString(Registro["DNIPR"]);
                        xidpersona = Convert.ToString(Registro["Id_Pernl"]);

                        if (obj.RN_Checar_SiPersonal_TieneAsistencia_Registrada(xidpersona.Trim()) == false)
                        {
                            if (obj.RN_Checar_SiPersonal_YaMarco_suFalta(xidpersona.Trim()) == false)
                            {
                                //Registrar falta
                                RN_Asistencia ojbA = new RN_Asistencia();
                                EN_Asistencia asi  = new EN_Asistencia();
                                IdAsistencia = RN_Utilitario.RN_NroDoc(3);


                                //Verificamos si el personal tiene alguna justificación..
                            }
                        }
                    }                    //Final del For Each
                    if (Cant > 1)
                    {
                        timerFalta.Stop();
                        fis.Show();
                        ok.Lbl_msm1.Text = "Un Total de: " + Cant.ToString() + "/" + TotalItem + " Faltas se han registrado exitosamente";
                        ok.ShowDialog();
                        fis.Hide();
                    }
                    else
                    {
                        timerFalta.Stop();
                        fis.Show();
                        ok.Lbl_msm1.Text = "El día de hoy no se han registrado faltas en el trabajo, Las " + TotalItem + " personas marcaron su asistencia correctamente";
                        ok.ShowDialog();
                        fis.Hide();
                    }
                }
            }
        }
Beispiel #16
0
        private void Guardar_Cotizacion()
        {
            RN_Cotizacion          obj        = new RN_Cotizacion();
            EN_Cotizacion          coti       = new EN_Cotizacion();
            Frm_Filtro             fil        = new Frm_Filtro();
            Frm_Exito              ex         = new Frm_Exito();
            Frm_Advertencia        adv        = new Frm_Advertencia();
            Frm_Print_Cotizaciones informeCot = new Frm_Print_Cotizaciones();

            try
            {
                GuardarPedido();
                if (BD_Pedido.guarda == true && BD_Pedido.detalleguarda == true)
                {
                    txtNroCotiza.Text    = RN_TipoDoc.RN_Nro_id(11);
                    coti.IdCotizacion    = txtNroCotiza.Text;
                    coti.IdPedido        = txtIdPedido.Text;
                    coti.FechaCotizacion = dtp_FechaEmi.Value;
                    coti.Vigencia        = Convert.ToInt32(nud_vigencia.Value);
                    coti.TotalCoti       = Convert.ToDouble(lbl_TotalPagar.Text);
                    coti.Condiciones     = txt_condicion.Text;
                    if (chk_sinIgv.Checked == true)
                    {
                        coti.PrecioConIgv = "No";
                    }
                    else
                    {
                        coti.PrecioConIgv = "Si";
                    }
                    coti.EstadoCoti = "Pendiente";

                    obj.RN_Registrar_Cotizacion(coti);

                    if (BD_Cotizacion.guardo == true)
                    {
                        //Mandar a imprimir cotizacion
                        fil.Show();
                        informeCot.Tag = txtNroCotiza.Text;
                        informeCot.Crear_Impresion_Cotizacion();
                        informeCot.ShowDialog();
                        fil.Hide();


                        RN_TipoDoc.RN_Actualizar_NumeroCorrelativo_Producto(11);
                        fil.Show();
                        ex.lbl_Msm1.Text = "Cotizacion Guardada Exitosamente.";
                        ex.ShowDialog();
                        fil.Hide();

                        pnl_sinProd.Visible = true;
                        lsv_Det.Items.Clear();
                        txt_cliente.Text   = "";
                        txtNroCotiza.Text  = "";
                        txtIdPedido.Text   = "";
                        lblIdCliente.Text  = "-";
                        txt_condicion.Text = ""; chk_sinIgv.Checked = false;
                        nud_vigencia.Value = 1;
                    }
                }
            }
            catch (Exception e)
            {
                fil.Show();
                adv.lbl_Msm1.Text = "Error al guardar la cotización: " + e.Message;
                adv.ShowDialog();
                fil.Hide();
            }
        }
Beispiel #17
0
        private void Registrar_Compra()
        {
            EN_IngresoCompra     com = new EN_IngresoCompra();
            EN_Det_IngresoCompra det = new EN_Det_IngresoCompra();
            RN_IngresoCompra     obj = new RN_IngresoCompra();
            RN_Productos         pro = new RN_Productos();

            Frm_Filtro      fil  = new Frm_Filtro();
            Frm_Advertencia adv  = new Frm_Advertencia();
            Frm_Exito       exit = new Frm_Exito();

            try
            {
                com.IdCom            = txt_IdComp.Text;
                com.Nro_Fac_Fisico1  = txt_NroFisico.Text;
                com.IdProvee1        = cbo_provee.SelectedValue.ToString();
                com.SubTotal_Com1    = Convert.ToDouble(lbl_subtotal.Text);
                com.FechaIngre1      = dtp_FechaCom.Value;
                com.IdUsu1           = Convert.ToInt32(Cls_Libreria.IdUsu);
                com.ModalidadPago1   = cbo_tipoPago.Text;
                com.TiempoEspera1    = 0;
                com.FechaVence1      = dtp_FechaVenc.Value;
                com.EstadoIngre1     = "Activo";
                com.RecibiConforme1  = conforme;
                com.Datos_Adicional1 = txt_obser.Text;
                com.Tipo_Doc_Compra1 = cbo_tipoDoc.Text;

                obj.RN_Ingresar_RegistroCompra(com);

                if (BD_IngresoCompra.guardado == true)
                {
                    RN_TipoDoc.RN_Actualizar_NumeroCorrelativo_Producto(9);

                    for (int i = 0; i < lsv_Det.Items.Count; i++)
                    {
                        var item = lsv_Det.Items[i];
                        det.Id_ingreso1 = txt_IdComp.Text;
                        det.Id_Pro1     = item.SubItems[0].Text;
                        det.Cantidad1   = Convert.ToDouble(item.SubItems[2].Text);
                        det.Precio1     = Convert.ToDouble(item.SubItems[3].Text);
                        det.Importe1    = Convert.ToDouble(item.SubItems[4].Text);

                        obj.RN_Insertar_Detalle_RegistroCompra(det);
                        Registrar_Movimiento_Kardex(det.Id_Pro1.Trim(), det.Cantidad1, det.Precio1);

                        double utilidad     = 0;
                        double valorAlmacen = 0;
                        double preCompra    = det.Precio1;
                        double PreVenta     = 0;
                        double xUtilidad    = 0;

                        xUtilidad    = BuscarUtilidad_Producto(det.Id_Pro1.Trim());
                        PreVenta     = xUtilidad * preCompra;
                        utilidad     = PreVenta - preCompra;
                        valorAlmacen = det.Cantidad1 * preCompra;
                        pro.RN_Actualizar_PrecioCompra_Producto(det.Id_Pro1.Trim(), preCompra,
                                                                PreVenta, utilidad, valorAlmacen);
                    }
                    fil.Show();
                    exit.lbl_Msm1.Text = "La compra se ha registrado correctamente";
                    exit.ShowDialog();
                    fil.Hide();
                    lsv_Det.Items.Clear();
                    cbo_provee.SelectedIndex = -1;
                    txt_NroFisico.Text       = "";
                    cbo_tipoPago.Text        = "";
                    this.Tag = "A";
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                fil.Show();
                adv.lbl_Msm1.Text = "Error al Guardar la compra: " + ex.Message;
                adv.ShowDialog();
                fil.Hide();
            }
        }
Beispiel #18
0
        private bool Validar_Texbox()
        {
            Frm_Filtro      fil = new Frm_Filtro();
            Frm_Advertencia ver = new Frm_Advertencia();

            if (txtIdProducto.Text.Trim().Length < 2)
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese el id del Producto"; ver.ShowDialog(); fil.Hide(); txtIdProducto.Focus(); return(false);
            }
            if (txtdescripcion_producto.Text.Trim().Length < 2)
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese la descripcion del producto"; ver.ShowDialog(); fil.Hide();  txtdescripcion_producto.Focus(); return(false);
            }
            if (txtPesoUnit.Text.Trim().Length < 2)
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese el peso por unidad del producto"; ver.ShowDialog(); fil.Hide(); txtPesoUnit.Focus(); return(false);
            }

            if (cmbTipoProducto.SelectedIndex == -1)
            {
                fil.Show(); ver.lbl_Msm1.Text = "Seleccione el tipo de Producto"; ver.ShowDialog(); fil.Hide(); cmbTipoProducto.Focus(); return(false);
            }
            if (cmbUnidadMedida.SelectedIndex == -1)
            {
                fil.Show(); ver.lbl_Msm1.Text = "Seleccione la unidad de medida del producto"; ver.ShowDialog(); fil.Hide(); cmbUnidadMedida.Focus(); return(false);
            }

            if (txtPrecioCompra.Text.Trim() == "")
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese el precio de compra del producto"; ver.ShowDialog(); fil.Hide(); txtPrecioCompra.Focus(); return(false);
            }
            if (Convert.ToDouble(txtPrecioCompra.Text) == 0)
            {
                fil.Show(); ver.lbl_Msm1.Text = "El precio de compra del producto no puede ser 0"; ver.ShowDialog(); fil.Hide(); txtPrecioCompra.Focus(); return(false);
            }

            if (txtPrecioVentaMenor.Text.Trim() == "")
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese el precio de venta por menor del producto "; ver.ShowDialog(); fil.Hide(); txtPrecioVentaMenor.Focus(); return(false);
            }
            if (Convert.ToDouble(txtPrecioVentaMenor.Text) == 0)
            {
                fil.Show(); ver.lbl_Msm1.Text = "El precio de venta minorista no puede ser 0"; ver.ShowDialog(); fil.Hide(); txtPrecioVentaMenor.Focus(); return(false);
            }

            if (txtPrecioVentaMayor.Text.Trim() == "")
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese el precio de venta mayorista del producto"; ver.ShowDialog(); fil.Hide(); txtPrecioVentaMayor.Focus(); return(false);
            }
            if (Convert.ToDouble(txtPrecioVentaMayor.Text) == 0)
            {
                fil.Show(); ver.lbl_Msm1.Text = "El precio de venta mayorista no puede ser 0"; ver.ShowDialog(); fil.Hide(); txtPrecioVentaMayor.Focus(); return(false);
            }

            if (txtPrecioVenta.Text.Trim() == "")
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese el precio de venta del producto"; ver.ShowDialog(); fil.Hide(); txtPrecioVenta.Focus(); return(false);
            }
            if (Convert.ToDouble(txtPrecioVenta.Text) == 0)
            {
                fil.Show(); ver.lbl_Msm1.Text = "El precio de venta del producto no puede ser 0"; ver.ShowDialog(); fil.Hide(); txtPrecioVenta.Focus(); return(false);
            }

            if (txtClaveSat.Text.Trim() == "")
            {
                fil.Show(); ver.lbl_Msm1.Text = "Ingrese la clave de Sat del producto"; ver.ShowDialog(); fil.Hide(); txtClaveSat.Focus(); return(false);
            }
            if (Convert.ToDouble(txtClaveSat.Text) == 0)
            {
                fil.Show(); ver.lbl_Msm1.Text = "La clave sat del producto no puede ser 0"; ver.ShowDialog(); fil.Hide(); txtClaveSat.Focus(); return(false);
            }

            return(true);
        }
Beispiel #19
0
        //private void txtMargenUtilidad_TextChanged(object sender, EventArgs e)
        //{
        //txtMargenUtilidad.Text = txtMargenUtilidad.Text.Replace(",", ".");
        //txtMargenUtilidad.SelectionStart = txtMargenUtilidad.Text.Length;

        //try
        //{
        //    if (txtMargenUtilidad.Text.Trim() == "") { return; }
        //    if (txtPrecioCompra.Text.Trim() == "") { return; }

        //    double precio_compra = 0;
        //    double utilidad = 0;

        //    precio_compra = Convert.ToDouble(txtPrecioCompra.Text) * Convert.ToDouble(txtMargenUtilidad.Text);
        //    txtPrecioVentaMenor.Text = precio_compra.ToString("##.00");

        //    utilidad = Convert.ToDouble(txtPrecioVentaMenor.Text) - Convert.ToDouble(txtPrecioCompra.Text);
        //    txtUtilidad.Text = utilidad.ToString("##.00");
        //}
        //catch(Exception ex)
        //{
        //    string sms = ex.Message;
        //}
        //}

        private void registrar()
        {
            RN_Productos    obj      = new RN_Productos();
            EN_Producto     producto = new EN_Producto();
            Frm_Filtro      fil      = new Frm_Filtro();
            Frm_Exito       ex       = new Frm_Exito();
            Frm_Advertencia adv      = new Frm_Advertencia();

            try
            {
                producto.Idpro       = txtIdProducto.Text;
                producto.Idprove     = lblidproveedor.Text;
                producto.Descripcion = txtdescripcion_producto.Text;
                producto.Utilidad    = Convert.ToDouble(txtUtilidad.Text);
                producto.Pre_compra  = Convert.ToDouble(txtPrecioCompra.Text);
                producto.StockActual = 0;
                producto.Pre_Venta   = Convert.ToDouble(txtPrecioVenta.Text);
                producto.IdCat       = Convert.ToInt32(lblidcat.Text);
                producto.IdMar       = Convert.ToInt32(lblidmarca.Text);
                if (xFotoruta.Trim().Length < 5)
                {
                    producto.Foto = ".";
                }
                else
                {
                    producto.Foto = xFotoruta;
                }
                producto.Pre_Venta_Menor = Convert.ToDouble(txtPrecioVentaMenor.Text);
                producto.Pre_Venta_Mayor = Convert.ToDouble(txtPrecioVentaMayor.Text);
                producto.UndMdida        = cmbUnidadMedida.Text;
                producto.PesoUnit        = Convert.ToDouble(txtPesoUnit.Text);
                producto.Utilidad        = Convert.ToDouble(txtUtilidad.Text);
                producto.TipoProd        = cmbTipoProducto.Text;
                producto.ValorporProd    = 0;
                producto.ClaveSAT        = txtClaveSat.Text;

                obj.RN_Registrar_Producoto(producto);

                if (BD_Productos.seguardo == true)
                {
                    if (cmbTipoProducto.SelectedIndex == 0)
                    {
                        Registrar_Kardex(txtIdProducto.Text);
                    }

                    RN_TipoDoc.RN_Actualizar_NumeroCorrelativo_Producto(4);
                    //RN_TipoDoc.RN_Actualizar_Tipo_Doc(4);
                    fil.Show();
                    ex.lbl_Msm1.Text = "Producto Guardado Exitosamente.";
                    ex.ShowDialog();
                    fil.Hide();

                    this.Tag = "A";
                    this.Close();
                }
            }
            catch (Exception e)
            {
                fil.Show();
                adv.lbl_Msm1.Text = "Error al guardar el producto: " + e.Message;
                adv.ShowDialog();
                fil.Hide();
            }
        }
Beispiel #20
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            Frm_Filtro      fil = new Frm_Filtro();
            Frm_Advertencia adv = new Frm_Advertencia();

            if (txtPrecio.Text == "")
            {
                fil.Show();
                adv.lbl_Msm1.Text = "Por favor ingresa un precio";
                adv.ShowDialog();
                fil.Hide();
                txtPrecio.Focus();
                return;
            }
            if (Convert.ToDouble(txtPrecio.Text) == 0)
            {
                fil.Show();
                adv.lbl_Msm1.Text = "El precio de venta no puede ser 0";
                adv.ShowDialog();
                fil.Hide();
                txtPrecio.Focus();
                return;
            }

            if (txtCantidad.Text == "")
            {
                fil.Show();
                adv.lbl_Msm1.Text = "Por favor ingresa una cantidad";
                adv.ShowDialog();
                fil.Hide();
                txtCantidad.Focus();
                return;
            }
            if (Convert.ToDouble(txtCantidad.Text) == 0)
            {
                fil.Show();
                adv.lbl_Msm1.Text = "La cantidad ingresada no puede ser 0";
                adv.ShowDialog();
                fil.Hide();
                txtCantidad.Focus();
                return;
            }
            try
            {
                double preCopra      = Convert.ToDouble(Lbl_precompra.Text);
                double preVenta      = Convert.ToDouble(txtPrecio.Text);
                double xUtilidadUnit = 0;

                xUtilidadUnit = preVenta - preCopra;

                Lbl_UtilidadUnit.Text = xUtilidadUnit.ToString();

                if (lblTipoProducto.Text.Trim().ToString() == "Producto")
                {
                    if (Convert.ToDouble(txtCantidad.Text) > Convert.ToDouble(Lbl_stockActual.Text))
                    {
                        txtCantidad.Text = "1";
                        fil.Show();
                        adv.lbl_Msm1.Text = "La cantidad a vender no puede ser mayor que el stock";
                        adv.ShowDialog();
                        fil.Hide();
                        txtCantidad.Focus();
                        return;
                    }
                    else
                    {
                        this.Tag = "A";
                        this.Close();
                    }
                }
                else
                {
                    this.Tag = "A";
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                txtCantidad.Text = "1";
                fil.Show();
                adv.lbl_Msm1.Text = "Error: " + ex.Message;
                adv.ShowDialog();
                fil.Hide();
                txtCantidad.Focus();
            }
        }
Beispiel #21
0
        private void Seleccionar_Producto_Vender()
        {
            Frm_Filtro      fil  = new Frm_Filtro();
            Frm_Edit_Cant   solo = new Frm_Edit_Cant();
            Frm_Advertencia adv  = new Frm_Advertencia();

            if (ltsProductos.SelectedIndices.Count == 0)
            {
                fil.Show(); adv.lbl_Msm1.Text = "Debes seleccionar un producto"; adv.ShowDialog(); fil.Hide(); return;
            }

            if (cbxCotizacion.Checked == true)
            {
                Seleccionar_Producto_ModoCotizacion();
            }
            else
            {
                double stock      = 0;
                string estadoProd = "";
                double xpreCompr  = 0;
                double xUtilidad  = 0;

                var lis = ltsProductos.SelectedItems[0];

                lblNomProd.Text    = lis.SubItems[1].Text;
                lblPreUnid.Text    = lis.SubItems[4].Text;
                lblIdProducto.Text = lis.SubItems[0].Text;
                stock            = Convert.ToDouble(lis.SubItems[2].Text);
                lblUtiUnit.Text  = lis.SubItems[9].Text;
                estadoProd       = lis.SubItems[10].Text;
                xpreCompr        = Convert.ToDouble(lis.SubItems[3].Text);
                lblTipoProd.Text = lis.SubItems[11].Text;
                lblUnid.Text     = lis.SubItems[8].Text;

                if (estadoProd.Trim() == "Eliminado")
                {
                    fil.Show(); adv.lbl_Msm1.Text = "El producto esta eliminado"; adv.ShowDialog(); fil.Hide(); return;
                }
                if (lblTipoProd.Text.Trim().ToString() == "Producto")
                {
                    if (stock == 0)
                    {
                        fil.Show(); adv.lbl_Msm1.Text = "El producto no cuenta con la cantidad suficiente"; adv.ShowDialog(); fil.Hide(); return;
                    }
                }
                if (cbxLlenarCarrito.Checked == true)
                {
                    fil.Show();
                    solo.lblTipoProd.Text = lblTipoProd.Text;
                    solo.lblStock.Text    = stock.ToString();
                    solo.txt_cant.Text    = "1";
                    solo.ShowDialog();
                    fil.Hide();
                    if (solo.Tag.ToString() == "A")
                    {
                        lblCant.Text       = solo.txt_cant.Text;
                        solo.txt_cant.Text = "";
                        //xUtilidad = Convert.ToDouble(lblCant.Text) - Convert.ToDouble(xpreCompr);
                        //lblUtiUnit.Text = xUtilidad.ToString("###0.00");
                        double importxx = Convert.ToDouble(lblCant.Text) * Convert.ToDouble(lblPreUnid.Text);
                        lblImport.Text = importxx.ToString("###0.00");
                        lblTotal.Text  = importxx.ToString();;

                        Agregar_Producto_Pedido(lblIdProducto.Text, lblNomProd.Text, lblUnid.Text, Convert.ToDouble(lblCant.Text),
                                                Convert.ToDouble(lblPreUnid.Text), Convert.ToDouble(lblImport.Text), Convert.ToDouble(lblUtiUnit.Text),
                                                Convert.ToDouble(lblTotal.Text), lblTipoProd.Text);
                        LimpiarLabels();
                    }
                }
                else
                {
                    fil.Show();
                    solo.lblTipoProd.Text = lblTipoProd.Text;
                    solo.lblStock.Text    = stock.ToString();
                    solo.txt_cant.Text    = "1";
                    solo.ShowDialog();
                    fil.Hide();

                    try
                    {
                        if (solo.Tag.ToString() == "A")
                        {
                            lblCant.Text       = solo.txt_cant.Text;
                            solo.txt_cant.Text = "";
                            //xUtilidad = Convert.ToDouble(lblCant.Text) - Convert.ToDouble(xpreCompr);
                            //lblUtiUnit.Text = xUtilidad.ToString("###0.00");
                            double importxx = Convert.ToDouble(lblCant.Text) * Convert.ToDouble(lblPreUnid.Text);
                            lblImport.Text = importxx.ToString("###0.00");
                            this.Tag       = "A";
                            this.Close();
                        }
                    }
                    catch (Exception)
                    {
                        solo.Tag = "";
                        this.Close();
                    }
                }
            }
        }
Beispiel #22
0
        private void timerFalta_Tick(object sender, EventArgs e)
        {
            RN_Asistencia   obj     = new RN_Asistencia();
            Frm_Filtro      fis     = new Frm_Filtro();
            Frm_Advertencia adver   = new Frm_Advertencia();
            Msm_Bueno       ok      = new Msm_Bueno();
            DataTable       dataper = new DataTable();
            RN_Personal     objper  = new RN_Personal();

            int HoLimite = Dtp_Hora_Limite.Value.Hour;
            int MiLimite = Dtp_Hora_Limite.Value.Minute;

            int    horaCaptu      = DateTime.Now.Hour;
            int    minutoCaptu    = DateTime.Now.Minute;
            string Dniper         = "";
            int    Cant           = 0;
            int    TotalItem      = 0;
            string xidpersona     = "";
            string IdAsistencia   = "";
            string xjustificacion = "";

            if (horaCaptu >= HoLimite)
            {
                if (minutoCaptu >= MiLimite)
                {
                    dataper = objper.RN_Leer_todoPersona();
                    if (dataper.Rows.Count <= 0)
                    {
                        return;
                    }
                    TotalItem = dataper.Rows.Count;  // obtenemos el total de personas registradas

                    foreach (DataRow Registro in dataper.Rows)
                    {
                        Dniper     = Convert.ToString(Registro["DNIPR"]);
                        xidpersona = Convert.ToString(Registro["Id_Pernl"]);

                        if (obj.RN_Checar_SiPersonal_TieneAsistencia_Registrada(xidpersona.Trim()) == false)
                        {
                            if (obj.RN_Checar_SiPersonal_YaMarco_suFalta(xidpersona.Trim()) == false)
                            {
                                // llamar registrar falta
                                RN_Asistencia objA = new RN_Asistencia();
                                EN_Asistencia asi  = new EN_Asistencia();
                                IdAsistencia = RN_Utilitario.RN_NroDoc(3);

                                // verificar si el personal tiene justificacion
                                if (objA.RN_Verificar_Justificacion_Aprobada(xidpersona) == true)
                                {
                                    xjustificacion = "Falta tiene justificativo";
                                }
                                else
                                {
                                    xjustificacion = "No tiene Justificactivo";
                                }

                                obj.RN_Registrar_Falta_Personal(IdAsistencia, xidpersona, xjustificacion);
                                if (BD_Asistencia.faltasaved == true)
                                {
                                    RN_Utilitario.RN_Actualizar_Tipo_Doc(3); // actualizamos el numero correlativo de asistencia
                                    // contador: almacena la cantidad de faltas registradas
                                    Cant += 1;
                                }
                            }
                        }
                    }// fin foreach

                    if (Cant > 1)
                    {
                        timerFalta.Stop();
                        fis.Show();
                        ok.Lbl_msm1.Text = "un total de: " + Cant.ToString() + "/" + TotalItem + "faltas se han registrado exitosamente";
                        ok.ShowDialog();
                        fis.Hide();
                    }
                    else
                    {
                        timerFalta.Stop();
                        fis.Show();
                        ok.Lbl_msm1.Text = "el dia de hoy no falto nadie al trabajo, las " + TotalItem + "Pesonas Marcaron si Asistencia";
                        ok.ShowDialog();
                        fis.Hide();
                    }
                }
            }
        }
        private void Btn_buscar_Click(object sender, EventArgs e)
        {
            RN_Personal     obj          = new RN_Personal();
            RN_Asistencia   objas        = new RN_Asistencia();
            DataTable       datosPersona = new DataTable();
            DataTable       dataAsis     = new DataTable();
            Frm_Filtro      fil          = new Frm_Filtro();
            Frm_Advertencia adver        = new Frm_Advertencia();

            string NroIDPersona;
            int    cont = 1;
            string rutaFoto;

            int HoLimite = Dtp_Hora_Limite.Value.Hour;
            int MiLimite = Dtp_Hora_Limite.Value.Minute;

            int horaCaptu   = DateTime.Now.Hour;
            int minutoCaptu = DateTime.Now.Minute;

            try
            {
                datosPersona = obj.RN_Buscar_Personal_xValor(txt_dni_Buscar.Text.Trim());
                if (datosPersona.Rows.Count <= 0)
                {
                    lbl_msm.BackColor = Color.MistyRose;
                    lbl_msm.ForeColor = Color.Red;
                    lbl_msm.Text      = "El número de DNI ingresado no existe o el personal está dado de baja";
                    tocar_timbre();
                    lbl_Cont.Text     = "10";
                    pnl_Msm.Visible   = true;
                    tmr_Conta.Enabled = true;
                    return;
                }
                else
                {
                    var dt = datosPersona.Rows[0];
                    rutaFoto             = Convert.ToString(dt["Foto"]);
                    lbl_nombresocio.Text = Convert.ToString(dt["Nombre_Completo"]);
                    lbl_Dni.Text         = Convert.ToString(dt["DNIPR"]);
                    NroIDPersona         = Convert.ToString(dt["Id_Pernl"]);
                    Lbl_Idperso.Text     = Convert.ToString(dt["Id_Pernl"]);

                    if (File.Exists(rutaFoto) == true)
                    {
                        picSocio.Load(rutaFoto.Trim());
                    }
                    else
                    {
                        picSocio.Load(Application.StartupPath + @"\user.png");
                    }

                    if (objas.RN_Checar_SiPersonal_YaMarco_Asistencia(Lbl_Idperso.Text) == true)
                    {
                        lbl_msm.BackColor = Color.MistyRose;
                        lbl_msm.ForeColor = Color.Red;
                        lbl_msm.Text      = "El sistema verificó que el personal ya marcó su entrada y su salida";
                        tocar_timbre();
                        lbl_Cont.Text     = "10";
                        pnl_Msm.Visible   = true;
                        tmr_Conta.Enabled = true;
                        return;
                    }
                    else if (objas.RN_Checar_SiPersonal_YaMarco_Entrada(Lbl_Idperso.Text.Trim()) == true)
                    {
                        //Toca Marcar su Salida
                        Frm_Sinox sino = new Frm_Sinox();
                        fil.Show();
                        sino.Lbl_msm1.Text = "El usuario ya tiene registrada su entrada, ¿Te gustarìa marcar su salida?";
                        sino.ShowDialog();
                        fil.Hide();

                        if (Convert.ToString(sino.Tag) == "Si")
                        {
                            dataAsis = objas.RN_Buscar_Asistencia_deEntrada(Lbl_Idperso.Text);
                            if (dataAsis.Rows.Count < 1)
                            {
                                return;
                            }
                            lbl_IdAsis.Text = Convert.ToString(dataAsis.Rows[0]["Id_asis"]);
                            objas.RN_Registrar_Salida_Personal(lbl_IdAsis.Text, Lbl_Idperso.Text, lbl_hora.Text, 8);
                            if (BD_Asistencia.salida == true)
                            {
                                lbl_msm.BackColor = Color.YellowGreen;
                                lbl_msm.ForeColor = Color.White;
                                lbl_msm.Text      = "La salida del personal fue registrada exitosamente";
                                tocar_timbreOK();
                                pnl_Msm.Visible   = true;
                                lbl_Cont.Text     = "10";
                                tmr_Conta.Enabled = true;
                            }
                        }
                        else
                        {
                            LimpiarFormulario();
                            sec = 10;
                            tmr_Conta.Stop();
                            pnl_Msm.Visible = false;
                            lbl_Cont.Text   = "10";
                        }
                    }
                    else
                    {
                        //Toca Marcar su Entrada
                        if (horaCaptu >= HoLimite)
                        {
                            lbl_msm.BackColor = Color.MistyRose;
                            lbl_msm.ForeColor = Color.Red;
                            lbl_msm.Text      = "Estimado usuario, su hora de entrada ya caducó. Has llegado demasiado tarde";
                            tocar_timbre();
                            lbl_Cont.Text     = "10";
                            pnl_Msm.Visible   = true;
                            tmr_Conta.Enabled = true;
                            return;
                        }
                        //Está en tiempo para marcar su entrada
                        calcular_Minutos_Tardanza();
                        lbl_IdAsis.Text = RN_Utilitario.RN_NroDoc(3);
                        objas.RN_Registrar_Entrada_Personal(lbl_IdAsis.Text, Lbl_Idperso.Text, lbl_hora.Text, Convert.ToDouble(lbl_totaltarde.Text), Convert.ToInt32(lbl_TotalHotrabajda.Text), lbl_justifi.Text);
                        if (BD_Asistencia.entrada == true)
                        {
                            RN_Utilitario.RN_Actualiza_Tipo_Doc(3);
                            lbl_msm.BackColor = Color.YellowGreen;
                            lbl_msm.ForeColor = Color.White;
                            lbl_msm.Text      = "La entrada del personal fue registrada exitosamente";
                            tocar_Bienvenida();
                            pnl_Msm.Visible   = true;
                            tmr_Conta.Enabled = true;
                            lbl_Cont.Text     = "10";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Algo malo pasó: " + ex.Message, "Advertencia de Seguridad", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #24
0
        private void Agregar_Productos_carro(string xxidProd, string xxnomprod, double xxcant, double xxprecio, double xximporte, string xunid, string xtipoProd, double xutilidadUnit)
        {
            Frm_Advertencia adv = new Frm_Advertencia();
            Frm_Filtro      fil = new Frm_Filtro();

            try
            {
                if (lsv_Det.Items.Count == 0)
                {
                    ListViewItem item = new ListViewItem();
                    item = lsv_Det.Items.Add(xxidProd);
                    item.SubItems.Add(xxnomprod.Trim());
                    item.SubItems.Add(xxcant.ToString());
                    item.SubItems.Add(xxprecio.ToString("###0.00"));
                    item.SubItems.Add(xximporte.ToString("###0.00"));
                    item.SubItems.Add(xtipoProd.ToString());
                    item.SubItems.Add(xunid.ToString());
                    item.SubItems.Add(xutilidadUnit.ToString("###0.00"));
                    item.SubItems.Add(xutilidadUnit.ToString("###0.00"));

                    Calcular();
                    lsv_Det.Focus();
                    lsv_Det.Items[0].Selected = true;
                    pnl_sinProd.Visible       = false;
                }
                else
                {
                    for (int i = 0; i < lsv_Det.Items.Count; i++)
                    {
                        if (lsv_Det.Items[i].Text.Trim() == xxidProd.Trim())
                        {
                            fil.Show();
                            adv.lbl_Msm1.Text = "El producto ya fue agregado al carrito de compras";
                            adv.ShowDialog();
                            fil.Hide();
                        }
                    }

                    ListViewItem item = new ListViewItem();
                    item = lsv_Det.Items.Add(xxidProd);
                    item.SubItems.Add(xxnomprod.Trim());
                    item.SubItems.Add(xxcant.ToString());
                    item.SubItems.Add(xxprecio.ToString("###0.00"));
                    item.SubItems.Add(xximporte.ToString("###0.00"));
                    item.SubItems.Add(xtipoProd.ToString());
                    item.SubItems.Add(xunid.ToString());
                    item.SubItems.Add(xutilidadUnit.ToString("###0.00"));
                    item.SubItems.Add(xutilidadUnit.ToString("###0.00"));

                    Calcular();
                    lsv_Det.Focus();
                    lsv_Det.Items[0].Selected = true;
                }
            }
            catch (Exception ex)
            {
                fil.Show();
                adv.lbl_Msm1.Text = "Ha ocurrido un error al guardar: " + ex.Message;
                adv.ShowDialog();
                fil.Hide();
            }
        }