public static void SaveDocumentoVenta(BE.documentoventaAbarrotes order) { SA.documentoVentaAbarrotesSA ventaSA = new SA.documentoVentaAbarrotesSA(); var doc = MappingDocumento(order); MappingDocumentoCompraCabecera(doc, order); MappingDocumentoCompraCabeceraDetalle(doc, order); ventaSA.GrabarVentaEquivalencia(doc); }
public ActionResult LoadOrders(string mes, string anio) { var periodo = $"{mes}/{anio}"; SA.documentoVentaAbarrotesSA DocumentoVentaSA = new SA.documentoVentaAbarrotesSA(); var ListaPedidos = DocumentoVentaSA.GetListarVentasPeriodoXTipo(3, periodo, "VNP").OrderByDescending(v => v.idDocumento).ToList(); return(Json(new { data = ListaPedidos }, JsonRequestBehavior.AllowGet)); }
public static void SaveOrder(BE.documento order) { SA.documentoVentaAbarrotesSA ventaSA = new SA.documentoVentaAbarrotesSA(); var doc = FillDocumento(order); FillDocumentoCompraCabecera(doc, order.documentoventaAbarrotes); FillDocumentoCompraCabeceraDetalle(doc, order.documentoventaAbarrotes); ventaSA.GrabarVentaEquivalenciaXInfra(doc); UpdateInfraestructura(order.documentoventaAbarrotes); }
public ActionResult Edit(int id) { SA.documentoVentaAbarrotesSA ventaSA = new SA.documentoVentaAbarrotesSA(); var doc = ventaSA.GetVentaID(new BE.documento() { idDocumento = id }); return(View(doc)); }
public ActionResult GetTransferenciasPeriodo(string mes, string anio) { var periodo = new DateTime(int.Parse(anio), int.Parse(mes), 1); var ventaSA = new SA.documentoVentaAbarrotesSA(); var ListaPedidos = ventaSA.GetTransferenciasPeriodo(new BE.documentoventaAbarrotes() { fechaDoc = periodo, idEmpresa = LoginInformation.Empresa.idEmpresa }); LoginInformation.documentoventaAbarrotesList = ListaPedidos; return(Json(new { data = ListaPedidos }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetTransferenciasEnTransito() { // var periodo = new DateTime(int.Parse(anio), int.Parse(mes), 1); var ventaSA = new SA.documentoVentaAbarrotesSA(); var ListaPedidos = ventaSA.GetTransferenciaEnTransito(new BE.documentoventaAbarrotes() { estadoEntrega = "0", idEmpresa = LoginInformation.Empresa.idEmpresa }); LoginInformation.documentoventaAbarrotesList = ListaPedidos; return(Json(new { data = ListaPedidos }, JsonRequestBehavior.AllowGet)); }
public ActionResult Verify(Account acc) { Helios.Cont.WCFService.ServiceAccess.establecimientoSA SA = new SA.establecimientoSA(); usuario = new BESG.AutenticacionUsuario(); usuario.Alias = acc.Name; usuario.Contrasena = acc.Password; usuario.IDCliente = "1";// empresaSPK.FirstOrDefault.idclientespk SelEmpresa = empresaSA.UbicarEmpresaRuc("20602665063"); var ListaUnidadesNegocio = SA.ObtenerListaEstablecimientos(SelEmpresa.idEmpresa); if (ListaUnidadesNegocio != null || ListaUnidadesNegocio.Count > 0) { LoginInformation.Empresa = SelEmpresa; LoginInformation.Establecimiento = ListaUnidadesNegocio.Where(s => s.TipoEstab == "UN").FirstOrDefault(); if (autenticacionSA.AutenticarUsuario(ref usuario)) { // Se supone que FORM1 es un MDI y que todos los formularios lo utilizan. var AutenticacionUsuario = usuario; Session["username"] = AutenticacionUsuario.Alias; //// Se obtiene los permisos necesarios //AutorizacionRolList = AutorizacionRolSA.GetListaAutorizaciones(new AutorizacionRol() { IDCliente = SelEmpresa.idclientespk, IDRol = usuario.CustomUsuario.CustomUsuarioRol.IDRol }); Helios.Seguridad.WCFService.ServiceAccess.UsuarioSA usuarioSA = new Seguridad.WCFService.ServiceAccess.UsuarioSA(); Product.GetUsuariosSistemas = usuarioSA.ListadoUsuariosv2(); SA.documentoVentaAbarrotesSA documentoVentaAbarrotesSA = new SA.documentoVentaAbarrotesSA(); var count = documentoVentaAbarrotesSA.GetTransferenciaEnTransitoCount(new BE.documentoventaAbarrotes() { idEmpresa = SelEmpresa.idEmpresa, idEstablecimiento = LoginInformation.Establecimiento.idCentroCosto, estadoEntrega = "0", }); LoginInformation.TransferTransitCount = count; //SA.detalleitemsSA prodSA = new SA.detalleitemsSA(); ////idEmpresa = "20604303495", //if (Product.GetDetalleitems == null || Product.GetDetalleitems.Count == 0) //{ // var Products = prodSA.GetProductosWithInventario(new BE.detalleitems // { // idEmpresa = LoginInformation.Empresa.idEmpresa, // idEstablecimiento = LoginInformation.Establecimiento.idCentroCosto, // descripcionItem = "" // }); // Product.GetDetalleitems = Products; //} //return View("Dashboardv1"); //return View("~/Views/Order/NuevaOrden2.cshtml"); return(Redirect("~/Order/NuevaOrden2")); } else { return(View("~/Views/Account/Login.cshtml")); //return View("Login"); } } else { return(View("~/Views/Account/Login.cshtml")); } }
public JsonResult GetPrintDocumento(int idmesa, string fecha, string vendedor, int id, string nameMesa) { DLLImpresion.TicketPedido print = new DLLImpresion.TicketPedido(); SA.documentoVentaAbarrotesSA pedidoSA = new SA.documentoVentaAbarrotesSA(); var doc = pedidoSA.GetImprimirPedido(new BE.documento() { idDocumento = id }); //TITULO print.AnadirLineaEmpresa("PEDIDO"); //DATOS DE CABECERA //FECHA // //PEDIDO Y NUMERO DE PEDIDO //NOMBRE DEL MOZO // // NOMBRE DE MESA // // // print.AnadirLineaCaracteresDatosGEnerales(fecha, "ADMIN", "PEDIDO" + "-", vendedor, "", nameMesa.ToString(), "NAC", "966557413"); //DETALLES DE LOS PEDIDOS foreach (var item in doc) { if (item.tipoVenta == "PL") { if (item.detalleAdicional != null) { print.AnadirLineaElementosFactura(item.monto1.GetValueOrDefault().ToString(), $"{item.nombreItem} ({item.detalleAdicional}) {"(PARA LLEVAR)"}", "", String.Format("{0:0.00}", 0), String.Format("{0:0.00}", 0)); } else { print.AnadirLineaElementosFactura(item.monto1.GetValueOrDefault().ToString(), $"{item.nombreItem}", item.unidad1, String.Format("{0:0.00}", 0), String.Format("{0:0.00}", 0)); } } else { if (item.detalleAdicional != null) { print.AnadirLineaElementosFactura(item.monto1.GetValueOrDefault().ToString(), $"{item.nombreItem} ({item.detalleAdicional})", "", String.Format("{0:0.00}", 0), String.Format("{0:0.00}", 0)); } else { print.AnadirLineaElementosFactura(item.monto1.GetValueOrDefault().ToString(), $"{item.nombreItem}", item.unidad1, String.Format("{0:0.00}", 0), String.Format("{0:0.00}", 0)); } } } //NOMBRE DE LA IMPRESORA //NUMERO COPIAS DE IMPRESION print.ImprimeTicket("TICKET", 1); // return new JsonResult { Data = new { status = true }, JsonRequestBehavior.AllowGet() }; //return Json(new { total = total, data = null }, JsonRequestBehavior.AllowGet); return(Json(new { data = "" }, JsonRequestBehavior.AllowGet)); }