public double GetTotalInsumo() { string sql = "select (isnull(Cantidad,0)*isnull(precio,0)) as Total"; sql = sql + " from Insumo where ActualizaStock =1"; DataTable trdo = cDb.ExecuteDataTable(sql); cFunciones fun = new cFunciones(); double Total = fun.TotalizarColumna(trdo, "Total"); return(Total); }
private void button1_Click(object sender, EventArgs e) { cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFechaCobro.Text) == false) { Mensaje("La fecha de cobro es incorrecta"); return; } DateTime FechaCobro = Convert.ToDateTime(txtFechaCobro.Text); if (Grilla.CurrentRow == null) { Mensaje("Debe seleccionar un elemento para continuar"); return; } string sFechaCobro = Grilla.CurrentRow.Cells[5].Value.ToString(); if (sFechaCobro != "") { Mensaje("Ya se ha cobrado el registro"); return; } Double Importe = 0; cCuentaCorriente cuenta = new cCuentaCorriente(); cMovimiento mov = new cMovimiento(); string Descripcion = "Cobro de Cuenta Corriente "; Descripcion = Descripcion + " " + Grilla.CurrentRow.Cells[1].Value.ToString(); Int32 CodOrden = Convert.ToInt32(Grilla.CurrentRow.Cells[6].Value.ToString()); SqlConnection con = new SqlConnection(cConexion.Cadenacon()); con.Open(); SqlTransaction Tran; Tran = con.BeginTransaction(); try { Importe = fun.ToDouble(Grilla.CurrentRow.Cells[3].Value.ToString()); mov.GrabarMovimientoTransaccion(con, Tran, Importe, Descripcion, FechaCobro, Principal.CodUsuarioLogueado, CodOrden); cuenta.ActualizarFechacobro(con, Tran, Convert.ToInt32(CodOrden), FechaCobro); Tran.Commit(); con.Close(); Mensaje("Datos grabados correctamente"); Buscar(); } catch (Exception ex) { Tran.Rollback(); con.Close(); Mensaje("Hubo un error en el proceso de grabacion"); throw; } }
private void Buscar() { cFunciones fun = new Clases.cFunciones(); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); cTurno turno = new cTurno(); DataTable trdo = turno.GetTurnos(FechaDesde, FechaHasta); Grilla.DataSource = trdo; string Col = "0;15;15;10;10;25;15;10"; fun.AnchoColumnas(Grilla, Col); }
private void form_FormClosing(object sender, FormClosingEventArgs e) { if (Principal.CampoIdSecundarioGenerado != "") { Clases.cFunciones fun = new Clases.cFunciones(); switch (Principal.NombreTablaSecundario) { case "Entidad": fun.LlenarCombo(cmbConcepto, "Entidad", "Nombre", "CodEntidad"); cmbConcepto.SelectedValue = Principal.CampoIdSecundarioGenerado; break; } } }
private void btnDelante_Click(object sender, EventArgs e) { cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFecha.Text) == false) { Mensaje("La fecha ingresada es incorrecta"); return; } DateTime Fecha = Convert.ToDateTime(txtFecha.Text); Fecha = Fecha.AddDays(1); txtFecha.Text = Fecha.ToShortDateString(); }
private void btnVetOrden_Click(object sender, EventArgs e) { cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFechaHasta.Text) == false) { Mensaje("La fecha hasta es incorrecta"); return; } if (fun.ValidarFecha(txtFechaDesde.Text) == false) { Mensaje("La fecha desde es incorrecta"); return; } Buscar(); }
private void btnGrabar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFechaDesde.Text) == false) { MessageBox.Show("La fecha ingresada es incorrecta", Clases.cMensaje.Mensaje()); return; } if (txtDescripcion.Text == "") { MessageBox.Show("Debe ingresar un motivo", Clases.cMensaje.Mensaje()); return; } Clases.cAlarma alarma = new Clases.cAlarma(); alarma.GrabarAlarma(txtDescripcion.Text.ToUpper(), Convert.ToDateTime(txtFechaDesde.Text)); MessageBox.Show("Alarma registrada correctamente", Clases.cMensaje.Mensaje()); txtDescripcion.Text = ""; }
private void form_FormClosing(object sender, FormClosingEventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); //CargarJugador(Convert.ToInt32(PRINCIPAL.CDOGIO_JUGADOR)); if (Principal.CodigoPrincipalAbm != null) { if (Principal.CodigoPrincipalAbm != "") { Botonera(3); txtCodigo.Text = Principal.CodigoPrincipalAbm.ToString(); if (Principal.CodigoPrincipalAbm != "") { fun.CargarControles(this, "Mecanico", "CodMecanico", txtCodigo.Text); } Grupo.Enabled = false; return; } } }
private void btnGuardar_Click(object sender, EventArgs e) { if (txtApellido.Text == "") { Mensaje("Debe ingresar un apellido"); return; } if (txtNombre.Text == "") { Mensaje("Debe ingresar un nombre"); return; } if (txtPatente.Text == "") { Mensaje("Debe ingresar una patente"); return; } cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFecha.Text) == false) { Mensaje("La Fecha Ingrsada es incorrecta"); return; } string Apellido = txtApellido.Text; string Nombre = txtNombre.Text; string Patente = txtPatente.Text; string Descripcion = txtDescripcion.Text; DateTime Fecha = Convert.ToDateTime(txtFecha.Text); string Telefono = txtTelefono.Text; string Hora = txtHora.Text; cTurno turno = new cTurno(); turno.Insertar(Apellido, Nombre, Patente, Descripcion, Fecha, Telefono, Hora); Mensaje("Datos grabados correctamente"); txtApellido.Text = ""; txtNombre.Text = ""; txtPatente.Text = ""; txtDescripcion.Text = ""; txtTelefono.Text = ""; }
private void btnAceptar_Click(object sender, EventArgs e) { if (txt_Nombre.Text == "") { MessageBox.Show("Debe ingresar un nombre para continuar", Clases.cMensaje.Mensaje()); return; } Clases.cFunciones fun = new Clases.cFunciones(); if (txtCodigo.Text == "") { fun.GuardarNuevoGenerico(this, "Barrio"); } else { fun.ModificarGenerico(this, "Barrio", "CodBarrio", txtCodigo.Text); } MessageBox.Show("Datos grabados Correctamente", Clases.cMensaje.Mensaje()); Botonera(1); fun.LimpiarGenerico(this); txtCodigo.Text = ""; }
private void Buscar() { cFunciones fun = new Clases.cFunciones(); DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); cMecanico mec = new cMecanico(); DataTable trdo = mec.GetProduccion(FechaDesde, FechaHasta); ArrayList ape = new ArrayList(); ArrayList Montos = new ArrayList(); // Grafico.Titles.Add("Producción de mecánicos"); for (int i = 0; i < trdo.Rows.Count; i++) { ape.Add(trdo.Rows[i]["Apellido"].ToString()); Montos.Add(Convert.ToDouble(trdo.Rows[i]["Total"].ToString())); } Grafico.Series[0].Points.DataBindXY(ape, Montos); trdo = fun.TablaaMiles(trdo, "Total"); Grilla.DataSource = trdo; fun.AnchoColumnas(Grilla, "30;30;20;20"); }
private void btnBuscar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFechaDesde.Text) == false) { MessageBox.Show("Fecha desde incorrecta", Clases.cMensaje.Mensaje()); return; } if (fun.ValidarFecha(txtFechaHasta.Text) == false) { MessageBox.Show("Fecha hasta incorrecta", Clases.cMensaje.Mensaje()); return; } if (Convert.ToDateTime(txtFechaDesde.Text) > Convert.ToDateTime(txtFechaHasta.Text)) { MessageBox.Show("La fecha desde debe ser inferior a la fecha hasta", Clases.cMensaje.Mensaje()); return; } GetRentabilidad(); }
private void btnGuardar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFecha.Text) == false) { Mensaje("La fecha es incorrecta"); return; } if (txtEfectivo.Text == "") { Mensaje("Debe ingresar un importe"); return; } if (cmbConcepto.SelectedIndex == 0) { if (txtDescripcion.Text == "") { Mensaje("Debe ingresar una descripción"); return; } } Int32 CodConcepto = Convert.ToInt32(cmbConcepto.SelectedValue); string Empleado = ""; if (CodConcepto == 6) { if (CmbMecanico.SelectedIndex < 1) { Mensaje("Debe seleccionar un mecánico"); return; } else { Empleado = CmbMecanico.Text; } } DateTime Fecha = Convert.ToDateTime(txtFecha.Text); double Importe = fun.ToDouble(txtEfectivo.Text); string Descripcion = txtDescripcion.Text; Int32? CodEntidad = null; string NombreEntidad = ""; if (cmbConcepto.SelectedIndex > 0) { CodEntidad = Convert.ToInt32(cmbConcepto.SelectedValue); Clases.cEntidad ent = new Clases.cEntidad(); NombreEntidad = ent.GetNombrexCodigo(Convert.ToInt32(CodEntidad)); } if (NombreEntidad != "") { Descripcion = NombreEntidad + "," + Descripcion; } if (CodEntidad == 6) { Descripcion = cmbConcepto.Text + " " + Empleado.ToString() + " " + txtDescripcion.Text; } Clases.cGastosNegocio gasto = new Clases.cGastosNegocio(); gasto.GrabarGastos(Fecha, CodEntidad, Descripcion, Importe); Clases.cMovimiento mov = new Clases.cMovimiento(); mov.GrabarMovimiento(-1 * Importe, Descripcion, Fecha, 1, null); Mensaje("Datos grabados correctamente"); txtEfectivo.Text = ""; txtFecha.Text = ""; txtDescripcion.Text = ""; if (cmbConcepto.Items.Count > 0) { cmbConcepto.SelectedIndex = 0; } }
private void btnBuscar_Click(object sender, EventArgs e) { int ConDeuda = 0; if (ChkVencida.Checked == true) { ConDeuda = 1; } Clases.cFunciones fun = new Clases.cFunciones(); Int32? CodOrden = null; DataTable tResul = fun.CrearTabla("Codigo;Tipo;Orden;Patente;Descripcion;Apellido;Telefono;Celular;Importe;Saldo;Fecha;Vencimiento;Cupon"); if (txtPatente.Text == "" && txtApellido.Text == "" && txtCodOrden.Text == "") { CodOrden = -1; } if (txtCodOrden.Text != "") { CodOrden = Convert.ToInt32(txtCodOrden.Text); } string Cupon = ""; if (txtCupon.Text != "") { Cupon = txtCupon.Text; } DateTime Fecha = Convert.ToDateTime(txtFecha.Text); string Valor = ""; cCheque cheque = new cCheque(); DataTable tcheque = cheque.GetChequesAdeudados(txtPatente.Text, txtApellido.Text, Fecha, ConDeuda, CodOrden); for (int i = 0; i < tcheque.Rows.Count; i++) { Valor = tcheque.Rows[i]["CodCheque"].ToString(); Valor = Valor + ";" + "Cheque"; Valor = Valor + ";" + tcheque.Rows[i]["CodOrden"].ToString(); Valor = Valor + ";" + tcheque.Rows[i]["Patente"].ToString(); Valor = Valor + ";" + tcheque.Rows[i]["Descripcion1"].ToString(); Valor = Valor + ";" + tcheque.Rows[i]["Apellido"].ToString(); Valor = Valor + ";" + tcheque.Rows[i]["Telefono"].ToString(); Valor = Valor + ";"; //+ tcheque.Rows[i]["Celular"].ToString(); Valor = Valor + ";" + tcheque.Rows[i]["Importe"].ToString(); Valor = Valor + ";" + tcheque.Rows[i]["Importe"].ToString(); Valor = Valor + ";" + tcheque.Rows[i]["Fecha"].ToString(); Valor = Valor + ";" + tcheque.Rows[i]["FechaVto"].ToString(); Valor = Valor + "; "; if (Cupon == "") { tResul = fun.AgregarFilas(tResul, Valor); } } cGarantia garant = new cGarantia(); DataTable tGar = garant.GetGarantiasAdeudadas(txtPatente.Text, txtApellido.Text, Fecha, ConDeuda, CodOrden); for (int i = 0; i < tGar.Rows.Count; i++) { Valor = tGar.Rows[i]["CodGarantia"].ToString(); Valor = Valor + ";" + "Garantía"; Valor = Valor + ";" + tGar.Rows[i]["CodOrden"].ToString(); Valor = Valor + ";" + tGar.Rows[i]["Patente"].ToString(); Valor = Valor + ";" + tGar.Rows[i]["Descripcion1"].ToString(); Valor = Valor + ";" + tGar.Rows[i]["Apellido"].ToString(); Valor = Valor + ";" + tGar.Rows[i]["Telefono"].ToString(); Valor = Valor + ";"; //+ tcheque.Rows[i]["Celular"].ToString(); Valor = Valor + ";" + tGar.Rows[i]["Importe"].ToString(); Valor = Valor + ";" + tGar.Rows[i]["Importe"].ToString(); Valor = Valor + ";" + tGar.Rows[i]["Fecha"].ToString(); Valor = Valor + "; "; Valor = Valor + "; "; if (Cupon == "") { tResul = fun.AgregarFilas(tResul, Valor); } } cDocumento doc = new cDocumento(); DataTable tdoc = doc.GetDocumentosAdeudados(txtPatente.Text, txtApellido.Text, Fecha, ConDeuda, CodOrden); for (int i = 0; i < tdoc.Rows.Count; i++) { Valor = tdoc.Rows[i]["CodDocumento"].ToString(); Valor = Valor + ";" + "Documento"; Valor = Valor + ";" + tdoc.Rows[i]["CodOrden"].ToString(); Valor = Valor + ";" + tdoc.Rows[i]["Patente"].ToString(); Valor = Valor + ";" + tdoc.Rows[i]["Descripcion1"].ToString(); Valor = Valor + ";" + tdoc.Rows[i]["Apellido"].ToString(); Valor = Valor + ";" + tdoc.Rows[i]["Telefono"].ToString(); Valor = Valor + ";"; //+ tcheque.Rows[i]["Celular"].ToString(); Valor = Valor + ";" + tdoc.Rows[i]["Importe"].ToString(); Valor = Valor + ";" + tdoc.Rows[i]["Importe"].ToString(); Valor = Valor + ";" + tdoc.Rows[i]["Fecha"].ToString(); Valor = Valor + "; "; Valor = Valor + "; "; if (Cupon == "") { tResul = fun.AgregarFilas(tResul, Valor); } } cCobroTarjeta cobro = new cCobroTarjeta(); DataTable tcobro = cobro.GetCobrotarjetaAdeudada(txtPatente.Text, txtApellido.Text, Fecha, ConDeuda, CodOrden, Cupon); for (int i = 0; i < tcobro.Rows.Count; i++) { Valor = tcobro.Rows[i]["CodCobro"].ToString(); Valor = Valor + ";" + "Tarjeta"; Valor = Valor + ";" + tcobro.Rows[i]["CodOrden"].ToString(); Valor = Valor + ";" + tcobro.Rows[i]["Patente"].ToString(); Valor = Valor + ";" + tcobro.Rows[i]["Descripcion1"].ToString(); Valor = Valor + ";" + tcobro.Rows[i]["Apellido"].ToString(); Valor = Valor + ";" + tcobro.Rows[i]["Telefono"].ToString(); Valor = Valor + ";"; //+ tcheque.Rows[i]["Celular"].ToString(); Valor = Valor + ";" + tcobro.Rows[i]["Importe"].ToString(); Valor = Valor + ";" + tcobro.Rows[i]["Importe"].ToString(); Valor = Valor + ";" + tcobro.Rows[i]["Fecha"].ToString(); Valor = Valor + "; "; Valor = Valor + ";" + tcobro.Rows[i]["Cupon"].ToString(); tResul = fun.AgregarFilas(tResul, Valor); } double Total = fun.TotalizarColumna(tResul, "Saldo"); txtTotal.Text = Total.ToString(); txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text); tResul = fun.TablaaMiles(tResul, "Importe"); tResul = fun.TablaaMiles(tResul, "Saldo"); Grilla.DataSource = tResul; Grilla.Columns[0].Visible = false; //Grilla.Columns[4].Visible = false; Grilla.Columns[7].Visible = false; Pintar(); }
private void txtCodOrden_KeyPress(object sender, KeyPressEventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); fun.SoloEnteroConPunto(sender, e); }
private void btnBuscar_Click(object sender, EventArgs e) { Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFechaDesde.Text) == false) { MessageBox.Show("Fecha desde incorrecta", Clases.cMensaje.Mensaje()); return; } if (fun.ValidarFecha(txtFechaHasta.Text) == false) { MessageBox.Show("Fecha hasta incorrecta", Clases.cMensaje.Mensaje()); return; } if (Convert.ToDateTime(txtFechaDesde.Text) > Convert.ToDateTime(txtFechaHasta.Text)) { MessageBox.Show("La fecha desde debe ser inferior a la fecha hasta", Clases.cMensaje.Mensaje()); return; } DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); string Concepto = txtConcepto.Text; Clases.cMovimiento mov = new Clases.cMovimiento(); DataTable trdo = mov.GetMovimientoxFecha(FechaDesde, FechaHasta, Concepto); DataTable tResul = new DataTable(); tResul.Columns.Add("Fecha"); tResul.Columns.Add("Descripcion"); tResul.Columns.Add("Ingreso"); tResul.Columns.Add("Egreso"); double TotalIngresos = 0; double TotalEgresos = 0; for (int i = 0; i < trdo.Rows.Count; i++) { string sFecha = trdo.Rows[i]["Fecha"].ToString(); string sDescripcion = trdo.Rows[i]["Descripcion"].ToString(); double Importe = Convert.ToDouble(trdo.Rows[i]["Importe"].ToString()); DataRow r = tResul.NewRow(); r["Fecha"] = sFecha; r["Descripcion"] = sDescripcion; if (Importe > 0) { TotalIngresos = TotalIngresos + Importe; r["Ingreso"] = Importe.ToString(); r["Egreso"] = ""; } else { TotalEgresos = TotalEgresos + Importe; Importe = (-1) * Importe; r["Ingreso"] = ""; r["Egreso"] = Importe.ToString(); } tResul.Rows.Add(r); } tResul = fun.TablaaMiles(tResul, "Ingreso"); tResul = fun.TablaaMiles(tResul, "Egreso"); trdo = fun.TablaaMiles(trdo, "ImporteEfectivo"); //Grilla.DataSource = trdo; Grilla.DataSource = tResul; Grilla.Columns[1].Width = 400; Grilla.Columns[2].Width = 150; Grilla.Columns[3].Width = 150; Grilla.Columns[1].HeaderText = "Descripción"; double Total = TotalIngresos + TotalEgresos; txtTotal.Text = Total.ToString(); txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text); }
private void GetRentabilidad() { cCobroTarjeta objCobro = new cCobroTarjeta(); Clases.cFunciones fun = new Clases.cFunciones(); DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text); DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text); cOrden orden = new cOrden(); txtCantidad.Text = orden.CantidadOrdenes(FechaDesde, FechaHasta).ToString(); double Efectivo = orden.GetTotalEfectivo(FechaDesde, FechaHasta); txtEfectivo.Text = Efectivo.ToString(); if (txtEfectivo.Text != "") { txtEfectivo.Text = fun.FormatoEnteroMiles(txtEfectivo.Text); } double TotalTarjeta = 0; cCobroTarjeta cobro = new cCobroTarjeta(); TotalTarjeta = cobro.GetTotalTarjeta(FechaDesde, FechaHasta); // Double Saldo = cobro.GetSaldoxFecha(FechaDesde, FechaHasta); txtDiferenciaTarjeta.Text = Saldo.ToString(); TotalTarjeta = TotalTarjeta - Saldo; txtTarjeta.Text = TotalTarjeta.ToString(); if (txtTarjeta.Text != "") { txtTarjeta.Text = fun.FormatoEnteroMiles(txtTarjeta.Text); } if (txtDiferenciaTarjeta.Text != "") { txtDiferenciaTarjeta.Text = fun.FormatoEnteroMiles(txtDiferenciaTarjeta.Text); } cDocumento doc = new cDocumento(); double ImporteDocu = doc.GetTotalDocumento(FechaDesde, FechaHasta); txtImporteDocumento.Text = ImporteDocu.ToString(); if (txtImporteDocumento.Text != "") { txtImporteDocumento.Text = fun.FormatoEnteroMiles(txtImporteDocumento.Text); } cCheque cheque = new cCheque(); double ImporteCheque = cheque.GetTotalChequexFecha(FechaDesde, FechaHasta); txtcheque.Text = ImporteCheque.ToString(); if (txtcheque.Text != "") { txtcheque.Text = fun.FormatoEnteroMiles(txtcheque.Text); } cGarantia garantia = new cGarantia(); double ImporteGarantia = garantia.GetTotalGarantiaxFecha(FechaDesde, FechaHasta); txtGarantia.Text = ImporteGarantia.ToString(); if (txtGarantia.Text != "") { txtGarantia.Text = fun.FormatoEnteroMiles(txtGarantia.Text); } cCuentaCorriente cc = new cCuentaCorriente(); Double ImporteCuentaCorriene = 0; ImporteCuentaCorriene = cc.GetTotalCuentaxFecha(FechaDesde, FechaHasta); txtTotalCuentaCorriente.Text = ImporteCuentaCorriene.ToString(); if (txtTotalCuentaCorriente.Text != "") { txtTotalCuentaCorriente.Text = fun.FormatoEnteroMiles(txtTotalCuentaCorriente.Text); } cTransferencia tranfer = new cTransferencia(); Double ImporteTransferencia = tranfer.GetTotalTransferencia(FechaDesde, FechaHasta); txtTotalTransferencia.Text = ImporteTransferencia.ToString(); if (txtTotalTransferencia.Text != "") { txtTotalTransferencia.Text = fun.FormatoEnteroMiles(txtTotalTransferencia.Text); } double TotalFacturado = Efectivo + TotalTarjeta + ImporteDocu + ImporteCheque + ImporteGarantia + ImporteCuentaCorriene + ImporteTransferencia; txtTotalFacturado.Text = TotalFacturado.ToString(); if (txtTotalFacturado.Text != "") { txtTotalFacturado.Text = fun.FormatoEnteroMiles(txtTotalFacturado.Text); } double GananciaInsumos = orden.GetGananciaInsumo(FechaDesde, FechaHasta); double RecargoTarjeta = objCobro.GetTotalRecargoTarjeta(FechaDesde, FechaHasta); double VentaInsumo = orden.GetVentaInsumo(FechaDesde, FechaHasta); double CostoInsumo = orden.GetCostoInsumo(FechaDesde, FechaHasta); txtVentaInsumos.Text = VentaInsumo.ToString(); txtCostoInsumo.Text = CostoInsumo.ToString(); double GananciaInsuloMostrador = 0; cVenta objVenta = new cVenta(); double CostoMostrador = 0; CostoMostrador = objVenta.GetCostoInsumoVenta(FechaDesde, FechaHasta); txtCostoInsumoMostrador.Text = CostoMostrador.ToString(); //GetVentaInsumoVenta double VentaMostrador = 0; VentaMostrador = objVenta.GetVentaInsumoVenta(FechaDesde, FechaHasta); txtVentaMostrador.Text = VentaMostrador.ToString(); if (txtCostoInsumoMostrador.Text != "") { txtCostoInsumoMostrador.Text = fun.FormatoEnteroMiles(txtCostoInsumoMostrador.Text); } if (txtVentaMostrador.Text != "") { txtVentaMostrador.Text = fun.FormatoEnteroMiles(txtVentaMostrador.Text); } if (txtVentaInsumos.Text != "") { txtVentaInsumos.Text = fun.FormatoEnteroMiles(txtVentaInsumos.Text); } if (txtCostoInsumo.Text != "") { txtCostoInsumo.Text = fun.FormatoEnteroMiles(txtCostoInsumo.Text); } txtGananciaInsumos.Text = GananciaInsumos.ToString(); if (txtGananciaInsumos.Text != "") { txtGananciaInsumos.Text = fun.FormatoEnteroMiles(txtGananciaInsumos.Text); } GananciaInsuloMostrador = VentaMostrador - CostoMostrador; txtGananciaMostrador.Text = GananciaInsuloMostrador.ToString(); if (txtGananciaMostrador.Text != "") { txtGananciaMostrador.Text = fun.FormatoEnteroMiles(txtGananciaMostrador.Text); } double GananciaMo = orden.GetGananciaManoObra(FechaDesde, FechaHasta); txtManoObra.Text = GananciaMo.ToString(); if (txtManoObra.Text != "") { txtManoObra.Text = fun.FormatoEnteroMiles(txtManoObra.Text); } double TotalGanancia = GananciaInsumos + GananciaMo + RecargoTarjeta + GananciaInsuloMostrador - Saldo; txtTotalGanancia.Text = TotalGanancia.ToString(); if (txtTotalGanancia.Text != "") { txtTotalGanancia.Text = fun.FormatoEnteroMiles(txtTotalGanancia.Text); } double GastoAlquiler = 0; cGastosNegocio gasto = new cGastosNegocio(); Int32? CodEntidad = 11; GastoAlquiler = gasto.GetGastosNegocio(FechaDesde, FechaHasta, CodEntidad); txtGastoAlquiler.Text = GastoAlquiler.ToString(); if (txtGastoAlquiler.Text != "") { txtGastoAlquiler.Text = fun.FormatoEnteroMiles(txtGastoAlquiler.Text); } double Sueldos = 0; CodEntidad = 6; Sueldos = gasto.GetGastosNegocio(FechaDesde, FechaHasta, CodEntidad); txtSueldo.Text = Sueldos.ToString(); if (txtSueldo.Text != "") { txtSueldo.Text = fun.FormatoEnteroMiles(txtSueldo.Text); } double Combustible = 0; CodEntidad = 13; Combustible = gasto.GetGastosNegocio(FechaDesde, FechaHasta, CodEntidad); txtCombustible.Text = Combustible.ToString(); if (txtCombustible.Text != "") { txtCombustible.Text = fun.FormatoEnteroMiles(txtCombustible.Text); } double Impuestos = 0; CodEntidad = 2; Impuestos = gasto.GetGastosNegocio(FechaDesde, FechaHasta, CodEntidad); txtImpuesto.Text = Impuestos.ToString(); if (txtImpuesto.Text != "") { txtImpuesto.Text = fun.FormatoEnteroMiles(txtImpuesto.Text); } double Varios = 0; CodEntidad = null; Varios = gasto.GetGastosNegocio(FechaDesde, FechaHasta, CodEntidad); Varios = Varios - Sueldos - Impuestos - Combustible - GastoAlquiler; txtOtrosGastos.Text = Varios.ToString(); if (txtOtrosGastos.Text != "") { txtOtrosGastos.Text = fun.FormatoEnteroMiles(txtOtrosGastos.Text); } double TotalGastos = 0; TotalGastos = Varios + Sueldos + Impuestos + Combustible + GastoAlquiler; //+Saldo; txtTotalGastos.Text = TotalGastos.ToString(); if (txtTotalGastos.Text != "") { txtTotalGastos.Text = fun.FormatoEnteroMiles(txtTotalGastos.Text); } double Rentabilidad = TotalGanancia - TotalGastos; txtRentabilidad.Text = Rentabilidad.ToString(); if (txtRentabilidad.Text != "") { txtRentabilidad.Text = fun.FormatoEnteroMiles(txtRentabilidad.Text); } double SaldoGarantia = garantia.GetTotalSaldoGarantiaxFecha(FechaDesde, FechaHasta); txtSaldoGarantia.Text = SaldoGarantia.ToString(); if (txtSaldoGarantia.Text != "") { txtSaldoGarantia.Text = fun.FormatoEnteroMiles(txtSaldoGarantia.Text); } double TotalSaldoTarjeta = cobro.GetTotalSaldoTarjeta(FechaDesde, FechaHasta); txtSaldoTarjeta.Text = TotalSaldoTarjeta.ToString(); if (txtSaldoTarjeta.Text != "") { txtSaldoTarjeta.Text = fun.FormatoEnteroMiles(txtSaldoTarjeta.Text); } double ImporteSaldoDoc = doc.GetTotalSaldoDocumento(FechaDesde, FechaHasta); txtSaldoDocumento.Text = ImporteSaldoDoc.ToString(); if (txtSaldoDocumento.Text != "") { txtSaldoDocumento.Text = fun.FormatoEnteroMiles(txtSaldoDocumento.Text); } double ImporteSaldoCheque = cheque.GetTotalSaldoChequexFecha(FechaDesde, FechaHasta); txtSaldoCheque.Text = ImporteSaldoCheque.ToString(); if (txtSaldoCheque.Text != "") { txtSaldoCheque.Text = fun.FormatoEnteroMiles(txtSaldoCheque.Text); } }