public void imprimirTicketsValores() { EPrestamos ePrestamos = new EPrestamos(); PrestamosCL prestamosCL = new PrestamosCL(); DataTable dataTable = prestamosCL.TraerPrestamo_planilla(this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Cedula"].Value.ToString(), this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Prestamo"].Value.ToString(), true).Tables[0]; DataTable dataTable2 = prestamosCL.TraerFechaFinalPrestamo(this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Prestamo"].Value.ToString()).Tables[0]; ClientesCL clientesCL = new ClientesCL(); DataTable dataTable3 = clientesCL.TraerClientes(this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Cedula"].Value.ToString()).Tables[0]; double saldoPretamoAnterior = Convert.ToDouble(this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Saldo"].Value.ToString()) + Convert.ToDouble(this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Monto"].Value.ToString()); ePrestamos.encabezado = this.encabezado; ePrestamos.clientePrestamo = this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Cedula"].Value.ToString(); ePrestamos.nombreCliente = dataTable3.Rows[0].ItemArray.GetValue(1).ToString(); ePrestamos.telefonoCliente = dataTable3.Rows[0].ItemArray.GetValue(4).ToString(); ePrestamos.direccionCliente = dataTable3.Rows[0].ItemArray.GetValue(2).ToString(); ePrestamos.totalPrestamo = Convert.ToDouble(dataTable.Rows[0].ItemArray.GetValue(6).ToString()); ePrestamos.fechaPactada = Convert.ToDateTime(this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Fecha_pactada"].Value.ToString()); ePrestamos.fechaAbono = Convert.ToDateTime(this.lblFecha.Text); ePrestamos.numeroCuota = Convert.ToInt32(this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Numero_cuota"].Value.ToString()); ePrestamos.idCuota = Convert.ToInt32(this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Prestamos_cuotas_id"].Value.ToString()); ePrestamos.prestamo = this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Prestamo"].Value.ToString(); ePrestamos.saldoPrestamo = Convert.ToDouble(this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Saldo"].Value.ToString()); ePrestamos.saldoPretamoAnterior = saldoPretamoAnterior; ePrestamos.montoAbono = Convert.ToDouble(this.dtgPrestamosCuotas.Rows[this.cRows].Cells["Monto"].Value.ToString()); ePrestamos.fechaFinalPrestamo = Convert.ToDateTime(dataTable2.Rows[0].ItemArray.GetValue(0).ToString()); this.ticket = ePrestamos.ticket; }
private void ImprimirTicket_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { FontFamily family = new FontFamily("Microsoft Sans Serif"); Font font = new Font(family, 9f); oEPrestamos = new EPrestamos(); clientesCL = new ClientesCL(); oPrestamos = new PrestamosCL(); DataTable dataTable = clientesCL.TraerClientes(this.cliente).Tables[0]; DataTable dataTable2 = oPrestamos.TraerFechaFinalPrestamo(this.Prestamo.ToString()).Tables[0]; oEPrestamos.encabezado = oEncabezado.encabezado; oEPrestamos.clientePrestamo = this.cliente; oEPrestamos.nombreCliente = dataTable.Rows[0].ItemArray.GetValue(1).ToString(); oEPrestamos.telefonoCliente = dataTable.Rows[0].ItemArray.GetValue(4).ToString(); oEPrestamos.direccionCliente = dataTable.Rows[0].ItemArray.GetValue(2).ToString(); oEPrestamos.totalPrestamo = this.totalPrestamo; oEPrestamos.fechaPactada = fechaPactada; oEPrestamos.fechaAbono = Convert.ToDateTime(Convert.ToString(this.dtFechaPago.Value)); oEPrestamos.fechaFinalPrestamo = Convert.ToDateTime(dataTable2.Rows[0].ItemArray.GetValue(0).ToString()); oEPrestamos.numeroCuota = Convert.ToInt32(Convert.ToString(this.NumCuota)); oEPrestamos.idCuota = idCuota; oEPrestamos.prestamo = Convert.ToString(this.Prestamo); oEPrestamos.saldoPrestamo = this.saldo; oEPrestamos.saldoPretamoAnterior = this.saldo + this.Monto; oEPrestamos.montoAbono = this.Monto; e.Graphics.PageUnit = GraphicsUnit.Pixel; e.Graphics.DrawString(oEPrestamos.ticket, font, Brushes.Black, 20f, 10f); }
public void ImprimirCuotas() { frmFechaPreliminarPagoCuota frmFechaPreliminarPagoCuota = new frmFechaPreliminarPagoCuota(this); frmFechaPreliminarPagoCuota.ShowDialog(); if (this.fechaPreliminarPago.ToShortDateString() != "01/01/0001") { frmEncabezadoAbono oEncabezado = new frmEncabezadoAbono("Reimprimir abono"); oEncabezado.ShowDialog(); if (oEncabezado.cancelar) { oEncabezado.Dispose(); return; } // DATOS DE LA FECHA FINAL DEL PRESTAMO PrestamosCL prestamosCL = new PrestamosCL(); DataTable fechaFinalPrestamo = prestamosCL.TraerFechaFinalPrestamo(Convert.ToString(this.dtgCuotas["id_prestamos", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString())).Tables[0]; // DATOS DEL CLIENTE ClientesCL clientesCL = new ClientesCL(); DataTable clientesDatos = clientesCL.TraerClientes(this.cliente).Tables[0]; // DATOS DEL PRESTAMO this.oEPrestamos = new EPrestamos(); this.oEPrestamos.clientePrestamo = this.cliente; this.oEPrestamos.nombreCliente = clientesDatos.Rows[0].ItemArray.GetValue(1).ToString(); this.oEPrestamos.telefonoCliente = clientesDatos.Rows[0].ItemArray.GetValue(4).ToString(); this.oEPrestamos.direccionCliente = clientesDatos.Rows[0].ItemArray.GetValue(2).ToString(); this.oEPrestamos.totalPrestamo = Convert.ToDouble(this.dtgPrestamos["Total1", this.dtgPrestamos.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.fechaAbono = fechaPreliminarPago; this.oEPrestamos.fechaFinalPrestamo = Convert.ToDateTime(fechaFinalPrestamo.Rows[0].ItemArray.GetValue(0).ToString()); // ORDENA LAS CUOTAS BASADO EN EL INDICE var cuotasOrdenadas = dtgCuotas.SelectedRows.Cast <DataGridViewRow>().OrderBy(row => row.Index); // CICLO QUE RECORRE LAS CUOTAS PARA SER IMPRESAS COMO PRELIMINARES foreach (DataGridViewRow item in cuotasOrdenadas) { this.oEPrestamos.encabezado = oEncabezado.encabezado; this.oEPrestamos.prestamo = Convert.ToString(item.Cells["id_prestamos"].Value.ToString()); this.oEPrestamos.saldoPrestamo = Convert.ToDouble(item.Cells["saldo"].Value.ToString()); this.oEPrestamos.fechaPactada = Convert.ToDateTime(item.Cells["fecha_pactada"].Value.ToString()); this.oEPrestamos.numeroCuota = Convert.ToInt32(item.Cells["num_cuota"].Value.ToString()); this.oEPrestamos.idCuota = Convert.ToInt32(item.Cells["id"].Value.ToString()); this.oEPrestamos.saldoPretamoAnterior = Convert.ToDouble(item.Cells["saldo"].Value.ToString()) + Convert.ToDouble(item.Cells["monto_cuota"].Value.ToString()); this.oEPrestamos.montoAbono = Convert.ToDouble(item.Cells["monto_cuota"].Value.ToString()); this.ImprimirTicket.Print(); } } }
// CARGA EL TOTAL DE SALDO DE TODOS LOS PRESTAMOS public void CargarTotalSaldo() { PrestamosCL oPrestamos = new PrestamosCL(); DataRow oTotalSaldo = oPrestamos.TraerPrestamoSaldoTotal().Tables[0].Rows[0]; EPrestamos oPrestamosMoneda = new EPrestamos(); string totalSaldo = oTotalSaldo.ItemArray.GetValue(0).ToString(); lblTotalSaldoPrestamos.Text = Convert.ToDouble(totalSaldo).ToString("C", oPrestamosMoneda.Moneda()); }
private void btnReimprimir_Click(object sender, EventArgs e) { if (!Convert.ToBoolean(this.dtgCuotas["pago", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString())) { MessageBox.Show("Esta cuota no tiene registros de pagos que imprimir", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { frmEncabezadoAbono oEncabezado = new frmEncabezadoAbono("Reimprimir abono"); oEncabezado.ShowDialog(); if (oEncabezado.cancelar) { oEncabezado.Dispose(); return; } //VALORES DEL TICKET ABONO ClientesCL clientesCL = new ClientesCL(); PrestamosCL prestamosCL = new PrestamosCL(); DataTable dataTable = clientesCL.TraerClientes(this.cliente).Tables[0]; DataTable dataTable2 = prestamosCL.TraerFechaFinalPrestamo(Convert.ToString(this.dtgCuotas["id_prestamos", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString())).Tables[0]; this.oEPrestamos = new EPrestamos(); this.oEPrestamos.encabezado = oEncabezado.encabezado; this.oEPrestamos.clientePrestamo = this.cliente; this.oEPrestamos.nombreCliente = dataTable.Rows[0].ItemArray.GetValue(1).ToString(); this.oEPrestamos.telefonoCliente = dataTable.Rows[0].ItemArray.GetValue(4).ToString(); this.oEPrestamos.direccionCliente = dataTable.Rows[0].ItemArray.GetValue(2).ToString(); this.oEPrestamos.totalPrestamo = Convert.ToDouble(this.dtgPrestamos["Total1", this.dtgPrestamos.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.fechaPactada = Convert.ToDateTime(this.dtgCuotas["fecha_pactada", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.fechaAbono = Convert.ToDateTime(this.dtgCuotas["fecha_pago", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.numeroCuota = Convert.ToInt32(this.dtgCuotas["num_cuota", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.idCuota = Convert.ToInt32(this.dtgCuotas["id", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.prestamo = Convert.ToString(this.dtgCuotas["id_prestamos", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.saldoPrestamo = Convert.ToDouble(this.dtgCuotas["saldo", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.saldoPretamoAnterior = Convert.ToDouble(this.dtgCuotas["saldo", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()) + Convert.ToDouble(this.dtgCuotas["monto_cuota", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.montoAbono = Convert.ToDouble(this.dtgCuotas["monto_cuota", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.fechaFinalPrestamo = Convert.ToDateTime(dataTable2.Rows[0].ItemArray.GetValue(0).ToString()); this.ImprimirTicket.Print(); oEncabezado.Dispose(); } }
private void btnImprimirPreliminar_Click(object sender, EventArgs e) { frmFechaPreliminarPagoCuota frmFechaPreliminarPagoCuota = new frmFechaPreliminarPagoCuota(this); frmFechaPreliminarPagoCuota.ShowDialog(); if (this.fechaPreliminarPago.ToShortDateString() != "01/01/0001") { frmEncabezadoAbono oReimprimir = new frmEncabezadoAbono("Imprimir preliminar"); oReimprimir.ShowDialog(); if (oReimprimir.cancelar) { oReimprimir.Dispose(); return; } //VALORES DEL TICKET ABONO this.oEPrestamos = new EPrestamos(); ClientesCL clientesCL = new ClientesCL(); PrestamosCL prestamosCL = new PrestamosCL(); DataTable dataTable = clientesCL.TraerClientes(this.cliente).Tables[0]; DataTable dataTable2 = prestamosCL.TraerFechaFinalPrestamo(Convert.ToString(this.dtgCuotas["id_prestamos", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString())).Tables[0]; this.oEPrestamos.encabezado = oReimprimir.encabezado; this.oEPrestamos.clientePrestamo = this.cliente; this.oEPrestamos.nombreCliente = dataTable.Rows[0].ItemArray.GetValue(1).ToString(); this.oEPrestamos.telefonoCliente = dataTable.Rows[0].ItemArray.GetValue(4).ToString(); this.oEPrestamos.direccionCliente = dataTable.Rows[0].ItemArray.GetValue(2).ToString(); this.oEPrestamos.totalPrestamo = Convert.ToDouble(this.dtgPrestamos["Total1", this.dtgPrestamos.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.fechaPactada = Convert.ToDateTime(this.dtgCuotas["fecha_pactada", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.fechaAbono = this.fechaPreliminarPago; this.oEPrestamos.numeroCuota = Convert.ToInt32(this.dtgCuotas["num_cuota", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.idCuota = Convert.ToInt32(this.dtgCuotas["id", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.prestamo = Convert.ToString(this.dtgCuotas["id_prestamos", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.saldoPrestamo = Convert.ToDouble(this.dtgCuotas["saldo", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.saldoPretamoAnterior = Convert.ToDouble(this.dtgCuotas["saldo", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()) + Convert.ToDouble(this.dtgCuotas["monto_cuota", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.montoAbono = Convert.ToDouble(this.dtgCuotas["monto_cuota", this.dtgCuotas.CurrentCell.RowIndex].Value.ToString()); this.oEPrestamos.fechaFinalPrestamo = Convert.ToDateTime(dataTable2.Rows[0].ItemArray.GetValue(0).ToString()); this.ImprimirTicket.Print(); } }