示例#1
0
        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));
        }
示例#2
0
        public void ImprimirPedido(BE.documento order)
        {
            DLLImpresion.TicketPedido print = new DLLImpresion.TicketPedido();
            //TITULO
            print.AnadirLineaEmpresa("PEDIDO");

            //DATOS DE CABECERA
            //FECHA
            //
            //PEDIDO Y NUMERO DE PEDIDO
            //NOMBRE DEL MOZO
            //
            // NOMBRE DE MESA
            //
            //
            //
            print.AnadirLineaCaracteresDatosGEnerales(order.fechaProceso.ToString(),
                                                      "ADMIN",
                                                      "PEDIDO" + "-",
                                                      order.CustomNumero,
                                                      "",
                                                      order.documentoventaAbarrotes.nroOrdenVenta.ToString(), "NAC", "966557413");


            //DETALLES DE LOS PEDIDOS
            foreach (var item in order.documentoventaAbarrotes.documentoventaAbarrotesDet.ToList())
            {
                //i/f (item.tipoVenta == "PL")
                //{
                if (item.detalleAdicional != null)
                {
                    if (item.tipoVenta == "PL")
                    {
                        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.detalleAdicional})", "", String.Format("{0:0.00}", 0), String.Format("{0:0.00}", 0));
                    }
                }
                else
                {
                    if (item.tipoVenta == "PL")
                    {
                        print.AnadirLineaElementosFactura(item.monto1.GetValueOrDefault().ToString(), $"{item.nombreItem} {"(PARA LLEVAR)"}", "", String.Format("{0:0.00}", 0), String.Format("{0:0.00}", 0));
                    }
                    else
                    {
                        print.AnadirLineaElementosFactura(item.monto1.GetValueOrDefault().ToString(), $"{item.nombreItem}", "", 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);
        }