private async void list() { var pagina = new VentasView(); pagina.BindingContext = new VentasViewModel(); await App.Current.MainPage.Navigation.PushAsync(pagina); }
public void GenerarCotizacion() { // Se guarda la cotización en la base de datos var dAhora = DateTime.Now; var oCot = new VentaCotizacion() { Fecha = dAhora, SucursalID = GlobalClass.SucursalID, ClienteID = this.oControlVentas.Cliente.ClienteID, VendedorID = this.oControlVentas.ctlCobro.VendodorID }; Datos.Guardar <VentaCotizacion>(oCot); // Detalle var oVentaDetalle = this.oControlVentas.GenerarVentaDetalle(); foreach (var oReg in oVentaDetalle) { var oParteCot = new VentaCotizacionDetalle() { VentaCotizacionID = oCot.VentaCotizacionID, ParteID = oReg.ParteID, Cantidad = oReg.Cantidad, PrecioUnitario = oReg.PrecioUnitario, Iva = oReg.Iva }; Datos.Guardar <VentaCotizacionDetalle>(oParteCot); } // Para generar el ticket de la cotización var oVendedor = Datos.GetEntity <Usuario>(q => q.UsuarioID == this.oControlVentas.ctlCobro.VendodorID && q.Estatus); var oVentaV = new VentasView() { Fecha = dAhora, Cliente = this.oControlVentas.Cliente.Nombre, Vendedor = oVendedor.NombrePersona, Total = this.oControlVentas.Total, SucursalID = GlobalClass.SucursalID }; List <VentasDetalleView> oVentaDetalleV = new List <VentasDetalleView>(); Parte oParte; foreach (var oDet in oVentaDetalle) { oParte = Datos.GetEntity <Parte>(q => q.ParteID == oDet.ParteID && q.Estatus); oVentaDetalleV.Add(new VentasDetalleView() { NumeroParte = oParte.NumeroParte, NombreParte = oParte.NombreParte, Cantidad = oDet.Cantidad, PrecioUnitario = oDet.PrecioUnitario, Iva = oDet.Iva }); } VentasLoc.GenerarTicketDeCotizacion(oVentaV, oVentaDetalleV); }
public void MostrarVentas() { VentasView view = (VentasView)Vista; foreach (Venta venta in Negocio.getNegocio().obtenerTodasVentasRealizadas()) { view.listarVenta( venta.IdVenta, venta.Cliente.Apellido, DateTime.Now, venta.obtenerImporteTotal()); } }
public static void GenerarTicketDeCotizacion(VentasView oVenta, List<VentasDetalleView> oVentaDetalle) { var oRep = new Report(); oRep.Load(GlobalClass.ConfiguracionGlobal.pathReportes + "CotizacionTicket.frx"); VentasLoc.TicketAgregarLeyendas(ref oRep); oRep.RegisterData(new List<VentasView>() { oVenta }, "Venta"); oRep.RegisterData(oVentaDetalle, "VentaDetalle"); oRep.SetParameterValue("TotalConLetra", Util.ImporteALetra(oVenta.Total).ToUpper()); oRep.SetParameterValue("Precio1", false); UtilLocal.EnviarReporteASalida("Reportes.VentaCotizacion.Salida", oRep); }
public static void GenerarTicketPrecio1(int VentaID) { var oVentaDetalles = Datos.GetListOf<VentasDetalleView>(v => v.VentaID == VentaID); var oVenta = Datos.GetEntity<VentasView>(v => v.VentaID == VentaID); var oRep = new Report(); oRep.Load(GlobalClass.ConfiguracionGlobal.pathReportes + "VentaTicket.frx"); VentasLoc.TicketAgregarLeyendas(ref oRep); decimal total = 0; var oVentaPrecio1 = new List<VentasDetalleView>(); foreach (var oVentaDetalle in oVentaDetalles) { var oParte = Datos.GetEntity<PartePrecio>(p => p.ParteID == oVentaDetalle.ParteID); var precioConIva = Util.Decimal(oParte.PrecioUno); var precioSinIva = UtilTheos.ObtenerPrecioSinIva(Util.Decimal(oParte.PrecioUno)); var iva = Util.Decimal(oParte.PrecioUno) - precioSinIva; oVentaPrecio1.Add(new VentasDetalleView() { VentaDetalleID = oVentaDetalle.VentaDetalleID, VentaID = oVentaDetalle.VentaID, ParteID = oVentaDetalle.ParteID, NumeroParte = oVentaDetalle.NumeroParte, NombreParte = oVentaDetalle.NombreParte, Costo = oVentaDetalle.Costo, CostoConDescuento = oVentaDetalle.CostoConDescuento, Cantidad = oVentaDetalle.Cantidad, Medida = oVentaDetalle.Medida, LineaID = oVentaDetalle.LineaID, PrecioUnitario = precioSinIva, Iva = iva }); total += precioConIva * oVentaDetalle.Cantidad; } var oVentasViewPrecio1 = new VentasView() { VentaID = oVenta.VentaID, Facturada = oVenta.Facturada, Folio = oVenta.Folio, ClienteID = oVenta.ClienteID, Cliente = oVenta.Cliente, SucursalID = oVenta.SucursalID, Sucursal = oVenta.Sucursal, VentaEstatusID = oVenta.VentaEstatusID, Estatus = oVenta.Estatus, Subtotal = UtilTheos.ObtenerPrecioSinIva(total), Iva = UtilTheos.ObtenerIvaDePrecio(total), Total = total, Pagado = oVenta.Pagado, ACredito = oVenta.ACredito, VendedorID = oVenta.VendedorID, Vendedor = oVenta.Vendedor, VendedorUsuario = oVenta.VendedorUsuario, ComisionistaID = oVenta.ComisionistaID, ClienteVehiculoID = oVenta.ClienteVehiculoID, Kilometraje = oVenta.Kilometraje }; oRep.RegisterData(new List<VentasView>() { oVentasViewPrecio1 }, "Venta"); oRep.RegisterData(oVentaPrecio1, "VentaDetalle"); oRep.SetParameterValue("TotalConLetra", Util.ImporteALetra(oVentasViewPrecio1.Total).ToUpper()); oRep.SetParameterValue("Precio1", true); UtilLocal.EnviarReporteASalida("Reportes.VentaTicket.Salida", oRep); }
public void GenerarCotizacion() { // Se guarda la cotización en la base de datos var dAhora = DateTime.Now; var oCot = new VentaCotizacion() { Fecha = dAhora, SucursalID = GlobalClass.SucursalID, ClienteID = this.oControlVentas.Cliente.ClienteID, VendedorID = this.oControlVentas.ctlCobro.VendodorID }; Datos.Guardar<VentaCotizacion>(oCot); // Detalle var oVentaDetalle = this.oControlVentas.GenerarVentaDetalle(); foreach (var oReg in oVentaDetalle) { var oParteCot = new VentaCotizacionDetalle() { VentaCotizacionID = oCot.VentaCotizacionID, ParteID = oReg.ParteID, Cantidad = oReg.Cantidad, PrecioUnitario = oReg.PrecioUnitario, Iva = oReg.Iva }; Datos.Guardar<VentaCotizacionDetalle>(oParteCot); } // Para generar el ticket de la cotización var oVendedor = Datos.GetEntity<Usuario>(q => q.UsuarioID == this.oControlVentas.ctlCobro.VendodorID && q.Estatus); var oVentaV = new VentasView() { Fecha = dAhora, Cliente = this.oControlVentas.Cliente.Nombre, Vendedor = oVendedor.NombrePersona, Total = this.oControlVentas.Total, SucursalID = GlobalClass.SucursalID }; List<VentasDetalleView> oVentaDetalleV = new List<VentasDetalleView>(); Parte oParte; foreach (var oDet in oVentaDetalle) { oParte = Datos.GetEntity<Parte>(q => q.ParteID == oDet.ParteID && q.Estatus); oVentaDetalleV.Add(new VentasDetalleView() { NumeroParte = oParte.NumeroParte, NombreParte = oParte.NombreParte, Cantidad = oDet.Cantidad, PrecioUnitario = oDet.PrecioUnitario, Iva = oDet.Iva }); } VentasLoc.GenerarTicketDeCotizacion(oVentaV, oVentaDetalleV); }
public App(string filename) { InitializeComponent(); VentasViewModel.Inicializador(filename); MainPage = new VentasView(); }