private void ActualizarEfectivo() { Efectivo = total - Tarjeta; LblEfectivo.Text = $"Efectivo: {Efectivo.ToString("C2", new CultureInfo("es-AR"))}"; LblTarjeta.Text = $"Tarjeta: {Tarjeta.ToString("C2", new CultureInfo("es-AR"))}"; BtnPagado.Visible = Efectivo >= 0 && Tarjeta >= 0 && Total - Tarjeta - Efectivo == 0 && Total > 0; }
public void TestGenerarReporteDeVentasPorMes() { Efectivo objEfectivo = new Efectivo(); List <OrdenDeVenta> unaVenta = VentaBLL.GenerarReporteDeVentasPorMes(6, 2021); Assert.AreEqual(objEfectivo.GetType(), unaVenta[0].MetodoDePago.GetType()); }
/// <summary> /// Convierte un datatable obtenido desde la base de datos en un objeto OrdenDeVenta /// </summary> /// <param name="objDataRow">DataRow Obtenido desde la base de datos con lo solicitado.</param> /// <returns>Devuelve un objeto OrdenDeVenta</returns> private static OrdenDeVenta ConvertirDeDataTableAOrdenDeVenta(DataRow objDataRow) { List <DetalleOrden> listaDetalles = new List <DetalleOrden>(); OrdenDeVenta unaVenta = new OrdenDeVenta(); Usuario unUsuario = new Usuario(); Tarjeta objTarjeta = new Tarjeta(); Efectivo objEfectivo = new Efectivo(); unaVenta.ID = (int)objDataRow["id"]; unaVenta.Fecha = Convert.ToDateTime(objDataRow["fecha"]); unUsuario.Legajo = (int)objDataRow["legajo_vendedor"]; if (objDataRow["metodo_pago"].ToString() == "Efectivo") { unaVenta.MetodoDePago = objEfectivo; } else if (objDataRow["metodo_pago"].ToString() == "Tarjeta") { unaVenta.MetodoDePago = objTarjeta; } else { throw new Excepcion_MetodoDePagoInvalido(); } unaVenta.UsuarioCreador = unUsuario; foreach (DetalleOrden unDetalle in listaDetalles) { listaDetalles.Add(ConvertirDeDataTableADetalleOrden(objDataRow)); } unaVenta.Detalles = listaDetalles; return(unaVenta); }
public List <Efectivo> listarEfectivo(metodoPago p) { List <Efectivo> listado = new List <Efectivo>(); AccesoDatosManager accesoDatos = new AccesoDatosManager(); Efectivo e; try { accesoDatos.setearConsulta("select e.importe,c.nombre,e.id from efectivos as e inner join clientes c on c.id=e.idCliente where e.id=" + p.id); accesoDatos.abrirConexion(); accesoDatos.ejecutarConsulta(); while (accesoDatos.Lector.Read()) { e = new Efectivo(); e.cliente = new Cliente(); e.cliente.nombre = accesoDatos.Lector["nombre"].ToString(); e.id = (long)accesoDatos.Lector["id"]; e.importe = (decimal)accesoDatos.Lector["importe"]; listado.Add(e); } return(listado); } catch (Exception ex) { throw ex; } finally { accesoDatos.cerrarConexion(); } }
//EVENTO CLIC DE LAS FORMAS DE PAGO public void boton_clic(object sender, EventArgs e) { bpagar = sender as Button; if (Convert.ToDouble(dgvDetalleDeuda.Rows[1].Cells[1].Value) == 0.0) { ok.LblMensaje.Text = "El saldo actual a pagar ya es de 0.00"; ok.ShowDialog(); } else { Efectivo efectivo = new Efectivo(bpagar.Tag.ToString(), dgvDetalleDeuda.Rows[1].Cells[1].Value.ToString(), "", bpagar.Text.ToString()); efectivo.ShowDialog(); if (efectivo.DialogResult == DialogResult.OK) { dbValorGrid = efectivo.dbValorGrid; dbValorRecuperado = efectivo.dbValorIngresado; dgvPagos.Rows.Add(efectivo.sIdPago, efectivo.sNombrePago, dbValorGrid.ToString("N2"), bpagar.AccessibleDescription); dgvPagos.ClearSelection(); efectivo.Close(); recalcularValores(); } } }
public agregarmPago() { InitializeComponent(); t = null; c = null; ef = null; }
public void TestGuardarVenta() { bool datoEsperado = true; DetalleOrden unDetalleOrden = new DetalleOrden(); OrdenDeVenta objOrdenDeVenta = new OrdenDeVenta(); List <Producto> ListaProducto = ProductoBLL.BuscarProducto("Vino"); List <DetalleOrden> ListaDetalles = new List <DetalleOrden>(); Efectivo objEfectivo = new Efectivo(); Usuario unUSuario = new Usuario(); Producto objProducto = ListaProducto[0]; unDetalleOrden.Producto = objProducto; unDetalleOrden.Cantidad = 2; ListaDetalles.Add(unDetalleOrden); objOrdenDeVenta.Detalles = ListaDetalles; objOrdenDeVenta.MetodoDePago = objEfectivo; List <Cliente> Clientes = ClienteBLL.BuscarClientesPorDNI("38567566"); Cliente ObjCliente = Clientes[0]; objOrdenDeVenta.Cliente = ObjCliente; unUSuario.ID = 1; objOrdenDeVenta.UsuarioCreador = unUSuario; Assert.AreEqual(datoEsperado, VentaBLL.GuardaOrdenVenta(objOrdenDeVenta)); }
public IHttpActionResult SetMoney(int value, int inventory, string device) { try { Common.Error response = new Common.Error() { Message = "Hubo un error al abrir la compuerta1", HasError = true }; Efectivo efect = new Efectivo(); efect.Location = device; efect.Inventory = inventory; efect.Value = value; PaymentService pyment = new PaymentService(); List <Efectivo> list = new List <Efectivo>(); list.Add(efect); response = pyment.SetMoney(list).error; return(Ok(response)); }catch (SystemException E) { return(NotFound()); } }
public void agregarEfectivo(Efectivo efectivo, Cliente cliente, int idpago) { SqlConnection conexion = new SqlConnection(); SqlCommand comando = new SqlCommand(); try { conexion.ConnectionString = AccesoDatosManager.cadenaConexion; comando.CommandType = System.Data.CommandType.Text; //MSF-20190420: le agregué todas las columnas. Teniendo en cuenta inclusive lo que elegimos en el combo de selección.. comando.CommandText = "insert into EFECTIVOS (importe,idCliente,idPago,activo) values"; comando.CommandText += "('" + efectivo.importe.ToString().Replace(",", ".") + "', '" + cliente.id + "', '" + idpago + "', '" + "1" + "')"; comando.Connection = conexion; conexion.Open(); comando.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } finally { conexion.Close(); } }
public void TestGenerarReporteDeVentasPorSemana() { Efectivo objEfectivo = new Efectivo(); var fechatest = new DateTime(2021, 6, 17, 0, 0, 0); List <OrdenDeVenta> unaVenta = VentaBLL.GenerarReporteDeVentasPorSemana(fechatest); Assert.AreEqual(objEfectivo.GetType(), unaVenta[0].MetodoDePago.GetType()); }
public List <Efectivo> CalcularDevuelta(int Valor) { int buffervalor = 0; Valor = (int)Math.Ceiling(Valor / 50d) * 50; List <Efectivo> Vueltas = new List <Efectivo>(); Efectivo val1 = inventory.GetInventario().OrderByDescending(c => c.Value).Where(c => c.Location == InventarioCash.Location.F56).FirstOrDefault(); int res; int value = Math.DivRem(Valor, val1.Value, out res); if (val1.Inventory >= value) { Vueltas.Add(new Efectivo() { Inventory = value, Type = InventarioCash.Type.Bill, Location = InventarioCash.Location.F56, Value = val1.Value }); buffervalor = res; } else { Vueltas.Add(new Efectivo() { Inventory = val1.Inventory, Type = InventarioCash.Type.Bill, Location = InventarioCash.Location.F56, Value = val1.Value }); buffervalor = Valor - (val1.Inventory * val1.Value); } Efectivo val2 = inventory.GetInventario().OrderByDescending(c => c.Value).Where(c => c.Location == InventarioCash.Location.F56 && c.Value != val1.Value).FirstOrDefault(); value = Math.DivRem(buffervalor, val2.Value, out res); if (val2.Inventory >= value) { Vueltas.Add(new Efectivo() { Inventory = value, Type = InventarioCash.Type.Bill, Location = InventarioCash.Location.F56, Value = val2.Value }); buffervalor = res; } else { Vueltas.Add(new Efectivo() { Inventory = val2.Inventory, Type = InventarioCash.Type.Bill, Location = InventarioCash.Location.F56, Value = val2.Value }); buffervalor = Valor - (val2.Inventory * val2.Value); } Vueltas.Add(new Efectivo() { Inventory = val2.Inventory, Type = InventarioCash.Type.Coin, Location = InventarioCash.Location.SMARTHOPPER, Value = buffervalor }); return(Vueltas); }
private void Limpiar() { DeudasIdTextBox.Text = "0"; NombreClienteTextBox.Text = string.Empty; Efectivo.Clear(); Devuelta.Clear(); // Refrescar(); }
public ActionResult DeleteConfirmed(int id) { //Efectivo efectivo = db.Tipos_Pagos.Find(id); Efectivo efectivo = (Efectivo)_UnityOfWork.TipoPagos.Get(id); // db.Tipos_Pagos.Remove(efectivo); _UnityOfWork.TipoPagos.Delete(efectivo); //db.SaveChanges(); _UnityOfWork.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Tipo_PagoId,Monto,EfectivoId")] Efectivo efectivo) { if (ModelState.IsValid) { //db.Entry(efectivo).State = EntityState.Modified; _UnityOfWork.StateModified(efectivo); //db.SaveChanges(); _UnityOfWork.SaveChanges(); return(RedirectToAction("Index")); } return(View(efectivo)); }
public ActionResult Create([Bind(Include = "Tipo_PagoId,Monto,EfectivoId")] Efectivo efectivo) { if (ModelState.IsValid) { // db.Tipos_Pagos.Add(efectivo); _UnityOfWork.TipoPagos.Add(efectivo); //db.SaveChanges(); _UnityOfWork.SaveChanges(); return(RedirectToAction("Index")); } return(View(efectivo)); }
private void button10_Click(object sender, EventArgs e) { Efectivo efectivo = new Efectivo(); agregarEfectivo ventana = new agregarEfectivo(); ventana.ShowDialog(); if (ventana.importe != 0) { efectivo.importe = ventana.importe; listaEfectivo.Add(efectivo); refrescarGrilla(); } }
public static void GrabarEfectivo(int NroDerecibo, int NroDeActa, Decimal Importe) { using (var context = new lts_sindicatoDataContext()) { Efectivo efectivo = new Efectivo { NroDeRecibo = NroDerecibo, NroDeActa = NroDeActa, Importe = Importe, Fecha = DateTime.Now }; context.Efectivo.InsertOnSubmit(efectivo); context.SubmitChanges(); } }
// GET: /Efectivo/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } //Efectivo efectivo = db.Tipos_Pagos.Find(id); Efectivo efectivo = (Efectivo)_UnityOfWork.TipoPagos.Get(id); if (efectivo == null) { return(HttpNotFound()); } return(View(efectivo)); }
public void DoPayment(List <Efectivo> PayoutAmount) { string Currency = "COP"; mut.WaitOne(); Hopper.DisableCoinMech(); Efectivo payment = PayoutAmount.Where(c => c.Location == InventarioCash.Location.SMARTHOPPER).FirstOrDefault(); Hopper.PayoutAmount(payment.Value, Currency.ToCharArray()); //Hopper.EnableHopper(); mut.ReleaseMutex(); }
private void button1_Click(object sender, EventArgs e) { if (cboPago.Text == "Transferencia") { t = new Transferencia(); agregarTransferencias ventana = new agregarTransferencias(); ventana.ShowDialog(); if (ventana.transferencia != null) { t = ventana.transferencia; this.Close(); } } else if (cboPago.Text == "Cheque") { c = new Cheque(); AgregarCheques ventana = new AgregarCheques(); ventana.ShowDialog(); if (ventana.cheque != null) { c = ventana.cheque; this.Close(); } } else if (cboPago.Text == "Efectivo") { ef = new Efectivo(); agregarEfectivo ventana = new agregarEfectivo(); ventana.ShowDialog(); if (ventana.importe != 0) { ef.importe = ventana.importe; this.Close(); } } }
public verEfectivo(Efectivo e) { InitializeComponent(); efectivo = new List <Efectivo>(); efectivo.Add(e); }
void pdoc_PrintPage(object sender, PrintPageEventArgs e) { Graphics graphics = e.Graphics; Font fontEmpresa = new Font("Courier New", 12, FontStyle.Bold); Font fontCabecera = new Font("Courier New", 8); Font fontProductos = new Font("Courier New", 7); int cantLineaTotales = 39; int cantiLineaCabecera = 40; int cantColumnaTotales = 8; int startX = 10; int startY = 0; int Offset = 0; graphics.DrawString(CentrarTexto(Tienda, 27), fontEmpresa, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 20; graphics.DrawString(CentrarTexto(Direccion, cantiLineaCabecera), fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 30; graphics.DrawString("Folio:" + NumeroTicket, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 10; graphics.DrawString("Fecha:" + this.FechaVenta, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 10; graphics.DrawString("Atendió: " + Cajero, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 10; string underLine = "------------------------------------------"; graphics.DrawString(underLine, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); foreach (ArticuloVenta articulo in Articulos) { Offset = Offset + 10; graphics.DrawString(RegistarElementoTicket(articulo.Cantidad.ToString(), articulo.NombreArticulo, "", AlinearTexto(articulo.Monto.ToString("0.00"), true, 11)), fontProductos, new SolidBrush(Color.Black), startX, startY + Offset); } Offset = Offset + 20; string subtotal = AlinearTexto(("Subtotal = " + AlinearTexto((Articulos.Sum(a => a.Monto) - decimal.Parse(IVA)).ToString("0.00"), true, cantColumnaTotales)), true, cantLineaTotales); graphics.DrawString(subtotal, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 10; string iva = AlinearTexto("IVA = " + AlinearTexto(IVA, true, cantColumnaTotales), true, cantLineaTotales); graphics.DrawString(iva, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 10; string descuento = AlinearTexto("Descuento = " + AlinearTexto(Descuento.ToString("0.00"), true, cantColumnaTotales), true, cantLineaTotales); graphics.DrawString(descuento, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 10; string montoTotal = AlinearTexto((Articulos.Sum(a => a.Monto) - Descuento).ToString("0.00"), true, cantColumnaTotales); string total = AlinearTexto("Total = " + montoTotal, true, cantLineaTotales); graphics.DrawString(total, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 20; string totalLetra = CentrarTexto(string.Format("({0})", Enletras(montoTotal)), cantiLineaCabecera); graphics.DrawString(totalLetra, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 30; string pagos = "Efectivo: " + Efectivo.ToString("0.00") + " Cambio: " + Cambio.ToString(); graphics.DrawString(pagos, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 10; underLine = "------------------------------------------"; graphics.DrawString(underLine, fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 10; graphics.DrawString(CentrarTexto("GRACIAS POR SU COMPRA", cantiLineaCabecera), fontCabecera, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 10; }