public void AgregarVenta(Cventa obj) { if (obj.Pago.FormaPago.Altera_caja) { Efec_final += obj.Pago.Importe; V_efectivo += obj.Pago.Importe; } else { V_otros += obj.Pago.Importe; } if (obj.Pago2 != null) { if (obj.Pago2.FormaPago.Altera_caja) { Efec_final += obj.Pago2.Importe; V_efectivo += obj.Pago2.Importe; } else { V_otros += obj.Pago2.Importe; } } V_total += obj.Total; ListaVentas.Add(obj); }
public void EliminarVenta(Cventa obj) { if (obj.Pago.FormaPago.Altera_caja) { Efec_final -= obj.Pago.Importe; V_efectivo -= obj.Pago.Importe; } else { V_otros -= obj.Pago.Importe; } if (obj.Pago2 != null) { if (obj.Pago2.FormaPago.Altera_caja) { Efec_final -= obj.Pago2.Importe; V_efectivo -= obj.Pago2.Importe; } else { V_otros -= obj.Pago2.Importe; } } V_total -= obj.Total; if (ListaVentas != null) { ListaVentas.Remove(obj); } }
public void ImprimirVenta(Cventa oVenta, Ccaja_diaria oCaja) { try { string strDate = DateTime.Now.ToString("dd/MM/yyyy HH:mm"); if (_oPrinter.CapRecPresent == true) { _oPrinter.TransactionPrint(PrinterStation.Receipt, PrinterTransactionControl.Transaction); _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|cA" + "X\n"); _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|cA" + "Documento no valido como factura\n"); _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|N" + "Caja:" + oCaja.ID + " " + oVenta.ID); _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|rA" + strDate + "\n"); _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|200uF"); foreach (Citem oItem in oVenta.Items()) { _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|N" + oItem.Cantidad + " " + oItem.Articulo.Descripcion); _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|rA" + "$" + oItem.Total + "\n"); } _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|200uF"); if (oVenta.DescRecargo != 0) { _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|N" + "Subtotal:"); _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|rA" + "$" + oVenta.Subtotal + "\n"); if (oVenta.DescRecargo > 0) { _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|N" + "Recargo:"); } else { _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|N" + "Descuento:"); } _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|rA" + "$" + oVenta.DescRecargo + "\n"); } _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|N" + "Total:"); _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|bC" + "\u001b|rA" + "$" + oVenta.Total + "\n"); _oPrinter.PrintNormal(PrinterStation.Receipt, "\u001b|3000uF"); if (_oPrinter.CapRecPaperCut == true) { _oPrinter.CutPaper(100); } _oPrinter.TransactionPrint(PrinterStation.Receipt, PrinterTransactionControl.Normal); } } catch (PosControlException ex) { throw new Exception("Error al imprimir una venta." + ex.Message); } }
public void Venta(Cventa obj) { _Venta = obj; }