├── .gitignore ├── views ├── pedidos.jade ├── error.jade ├── layout.jade ├── index.jade ├── verify.jade ├── admin.jade ├── ventas.jade ├── ventas - copia.jade ├── ventastotales.jade ├── ventasefectivo.jade ├── ventastarjetas.jade ├── mensual.jade ├── mozos.jade ├── bebidas.jade ├── platos.jade ├── mesas.jade └── panel.jade ├── aplicacion ├── css │ ├── main.css │ ├── reset.css │ ├── header.css │ ├── reset.scss │ ├── header.scss │ ├── main.scss │ └── normalize.css ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 ├── index.html └── js │ └── app.js ├── public ├── stylesheets │ ├── mesas.css │ ├── select.css │ ├── notify.css │ ├── reset.scss │ ├── reporte.css │ ├── widget.css │ ├── homeLogin.css │ ├── style.css │ ├── widget.scss │ ├── administracion.css │ ├── print.css │ ├── utils.scs │ ├── salon.css │ ├── platosDelete.scss │ ├── button.css │ ├── utils.css │ ├── menu.css │ ├── notify.scss │ ├── button.scss │ ├── print.scss │ ├── select.scss │ ├── utils.scss │ ├── homeLogin.scss │ ├── reporte.scss │ ├── menu.scss │ ├── administracion.scss │ ├── mesas.scss │ ├── salon.scss │ ├── normalize.css │ └── prepros.cfg ├── images │ ├── logo.png │ ├── mesa.png │ ├── mesa2.png │ └── ring-alt.svg ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 └── javascripts │ ├── ventasmensual.js │ ├── copia.js │ ├── jquery.hideseek.js │ ├── jquery.cookie.js │ ├── deleteMesas.js │ ├── ventas.js │ ├── ventastarjetas.js │ ├── ventasefectivo.js │ └── copiamesas.js ├── routes ├── validate.js ├── users.js ├── index.js ├── panel.js ├── copymesas.js ├── apipollos.js ├── mesas.js ├── ventas.js └── pedidos.js ├── models └── local.js ├── webpack-config.js ├── .github └── FUNDING.yml ├── package.json ├── passport.js ├── README.md ├── bin └── www ├── npm-debug.log └── app.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /views/pedidos.jade: -------------------------------------------------------------------------------- 1 | h2 hola -------------------------------------------------------------------------------- /aplicacion/css/main.css: -------------------------------------------------------------------------------- 1 | main { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /public/stylesheets/mesas.css: -------------------------------------------------------------------------------- 1 | .mesasSelect { 2 | cursor: pointer; 3 | } 4 | -------------------------------------------------------------------------------- /public/stylesheets/select.css: -------------------------------------------------------------------------------- 1 | .ocupado-JS { 2 | background: red; 3 | } 4 | -------------------------------------------------------------------------------- /aplicacion/css/reset.css: -------------------------------------------------------------------------------- 1 | h1, h2, h3, h4, h5, h6, figure, ul { 2 | padding: 0; 3 | margin: 0; 4 | } 5 | -------------------------------------------------------------------------------- /public/stylesheets/notify.css: -------------------------------------------------------------------------------- 1 | .headerNotify { 2 | position: absolute; 3 | background: red; 4 | } 5 | -------------------------------------------------------------------------------- /public/stylesheets/reset.scss: -------------------------------------------------------------------------------- 1 | figure, ul, h1, h2, h3, h4, h5, h6 { 2 | margin: 0; 3 | padding: 0; 4 | } -------------------------------------------------------------------------------- /public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/public/images/logo.png -------------------------------------------------------------------------------- /public/images/mesa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/public/images/mesa.png -------------------------------------------------------------------------------- /public/images/mesa2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/public/images/mesa2.png -------------------------------------------------------------------------------- /public/stylesheets/reporte.css: -------------------------------------------------------------------------------- 1 | .contenido--Details .contenido--ReportesDay { 2 | background: blue; 3 | } 4 | -------------------------------------------------------------------------------- /public/stylesheets/widget.css: -------------------------------------------------------------------------------- 1 | .header--Cont--Center .Center--Time .time--Title { 2 | color: white; 3 | } 4 | -------------------------------------------------------------------------------- /aplicacion/css/header.css: -------------------------------------------------------------------------------- 1 | .header { 2 | background: #36459B; 3 | line-height: 50px; 4 | width: 100%; 5 | } 6 | -------------------------------------------------------------------------------- /aplicacion/css/reset.scss: -------------------------------------------------------------------------------- 1 | h1, h2, h3, h4, h5, h6, figure, ul{ 2 | padding: 0; 3 | margin: 0; 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/public/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /views/error.jade: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= message 5 | h2= error.status 6 | pre #{error.stack} 7 | -------------------------------------------------------------------------------- /aplicacion/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/aplicacion/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/public/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/public/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/public/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/public/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /public/stylesheets/homeLogin.css: -------------------------------------------------------------------------------- 1 | .mainHome .sectionHome .sectionHome--Header .sectionHome--Header--Figure img { 2 | width: 50%; 3 | } 4 | -------------------------------------------------------------------------------- /aplicacion/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/aplicacion/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /aplicacion/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/aplicacion/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /aplicacion/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/aplicacion/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /aplicacion/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edinsoncs/Sistema-Restaurante/HEAD/aplicacion/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } 9 | -------------------------------------------------------------------------------- /public/stylesheets/widget.scss: -------------------------------------------------------------------------------- 1 | .header--Cont--Center { 2 | .Center--Time { 3 | .time--Title { 4 | color: white; 5 | font-weight: 400; 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /views/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/stylesheets/style.css') 6 | body 7 | block content 8 | -------------------------------------------------------------------------------- /public/stylesheets/administracion.css: -------------------------------------------------------------------------------- 1 | .contenido { 2 | width: 100%; 3 | background: white; 4 | padding: 1em; 5 | border: 1px solid #D8D8D8; 6 | height: 500px; 7 | } 8 | -------------------------------------------------------------------------------- /public/javascripts/ventasmensual.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | function showMensual(){ 4 | 5 | 6 | 7 | 8 | } 9 | showMensual(); 10 | 11 | }); -------------------------------------------------------------------------------- /public/stylesheets/print.css: -------------------------------------------------------------------------------- 1 | .header { 2 | display: none; 3 | } 4 | 5 | main { 6 | display: none; 7 | } 8 | 9 | .impresionMesaCerrada { 10 | background: red; 11 | } 12 | -------------------------------------------------------------------------------- /public/stylesheets/utils.scs: -------------------------------------------------------------------------------- 1 | .cssPreload { 2 | text-align: center; 3 | } 4 | .jsTextEllipsis { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } -------------------------------------------------------------------------------- /public/stylesheets/salon.css: -------------------------------------------------------------------------------- 1 | main { 2 | width: 1220px; 3 | margin: 0 auto; 4 | } 5 | 6 | main .content { 7 | width: 70%; 8 | background-color: white; 9 | height: 500px; 10 | } 11 | -------------------------------------------------------------------------------- /public/stylesheets/platosDelete.scss: -------------------------------------------------------------------------------- 1 | .jsFormPlatos { 2 | .aside--Form--Fieldset { 3 | .fieldset--De { 4 | input[name='nombrePlato'] { 5 | text-transform: capitalize; 6 | } 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /aplicacion/css/header.scss: -------------------------------------------------------------------------------- 1 | .header { 2 | background: #36459b; 3 | box-shadow: 0 0 2px #232F75; 4 | line-height: 50px; 5 | width: 100%; 6 | padding: 0 1em; 7 | .title--Header{ 8 | color: white; 9 | font-weight: 400; 10 | } 11 | } -------------------------------------------------------------------------------- /routes/validate.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | router.get('/', function(req, res, next) { 5 | res.render('verify', { title: 'Incorrecto - Lacatedraldelpisco' }); 6 | }); 7 | 8 | module.exports = router; -------------------------------------------------------------------------------- /public/stylesheets/button.css: -------------------------------------------------------------------------------- 1 | .sendBtn { 2 | background: #444444; 3 | border: none; 4 | color: white; 5 | font-size: 0.9em; 6 | padding: 0.5em 1em; 7 | outline: medium none; 8 | border-radius: 4px; 9 | box-shadow: 0 2px 0 black; 10 | } 11 | -------------------------------------------------------------------------------- /routes/users.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | /* GET users listing. */ 5 | router.get('/', function(req, res, next) { 6 | res.send('respond with a resource'); 7 | }); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /public/stylesheets/utils.css: -------------------------------------------------------------------------------- 1 | .cssPreload { 2 | text-align: center; 3 | display: none; 4 | } 5 | 6 | .cssPreload .cssPreload--Header { 7 | padding: 1em 0; 8 | } 9 | 10 | .cssPreload .cssPreload--Header .title { 11 | font-weight: 400; 12 | color: #AFAFB7; 13 | } 14 | -------------------------------------------------------------------------------- /routes/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | /* GET home page. */ 5 | router.get('/', function(req, res, next) { 6 | res.render('index', { title: 'Administración Lacatedraldelpisco' }); 7 | }); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /models/local.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | var Schema = mongoose.Schema; 3 | 4 | var usuario = new Schema ({ 5 | username: String, 6 | password: String 7 | }, { 8 | collection: 'usuarios' 9 | }); 10 | 11 | var usuarioModel = mongoose.model('model', usuario); 12 | -------------------------------------------------------------------------------- /routes/panel.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | router.get('/', function(req, res, next) { 5 | res.render('panel', { 6 | title: 'Panel - Lacatedraldelpisco', 7 | username: req.user.username 8 | }); 9 | }); 10 | 11 | module.exports = router; -------------------------------------------------------------------------------- /public/stylesheets/menu.css: -------------------------------------------------------------------------------- 1 | .header .header--Cont { 2 | width: 1220px; 3 | margin: 0 auto; 4 | display: flex; 5 | justify-content: space-between; 6 | } 7 | 8 | .header .header--Cont .header--Cont--Iz { 9 | width: 20%; 10 | } 11 | 12 | .header .header--Cont .header--Cont--Iz .header--Cont--Figure img { 13 | width: 100%; 14 | } 15 | 16 | .header .header--Cont .header--Cont--De { 17 | width: 70%; 18 | } 19 | -------------------------------------------------------------------------------- /public/stylesheets/notify.scss: -------------------------------------------------------------------------------- 1 | .headerNotify { 2 | position: absolute; 3 | background: #5CB85C; 4 | left: 0; 5 | right: 0; 6 | width: 100%; 7 | display: none; 8 | .success { 9 | width: 1220px; 10 | margin: 0 auto; 11 | .title { 12 | font-size: 1em; 13 | line-height: 32px; 14 | color: white; 15 | font-weight: 400; 16 | i { 17 | padding: 0 0.5em 0 0; 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /public/stylesheets/button.scss: -------------------------------------------------------------------------------- 1 | .sendBtn { 2 | background: #444444; 3 | border: none; 4 | color: white; 5 | font-size: 0.9em; 6 | padding: 0.5em 1em; 7 | outline: medium none; 8 | border-radius: 4px; 9 | box-shadow: 0 2px 0 black; 10 | &:active { 11 | animation: hot 1s 12 | } 13 | @keyframes hot { 14 | 20% { 15 | transform: scale(0.9); 16 | } 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /public/stylesheets/print.scss: -------------------------------------------------------------------------------- 1 | @media print { 2 | 3 | 4 | .header { 5 | display: none; 6 | } 7 | main { 8 | display: none; 9 | } 10 | .impresionMesaCerrada { 11 | margin-top: 0; 12 | font-size: 0.75em; 13 | } 14 | .buttons--Cont { 15 | display: none; 16 | } 17 | .impresion--Cont--Gracias { 18 | border-top: 1px solid black; 19 | border-bottom: 1px solid black; 20 | margin: 0.5em 0; 21 | } 22 | .jsCocina { 23 | font-size: 1em; 24 | } 25 | } -------------------------------------------------------------------------------- /public/stylesheets/select.scss: -------------------------------------------------------------------------------- 1 | .ocupado-JS { 2 | background: #323131!important; 3 | img { 4 | } 5 | .content--Mesa--Number { 6 | margin-top: -2em!important; 7 | line-height: 14px!important; 8 | :after { 9 | content: "Ocupado"; 10 | font-size: 0.7em; 11 | display: block; 12 | } 13 | 14 | .titleMesa { 15 | color: #FEDA4C!important; 16 | } 17 | } 18 | 19 | } 20 | 21 | .itemSelect { 22 | background: #C9C9CA; 23 | } 24 | .contSum { 25 | .title { 26 | cursor: pointer; 27 | } 28 | } -------------------------------------------------------------------------------- /public/stylesheets/utils.scss: -------------------------------------------------------------------------------- 1 | .cssNone{ 2 | display: none; 3 | } 4 | .cssPreload { 5 | text-align: center; 6 | display:none; 7 | .cssPreload--Header { 8 | padding: 1em 0; 9 | .title { 10 | font-weight: 400; 11 | color: #AFAFB7; 12 | } 13 | } 14 | } 15 | .jsOcultar { 16 | display: none; 17 | } 18 | .ventas { 19 | width: 100%!important; 20 | } 21 | .contenido--ReporteTotal { 22 | text-align: right; 23 | width: 100%; 24 | .header--ReporteTotal { 25 | .title { 26 | font-weight: 400; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /webpack-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | devtool: 'source-map', 3 | entry: "./app.tsx", 4 | mode: "development", 5 | output: { 6 | filename: "./app-bundle.js" 7 | }, 8 | resolve: { 9 | extensions: ['.Webpack.js', '.web.js', '.ts', '.js', '.jsx', '.tsx'] 10 | }, 11 | module: { 12 | rules: [ 13 | { 14 | test: /\.tsx$/, 15 | exclude: /(node_modules|bower_components)/, 16 | use: { 17 | loader: 'ts-loader' 18 | } 19 | } 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /public/images/ring-alt.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sistema", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "body-parser": "~1.20.2", 10 | "cookie-parser": "~1.3.5", 11 | "debug": "~2.2.0", 12 | "express": "~4.18.2", 13 | "express-session": "^1.12.1", 14 | "jade": "~1.11.0", 15 | "mongodb": "^3.1.13", 16 | "mongoose": "^5.7.5", 17 | "mongoskin": "^1.3.20", 18 | "monk": "https://github.com/vccabral/monk.git", 19 | "morgan": "~1.6.1", 20 | "mpromise": "0.5.1", 21 | "node-thermal-printer": "0.0.11", 22 | "passport": "^0.3.2", 23 | "passport-local": "^1.0.0", 24 | "serve-favicon": "~2.3.0", 25 | "react": "~16.6.0", 26 | "react-dom": "~16.6.0", 27 | "ts-loader": "~5.3.0", 28 | "typescript": "~3.1.5", 29 | "webpack": "~4.23.1", 30 | "webpack-cli": "~3.1.2" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /public/javascripts/copia.js: -------------------------------------------------------------------------------- 1 | var id = $(this).find('.details--Name .id').text(); 2 | var mesa = $(this).find('.details--Name .title').text(); 3 | var personas = $(this).find('.details--Name .persona').text(); 4 | var pedido = $(this).find('.jsPedido .title').text(); 5 | var moso = $(this).find('.details--Celu .title').text(); 6 | //alert(id); 7 | $(".jsMesaTT").text(mesa); 8 | //alert(pedido); 9 | 10 | $(".jsEditPedidos .idTitle").text(id); 11 | $(".jsEditPedidos input[name='jsPersonas']").val(personas); 12 | 13 | 14 | var templateMesa = ""; 17 | 18 | globalTemplate += ""; 21 | 22 | for(var i = 0; i < pedido.length; i++){ 23 | var recorrer = pedido[i]; 24 | console.log(recorrer); 25 | } 26 | 27 | $(".jsEditPedidos select[name='jsPedidoActual']").html(globalTemplate); 28 | 29 | $(".selectMozo").html(templateMesa); -------------------------------------------------------------------------------- /views/index.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='stylesheets/normalize.css') 7 | link(rel='stylesheet', href='stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src='javascripts/app.js') 10 | script(src='javascripts/web.js') 11 | body 12 | main.mainHome 13 | section.sectionHome 14 | header.sectionHome--Header 15 | figure.sectionHome--Header--Figure 16 | img(src="images/logo.png", alt="Lacatedraldelpisco Sistema") 17 | form(action="/login", method="POST", class="formLogin") 18 | header.formLogin--Header 19 | h2.title 20 | | Acceso al sistema 21 | fieldset.formFieldset 22 | input(type="text", class="inputHome" name="username", placeholder="Ingrese usuario") 23 | fieldset.formFieldset 24 | input(type="password", class="inputHome" name="password", placeholder="Ingrese su contraseña") 25 | fieldset.formFieldset 26 | input(type="submit", class="inputLogin", value="Ingresar") -------------------------------------------------------------------------------- /views/verify.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='stylesheets/normalize.css') 7 | link(rel='stylesheet', href='stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src='javascripts/app.js') 10 | script(src='javascripts/web.js') 11 | body 12 | main.mainHome 13 | section.sectionHome 14 | header.sectionHome--Header 15 | figure.sectionHome--Header--Figure 16 | img(src="images/logo.png", alt="Lacatedraldelpisco Sistema") 17 | form(action="/login", method="POST", class="formLogin") 18 | header.formLogin--Header 19 | h2.title 20 | | Hubo un error 21 | fieldset.formFieldset 22 | input(type="text", class="inputHome" name="username", placeholder="Ingrese usuario") 23 | fieldset.formFieldset 24 | input(type="password", class="inputHome" name="password", placeholder="Ingrese su contraseña") 25 | fieldset.formFieldset 26 | input(type="submit", class="inputLogin", value="Ingresar") -------------------------------------------------------------------------------- /public/stylesheets/homeLogin.scss: -------------------------------------------------------------------------------- 1 | .mainHome { 2 | .sectionHome { 3 | background-color: white; 4 | padding: 0.2em; 5 | width: 350px; 6 | margin: 0 auto; 7 | position: absolute; 8 | top: 50%; 9 | left: 50%; 10 | margin-left: -10em; 11 | margin-top: -10em; 12 | border: 1px solid #C6C5C5; 13 | .sectionHome--Header { 14 | text-align: center; 15 | .sectionHome--Header--Figure { 16 | margin: 0; 17 | padding: 0.5em 0; 18 | img { 19 | width: 250px; 20 | } 21 | } 22 | } 23 | .formLogin { 24 | .formLogin--Header { 25 | text-align: center; 26 | font-weight: 400; 27 | color: #F62459; 28 | font-size: 1.5em; 29 | } 30 | .formFieldset { 31 | border: none; 32 | margin: 0.5em 0; 33 | padding: 0; 34 | text-align: center; 35 | .inputHome { 36 | width: 90%; 37 | padding: 0.4em 0.5em; 38 | height: 30px; 39 | outline: medium none; 40 | border-radius: 4px; 41 | border: none; 42 | border: 1px solid #dedede; 43 | color: #9e9e9e; 44 | background: linear-gradient(#F0EFEF, #EEE, #DEDEDE); 45 | } 46 | .inputLogin { 47 | border: none; 48 | padding: 0.5em 1em; 49 | color: white; 50 | background: #F62459; 51 | outline: medium none; 52 | border-radius: 4px; 53 | } 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /routes/copymesas.js: -------------------------------------------------------------------------------- 1 | collection.findAndModify({ 2 | query: {'_id': id}, 3 | update: { 4 | 'Mesa': mesa, 5 | 'Personas': personas, 6 | 'Pedido': pedido, 7 | 'Mozo': mozo, 8 | 'Estado': 'Actualizado', 9 | 'Hora': resultadoHora, 10 | 'Fecha': resultadoFecha, 11 | 'Adicionales': [ 12 | {'PedidosCant0' : pedidosCant0}, 13 | {'PedidosCant1' : pedidosCant}, 14 | {'pedidosCant2' : pedidosCant2}, 15 | {'pedidosCant3' : pedidosCant3}, 16 | {'pedidosCant4' : pedidosCant4}, 17 | {'pedidosCant5' : pedidosCant5}, 18 | {'pedidosCant6' : pedidosCant6}, 19 | {'pedidosCant7' : pedidosCant7}, 20 | {'pedidosCant8' : pedidosCant8}, 21 | {'pedidosCant9' : pedidosCant9}, 22 | {'pedidosCant10' : pedidosCant10}, 23 | {'pedidosCant11' : pedidosCant11}, 24 | {'pedidosCant12' : pedidosCant12}, 25 | {'pedidosCant13' : pedidosCant13}, 26 | {'pedidosCant14' : pedidosCant14}, 27 | {'pedidosCant15' : pedidosCant15}, 28 | {'pedidosCant16' : pedidosCant16}, 29 | {'pedidosCant17' : pedidosCant17}, 30 | {'pedidosCant18' : pedidosCant18}, 31 | {'pedidosCant19' : pedidosCant19}, 32 | {'pedidosCant20' : pedidosCant20} 33 | ] 34 | 35 | 36 | 37 | } 38 | 39 | 40 | }).success(function(doc){ 41 | res.json({inserted: true}); 42 | }).error(function(err){ 43 | console.log('hubo error' + err); 44 | }) -------------------------------------------------------------------------------- /aplicacion/css/main.scss: -------------------------------------------------------------------------------- 1 | main { 2 | width: 90%; 3 | margin: 1em auto 1em auto; 4 | padding: 1em; 5 | height: 500px; 6 | background: white; 7 | border: 1px solid #999; 8 | .headerMain { 9 | border-bottom: 1px solid #656262; 10 | overflow: hidden; 11 | .iz--HeaderMain { 12 | .title { 13 | font-weight: 400; 14 | color: #656262; 15 | } 16 | float: left; 17 | } 18 | .de--HeaderMain { 19 | color: #656262; 20 | float: right; 21 | } 22 | } 23 | 24 | 25 | .pedidosMain { 26 | .navPedidos .ul { 27 | text-align: center; 28 | background: #8E8E8E; 29 | padding: 0.5em 0; 30 | .list { 31 | display: inline-block; 32 | list-style-type: none; 33 | width: 24%; 34 | color: white; 35 | } 36 | } 37 | } 38 | .content { 39 | .ul { 40 | text-align: center; 41 | background: #fff; 42 | padding: 0.2em 0; 43 | border-bottom: 1px solid black; 44 | .contentUl { 45 | .list { 46 | display: inline-block; 47 | list-style-type: none; 48 | width: 24%; 49 | color: black; 50 | &:first-child { 51 | font-weight: 700; 52 | } 53 | .buttonAproved { 54 | background: #26A65B; 55 | padding: 0.5em 0.5em; 56 | border: none; 57 | color: white; 58 | border-radius: 4px; 59 | outline: medium none; 60 | i { 61 | margin: 0 0.5em 0 0; 62 | } 63 | } 64 | } 65 | 66 | } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /aplicacion/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Aplicacion Lacatedral 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |

17 | Lacatedraldelpisco - App 18 |

19 |
20 | 21 |
22 |
23 |
24 |

25 | Últimos Pedidos - Pollos 26 |

27 |
28 |
29 | 30 | 31 | 32 |
33 |
34 |
35 | 52 |
53 | 54 |
55 | 56 |
57 | 58 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /public/stylesheets/reporte.scss: -------------------------------------------------------------------------------- 1 | .contenido--Details { 2 | .contenido--ReportesDay { 3 | background: #26A65B; 4 | color: white; 5 | text-align: left; 6 | padding: 0.5em; 7 | } 8 | } 9 | .content--Search { 10 | [contenteditable='true'] { 11 | background: #4B77BE; 12 | padding: 0.2em 0.5em; 13 | color: white; 14 | margin: 0 0.2em; 15 | &:focus { 16 | background: transparent; 17 | color: black; 18 | } 19 | } 20 | .linkButton--Reporte { 21 | margin: 0 0 0 1em; 22 | background: #000; 23 | border: none; 24 | color: white; 25 | font-size: 1em; 26 | padding: 0.5em 0.5em; 27 | border-top-left-radius: 4px; 28 | outline: medium none; 29 | i { 30 | margin: 0 0.5em 0 0; 31 | } 32 | } 33 | } 34 | .jsReportes { 35 | //height: 400px; 36 | max-height: 400px; 37 | overflow-y: scroll; 38 | overflow-x: hidden; 39 | padding: 0 0 0.5em 0; 40 | } 41 | .contenido--ReporteTotal { 42 | .button--SaveTotal { 43 | margin: 1em 0; 44 | display: flex; 45 | justify-content: space-between; 46 | align-items: center; 47 | 48 | span, a { 49 | display: block; 50 | } 51 | .guardar--ElTotal { 52 | background: #337AB7; 53 | border: 1px solid #2e6da4; 54 | border-radius: 4px; 55 | color: white; 56 | cursor: pointer; 57 | padding: 0.5em 1em; 58 | &:hover { 59 | background: #286090 60 | } 61 | } 62 | .ver--ReporteMensual { 63 | background: #D91E18; 64 | border: 1px solid #96281B; 65 | border-radius: 4px; 66 | color: white; 67 | cursor: pointer; 68 | padding: 0.5em 1em; 69 | text-decoration: none; 70 | i { 71 | padding: 0 0.5em 0 0; 72 | } 73 | &:hover { 74 | background: #C21C17; 75 | } 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /passport.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | 3 | var UserDetails = mongoose.model('model'); 4 | 5 | var LocalStrategy = require('passport-local').Strategy; 6 | // Fichero de configuración donde se encuentran las API keys 7 | // Este archivo no debe subirse a GitHub ya que contiene datos 8 | // que pueden comprometer la seguridad de la aplicación. 9 | //var config = require('./config'); 10 | 11 | // Exportamos como módulo las funciones de passport, de manera que 12 | // podamos utilizarlas en otras partes de la aplicación. 13 | // De esta manera, mantenemos el código separado en varios archivos 14 | // logrando que sea más manejable. 15 | module.exports = function(passport) { 16 | 17 | // Serializa al usuario para almacenarlo en la sesión 18 | passport.serializeUser(function(user, done) { 19 | done(null, user); 20 | }); 21 | 22 | // Deserializa el objeto usuario almacenado en la sesión para 23 | // poder utilizarlo 24 | passport.deserializeUser(function(obj, done) { 25 | done(null, obj); 26 | }); 27 | 28 | 29 | // Configuracion del autenticado local 30 | passport.use(new LocalStrategy(function(username, password, done) { 31 | process.nextTick(function() { 32 | UserDetails.findOne({ 33 | 'username': username 34 | }, function(err, user) { 35 | if (err) { 36 | return done(err); 37 | } 38 | 39 | if (!user) { 40 | console.log('ocurrio un error'); 41 | return done(null, false); 42 | } 43 | 44 | if (user.password != password) { 45 | console.log('hubo un error en la cuenta'); 46 | return done(null, false); 47 | } 48 | 49 | return done(null, user); 50 | }); 51 | }); 52 | 53 | })); 54 | 55 | 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![alt tag](https://i.ibb.co/gWYF4nQ/erestaurant-new-1024x517.png) 3 | 4 | **English:** 5 | Hello community, thanks for visiting this project that was created 4 years ago. Everything was born from a need and learning new technologies. Today I am developing a very complete CMS with many things which need collaboration from you. I count on your support 6 | 7 | **Spanish:** 8 | Hola comunidad, gracias por visitar este proyecto que fue creado hace 4 años. todo nacio por una necesidad y aprendizaje de nuevas tecnologias. hoy en la actualidad estoy desarrollando un CMS muy completo con muchas cosas la cual se necesita colaboración de parte de ustedes. espero contar con su apoyo 9 | 10 | **French:** 11 | Bonjour la communauté, merci de visiter ce projet qui a été créé il y a 4 ans. Tout est né d'un besoin et de l'apprentissage de nouvelles technologies. Aujourd'hui, je développe un CMS très complet avec beaucoup de choses qui nécessitent une collaboration de votre part. J'espère compter sur votre soutien 12 | 13 | **Germany:** 14 | Hallo Community, vielen Dank für den Besuch dieses Projekts, das vor 4 Jahren erstellt wurde. Alles wurde aus einem Bedürfnis geboren und lernte neue Technologien. Heute entwickle ich ein sehr vollständiges CMS mit vielen Dingen, die eine Zusammenarbeit von Ihnen erfordern. Ich hoffe auf Ihre Unterstützung zählen zu können. 15 | 16 | **Russia:** 17 | Здравствуйте, сообщество, спасибо за посещение этого проекта, который был создан 4 года назад. Все рождено от потребности и изучения новых технологий. Сегодня я разрабатываю очень полную CMS со многими вещами, которые требуют совместной работы от вас. Я надеюсь рассчитывать на вашу поддержку. 18 | 19 | 20 | Sistema para restaurante creado en nodejs(Versión temporal) 21 | Primera versión: 22 | 23 | ![alt tag](https://i.ibb.co/dWLHbJ6/screencapture-localhost-8080-panel-2020-05-03-14-38-23-1203x1536.png) 24 | 25 | 26 | 27 | Desarrollado por www.edinsoncs.com 28 | 29 | -------------------------------------------------------------------------------- /bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('sistema:server'); 9 | var http = require('http'); 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '8080'); 16 | app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort(val) { 37 | var port = parseInt(val, 10); 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val; 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port; 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError(error) { 57 | if (error.syscall !== 'listen') { 58 | throw error; 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port; 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges'); 69 | process.exit(1); 70 | break; 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use'); 73 | process.exit(1); 74 | break; 75 | default: 76 | throw error; 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening() { 85 | var addr = server.address(); 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port; 89 | debug('Listening on ' + bind); 90 | } 91 | -------------------------------------------------------------------------------- /public/stylesheets/menu.scss: -------------------------------------------------------------------------------- 1 | .header { 2 | background: #36459b; 3 | box-shadow: 0 0 2px #232F75; 4 | line-height: 60px; 5 | position: relative; 6 | .header--Cont { 7 | width: 1220px; 8 | margin: 0 auto; 9 | display: flex; 10 | justify-content: space-between; 11 | align-items: center; 12 | 13 | .header--Cont--Iz { 14 | width: 20%; 15 | .header--Cont--Figure { 16 | img { 17 | width: 100px; 18 | } 19 | .Title { 20 | color: white; 21 | font-weight: 400; 22 | font-size: 1.5em; 23 | } 24 | } 25 | } 26 | .header--Cont--Center { 27 | display: flex; 28 | justify-content: space-between; 29 | width: 30%; 30 | .Center--Day { 31 | .article { 32 | display: flex; 33 | justify-content: space-between; 34 | align-items: center; 35 | .article--Icon i { 36 | color: white; 37 | font-size: 1.5em; 38 | } 39 | .article--Data { 40 | line-height: 18px; 41 | margin: 0 0 0 0.5em; 42 | span { 43 | display: block; 44 | color: white; 45 | font-size: 0.9em; 46 | } 47 | } 48 | } 49 | } 50 | } 51 | .headder--Cont--De { 52 | width: 35%; 53 | text-align: right; 54 | .header--Cont--Nav { 55 | .ul { 56 | .list { 57 | list-style-type: none; 58 | font-size: 1.4em; 59 | margin: 0 0.8em 0 0; 60 | display: inline-block; 61 | padding: 0 0.5em; 62 | transition: all 0.5s linear; 63 | .link { 64 | text-decoration: none; 65 | color: white; 66 | } 67 | &:hover { 68 | background: #3D4DA9; 69 | } 70 | &:last-child { 71 | font-size: 1em; 72 | margin: 0; 73 | padding: 0; 74 | background: transparent; 75 | color: #00BCD4; 76 | text-transform: capitalize; 77 | i { 78 | padding: 0 0.2em 0 0; 79 | color: #00BCD4; 80 | } 81 | } 82 | } 83 | } 84 | } 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /routes/apipollos.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | router.get('/', function(req, res, next) { 5 | 6 | var db = req.db; 7 | var pollos = db.get('ordenespollos'); 8 | 9 | pollos.find({}, function(err, doc){ 10 | res.json(doc); 11 | }); 12 | 13 | }); 14 | 15 | router.post('/save', function(req, res, next){ 16 | var id = req.params.id; 17 | var db = req.db; 18 | 19 | var collection = db.get('ordenespollos'); 20 | 21 | var mesa = req.body.mesa; 22 | 23 | var precio = req.body.precio; 24 | var pedido = req.body.pedido; 25 | //console.log(typeof pedidosCant + "a"); 26 | //console.log(descuento.length + " b"); 27 | 28 | /*Data*/ 29 | var fecha = new Date(); 30 | var hora = fecha.getHours(); 31 | var minutes = fecha.getMinutes(); 32 | var resultadoHora = hora + ":" + minutes; 33 | 34 | var mes = fecha.getMonth(); 35 | var ano = fecha.getFullYear(); 36 | var dia = fecha.getDate(); 37 | 38 | if(mes == 0) { 39 | mes = "Enero"; 40 | } 41 | else if(mes == 1) { 42 | mes = "Febrero"; 43 | } 44 | else if(mes == 2) { 45 | mes = "Marzo"; 46 | } 47 | else if(mes == 3){ 48 | mes = "Abril"; 49 | } 50 | else if(mes == 4) { 51 | mes = "Mayo"; 52 | } 53 | else if(mes == 5) { 54 | mes = "Junio"; 55 | } 56 | else if(mes == 6) { 57 | mes = "Julio"; 58 | } 59 | else if(mes == 7) { 60 | mes = "Agosto"; 61 | } 62 | else if(mes == 8) { 63 | mes = "Septiembre"; 64 | } 65 | else if(mes == 9) { 66 | mes = "Octubre"; 67 | } 68 | else if(mes == 10) { 69 | mes = "Noviembre"; 70 | } 71 | else if(mes == 11){ 72 | mes = "Diciembre"; 73 | } 74 | else { 75 | mes = "Ningun mes se encontro"; 76 | } 77 | var resultadoFecha = "El " + dia + " de " + mes + " del " + ano; 78 | 79 | 80 | collection.insert({ 81 | 'Pedido': pedido, 82 | 'Precio': precio, 83 | 'Mesa': mesa, 84 | 'Fecha': resultadoFecha, 85 | 'Hora': resultadoHora 86 | 87 | }).success(function(doc){ 88 | res.json({inserted: true}); 89 | }).error(function(err){ 90 | res.json({error: 'Ocurrio un error'}); 91 | console.log(err); 92 | }); 93 | 94 | 95 | 96 | }); 97 | 98 | router.get('/:fecha', function(req, res, next){ 99 | var db = req.db; 100 | var save = db.get('ordenespollos'); 101 | var fecha = req.params.fecha; 102 | 103 | save.find({'Fecha': fecha}, function(err, doc){ 104 | res.send(doc); 105 | }); 106 | 107 | }); 108 | router.get('/borrar/:id', function(req, res, next){ 109 | var db = req.db; 110 | var pollos = db.get('ordenespollos'); 111 | var id = req.params.id; 112 | 113 | pollos.remove({ 114 | '_id': id 115 | }, function(err, doc){ 116 | if(err){ 117 | console.log(err); 118 | } 119 | else { 120 | console.log('enviado'); 121 | } 122 | }); 123 | 124 | }); 125 | 126 | module.exports = router; -------------------------------------------------------------------------------- /views/admin.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='stylesheets/normalize.css') 7 | link(rel='stylesheet', href='stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src='javascripts/app.js') 10 | script(src='javascripts/web.js') 11 | body 12 | header.header(data-role="role") 13 | div.header--Cont 14 | div.header--Cont--Iz 15 | figure.header--Cont--Figure 16 | h1.Title 17 | | LaCatedralDelPisco 18 | div.header--Cont--Center 19 | div.Center--Day 20 | article.article 21 | div.article--Icon 22 | i(class="fa fa-sun-o") 23 | div.article--Data 24 | span.title.jsTitleHeader 25 | | ALMUERZO 26 | span.title.jsTitleSubHeader 27 | strong.jsTitleDay 28 | strong.jsTitleMounth 29 | 30 | div.Center--Time 31 | h1.time--Title 32 | div.Center--Clima 33 | div.headder--Cont--De 34 | nav.header--Cont--Nav 35 | ul.ul 36 | li.list 37 | a.link(href="panel", title="Panel Activar Mesas") 38 | i(class="fa fa-cutlery") 39 | li.list 40 | a.link(href="mesas", title="Listado de Mesas, Agregar Pedidos") 41 | i(class="fa fa-shopping-basket") 42 | li.list 43 | a.link(href="ventas", title="Resumen de ventas") 44 | i(class="fa fa-usd") 45 | li.list 46 | a.link(href="modulos", title="Modulos de activación") 47 | i(class="fa fa-cubes") 48 | li.list 49 | a.link(href="administracion", title="Configuración, agregar platos y mozos") 50 | i(class="fa fa-cog") 51 | li.list 52 | i(class="fa fa-user") 53 | | #{username} 54 | main 55 | section.contenido 56 | header.contenido--Header 57 | h2.title 58 | | Administración 59 | nav.contenido--Nav 60 | ul.ul 61 | li.list 62 | a.link(href="administracion/mozos") 63 | div.list--Icon 64 | i(class="fa fa-user-plus") 65 | div.list--Data 66 | span.title 67 | strong(class="titleStrong") 68 | |Lista de camareros 69 | br 70 | span.title 71 | |para la atención de las mesas. 72 | li.list 73 | a.link(href="administracion/platos") 74 | div.list--Icon 75 | i(class="fa fa-folder-open") 76 | div.list--Data 77 | span.title 78 | strong(class="titleStrong") 79 | |Lista de platos 80 | br 81 | span.title 82 | |creación de platos y comida 83 | li.list 84 | a.link(href="administracion/bebidas") 85 | div.list--Icon 86 | i(class="fa fa-folder-open") 87 | div.list--Data 88 | span.title 89 | strong(class="titleStrong") 90 | |Lista de bebidas 91 | br 92 | span.title 93 | |creación de bebidas y postres -------------------------------------------------------------------------------- /views/ventas.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='stylesheets/normalize.css') 7 | link(rel='stylesheet', href='stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src='javascripts/web.js') 10 | body 11 | header.header(data-role="role") 12 | div.header--Cont 13 | div.header--Cont--Iz 14 | figure.header--Cont--Figure 15 | h1.Title 16 | | LaCatedralDelPisco 17 | div.header--Cont--Center 18 | div.Center--Day 19 | article.article 20 | div.article--Icon 21 | i(class="fa fa-sun-o") 22 | div.article--Data 23 | span.title.jsTitleHeader 24 | | ALMUERZO 25 | span.title.jsTitleSubHeader 26 | strong.jsTitleDay 27 | strong.jsTitleMounth 28 | 29 | div.Center--Time 30 | h1.time--Title 31 | div.Center--Clima 32 | div.headder--Cont--De 33 | nav.header--Cont--Nav 34 | ul.ul 35 | li.list 36 | a.link(href="panel", title="Panel Activar Mesas") 37 | i(class="fa fa-cutlery") 38 | li.list 39 | a.link(href="mesas", title="Listado de Mesas, Agregar Pedidos") 40 | i(class="fa fa-shopping-basket") 41 | li.list 42 | a.link(href="ventas", title="Resumen de ventas") 43 | i(class="fa fa-usd") 44 | li.list 45 | a.link(href="modulos", title="Modulos de activación") 46 | i(class="fa fa-cubes") 47 | li.list 48 | a.link(href="administracion", title="Configuración, agregar platos y mozos") 49 | i(class="fa fa-cog") 50 | li.list 51 | i(class="fa fa-user") 52 | | #{username} 53 | main 54 | section.contenido 55 | header.contenido--Header 56 | h2.title 57 | | Reporte Ventas 58 | nav.contenido--Nav 59 | ul.ul 60 | li.list 61 | a.link(href="ventas/totales") 62 | div.list--Icon 63 | i(class="fa fa-calendar-check-o") 64 | div.list--Data 65 | span.title 66 | strong(class="titleStrong") 67 | |Ventas Diarias Totales 68 | br 69 | span.title 70 | |ventas en total: efectivo, tarjeta, descuento 71 | li.list 72 | a.link(href="ventas/tarjetas") 73 | div.list--Icon 74 | i(class="fa fa-credit-card-alt") 75 | div.list--Data 76 | span.title 77 | strong(class="titleStrong") 78 | |Ventas Diarias Tarjetas 79 | br 80 | span.title 81 | |compras realizadas con tarjetas 82 | li.list 83 | a.link(href="ventas/efectivo") 84 | div.list--Icon 85 | i(class="fa fa-money") 86 | div.list--Data 87 | span.title 88 | strong(class="titleStrong") 89 | |Ventas Diarias Efectivo 90 | br 91 | span.title 92 | |compras realizadas en efectivo 93 | -------------------------------------------------------------------------------- /public/stylesheets/administracion.scss: -------------------------------------------------------------------------------- 1 | .contenido { 2 | width: 100%; 3 | background: white; 4 | padding: 1em; 5 | border: 1px solid #D8D8D8; 6 | height: 500px; 7 | .contenido--Header { 8 | .title { 9 | color: #323131; 10 | font-weight: 400; 11 | border-bottom: 1px solid #323131; 12 | } 13 | } 14 | .contenido--Nav { 15 | .ul { 16 | .list { 17 | list-style-type: none; 18 | width: 100%; 19 | margin: 1em 0; 20 | background: linear-gradient(#E0E0E0, #F5F2F2, #FFFCFC); 21 | .link { 22 | display: flex; 23 | text-decoration: none; 24 | color: #444444; 25 | padding: 1em 0.5em; 26 | justify-content: space-between; 27 | align-items: center; 28 | width: 300px; 29 | .list--Icon { 30 | i { 31 | font-size: 2em; 32 | } 33 | } 34 | .list--Data { 35 | width: 250px; 36 | .title:first-child { 37 | font-size: 1.2em; 38 | } 39 | .title:last-child { 40 | font-style: italic; 41 | font-size: 0.9em; 42 | } 43 | } 44 | } 45 | } 46 | } 47 | } 48 | } 49 | 50 | .content { 51 | .contenido--Header { 52 | border-bottom: 1px solid #323131; 53 | width: 100%; 54 | display: flex; 55 | justify-content: space-between; 56 | align-items: center; 57 | margin: 0 0 0.5em 0; 58 | .title { 59 | color: #323131; 60 | font-weight: 400; 61 | 62 | } 63 | } 64 | .contenido--Filter { 65 | padding: 0.5em 0 0.5em 0; 66 | text-align: right; 67 | width: 50%; 68 | .searchFilter { 69 | box-shadow: 0 0 1px black; 70 | border: none; 71 | outline: medium none; 72 | padding: 0.5em 1em; 73 | border-radius: 4px; 74 | color: #999999; 75 | } 76 | } 77 | .contenido--Details { 78 | width: 100%; 79 | margin: 1em 0; 80 | border: 1px solid #999; 81 | text-align: center; 82 | .ul--Details { 83 | text-align: center; 84 | background: #F2F1EB; 85 | display: flex; 86 | justify-content: space-between; 87 | padding: 0.5em 0; 88 | border-bottom: 1px solid #999; 89 | .list { 90 | list-style-type: none; 91 | width: 10%; 92 | font-weight: 700; 93 | font-size: 0.9em; 94 | } 95 | } 96 | .details { 97 | display: flex; 98 | justify-content: space-between; 99 | font-size: 0.9em; 100 | padding: 0.5em 0; 101 | border-bottom: 1px solid #999; 102 | &:last-child { 103 | border-bottom: none; 104 | } 105 | .details--Name { 106 | width: 25%; 107 | text-align: left; 108 | padding: 0 0 0 1em; 109 | .title { 110 | font-weight: 700; 111 | } 112 | } 113 | .details--Email { 114 | width: 23%; 115 | text-align: left; 116 | white-space: nowrap; 117 | text-overflow: ellipsis; 118 | overflow: hidden; 119 | } 120 | .details--Celu { 121 | width: 23%; 122 | text-align: left; 123 | 124 | 125 | } 126 | .details--Activo { 127 | 128 | width: 10%; 129 | } 130 | } 131 | } 132 | } 133 | 134 | -------------------------------------------------------------------------------- /public/javascripts/jquery.hideseek.js: -------------------------------------------------------------------------------- 1 | /** 2 | * HideSeek jQuery plugin 3 | * 4 | * @copyright Copyright 2013, Dimitris Krestos 5 | * @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php) 6 | * @link http://vdw.staytuned.gr 7 | * @version v0.3.3 8 | * 9 | * Dependencies are include in minified versions at the bottom: 10 | * 1. Highlight v4 by Johann Burkard 11 | * 12 | */ 13 | 14 | /* Sample html structure 15 | 16 |
17 | 18 | */ 19 | 20 | ;(function($, window, undefined) { 21 | "use strict"; 22 | 23 | $.fn.hideseek = function(options) { 24 | 25 | var defaults = { 26 | list: '.hideseek-data', 27 | nodata: '', 28 | attribute: 'text', 29 | highlight: false 30 | }; 31 | 32 | var options = $.extend(defaults, options); 33 | 34 | $(this).each(function() { 35 | 36 | var $this = $(this); 37 | 38 | $this.keyup(function() { 39 | 40 | // Ungly overwrite 41 | options.list = $(this).data('list') || options.list; 42 | options.nodata = $(this).data('nodata') || options.nodata; 43 | options.attribute = $(this).data('attribute') || options.attribute; 44 | 45 | var q = $this.val().toLowerCase(); 46 | 47 | var $list = $(options.list); 48 | 49 | $list.children().each(function() { 50 | 51 | var data = (options.attribute != 'text') ? $(this).attr(options.attribute).toLowerCase() : $(this).text().toLowerCase(); 52 | 53 | if (data.indexOf(q) == -1) { 54 | 55 | $(this).hide(); 56 | 57 | } else { 58 | 59 | options.highlight ? $(this).removeHighlight().highlight(q).show() : $(this).show(); 60 | 61 | } 62 | 63 | }); 64 | 65 | // No results message 66 | if (options.nodata) { 67 | 68 | $list.find('.no-results').remove(); 69 | 70 | if ($list.children(':not([style*="display: none"])').length == 0) { 71 | 72 | $list.children().first().clone().removeHighlight().addClass('no-results').show().prependTo(options.list).text(options.nodata); 73 | 74 | } 75 | 76 | } 77 | 78 | }); 79 | 80 | }); 81 | 82 | }; 83 | 84 | $(document).ready(function () { $('[data-toggle="hideseek"]').hideseek(); }); 85 | 86 | })(jQuery); 87 | 88 | /* 89 | 90 | highlight v4 91 | 92 | Highlights arbitrary terms. 93 | 94 | 95 | 96 | MIT license. 97 | 98 | Johann Burkard 99 | 100 | 101 | 102 | */ 103 | jQuery.fn.highlight=function(t){function e(t,i){var n=0;if(3==t.nodeType){var a=t.data.toUpperCase().indexOf(i);if(a>=0){var s=document.createElement("mark");s.className="highlight";var r=t.splitText(a);r.splitText(i.length);var o=r.cloneNode(!0);s.appendChild(o),r.parentNode.replaceChild(s,r),n=1}}else if(1==t.nodeType&&t.childNodes&&!/(script|style)/i.test(t.tagName))for(var h=0;h Reportes 60 | div.content--Search 61 | span.title--Search--Primary 62 | | El 63 | span.title--Search--Secondary(contenteditable="true") 64 | | 25 65 | span.title--Search--Tree 66 | | de 67 | span.title--Search--Four(contenteditable="true") 68 | | Enero 69 | span.title--Search--Five 70 | | del 2016 71 | button.linkButton--Reporte 72 | i(class="fa fa-search") 73 | | Buscar Reporte 74 | section.contenido--Details 75 | div.contenido--ReportesDay 76 | span.title 77 | |Ventas Realizadas: 78 | span.titleReporteDia 79 | ul.ul--Details 80 | li.list 81 | | Mesa 82 | li.list 83 | | Fecha 84 | li.list 85 | | Hora 86 | li.list 87 | | Metodo de pago 88 | li.list 89 | | Descuentos 90 | li.list 91 | | Total 92 | div.details--Cont.jsReportes 93 | div.contenido--ReporteTotal 94 | header.header--ReporteTotal 95 | h2.title 96 | | Hoy se vendio: 97 | span.titlePrice.jsPriceTotallVentas 98 | div.button--SaveTotal 99 | a.ver--ReporteMensual(href="ventas/mensual") 100 | i(class="fa fa-pie-chart") 101 | | Reporte Mensual 102 | span.guardar--ElTotal 103 | | Guardar Total 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /views/ventastotales.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='/stylesheets/normalize.css') 7 | link(rel='stylesheet', href='/stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src="/javascripts/ventas.js") 10 | script(src='/javascripts/web.js') 11 | body 12 | header.header(data-role="role") 13 | div.header--Cont 14 | div.header--Cont--Iz 15 | figure.header--Cont--Figure 16 | h1.Title 17 | | LaCatedralDelPisco 18 | div.header--Cont--Center 19 | div.Center--Day 20 | article.article 21 | div.article--Icon 22 | i(class="fa fa-sun-o") 23 | div.article--Data 24 | span.title.jsTitleHeader 25 | | ALMUERZO 26 | span.title.jsTitleSubHeader 27 | strong.jsTitleDay 28 | strong.jsTitleMounth 29 | 30 | div.Center--Time 31 | h1.time--Title 32 | div.Center--Clima 33 | div.headder--Cont--De 34 | nav.header--Cont--Nav 35 | ul.ul 36 | ul.ul 37 | li.list 38 | a.link(href="../panel", title="Panel Activar Mesas") 39 | i(class="fa fa-cutlery") 40 | li.list 41 | a.link(href="../mesas", title="Listado de Mesas, Agregar Pedidos") 42 | i(class="fa fa-shopping-basket") 43 | li.list 44 | a.link(href="../ventas", title="Resumen de ventas") 45 | i(class="fa fa-usd") 46 | li.list 47 | a.link(href="../modulos", title="Modulos de activación") 48 | i(class="fa fa-cubes") 49 | li.list 50 | a.link(href="../administracion", title="Configuración, agregar platos y mozos") 51 | i(class="fa fa-cog") 52 | li.list 53 | i(class="fa fa-user") 54 | | #{username} 55 | main 56 | section.content.ventas 57 | header.contenido--Header 58 | h2.title 59 | | Ventas > Reportes 60 | div.content--Search 61 | span.title--Search--Primary 62 | | El 63 | span.title--Search--Secondary(contenteditable="true") 64 | | 25 65 | span.title--Search--Tree 66 | | de 67 | span.title--Search--Four(contenteditable="true") 68 | | Enero 69 | span.title--Search--Five 70 | | del 2016 71 | button.linkButton--Reporte 72 | i(class="fa fa-search") 73 | | Buscar Reporte 74 | section.contenido--Details 75 | div.contenido--ReportesDay 76 | span.title 77 | |Ventas Realizadas: 78 | span.titleReporteDia 79 | ul.ul--Details 80 | li.list 81 | | Mesa 82 | li.list 83 | | Fecha 84 | li.list 85 | | Hora 86 | li.list 87 | | Metodo de pago 88 | li.list 89 | | Descuentos 90 | li.list 91 | | Total 92 | div.details--Cont.jsReportes 93 | div.contenido--ReporteTotal 94 | header.header--ReporteTotal 95 | h2.title 96 | | Hoy se vendio: 97 | span.titlePrice.jsPriceTotallVentas 98 | div.button--SaveTotal 99 | a.ver--ReporteMensual(href="ventas/mensual") 100 | i(class="fa fa-pie-chart") 101 | | Reporte Mensual 102 | span.guardar--ElTotal 103 | | Guardar Total 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /views/ventasefectivo.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='/stylesheets/normalize.css') 7 | link(rel='stylesheet', href='/stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src="/javascripts/ventasefectivo.js") 10 | script(src='/javascripts/web.js') 11 | body 12 | header.header(data-role="role") 13 | div.header--Cont 14 | div.header--Cont--Iz 15 | figure.header--Cont--Figure 16 | h1.Title 17 | | LaCatedralDelPisco 18 | div.header--Cont--Center 19 | div.Center--Day 20 | article.article 21 | div.article--Icon 22 | i(class="fa fa-sun-o") 23 | div.article--Data 24 | span.title.jsTitleHeader 25 | | ALMUERZO 26 | span.title.jsTitleSubHeader 27 | strong.jsTitleDay 28 | strong.jsTitleMounth 29 | 30 | div.Center--Time 31 | h1.time--Title 32 | div.Center--Clima 33 | div.headder--Cont--De 34 | nav.header--Cont--Nav 35 | ul.ul 36 | ul.ul 37 | li.list 38 | a.link(href="../panel", title="Panel Activar Mesas") 39 | i(class="fa fa-cutlery") 40 | li.list 41 | a.link(href="../mesas", title="Listado de Mesas, Agregar Pedidos") 42 | i(class="fa fa-shopping-basket") 43 | li.list 44 | a.link(href="../ventas", title="Resumen de ventas") 45 | i(class="fa fa-usd") 46 | li.list 47 | a.link(href="../modulos", title="Modulos de activación") 48 | i(class="fa fa-cubes") 49 | li.list 50 | a.link(href="../administracion", title="Configuración, agregar platos y mozos") 51 | i(class="fa fa-cog") 52 | li.list 53 | i(class="fa fa-user") 54 | | #{username} 55 | main 56 | section.content.ventas 57 | header.contenido--Header 58 | h2.title 59 | | Ventas Efectivo > Reportes 60 | div.content--Search 61 | span.title--Search--Primary 62 | | El 63 | span.title--Search--Secondary(contenteditable="true") 64 | | 25 65 | span.title--Search--Tree 66 | | de 67 | span.title--Search--Four(contenteditable="true") 68 | | Enero 69 | span.title--Search--Five 70 | | del 2016 71 | button.linkButton--Reporte 72 | i(class="fa fa-search") 73 | | Buscar Reporte 74 | section.contenido--Details 75 | div.contenido--ReportesDay 76 | span.title 77 | |Ventas Realizadas: 78 | span.titleReporteDia 79 | ul.ul--Details 80 | li.list 81 | | Mesa 82 | li.list 83 | | Fecha 84 | li.list 85 | | Hora 86 | li.list 87 | | Metodo de pago 88 | li.list 89 | | Descuentos 90 | li.list 91 | | Total 92 | div.details--Cont.jsReportes 93 | div.contenido--ReporteTotal 94 | header.header--ReporteTotal 95 | h2.title 96 | | Hoy se vendio: 97 | span.titlePrice.jsPriceTotallVentas 98 | div.button--SaveTotal 99 | a.ver--ReporteMensual(href="ventas/mensual") 100 | i(class="fa fa-pie-chart") 101 | | Reporte Mensual 102 | span.guardar--ElTotal 103 | | Guardar Total 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /views/ventastarjetas.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='/stylesheets/normalize.css') 7 | link(rel='stylesheet', href='/stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src="/javascripts/ventastarjetas.js") 10 | script(src='/javascripts/web.js') 11 | body 12 | header.header(data-role="role") 13 | div.header--Cont 14 | div.header--Cont--Iz 15 | figure.header--Cont--Figure 16 | h1.Title 17 | | LaCatedralDelPisco 18 | div.header--Cont--Center 19 | div.Center--Day 20 | article.article 21 | div.article--Icon 22 | i(class="fa fa-sun-o") 23 | div.article--Data 24 | span.title.jsTitleHeader 25 | | ALMUERZO 26 | span.title.jsTitleSubHeader 27 | strong.jsTitleDay 28 | strong.jsTitleMounth 29 | 30 | div.Center--Time 31 | h1.time--Title 32 | div.Center--Clima 33 | div.headder--Cont--De 34 | nav.header--Cont--Nav 35 | ul.ul 36 | ul.ul 37 | li.list 38 | a.link(href="../panel", title="Panel Activar Mesas") 39 | i(class="fa fa-cutlery") 40 | li.list 41 | a.link(href="../mesas", title="Listado de Mesas, Agregar Pedidos") 42 | i(class="fa fa-shopping-basket") 43 | li.list 44 | a.link(href="../ventas", title="Resumen de ventas") 45 | i(class="fa fa-usd") 46 | li.list 47 | a.link(href="../modulos", title="Modulos de activación") 48 | i(class="fa fa-cubes") 49 | li.list 50 | a.link(href="../administracion", title="Configuración, agregar platos y mozos") 51 | i(class="fa fa-cog") 52 | li.list 53 | i(class="fa fa-user") 54 | | #{username} 55 | main 56 | section.content.ventas 57 | header.contenido--Header 58 | h2.title 59 | | Ventas Tarjetas > Reportes 60 | div.content--Search 61 | span.title--Search--Primary 62 | | El 63 | span.title--Search--Secondary(contenteditable="true") 64 | | 25 65 | span.title--Search--Tree 66 | | de 67 | span.title--Search--Four(contenteditable="true") 68 | | Enero 69 | span.title--Search--Five 70 | | del 2016 71 | button.linkButton--Reporte 72 | i(class="fa fa-search") 73 | | Buscar Reporte 74 | section.contenido--Details 75 | div.contenido--ReportesDay 76 | span.title 77 | |Ventas Realizadas: 78 | span.titleReporteDia 79 | ul.ul--Details 80 | li.list 81 | | Mesa 82 | li.list 83 | | Fecha 84 | li.list 85 | | Hora 86 | li.list 87 | | Metodo de pago 88 | li.list 89 | | Descuentos 90 | li.list 91 | | Total 92 | div.details--Cont.jsReportes 93 | div.contenido--ReporteTotal 94 | header.header--ReporteTotal 95 | h2.title 96 | | Hoy se vendio: 97 | span.titlePrice.jsPriceTotallVentas 98 | div.button--SaveTotal 99 | a.ver--ReporteMensual(href="ventas/mensual") 100 | i(class="fa fa-pie-chart") 101 | | Reporte Mensual 102 | span.guardar--ElTotal 103 | | Guardar Total 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /public/javascripts/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2006, 2014 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD (Register as an anonymous module) 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // Node/CommonJS 14 | module.exports = factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (arguments.length > 1 && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setMilliseconds(t.getMilliseconds() + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}, 79 | // To prevent the for loop in the first place assign an empty array 80 | // in case there are no cookies at all. Also prevents odd result when 81 | // calling $.cookie(). 82 | cookies = document.cookie ? document.cookie.split('; ') : [], 83 | i = 0, 84 | l = cookies.length; 85 | 86 | for (; i < l; i++) { 87 | var parts = cookies[i].split('='), 88 | name = decode(parts.shift()), 89 | cookie = parts.join('='); 90 | 91 | if (key === name) { 92 | // If second argument (value) is a function it's a converter... 93 | result = read(cookie, value); 94 | break; 95 | } 96 | 97 | // Prevent storing a cookie that we couldn't decode. 98 | if (!key && (cookie = read(cookie)) !== undefined) { 99 | result[name] = cookie; 100 | } 101 | } 102 | 103 | return result; 104 | }; 105 | 106 | config.defaults = {}; 107 | 108 | $.removeCookie = function (key, options) { 109 | // Must not alter options, thus extending a fresh object... 110 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 111 | return !$.cookie(key); 112 | }; 113 | 114 | })); 115 | -------------------------------------------------------------------------------- /views/mensual.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='/stylesheets/normalize.css') 7 | link(rel='stylesheet', href='/stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src="/javascripts/ventasmensual.js") 10 | script(src='/javascripts/web.js') 11 | body 12 | header.header(data-role="role") 13 | div.header--Cont 14 | div.header--Cont--Iz 15 | figure.header--Cont--Figure 16 | h1.Title 17 | | LaCatedralDelPisco 18 | div.header--Cont--Center 19 | div.Center--Day 20 | article.article 21 | div.article--Icon 22 | i(class="fa fa-sun-o") 23 | div.article--Data 24 | span.title.jsTitleHeader 25 | | ALMUERZO 26 | span.title.jsTitleSubHeader 27 | strong.jsTitleDay 28 | strong.jsTitleMounth 29 | 30 | div.Center--Time 31 | h1.time--Title 32 | div.Center--Clima 33 | div.headder--Cont--De 34 | nav.header--Cont--Nav 35 | ul.ul 36 | ul.ul 37 | li.list 38 | a.link(href="panel", title="Panel Activar Mesas") 39 | i(class="fa fa-cutlery") 40 | li.list 41 | a.link(href="mesas", title="Listado de Mesas, Agregar Pedidos") 42 | i(class="fa fa-shopping-basket") 43 | li.list 44 | a.link(href="ventas", title="Resumen de ventas") 45 | i(class="fa fa-usd") 46 | li.list 47 | a.link(href="modulos", title="Modulos de activación") 48 | i(class="fa fa-cubes") 49 | li.list 50 | a.link(href="administracion", title="Configuración, agregar platos y mozos") 51 | i(class="fa fa-cog") 52 | li.list 53 | i(class="fa fa-user") 54 | | #{username} 55 | main 56 | section.content.ventas 57 | header.contenido--Header 58 | h2.title 59 | | Ventas > Reportes Mensuales 60 | div.content--Search 61 | span.title--Search--Primary 62 | | Del 63 | span.title--Search--Secondary(contenteditable="true") 64 | | 25 65 | span.title--Search--Tree 66 | | de 67 | span.title--Search--Four(contenteditable="true") 68 | | Enero 69 | span.title--Search--Five 70 | | del 2016 71 | div.content--Search 72 | span.title--Search--Primary 73 | | Al 74 | span.title--Search--Secondary(contenteditable="true") 75 | | 31 76 | span.title--Search--Tree 77 | | de 78 | span.title--Search--Four(contenteditable="true") 79 | | Enero 80 | span.title--Search--Five 81 | | del 2016 82 | button.linkButton--Reporte 83 | i(class="fa fa-search") 84 | | Buscar Reporte 85 | section.contenido--Details 86 | div.contenido--ReportesDay 87 | span.title 88 | |Ventas Realizadas: 89 | span.titleReporteDia 90 | ul.ul--Details 91 | li.list 92 | | Mesa 93 | li.list 94 | | Fecha 95 | li.list 96 | | Hora 97 | li.list 98 | | Total 99 | div.details--Cont.jsReportes 100 | div.contenido--ReporteTotal 101 | header.header--ReporteTotal 102 | h2.title 103 | | Hoy se vendio: 104 | span.titlePrice.jsPriceTotallVentas 105 | div.button--SaveTotal 106 | span.ver--ReporteMensual 107 | i(class="fa fa-pie-chart") 108 | | Reporte Mensual 109 | span.guardar--ElTotal 110 | | Guardar Total 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /views/mozos.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='/stylesheets/normalize.css') 7 | link(rel='stylesheet', href='/stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src='/javascripts/app.js') 10 | script(src='/javascripts/web.js') 11 | body 12 | header.header(data-role="role") 13 | div.header--Cont 14 | div.header--Cont--Iz 15 | figure.header--Cont--Figure 16 | h1.Title 17 | | LaCatedralDelPisco 18 | div.header--Cont--Center 19 | div.Center--Day 20 | article.article 21 | div.article--Icon 22 | i(class="fa fa-sun-o") 23 | div.article--Data 24 | span.title.jsTitleHeader 25 | | ALMUERZO 26 | span.title.jsTitleSubHeader 27 | strong.jsTitleDay 28 | strong.jsTitleMounth 29 | 30 | div.Center--Time 31 | h1.time--Title 32 | div.Center--Clima 33 | div.headder--Cont--De 34 | nav.header--Cont--Nav 35 | ul.ul 36 | li.list 37 | a.link(href="../panel") 38 | i(class="fa fa-cutlery") 39 | li.list 40 | a.link(href="../mesas") 41 | i(class="fa fa-shopping-basket") 42 | li.list 43 | a.link(href="../ventas") 44 | i(class="fa fa-usd") 45 | li.list 46 | a.link(href="../modulos") 47 | i(class="fa fa-cubes") 48 | li.list 49 | a.link(href="../administracion") 50 | i(class="fa fa-cog") 51 | li.list 52 | i(class="fa fa-user") 53 | | #{username} 54 | main 55 | section.content 56 | header.contenido--Header 57 | h2.title 58 | | Administración > Mozos 59 | 60 | section.contenido--Details 61 | ul.ul--Details 62 | li.list 63 | | Nombre 64 | li.list 65 | | E-mail 66 | li.list 67 | | Celular 68 | li.list 69 | | Activo 70 | div.details--Cont.jsMozosAdd 71 | 72 | 73 | aside.aside 74 | form.aside--Form.jsFormMozos 75 | header.aside--Form--Header 76 | h2.title 77 | | Nuevo Mozo 78 | div.jsPreload.cssPreload 79 | img(src="../images/ring-alt.svg", alt="") 80 | header.cssPreload--Header 81 | h2.title 82 | | Mozo Creado 83 | div.aside--Form--Fieldset.jsHide 84 | div.fieldset--Iz 85 | label.title 86 | | Nombre 87 | div.fieldset--De 88 | input(type="text", name="nombre", class="inputNombre") 89 | div.aside--Form--Fieldset.jsHide 90 | div.fieldset--Iz 91 | label.title 92 | | Email: 93 | div.fieldset--De 94 | input(type="text", name="email", class="inputEmail") 95 | div.aside--Form--Fieldset.jsHide 96 | div.fieldset--Iz 97 | label.title 98 | | Celular: 99 | div.fieldset--De 100 | input(type="text", name="celular", class="inputCel") 101 | div.aside--Form--Fieldset.jsHide 102 | input(class="send", type="submit", value="Crear Mozo") 103 | form.aside--Form.jsFormMozosDelete 104 | header.aside--Form--Header 105 | h2.title 106 | | Eliminar Mozo 107 | div.aside--Form--Fieldset 108 | div.fieldset--Iz 109 | label.title 110 | | Mozos 111 | div.fieldset--De.mozosDelete 112 | select(name="", class="mozosDelete--Select") 113 | option(value="seleciona") 114 | | Seleciona 115 | div.aside--Form--Fieldset 116 | input(class="sendDelete", type="submit", value="Eliminar Mozo") 117 | -------------------------------------------------------------------------------- /aplicacion/js/app.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | var template = ""; 4 | var mesa, pedido, hora; 5 | var API; 6 | var resultadoFecha; 7 | 8 | function show(){ 9 | 10 | function hour(){ 11 | /*Data*/ 12 | var fecha = new Date(); 13 | var hora = fecha.getHours(); 14 | var minutes = fecha.getMinutes(); 15 | var resultadoHora = hora + ":" + minutes; 16 | 17 | var mes = fecha.getMonth(); 18 | var ano = fecha.getFullYear(); 19 | var dia = fecha.getDate(); 20 | 21 | if(mes == 0) { 22 | mes = "Enero"; 23 | } 24 | else if(mes == 1) { 25 | mes = "Febrero"; 26 | } 27 | else if(mes == 2) { 28 | mes = "Marzo"; 29 | } 30 | else if(mes == 3){ 31 | mes = "Abril"; 32 | } 33 | else if(mes == 4) { 34 | mes = "Mayo"; 35 | } 36 | else if(mes == 5) { 37 | mes = "Junio"; 38 | } 39 | else if(mes == 6) { 40 | mes = "Julio"; 41 | } 42 | else if(mes == 7) { 43 | mes = "Agosto"; 44 | } 45 | else if(mes == 8) { 46 | mes = "Septiembre"; 47 | } 48 | else if(mes == 9) { 49 | mes = "Octubre"; 50 | } 51 | else if(mes == 10) { 52 | mes = "Noviembre"; 53 | } 54 | else if(mes == 11){ 55 | mes = "Diciembre"; 56 | } 57 | else { 58 | mes = "Ningun mes se encontro"; 59 | } 60 | resultadoFecha = "El " + dia + " de " + mes + " del " + ano; 61 | $(".headerMain .de--HeaderMain .title").text(resultadoFecha); 62 | 63 | } 64 | hour(); 65 | 66 | 67 | function showPedidos(){ 68 | 69 | API = "http://128.199.86.176:8080/apipollos/" + resultadoFecha; 70 | 71 | $.getJSON(API, pollos, false); 72 | 73 | 74 | function pollos(data){ 75 | 76 | for(var i = 0; i < data.length; i++) { 77 | 78 | mesa = data[i].Mesa; 79 | pedido = data[i].Pedido; 80 | hora = data[i].Hora; 81 | var codigo = data[i]._id; 82 | template += "
    "+ 83 | "
    "+ 84 | "
  • "+ 85 | ""+ 86 | mesa+ 87 | ""+ 88 | "
  • "+ 89 | "
  • "+ 90 | ""+ 91 | pedido+ 92 | ""+ 93 | "
  • "+ 94 | "
  • "+ 95 | ""+hora+""+ 96 | "
  • "+ 97 | "
  • "+ 98 | ""+ 102 | "
  • "+ 103 | "
    "+ 104 | "
"; 105 | 106 | } 107 | 108 | $(".jsInsertMain").html(template); 109 | 110 | //todelete pedido 111 | $(".buttonAproved").click(function(e){ 112 | e.preventDefault(); 113 | var a = $(this).find('.idCode').text(); 114 | $.ajax({ 115 | url: "http://128.199.86.176:8080/apipollos/borrar/"+a, 116 | tpye: "POST", 117 | contentType: "application/json", 118 | success: function(data){ 119 | alert("Se envió el pollo"); 120 | }, 121 | error: function(err){ 122 | alert('ocurrio un error'); 123 | } 124 | 125 | }); 126 | }); 127 | } 128 | 129 | 130 | } 131 | showPedidos(); 132 | 133 | 134 | } 135 | 136 | 137 | 138 | setInterval(show, 5000); 139 | setInterval(function(){ 140 | window.location.reload(); 141 | 142 | }, 3000); 143 | show(); 144 | 145 | 146 | 147 | 148 | }); 149 | 150 | -------------------------------------------------------------------------------- /npm-debug.log: -------------------------------------------------------------------------------- 1 | 0 info it worked if it ends with ok 2 | 1 verbose cli [ 'c:\\Program Files\\nodejs\\node.exe', 3 | 1 verbose cli 'c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 4 | 1 verbose cli 'start' ] 5 | 2 info using npm@3.3.6 6 | 3 info using node@v5.0.0 7 | 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 8 | 5 info lifecycle sistema@0.0.0~prestart: sistema@0.0.0 9 | 6 silly lifecycle sistema@0.0.0~prestart: no script for prestart, continuing 10 | 7 info lifecycle sistema@0.0.0~start: sistema@0.0.0 11 | 8 verbose lifecycle sistema@0.0.0~start: unsafe-perm in lifecycle true 12 | 9 verbose lifecycle sistema@0.0.0~start: PATH: c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;c:\xampp\htdocs\proyectos\sistema\node_modules\.bin;c:\Users\Victor Jacay\bin;.;C:\RailsInstaller\Git\local\bin;C:\RailsInstaller\Git\mingw\bin;C:\RailsInstaller\Git\bin;c:\Python27\;c:\Python27\Scripts;c:\ProgramData\Oracle\Java\javapath;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;c:\WINDOWS\system32;c:\WINDOWS;c:\WINDOWS\System32\Wbem;c:\WINDOWS\System32\WindowsPowerShell\v1.0\;c:\Program Files\Intel\Intel(R) Management Engine Components\DAL;c:\Program Files\Intel\Intel(R) Management Engine Components\IPT;c:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;c:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;c:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;c:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Python34\;c:\Python34\Scripts;c:\Program Files (x86)\Bitvise SSH Client;c:\Program Files\Microsoft DNX\Dnvm\;c:\Program Files (x86)\Java\jre1.8.0_65\bin;c:\Program Files\nodejs\;c:\Program Files (x86)\Skype\Phone\;C:\RailsInstaller\Git\cmd;c:\RailsInstaller\Ruby2.0.0\bin;c:\Ruby22\bin";c:\Program Files\MongoDB\Server\3.0\bin;c:\Users\Victor Jacay\AppData\Roaming\npm 13 | 10 verbose lifecycle sistema@0.0.0~start: CWD: c:\xampp\htdocs\proyectos\sistema 14 | 11 silly lifecycle sistema@0.0.0~start: Args: [ '/d /s /c', 'node ./bin/www' ] 15 | 12 silly lifecycle sistema@0.0.0~start: Returned: code: 1 signal: null 16 | 13 info lifecycle sistema@0.0.0~start: Failed to exec start script 17 | 14 verbose stack Error: sistema@0.0.0 start: `node ./bin/www` 18 | 14 verbose stack Exit status 1 19 | 14 verbose stack at EventEmitter. (c:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:233:16) 20 | 14 verbose stack at emitTwo (events.js:87:13) 21 | 14 verbose stack at EventEmitter.emit (events.js:172:7) 22 | 14 verbose stack at ChildProcess. (c:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14) 23 | 14 verbose stack at emitTwo (events.js:87:13) 24 | 14 verbose stack at ChildProcess.emit (events.js:172:7) 25 | 14 verbose stack at maybeClose (internal/child_process.js:818:16) 26 | 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 27 | 15 verbose pkgid sistema@0.0.0 28 | 16 verbose cwd c:\xampp\htdocs\proyectos\sistema 29 | 17 error Windows_NT 6.3.9600 30 | 18 error argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 31 | 19 error node v5.0.0 32 | 20 error npm v3.3.6 33 | 21 error code ELIFECYCLE 34 | 22 error sistema@0.0.0 start: `node ./bin/www` 35 | 22 error Exit status 1 36 | 23 error Failed at the sistema@0.0.0 start script 'node ./bin/www'. 37 | 23 error This is most likely a problem with the sistema package, 38 | 23 error not with npm itself. 39 | 23 error Tell the author that this fails on your system: 40 | 23 error node ./bin/www 41 | 23 error You can get their info via: 42 | 23 error npm owner ls sistema 43 | 23 error There is likely additional logging output above. 44 | 24 verbose exit [ 1, true ] 45 | -------------------------------------------------------------------------------- /routes/mesas.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var ObjectId = require('mongodb').ObjectID; 4 | 5 | router.get('/', function(req, res, next){ 6 | res.render('mesas', { 7 | title: 'Mesas - Lacatedraldelpisco', 8 | username: req.user.username 9 | }); 10 | }); 11 | 12 | router.post('/edit/:id', function(req, res, next) { 13 | var id = req.params.id; 14 | var db = req.db; 15 | 16 | var collection = db.get('pedidos'); 17 | var mesa = req.body.mesa; 18 | var personas = req.body.personas; 19 | var pedido = req.body.pedido; 20 | var mozo = req.body.mozo; 21 | var comentarios = req.body.comentarios; 22 | console.log(comentarios); 23 | 24 | var descuento = req.body.descuento; 25 | var metodoPago = req.body.metodoPago; 26 | 27 | var pedidosCant = req.body.pedidosCant; 28 | var pedidosPrecio = req.body.precio; 29 | //console.log(typeof pedidosCant + "a"); 30 | //console.log(descuento.length + " b"); 31 | 32 | /*Data*/ 33 | var fecha = new Date(); 34 | var hora = fecha.getHours(); 35 | var minutes = fecha.getMinutes(); 36 | var resultadoHora = hora + ":" + minutes; 37 | 38 | var mes = fecha.getMonth(); 39 | var ano = fecha.getFullYear(); 40 | var dia = fecha.getDate(); 41 | 42 | if(mes == 0) { 43 | mes = "Enero"; 44 | } 45 | else if(mes == 1) { 46 | mes = "Febrero"; 47 | } 48 | else if(mes == 2) { 49 | mes = "Marzo"; 50 | } 51 | else if(mes == 3){ 52 | mes = "Abril"; 53 | } 54 | else if(mes == 4) { 55 | mes = "Mayo"; 56 | } 57 | else if(mes == 5) { 58 | mes = "Junio"; 59 | } 60 | else if(mes == 6) { 61 | mes = "Julio"; 62 | } 63 | else if(mes == 7) { 64 | mes = "Agosto"; 65 | } 66 | else if(mes == 8) { 67 | mes = "Septiembre"; 68 | } 69 | else if(mes == 9) { 70 | mes = "Octubre"; 71 | } 72 | else if(mes == 10) { 73 | mes = "Noviembre"; 74 | } 75 | else if(mes == 11){ 76 | mes = "Diciembre"; 77 | } 78 | else { 79 | mes = "Ningun mes se encontro"; 80 | } 81 | var resultadoFecha = "El " + dia + " de " + mes + " del " + ano; 82 | 83 | 84 | 85 | //console.log(descuento + " uno"); 86 | //console.log(descuento.length + " dos"); 87 | 88 | collection.findOne({'_id': id}, function(err, doc){ 89 | 90 | if(pedidosCant == undefined) { 91 | console.log('error'); 92 | } 93 | else { 94 | collection.update({ 95 | _id: ObjectId(id)}, 96 | 97 | {'$push': { 98 | 'Adicionales': { 99 | 'Precio': pedidosCant, 100 | 'Pedido': pedidosPrecio 101 | } 102 | } 103 | }).success(function(doc){ 104 | res.json({inserted: true}); 105 | }).error(function(err){ 106 | console.log('hubo error' + err); 107 | }); 108 | } 109 | 110 | if(descuento > 0){ 111 | collection.update( 112 | {_id: ObjectId(id)}, 113 | {$set: 114 | {'Descuento': descuento} 115 | }) 116 | .success(function(doc){ 117 | res.end(JSON.stringify({inserted: true})); 118 | }); 119 | } 120 | else { 121 | console.log('error'); 122 | } 123 | 124 | if(metodoPago == "Efectivo" || metodoPago == "Tarjeta"){ 125 | collection.update( 126 | {_id: ObjectId(id)}, 127 | {$set: 128 | {'MetodoPago': metodoPago} 129 | }) 130 | .success(function(doc){ 131 | res.end(JSON.stringify({inserted: true})); 132 | }); 133 | } 134 | 135 | 136 | collection.update( 137 | {_id: ObjectId(id)}, 138 | {$set: 139 | {'Comentarios': comentarios} 140 | }) 141 | .success(function(doc){ 142 | res.end(JSON.stringify({inserted: true})); 143 | }); 144 | 145 | /*else if(metodoPago == "Tarjeta") { 146 | collection.update( 147 | {_id: ObjectId(id)}, 148 | {$set: 149 | {'MetodoPago': metodoPago} 150 | }) 151 | .success(function(doc){ 152 | res.end(JSON.stringify({inserted: true})); 153 | }); 154 | }*/ 155 | 156 | }); 157 | 158 | 159 | 160 | 161 | 162 | }); 163 | 164 | module.exports = router; -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | //Initialize Project Restaurant CMS 2018 3 | 4 | var express = require('express'); 5 | var path = require('path'); 6 | var favicon = require('serve-favicon'); 7 | var logger = require('morgan'); 8 | var cookieParser = require('cookie-parser'); 9 | var bodyParser = require('body-parser'); 10 | var monk = require('monk'); 11 | var db = monk("localhost:27017/rest"); 12 | var mongodb = require('mongodb'); 13 | var mongoose = require('mongoose'); 14 | var passport = require('passport'); 15 | var expressSession = require('express-session'); 16 | var LocalStrategy = require('passport-local').Strategy; 17 | 18 | var printer = require('node-thermal-printer'); 19 | 20 | 21 | 22 | 23 | var routes = require('./routes/index'); 24 | var verify = require('./routes/validate'); 25 | var users = require('./routes/users'); 26 | var panel = require('./routes/panel'); 27 | var admin = require('./routes/admin'); 28 | var pedidos = require('./routes/pedidos'); 29 | var mesas = require('./routes/mesas'); 30 | var ventas = require('./routes/ventas'); 31 | var apipollos = require('./routes/apipollos'); 32 | 33 | 34 | mongoose.connect('mongodb://localhost:27017/rest' , function(err, res){ 35 | if(err) throw err; 36 | console.log('Genial me conecte a la bd'); 37 | }); 38 | 39 | 40 | 41 | /*Function auntetificacion*/ 42 | 43 | 44 | 45 | /*End auntetificacion*/ 46 | 47 | require('./models/local'); 48 | require('./passport')(passport); 49 | 50 | var app = express(); 51 | 52 | 53 | 54 | app.use(function(req,res,next){ 55 | req.db = db; 56 | next(); 57 | }); 58 | 59 | 60 | 61 | app.use(function (req, res, next) { 62 | res.header("Access-Control-Allow-Origin", "*"); 63 | res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); 64 | res.header("Access-Control-Allow-Headers", "X-Requested-With, Content-Type"); 65 | next(); 66 | }); 67 | 68 | 69 | /*Express Sessions*/ 70 | //app.use(expressSession({secret: 'miclavesecreta', proxy: true, resave: true, saveUninitialized: true})); 71 | app.use(expressSession({ 72 | secret: 'ilovescotchscotchyscotchscotch', 73 | resave: false, 74 | saveUninitialized: true, 75 | cookie:{ 76 | maxAge : 360000000000 // one hour in millis 77 | } 78 | })); 79 | 80 | 81 | app.use(passport.initialize()); 82 | app.use(passport.session()); 83 | 84 | 85 | function ensureAuthenticated(req, res, next) { 86 | if (req.isAuthenticated()) { 87 | return next(); 88 | } 89 | else { 90 | res.redirect('/'); 91 | console.log(req.isAuthenticated()); 92 | } 93 | } 94 | 95 | 96 | 97 | 98 | 99 | // view engine setup 100 | app.set('views', path.join(__dirname, 'views')); 101 | app.set('view engine', 'jade'); 102 | 103 | // uncomment after placing your favicon in /public 104 | //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); 105 | app.use(logger('dev')); 106 | app.use(bodyParser.json()); 107 | app.use(bodyParser.urlencoded({ extended: false })); 108 | app.use(cookieParser()); 109 | app.use(express.static(path.join(__dirname, 'public'))); 110 | 111 | 112 | app.use('/', routes); 113 | app.use('/incorrecto', verify); 114 | app.use('/users', ensureAuthenticated, users); 115 | app.use('/panel', ensureAuthenticated, panel); 116 | app.use('/administracion', ensureAuthenticated, admin); 117 | app.use('/pedidos', ensureAuthenticated, pedidos); 118 | app.use('/mesas', ensureAuthenticated, mesas); 119 | app.use('/ventas', ensureAuthenticated, ventas); 120 | app.use('/apipollos', apipollos); 121 | 122 | 123 | app.post('/login', passport.authenticate('local', { 124 | successRedirect: '/panel', 125 | failureRedirect: '/incorrecto' 126 | })); 127 | 128 | 129 | // catch 404 and forward to error handler 130 | app.use(function(req, res, next) { 131 | var err = new Error('Not Found'); 132 | err.status = 404; 133 | next(err); 134 | }); 135 | 136 | // error handlers 137 | 138 | // development error handler 139 | // will print stacktrace 140 | if (app.get('env') === 'development') { 141 | app.use(function(err, req, res, next) { 142 | res.status(err.status || 500); 143 | res.render('error', { 144 | message: err.message, 145 | error: err 146 | }); 147 | }); 148 | } 149 | 150 | // production error handler 151 | // no stacktraces leaked to user 152 | app.use(function(err, req, res, next) { 153 | res.status(err.status || 500); 154 | res.render('error', { 155 | message: err.message, 156 | error: {} 157 | }); 158 | }); 159 | 160 | 161 | module.exports = app; 162 | -------------------------------------------------------------------------------- /public/javascripts/deleteMesas.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | 4 | 5 | function pedidosMesa() { 6 | var url = window.location.pathname; 7 | 8 | 9 | if(url == "/panel") { 10 | 11 | $(".jsPedidos").submit(function(e){ 12 | 13 | e.preventDefault(); 14 | 15 | $.when( 16 | 17 | $.ajax({ 18 | url: "pedidos/save", 19 | type: "POST", 20 | dataType: "JSON", 21 | contentType: "application/json", 22 | data: JSON.stringify({ 23 | mesa: $(".jsPedidosMesa").text(), 24 | //personas: $("input[name='jsPersonas']").val(), 25 | pedido: $("select[name='jsPedido']").val(), 26 | precio: $("select[name='jsPedido'] option:selected").data('precio'), 27 | mozo: $("select[name='jsMozo']").val(), 28 | codigo: $(".jsCodigoMesa").text() 29 | }), 30 | success: function(data){ 31 | //alert('agregado'); 32 | $(".jsPedidos .aside--Form--Fieldset").hide(); 33 | $(".cssPreload").css('display','block'); 34 | $(".cssPreload .cssPreload--Header").css('display','none'); 35 | setTimeout(function(){ 36 | $(".cssPreload img").css('display','none'); 37 | $(".cssPreload .cssPreload--Header").css({'display':'block','padding':'1em 0;'}); 38 | }, 2000); 39 | 40 | setTimeout(function(){ 41 | window.location.href = "/mesas"; 42 | }, 2800); 43 | 44 | }, 45 | error: function(err) { 46 | alert('hubo un error'); 47 | console.log(err) 48 | } 49 | }), 50 | 51 | $.ajax({ 52 | url: "pedidos/mesas", 53 | type: "POST", 54 | dataType: "JSON", 55 | contentType: "application/json", 56 | data: JSON.stringify({ 57 | mesa: $(".jsPedidosMesa").text(), 58 | codigo: $(".jsCodigoMesa").text() 59 | }), 60 | success: function(data){ 61 | console.log('agregado'); 62 | }, 63 | error: function(err) { 64 | //alert('hubo un error'); 65 | //console.log(err) 66 | console.log(err) 67 | } 68 | }) 69 | 70 | 71 | ).then(function(){ 72 | // 73 | }); 74 | 75 | }); 76 | 77 | function pintarColours() { 78 | var API = "/pedidos/showmesas"; 79 | $.getJSON(API, verificar, false); 80 | var estado = ""; 81 | var mesa = ""; 82 | 83 | function verificar(data){ 84 | 85 | for(var i = 0; i < data.length; i++) { 86 | estado = data[i].Estado; 87 | mesa = data[i].Mesa; 88 | 89 | //alert(mesa); 90 | 91 | if(estado == "Ocupado"){ 92 | 93 | var find = $(".content--Mesa:contains('"+mesa+"')").addClass('ocupado-JS ocupadoBtn'); 94 | 95 | var string = $(find).find(mesa).selector; 96 | /*if(string == mesa) { 97 | 98 | }*/ 99 | console.log(find); 100 | 101 | } 102 | } 103 | 104 | } 105 | } 106 | pintarColours(); 107 | 108 | function occupeMesas() { 109 | var API = "pedidos/showmesas"; 110 | 111 | $.getJSON(API, mesas, false); 112 | 113 | 114 | var estado = ""; 115 | var mesas; 116 | var template = ""; 117 | 118 | function mesas(data){ 119 | 120 | 121 | 122 | for(var i = 0; i < data.length; i++) { 123 | 124 | estado = data[i].Estado; 125 | mesas = data[i].Mesa; 126 | mesasDe = data[i].Mesa; 127 | var codigo = data[i].Codigo; 128 | var t = decodeURIComponent(mesasDe); 129 | 130 | id = data[i]._id; 131 | 132 | template += "" 135 | 136 | // alert(template); 137 | } 138 | $(".mesasOccupe").append(template); 139 | } 140 | } 141 | occupeMesas(); 142 | 143 | 144 | } 145 | 146 | 147 | } 148 | pedidosMesa(); 149 | 150 | 151 | function deleteMesas() { 152 | var selecionado; 153 | $(".mesasOccupe").change(function(){ 154 | 155 | $(".mesasOccupe option:selected").each(function(){ 156 | selecionado = $(this).val() + " "; 157 | 158 | }); 159 | 160 | }); 161 | 162 | 163 | 164 | $(".jsMesasDisponibilidad").submit(function(e){ 165 | 166 | 167 | 168 | var url = "pedidos/deletemesas/" + selecionado; 169 | 170 | $.ajax({ 171 | url: url, 172 | method: "POST", 173 | cache: false, 174 | contentType: 'application/json; charset=utf-8', 175 | dataType: 'json', 176 | success: function() { 177 | alert('borrado'); 178 | window.location.href = "/"; 179 | }, 180 | error: function(err){ 181 | alert('error'); 182 | } 183 | }); 184 | 185 | e.preventDefault(); 186 | 187 | }); 188 | 189 | } 190 | deleteMesas(); 191 | }); -------------------------------------------------------------------------------- /public/stylesheets/mesas.scss: -------------------------------------------------------------------------------- 1 | .impresion--Success { 2 | background: white; 3 | left: 50%; 4 | } 5 | .background--Mesa { 6 | background: rgba(12, 12, 12, 0.77); 7 | top: 0; 8 | left: 0; 9 | right: 0; 10 | bottom:0; 11 | position: fixed; 12 | display: none; 13 | z-index: 29; 14 | } 15 | .mesasSelect { 16 | cursor: pointer; 17 | } 18 | 19 | .background--Error { 20 | position: absolute; 21 | background: white; 22 | box-shadow: 0 0 16px #dedede; 23 | border: 1px solid #dedede; 24 | top: 50%; 25 | left: 50%; 26 | width: 20%; 27 | padding: 0.5em; 28 | margin-left: -8em; 29 | margin-top: -5em; 30 | display: none; 31 | .header--Error { 32 | text-align: center; 33 | .title { 34 | font-weight: 400; 35 | color: red; 36 | } 37 | } 38 | .description--Error { 39 | .description { 40 | font-size: 0.9em; 41 | } 42 | } 43 | } 44 | 45 | .jsEditPedidos { 46 | .idTitle { 47 | display: none; 48 | } 49 | .title--Mesa { 50 | background: orange; 51 | color: white; 52 | padding: 0 0.5em; 53 | font-size: 0.8rem; 54 | margin: 0 0.5em 0 0; 55 | border-radius: 5px; 56 | } 57 | } 58 | .contSum { 59 | width: 100%!important; 60 | .labelCont { 61 | display: flex; 62 | justify-content: space-between; 63 | 64 | span { 65 | display: block; 66 | background: #F0AD4E; 67 | padding: 0.5em 1em; 68 | color: #fff; 69 | border-radius: 4px; 70 | border: 1px solid #B47C2D; 71 | &:hover { 72 | background: #ec971f; 73 | } 74 | } 75 | } 76 | } 77 | .jsDeleteSum { 78 | width: 44%; 79 | .labelCont { 80 | .jsDeleteP { 81 | 82 | background: #D9534F; 83 | padding: 0.5em 1em; 84 | color: #fff; 85 | border-radius: 4px; 86 | border: 1px solid #d43f3a; 87 | font-size: 0.9em; 88 | cursor :pointer; 89 | &:hover { 90 | background: #c9302c; 91 | } 92 | } 93 | } 94 | } 95 | .tBackground { 96 | background: #9E9E9E; 97 | color: #000; 98 | .details--Name { 99 | overflow: hidden; 100 | .title i { 101 | color: white; 102 | width: 18px; 103 | margin: 0.2em 0; 104 | float: left; 105 | color: white; 106 | } 107 | } 108 | } 109 | 110 | .impresionMesaCerrada { 111 | position: absolute; 112 | background: #fff; 113 | width: 210px; 114 | left: 0; 115 | top: 0%; 116 | box-shadow: 0 0 2px black; 117 | padding: 0.5em; 118 | display: none; 119 | z-index: 30; 120 | font-size: 0.8em; 121 | .impresion--Header { 122 | text-align: center; 123 | .title { 124 | font-weight: 400; 125 | } 126 | .impresion--SubHeader { 127 | 128 | } 129 | } 130 | } 131 | .buttons--Cont { 132 | display: flex; 133 | justify-content: space-between; 134 | margin: 0 0 0.5em 0; 135 | } 136 | .imprension--Cont { 137 | margin: 0.5em 0; 138 | 139 | .numTicket, .imprension--Cont--Fecha, .imprension--Cont--Fecha--Abierto { 140 | text-align: center; 141 | font-size: 0.9em; 142 | } 143 | 144 | .imprension--Cont--Gracias { 145 | text-align: center; 146 | margin: 0.5em 0; 147 | } 148 | .imprension--Cont--Totall { 149 | margin: 0.5em 0; 150 | } 151 | .imprension--Cont--Descuento { 152 | .descuento { 153 | display: flex; 154 | justify-content: space-between; 155 | margin: 0.5em 0; 156 | .descuento--Iz { 157 | .title { 158 | 159 | } 160 | } 161 | .descuento--De { 162 | .title { 163 | 164 | } 165 | } 166 | 167 | } 168 | } 169 | .imprension--Cont--Total-Descuento { 170 | .descuento { 171 | display: flex; 172 | justify-content: space-between; 173 | margin: 0.5em 0; 174 | .descuento--Iz { 175 | .title { 176 | font-weight: 700; 177 | } 178 | } 179 | .descuento--De { 180 | .title { 181 | font-weight: 700; 182 | } 183 | } 184 | 185 | } 186 | } 187 | .imprension--Cont--Header { 188 | display: flex; 189 | justify-content: space-between; 190 | .cont--Iz { 191 | width: 40%; 192 | } 193 | .cont--De { 194 | width: 40%; 195 | text-align: right; 196 | } 197 | } 198 | 199 | .imprension--Cont--Description { 200 | display: flex; 201 | justify-content: space-between; 202 | .cont--Iz { 203 | width: 80%; 204 | } 205 | .cont--De { 206 | width: 40%; 207 | text-align: right; 208 | } 209 | } 210 | .imprension--Cont--Description-Mas { 211 | display: flex; 212 | justify-content: space-between; 213 | .cont--Iz { 214 | width: 70%; 215 | } 216 | .cont--De { 217 | width: 40%; 218 | text-align: right; 219 | } 220 | } 221 | .imprension--Cont--Totall { 222 | overflow: hidden; 223 | .totall { 224 | width: 60%; 225 | float: right; 226 | display: flex; 227 | .totall--Iz { 228 | width: 20%; 229 | } 230 | .totall--De { 231 | width: 80%; 232 | text-align: right; 233 | } 234 | } 235 | } 236 | 237 | } 238 | -------------------------------------------------------------------------------- /views/bebidas.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='/stylesheets/normalize.css') 7 | link(rel='stylesheet', href='/stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src='/javascripts/web.js') 10 | script(src='/javascripts/stock.js') 11 | script(src='/javascripts/jquery.hideseek.js') 12 | body 13 | header.header(data-role="role") 14 | div.header--Cont 15 | div.header--Cont--Iz 16 | figure.header--Cont--Figure 17 | h1.Title 18 | | LaCatedralDelPisco 19 | div.header--Cont--Center 20 | div.Center--Day 21 | article.article 22 | div.article--Icon 23 | i(class="fa fa-sun-o") 24 | div.article--Data 25 | span.title.jsTitleHeader 26 | | ALMUERZO 27 | span.title.jsTitleSubHeader 28 | strong.jsTitleDay 29 | strong.jsTitleMounth 30 | 31 | div.Center--Time 32 | h1.time--Title 33 | div.Center--Clima 34 | div.headder--Cont--De 35 | nav.header--Cont--Nav 36 | ul.ul 37 | li.list 38 | a.link(href="../panel") 39 | i(class="fa fa-cutlery") 40 | li.list 41 | a.link(href="../mesas") 42 | i(class="fa fa-shopping-basket") 43 | li.list 44 | a.link(href="../ventas") 45 | i(class="fa fa-usd") 46 | li.list 47 | a.link(href="../modulos") 48 | i(class="fa fa-cubes") 49 | li.list 50 | a.link(href="../administracion") 51 | i(class="fa fa-cog") 52 | li.list 53 | i(class="fa fa-user") 54 | | #{username} 55 | main 56 | section.content 57 | header.contenido--Header 58 | div.contenido--HeaderTitle 59 | h2.title 60 | | Administración > Bebidas 61 | div.contenido--Filter 62 | input(type="text", class="searchFilter", placeholder="Filtrado por categorias", name="search", data-list=".data-list") 63 | section.contenido--Details 64 | ul.ul--Details 65 | li.list 66 | | Nombre 67 | li.list 68 | | Precio 69 | li.list 70 | | Categoria 71 | li.list 72 | | Codigo 73 | div.details--Cont.jsBebidasAdd 74 | 75 | 76 | aside.aside 77 | form.aside--Form.jsFormBebidas(method="GET") 78 | header.aside--Form--Header 79 | h2.title 80 | | Nueva Bebida 81 | div.jsPreload.cssPreload 82 | img(src="../images/ring-alt.svg", alt="") 83 | header.cssPreload--Header 84 | h2.title 85 | | Bebida Creada 86 | div.aside--Form--Fieldset.jsHide 87 | div.fieldset--Iz 88 | label.title 89 | | Nombre 90 | div.fieldset--De 91 | input(type="text", name="nombreBebida", class="nombreBebida") 92 | div.aside--Form--Fieldset.jsHide 93 | div.fieldset--Iz 94 | label.title 95 | | Precio 96 | div.fieldset--De 97 | input(type="text", name="precioBebida", class="precioBebida") 98 | div.aside--Form--Fieldset.jsHide 99 | div.fieldset--Iz 100 | label.title 101 | | Categoria: 102 | div.fieldset--De 103 | select(name="categoryBebida", class="categoryBebida") 104 | option(value="Bebidassinalcohol") 105 | |Bebidas Sin Alchohol 106 | option(value="Cerverzas") 107 | |Cervezas 108 | option(value="Tragosconpisco") 109 | |Tragos Con Pisco 110 | option(value="Tragosconvodka") 111 | |Tragos Con Vodka 112 | option(value="Tragosconron") 113 | |Tragos Con Ron 114 | option(value="Vinosblancos") 115 | |Vinos Blancos 116 | option(value="Espumantes") 117 | |Espumantes 118 | option(value="Tragoscontequila") 119 | |Tragoscontequila 120 | option(value="Medidawhisky") 121 | |Medida Whisky 122 | option(value="Vinostintos") 123 | |Vinos Tintos 124 | 125 | div.aside--Form--Fieldset.jsHide 126 | div.fieldset--Iz 127 | label.title 128 | | Codigo 129 | div.fieldset--De 130 | input(type="text", name="codigoBebida", class="codigoBebida") 131 | div.aside--Form--Fieldset.jsHide 132 | input(class="send", type="submit", value="Crear Bebida") 133 | form.aside--Form.jsFormBebidasDelete(method="get") 134 | header.aside--Form--Header 135 | h2.title 136 | | Eliminar Bebida 137 | div.aside--Form--Fieldset 138 | div.fieldset--Iz 139 | label.title 140 | | Bebidas 141 | div.fieldset--De.mozosDelete 142 | select(name="", class="bebidasDelete--Select") 143 | option(value="seleciona") 144 | | Seleciona 145 | div.aside--Form--Fieldset 146 | input(class="sendDelete", type="submit", value="Eliminar Bebida") 147 | -------------------------------------------------------------------------------- /public/stylesheets/salon.scss: -------------------------------------------------------------------------------- 1 | main { 2 | width: 1220px; 3 | margin: 1em auto 0 auto; 4 | display: flex; 5 | justify-content: space-between; 6 | align-items: flex-start; 7 | .content { 8 | width: 68%; 9 | background-color: white; 10 | border: 1px solid #D8D8D8; 11 | padding: 1em; 12 | display: flex; 13 | justify-content: space-between; 14 | flex-wrap: wrap; 15 | align-items: flex-start; 16 | .content-Mesa--Iz { 17 | width: 20%; 18 | border: 1px solid #D8D8D8; 19 | .content--Bano { 20 | border-bottom: 1px solid #D8D8D8; 21 | text-align: center; 22 | padding: 1em 0; 23 | background: #F1F1F1; 24 | .title { 25 | font-weight: 400; 26 | } 27 | } 28 | .content--Mesa { 29 | margin: 0.5em auto 0.5em auto; 30 | &:nth-child(1), &:nth-child(2), &:nth-child(3), &:nth-child(4), &:nth-child(5) { 31 | border-radius: 20%; 32 | } 33 | } 34 | } 35 | .content-Mesa--Center { 36 | width: 38%; 37 | border: 1px solid #D8D8D8; 38 | //background: blue; 39 | 40 | .mesaRectangular { 41 | width: 250px; 42 | margin: 1em auto; 43 | img { 44 | width: 32%; 45 | } 46 | } 47 | .content--Mesas-Dos { 48 | display: flex; 49 | justify-content: space-between; 50 | width: 270px; 51 | margin: 0 auto; 52 | .content--Mesas-Large { 53 | .mesaLarge { 54 | height: 165px; 55 | .content--Mesa--Number { 56 | margin-top: -5em; 57 | } 58 | } 59 | } 60 | } 61 | } 62 | .content-Mesa--De { 63 | width: 38%; 64 | border: 1px solid #D8D8D8; 65 | .mesaRectangular { 66 | width: 250px; 67 | margin: 1em auto; 68 | img { 69 | width: 32%; 70 | } 71 | } 72 | 73 | .content--Mesa { 74 | margin: 0.5em auto 0.5em auto; 75 | &:nth-child(1), &:nth-child(2){ 76 | border-radius: 20%; 77 | } 78 | } 79 | 80 | .mesaLarge { 81 | height: 165px; 82 | .content--Mesa--Number { 83 | margin-top: -5em; 84 | } 85 | } 86 | 87 | 88 | 89 | } 90 | 91 | .content--Mesa { 92 | position: relative; 93 | width: 110px; 94 | height: 70px; 95 | padding: 0.5em; 96 | cursor: pointer; 97 | margin: 0 0 0.5em 0; 98 | background: #F1F1F1; 99 | border: 1px solid #D8D8D8; 100 | 101 | &:hover { 102 | background: #323131; 103 | } 104 | img { 105 | width: 70%; 106 | } 107 | .content--Mesa--Number { 108 | position: absolute; 109 | left: 50%; 110 | margin-left: -1em; 111 | top: 50%; 112 | margin-top: -2em; 113 | text-align: center; 114 | .titleMesa { 115 | font-weight: 400; 116 | color: #646262; 117 | } 118 | } 119 | } 120 | } 121 | .aside { 122 | width: 28%; 123 | background-color: white; 124 | border: 1px solid #D8D8D8; 125 | .aside--Form { 126 | padding: 1em; 127 | .aside--Form--Header { 128 | border-bottom: 1px solid #323131; 129 | .title { 130 | font-weight: 400; 131 | font-size: 1.2em; 132 | color: #323131; 133 | } 134 | } 135 | .aside--Form--Fieldset { 136 | margin: 1em 0 0 0; 137 | border: none; 138 | padding: 0; 139 | display: flex; 140 | width: 100%; 141 | justify-content: space-between; 142 | align-items: center; 143 | .sendDelete { 144 | background: #D91E18; 145 | border: none; 146 | color: white; 147 | font-size: 0.9em; 148 | padding: 0.5em 1em; 149 | outline: medium none; 150 | border-radius: 4px; 151 | box-shadow: 0 2px 0 #AB1612; 152 | &:active { 153 | animation: hot 1s; 154 | } 155 | @keyframes hot { 156 | 20% { 157 | transform: scale(0.9); 158 | } 159 | } 160 | } 161 | .send { 162 | background: #444444; 163 | border: none; 164 | color: white; 165 | font-size: 0.9em; 166 | padding: 0.5em 1em; 167 | outline: medium none; 168 | border-radius: 4px; 169 | box-shadow: 0 2px 0 black; 170 | &:active { 171 | animation: hot 1s; 172 | } 173 | @keyframes hot { 174 | 20% { 175 | transform: scale(0.9); 176 | } 177 | } 178 | } 179 | .fieldset--Iz { 180 | width: 20%; 181 | .title { 182 | font-weight: 400; 183 | font-size: 0.85em; 184 | } 185 | } 186 | .fieldset--De { 187 | width: 60%; 188 | input { 189 | width: 95%; 190 | outline: medium none; 191 | box-shadow: inset 0px 3px 14px -3px #D4D3D3; 192 | border: none; 193 | border: 1px solid #999; 194 | padding: 0.2em 0.2em; 195 | color: #999; 196 | } 197 | select { 198 | width: 100%; 199 | outline: medium none; 200 | box-shadow: inset 0px 3px 14px -3px #D4D3D3; 201 | border: none; 202 | border: 1px solid #999; 203 | padding: 0.2em 0; 204 | color: #999; 205 | } 206 | } 207 | } 208 | } 209 | } 210 | } -------------------------------------------------------------------------------- /views/platos.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='/stylesheets/normalize.css') 7 | link(rel='stylesheet', href='/stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src='/javascripts/appadmin.js') 10 | script(src='/javascripts/web.js') 11 | script(src='/javascripts/platos.js') 12 | script(src='/javascripts/jquery.hideseek.js') 13 | body 14 | header.header(data-role="role") 15 | div.header--Cont 16 | div.header--Cont--Iz 17 | figure.header--Cont--Figure 18 | h1.Title 19 | | LaCatedralDelPisco 20 | div.header--Cont--Center 21 | div.Center--Day 22 | article.article 23 | div.article--Icon 24 | i(class="fa fa-sun-o") 25 | div.article--Data 26 | span.title.jsTitleHeader 27 | | ALMUERZO 28 | span.title.jsTitleSubHeader 29 | strong.jsTitleDay 30 | strong.jsTitleMounth 31 | 32 | div.Center--Time 33 | h1.time--Title 34 | div.Center--Clima 35 | div.headder--Cont--De 36 | nav.header--Cont--Nav 37 | ul.ul 38 | li.list 39 | a.link(href="../panel") 40 | i(class="fa fa-cutlery") 41 | li.list 42 | a.link(href="../mesas") 43 | i(class="fa fa-shopping-basket") 44 | li.list 45 | a.link(href="../ventas") 46 | i(class="fa fa-usd") 47 | li.list 48 | a.link(href="../modulos") 49 | i(class="fa fa-cubes") 50 | li.list 51 | a.link(href="../administracion") 52 | i(class="fa fa-cog") 53 | li.list 54 | i(class="fa fa-user") 55 | | #{username} 56 | main 57 | section.content 58 | header.contenido--Header 59 | div.contenido--HeaderTitle 60 | h2.title 61 | | Administración > Platos 62 | div.contenido--Filter 63 | input(type="text", class="searchFilter", placeholder="Filtrado por categorias", name="search", data-list=".data-list") 64 | section.contenido--Details 65 | ul.ul--Details 66 | li.list 67 | | Nombre 68 | li.list 69 | | Precio 70 | li.list 71 | | Categoria 72 | li.list 73 | | Codigo 74 | div.details--Cont.jsPlatosAdd 75 | 76 | 77 | aside.aside 78 | form.aside--Form.jsFormPlatos(method="GET") 79 | header.aside--Form--Header 80 | h2.title 81 | | Nuevo Plato 82 | div.jsPreload.cssPreload 83 | img(src="../images/ring-alt.svg", alt="") 84 | header.cssPreload--Header 85 | h2.title 86 | | Plato Creado 87 | div.aside--Form--Fieldset.jsHide 88 | div.fieldset--Iz 89 | label.title 90 | | Nombre 91 | div.fieldset--De 92 | input(type="text", name="nombrePlato", class="nombrePlato") 93 | div.aside--Form--Fieldset.jsHide 94 | div.fieldset--Iz 95 | label.title 96 | | Precio 97 | div.fieldset--De 98 | input(type="text", name="precioPlato", class="precioPlato") 99 | div.aside--Form--Fieldset.jsHide 100 | div.fieldset--Iz 101 | label.title 102 | | Categoria: 103 | div.fieldset--De 104 | select(name="category", class="categoryPlato") 105 | option(value="Entradas") 106 | |Entradas 107 | option(value="Ceviches") 108 | |Ceviches 109 | option(value="PescadosMariscos") 110 | |Pescados y Mariscos 111 | option(value="Tiraditos") 112 | |Tiraditos 113 | option(value="Lechedetigre") 114 | |Leche de tigre 115 | option(value="Sudadoschupes") 116 | |Sudados y Chupes 117 | option(value="Segundosmarinos") 118 | |Segundos Marinos 119 | option(value="ChicharronesMarinos") 120 | |Chicharrones Marinos 121 | option(value="Trilogias") 122 | |Trilogias 123 | option(value="TacuTacus") 124 | |Tacu Tacus 125 | option(value="Chicharrones") 126 | |Chicharrones 127 | option(value="Guarniciones") 128 | |Guarniciones 129 | option(value="Sopascriollas") 130 | |Sopas Criollas 131 | option(value="Chifas") 132 | |Chifas 133 | option(value="Polloalabrasa") 134 | |Pollo a la brasa 135 | div.aside--Form--Fieldset.jsHide 136 | div.fieldset--Iz 137 | label.title 138 | | Codigo 139 | div.fieldset--De 140 | input(type="text", name="codigoPlato", class="codigoPlato") 141 | div.aside--Form--Fieldset.jsHide 142 | input(class="send", type="submit", value="Crear Plato") 143 | form.aside--Form.jsFormPlatosDelete(method="get") 144 | header.aside--Form--Header 145 | h2.title 146 | | Eliminar Plato 147 | div.aside--Form--Fieldset 148 | div.fieldset--Iz 149 | label.title 150 | | Plato 151 | div.fieldset--De.mozosDelete 152 | select(name="", class="platosDelete--Select") 153 | option(value="seleciona") 154 | | Seleciona 155 | div.aside--Form--Fieldset 156 | input(class="sendDelete", type="submit", value="Eliminar Mozo") 157 | -------------------------------------------------------------------------------- /routes/ventas.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var mongoose = require('mongoose'); 4 | 5 | router.get('/', function(req, res, next){ 6 | res.render('ventas', { 7 | title: 'Ventas Reportes - Lacatedraldelpisco', 8 | username: req.user.username 9 | }) 10 | }); 11 | 12 | router.get('/totales', function(req, res, next){ 13 | res.render('ventastotales', { 14 | title: 'Ventas Totales - Lacatedraldelpisco', 15 | username: req.user.username 16 | }); 17 | }); 18 | router.get('/tarjetas', function(req, res, next){ 19 | res.render('ventastarjetas', { 20 | title: 'Ventas Totales - Lacatedraldelpisco', 21 | username: req.user.username 22 | }); 23 | }); 24 | router.get('/efectivo', function(req, res, next){ 25 | res.render('ventasefectivo', { 26 | title: 'Ventas Totales - Lacatedraldelpisco', 27 | username: req.user.username 28 | }); 29 | }); 30 | 31 | router.get('/mensual', function(req, res, next){ 32 | res.render('mensual',{ 33 | itle: 'Ventas Mensuales - Lacatedraldelpisco', 34 | username: req.user.username 35 | }); 36 | }); 37 | router.get('/mensual/principal', function(req, res, next){ 38 | var db = req.db; 39 | var total = db.get('total'); 40 | var fechaPrincipal = req.params.principal; 41 | var fechaFinal = req.params.fin; 42 | 43 | total.find({ 44 | 'Fecha': { 45 | '$gte': '2016-02-01T05:54:20.743Z', 46 | '$lt': '2016-02-02T06:13:16.074Z' 47 | } 48 | }, function(err, doc){ 49 | res.send(doc); 50 | }) 51 | 52 | }); 53 | 54 | router.post('/save', function(req, res, next) { 55 | var db = req.db; 56 | var collection = db.get('ventas'); 57 | var pagosTarjetas = db.get('ventasTarjeta'); 58 | var pagosTarjetasUno = db.get('ventasEfectivo'); 59 | 60 | var codigo = req.body.codigo; 61 | var mesa = req.body.mesa; 62 | var hora = req.body.hora; 63 | var fecha = req.body.fecha; 64 | var total = req.body.total; 65 | var metodoPago = req.body.metodoPago; 66 | var descuento = req.body.descuento; 67 | var descuentoTotal = req.body.descuentoTotal; 68 | 69 | 70 | if(metodoPago == "Efectivo") { 71 | pagosTarjetasUno.insert({ 72 | 'Mesa': mesa, 73 | 'Total': total, 74 | 'Codigo': codigo, 75 | 'Hora': hora, 76 | 'Fecha': fecha, 77 | 'Metodopago': metodoPago, 78 | 'Descuento': descuento, 79 | 'DescuentoTotal': descuentoTotal 80 | }).success(function(doc){ 81 | res.end(JSON.stringify({inserted: true})); 82 | }).error(function(err){ 83 | console.log('error'); 84 | }); 85 | 86 | } 87 | else if(metodoPago == "Tarjeta"){ 88 | 89 | pagosTarjetas.insert({ 90 | 'Mesa': mesa, 91 | 'Total': total, 92 | 'Codigo': codigo, 93 | 'Hora': hora, 94 | 'Fecha': fecha, 95 | 'Metodopago': metodoPago, 96 | 'Descuento': descuento, 97 | 'DescuentoTotal': descuentoTotal 98 | }).success(function(doc){ 99 | res.end(JSON.stringify({inserted: true})); 100 | console.log('error'); 101 | }); 102 | } 103 | 104 | else { 105 | console.log('error'); 106 | } 107 | 108 | collection.insert({ 109 | 'Mesa': mesa, 110 | 'Total': total, 111 | 'Codigo': codigo, 112 | 'Hora': hora, 113 | 'Fecha': fecha, 114 | 'Metodopago': metodoPago, 115 | 'Descuento': descuento, 116 | 'DescuentoTotal': descuentoTotal 117 | }).success(function(doc){ 118 | res.end(JSON.stringify({inserted: true})); 119 | }).error(function(err){ 120 | console.log('error'); 121 | }); 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | }); 130 | 131 | router.get('/list/:fecha', function(req, res, next){ 132 | var db = req.db; 133 | var save = db.get('ventas'); 134 | var fecha = req.params.fecha; 135 | save.find({'Fecha': fecha}, function(err, doc){ 136 | res.send(doc); 137 | }) 138 | 139 | }); 140 | 141 | router.get('/list/tarjetas/:fecha', function(req, res, next){ 142 | var db = req.db; 143 | var save = db.get('ventasTarjeta'); 144 | var fecha = req.params.fecha; 145 | 146 | save.find({'Fecha': fecha}, function(err, doc){ 147 | res.send(doc); 148 | }); 149 | 150 | }); 151 | 152 | router.get('/list/efectivo/:fecha', function(req, res, next){ 153 | var db = req.db; 154 | var save = db.get('ventasEfectivo'); 155 | var fecha = req.params.fecha; 156 | 157 | save.find({'Fecha': fecha}, function(err, doc){ 158 | res.send(doc); 159 | }); 160 | 161 | }); 162 | 163 | router.post('/savetotal', function(req, res, next){ 164 | var db = req.db; 165 | var totalBD = db.get('total'); 166 | var fecha = req.body.fecha; 167 | var total = req.body.total; 168 | 169 | totalBD.insert({ 170 | 'Total': total, 171 | 'Fecha': new Date() 172 | }).success(function(doc){ 173 | res.json({inserted: true}); 174 | }).error(function(err){ 175 | console.log('error'); 176 | }) 177 | }); 178 | 179 | router.post('/savetotaltarjeta', function(req, res, next){ 180 | var db = req.db; 181 | var totalBD = db.get('totaltarjeta'); 182 | var fecha = req.body.fecha; 183 | var total = req.body.total; 184 | 185 | totalBD.insert({ 186 | 'Total': total, 187 | 'Fecha': new Date() 188 | }).success(function(doc){ 189 | res.json({inserted: true}); 190 | }).error(function(err){ 191 | console.log('error'); 192 | }) 193 | }); 194 | 195 | router.post('/savetotalefectivo', function(req, res, next){ 196 | var db = req.db; 197 | var totalBD = db.get('totaltarjeta'); 198 | var fecha = req.body.fecha; 199 | var total = req.body.total; 200 | 201 | totalBD.insert({ 202 | 'Total': total, 203 | 'Fecha': new Date() 204 | }).success(function(doc){ 205 | res.json({inserted: true}); 206 | }).error(function(err){ 207 | console.log('error'); 208 | }) 209 | }); 210 | 211 | module.exports = router; -------------------------------------------------------------------------------- /public/javascripts/ventas.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | 4 | function showReportes(){ 5 | 6 | /*Data*/ 7 | var fecha = new Date(); 8 | var hora = fecha.getHours(); 9 | var minutes = fecha.getMinutes(); 10 | var resultadoHora = hora + ":" + minutes; 11 | 12 | var mes = fecha.getMonth(); 13 | var ano = fecha.getFullYear(); 14 | var dia = fecha.getDate(); 15 | 16 | if(mes == 0) { 17 | mes = "Enero"; 18 | } 19 | else if(mes == 1) { 20 | mes = "Febrero"; 21 | } 22 | else if(mes == 2) { 23 | mes = "Marzo"; 24 | } 25 | else if(mes == 3){ 26 | mes = "Abril"; 27 | } 28 | else if(mes == 4) { 29 | mes = "Mayo"; 30 | } 31 | else if(mes == 5) { 32 | mes = "Junio"; 33 | } 34 | else if(mes == 6) { 35 | mes = "Julio"; 36 | } 37 | else if(mes == 7) { 38 | mes = "Agosto"; 39 | } 40 | else if(mes == 8) { 41 | mes = "Septiembre"; 42 | } 43 | else if(mes == 9) { 44 | mes = "Octubre"; 45 | } 46 | else if(mes == 10) { 47 | mes = "Noviembre"; 48 | } 49 | else if(mes == 11){ 50 | mes = "Diciembre"; 51 | } 52 | else { 53 | mes = "Ningun mes se encontro"; 54 | } 55 | var resultadoFecha 56 | resultadoFecha = "El " + dia + " de " + mes + " " + "del" + " "+ ano; 57 | 58 | $(".content--Search .title--Search--Secondary").text(dia); 59 | $(".content--Search .title--Search--Four").text(mes); 60 | 61 | $(".titleReporteDia").text(resultadoFecha); 62 | 63 | //encontrar reporte del dia 64 | $(".linkButton--Reporte").click(function(e){ 65 | e.preventDefault(); 66 | 67 | var onePrimary = $(".content--Search .title--Search--Secondary").text(); 68 | var twoPrimary = $(".content--Search .title--Search--Four").text(); 69 | resultadoFecha = "El " + onePrimary + " de " + twoPrimary + " " + "del" + " " + ano; 70 | 71 | $(".titleReporteDia").text(resultadoFecha); 72 | 73 | var APIURL = "../ventas/list/" + resultadoFecha; 74 | 75 | 76 | 77 | $.getJSON(APIURL, ventas, false); 78 | 79 | function ventas(data){ 80 | var name; 81 | var total; 82 | var hora; 83 | var fecha; 84 | var inTemplate = ""; 85 | var suma = 0; 86 | var totalDay = 0; 87 | for(var i = 0; i < data.length; i++) { 88 | name = data[i].Mesa; 89 | total = data[i].Total; 90 | fecha = data[i].Fecha; 91 | hora = data[i].Hora; 92 | var numberoTotall = data[i].Total.replace('$',''); 93 | 94 | var converterNumber = Number(numberoTotall); 95 | 96 | totalDay += converterNumber; 97 | 98 | 99 | 100 | inTemplate += "
" + 101 | "
"+ 102 | ""+name+""+ 103 | "
"+ 104 | ""+ 107 | "
"+ 108 | ""+hora+""+ 109 | "
"+ 110 | "
"+ 111 | ""+ 112 | total+ 113 | ""+ 114 | "
"+ 115 | "
"; 116 | 117 | } 118 | 119 | $(".jsReportes").html(inTemplate); 120 | $(".jsPriceTotallVentas").html(" $"+totalDay); 121 | } 122 | 123 | 124 | }); 125 | 126 | var APIURL = "../ventas/list/" + resultadoFecha; 127 | 128 | 129 | 130 | $.getJSON(APIURL, ventas, false); 131 | 132 | function ventas(data){ 133 | var name; 134 | var total; 135 | var hora; 136 | var fecha; 137 | var inTemplate = ""; 138 | var suma = 0; 139 | var totalDay = 0; 140 | for(var i = 0; i < data.length; i++) { 141 | name = data[i].Mesa; 142 | total = data[i].Total; 143 | fecha = data[i].Fecha; 144 | hora = data[i].Hora; 145 | var formaPago = data[i].Metodopago; 146 | var descuento = data[i].Descuento; 147 | var descuentoTotal = data[i].DescuentoTotal; 148 | var numberoTotall = data[i].Total.replace('$',''); 149 | 150 | var converterNumber = Number(numberoTotall); 151 | 152 | totalDay += converterNumber; 153 | 154 | if(descuento == "" ){ 155 | descuento = "No hay descuento"; 156 | } 157 | if(descuentoTotal.length > 0){ 158 | total = descuentoTotal; 159 | } 160 | 161 | inTemplate += "
" + 162 | "
"+ 163 | ""+name+""+ 164 | "
"+ 165 | ""+ 168 | "
"+ 169 | ""+hora+""+ 170 | "
"+ 171 | "
"+ 172 | ""+formaPago+""+ 173 | "
"+ 174 | "
"+ 175 | ""+descuento+""+ 176 | "
"+ 177 | 178 | "
"+ 179 | ""+ 180 | total+ 181 | ""+ 182 | "
"+ 183 | "
"; 184 | 185 | } 186 | 187 | $(".jsReportes").html(inTemplate); 188 | $(".jsPriceTotallVentas").html(" $"+totalDay); 189 | } 190 | 191 | 192 | 193 | 194 | } 195 | showReportes(); 196 | 197 | function savePrice(){ 198 | $(".guardar--ElTotal").click(function(e){ 199 | e.preventDefault(); 200 | 201 | var total = $(".jsPriceTotallVentas").text(); 202 | var fecha = $(".titleReporteDia").text(); 203 | 204 | $.ajax({ 205 | url: "ventas/savetotal", 206 | type: "POST", 207 | dataType: "JSON", 208 | contentType: "application/json", 209 | data: JSON.stringify({ 210 | fecha: fecha, 211 | total: total 212 | }), 213 | success: function(data){ 214 | alert('guardado en total'); 215 | }, 216 | error: function(err) { 217 | alert('error'); 218 | } 219 | }); 220 | 221 | }); 222 | } 223 | savePrice(); 224 | 225 | 226 | }); 227 | -------------------------------------------------------------------------------- /public/javascripts/ventastarjetas.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | 4 | function showReportes(){ 5 | 6 | /*Data*/ 7 | var fecha = new Date(); 8 | var hora = fecha.getHours(); 9 | var minutes = fecha.getMinutes(); 10 | var resultadoHora = hora + ":" + minutes; 11 | 12 | var mes = fecha.getMonth(); 13 | var ano = fecha.getFullYear(); 14 | var dia = fecha.getDate(); 15 | 16 | if(mes == 0) { 17 | mes = "Enero"; 18 | } 19 | else if(mes == 1) { 20 | mes = "Febrero"; 21 | } 22 | else if(mes == 2) { 23 | mes = "Marzo"; 24 | } 25 | else if(mes == 3){ 26 | mes = "Abril"; 27 | } 28 | else if(mes == 4) { 29 | mes = "Mayo"; 30 | } 31 | else if(mes == 5) { 32 | mes = "Junio"; 33 | } 34 | else if(mes == 6) { 35 | mes = "Julio"; 36 | } 37 | else if(mes == 7) { 38 | mes = "Agosto"; 39 | } 40 | else if(mes == 8) { 41 | mes = "Septiembre"; 42 | } 43 | else if(mes == 9) { 44 | mes = "Octubre"; 45 | } 46 | else if(mes == 10) { 47 | mes = "Noviembre"; 48 | } 49 | else if(mes == 11){ 50 | mes = "Diciembre"; 51 | } 52 | else { 53 | mes = "Ningun mes se encontro"; 54 | } 55 | var resultadoFecha 56 | resultadoFecha = "El " + dia + " de " + mes + " " + "del" + " "+ ano; 57 | 58 | $(".content--Search .title--Search--Secondary").text(dia); 59 | $(".content--Search .title--Search--Four").text(mes); 60 | 61 | $(".titleReporteDia").text(resultadoFecha); 62 | 63 | //encontrar reporte del dia 64 | $(".linkButton--Reporte").click(function(e){ 65 | e.preventDefault(); 66 | 67 | var onePrimary = $(".content--Search .title--Search--Secondary").text(); 68 | var twoPrimary = $(".content--Search .title--Search--Four").text(); 69 | resultadoFecha = "El " + onePrimary + " de " + twoPrimary + " " + "del" + " " + ano; 70 | 71 | $(".titleReporteDia").text(resultadoFecha); 72 | 73 | var APIURL = "../ventas/list/tarjetas/" + resultadoFecha; 74 | 75 | 76 | $.getJSON(APIURL, ventas, false); 77 | 78 | function ventas(data){ 79 | var name; 80 | var total; 81 | var hora; 82 | var fecha; 83 | var inTemplate = ""; 84 | var suma = 0; 85 | var totalDay = 0; 86 | for(var i = 0; i < data.length; i++) { 87 | name = data[i].Mesa; 88 | total = data[i].Total; 89 | fecha = data[i].Fecha; 90 | hora = data[i].Hora; 91 | var numberoTotall = data[i].Total.replace('$',''); 92 | 93 | var converterNumber = Number(numberoTotall); 94 | 95 | totalDay += converterNumber; 96 | 97 | 98 | 99 | inTemplate += "
" + 100 | "
"+ 101 | ""+name+""+ 102 | "
"+ 103 | ""+ 106 | "
"+ 107 | ""+hora+""+ 108 | "
"+ 109 | "
"+ 110 | ""+ 111 | total+ 112 | ""+ 113 | "
"+ 114 | "
"; 115 | 116 | } 117 | 118 | $(".jsReportes").html(inTemplate); 119 | $(".jsPriceTotallVentas").html(" $"+totalDay); 120 | } 121 | 122 | 123 | }); 124 | 125 | var APIURL = "../ventas/list/tarjetas/ " + resultadoFecha; 126 | 127 | 128 | 129 | $.getJSON(APIURL, ventas, false); 130 | 131 | function ventas(data){ 132 | var name; 133 | var total; 134 | var hora; 135 | var fecha; 136 | var inTemplate = ""; 137 | var suma = 0; 138 | var totalDay = 0; 139 | for(var i = 0; i < data.length; i++) { 140 | name = data[i].Mesa; 141 | total = data[i].Total; 142 | fecha = data[i].Fecha; 143 | hora = data[i].Hora; 144 | var formaPago = data[i].Metodopago; 145 | var descuento = data[i].Descuento; 146 | var descuentoTotal = data[i].DescuentoTotal; 147 | var numberoTotall = data[i].Total.replace('$',''); 148 | 149 | var converterNumber = Number(numberoTotall); 150 | 151 | totalDay += converterNumber; 152 | 153 | if(descuento == "" ){ 154 | descuento = "No hay descuento"; 155 | } 156 | if(descuentoTotal.length > 0){ 157 | total = descuentoTotal; 158 | } 159 | 160 | inTemplate += "
" + 161 | "
"+ 162 | ""+name+""+ 163 | "
"+ 164 | ""+ 167 | "
"+ 168 | ""+hora+""+ 169 | "
"+ 170 | "
"+ 171 | ""+formaPago+""+ 172 | "
"+ 173 | "
"+ 174 | ""+descuento+""+ 175 | "
"+ 176 | 177 | "
"+ 178 | ""+ 179 | total+ 180 | ""+ 181 | "
"+ 182 | "
"; 183 | 184 | } 185 | 186 | $(".jsReportes").html(inTemplate); 187 | $(".jsPriceTotallVentas").html(" $"+totalDay); 188 | } 189 | 190 | 191 | 192 | 193 | } 194 | showReportes(); 195 | 196 | function savePrice(){ 197 | $(".guardar--ElTotal").click(function(e){ 198 | e.preventDefault(); 199 | 200 | var total = $(".jsPriceTotallVentas").text(); 201 | var fecha = $(".titleReporteDia").text(); 202 | 203 | $.ajax({ 204 | url: "../ventas/savetotaltarjeta", 205 | type: "POST", 206 | dataType: "JSON", 207 | contentType: "application/json", 208 | data: JSON.stringify({ 209 | fecha: fecha, 210 | total: total 211 | }), 212 | success: function(data){ 213 | alert('guardado en total'); 214 | }, 215 | error: function(err) { 216 | alert('error'); 217 | } 218 | }); 219 | 220 | }); 221 | } 222 | savePrice(); 223 | 224 | 225 | }); 226 | -------------------------------------------------------------------------------- /public/javascripts/ventasefectivo.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | 4 | function showReportes(){ 5 | 6 | /*Data*/ 7 | var fecha = new Date(); 8 | var hora = fecha.getHours(); 9 | var minutes = fecha.getMinutes(); 10 | var resultadoHora = hora + ":" + minutes; 11 | 12 | var mes = fecha.getMonth(); 13 | var ano = fecha.getFullYear(); 14 | var dia = fecha.getDate(); 15 | 16 | if(mes == 0) { 17 | mes = "Enero"; 18 | } 19 | else if(mes == 1) { 20 | mes = "Febrero"; 21 | } 22 | else if(mes == 2) { 23 | mes = "Marzo"; 24 | } 25 | else if(mes == 3){ 26 | mes = "Abril"; 27 | } 28 | else if(mes == 4) { 29 | mes = "Mayo"; 30 | } 31 | else if(mes == 5) { 32 | mes = "Junio"; 33 | } 34 | else if(mes == 6) { 35 | mes = "Julio"; 36 | } 37 | else if(mes == 7) { 38 | mes = "Agosto"; 39 | } 40 | else if(mes == 8) { 41 | mes = "Septiembre"; 42 | } 43 | else if(mes == 9) { 44 | mes = "Octubre"; 45 | } 46 | else if(mes == 10) { 47 | mes = "Noviembre"; 48 | } 49 | else if(mes == 11){ 50 | mes = "Diciembre"; 51 | } 52 | else { 53 | mes = "Ningun mes se encontro"; 54 | } 55 | var resultadoFecha 56 | resultadoFecha = "El " + dia + " de " + mes + " " + "del" + " "+ ano; 57 | 58 | $(".content--Search .title--Search--Secondary").text(dia); 59 | $(".content--Search .title--Search--Four").text(mes); 60 | 61 | $(".titleReporteDia").text(resultadoFecha); 62 | 63 | //encontrar reporte del dia 64 | $(".linkButton--Reporte").click(function(e){ 65 | e.preventDefault(); 66 | 67 | var onePrimary = $(".content--Search .title--Search--Secondary").text(); 68 | var twoPrimary = $(".content--Search .title--Search--Four").text(); 69 | resultadoFecha = "El " + onePrimary + " de " + twoPrimary + " " + "del" + " " + ano; 70 | 71 | $(".titleReporteDia").text(resultadoFecha); 72 | 73 | var APIURL = "../ventas/list/efectivo/" + resultadoFecha; 74 | 75 | 76 | 77 | $.getJSON(APIURL, ventas, false); 78 | 79 | function ventas(data){ 80 | var name; 81 | var total; 82 | var hora; 83 | var fecha; 84 | var inTemplate = ""; 85 | var suma = 0; 86 | var totalDay = 0; 87 | for(var i = 0; i < data.length; i++) { 88 | name = data[i].Mesa; 89 | total = data[i].Total; 90 | fecha = data[i].Fecha; 91 | hora = data[i].Hora; 92 | var numberoTotall = data[i].Total.replace('$',''); 93 | 94 | var converterNumber = Number(numberoTotall); 95 | 96 | totalDay += converterNumber; 97 | 98 | 99 | 100 | inTemplate += "
" + 101 | "
"+ 102 | ""+name+""+ 103 | "
"+ 104 | ""+ 107 | "
"+ 108 | ""+hora+""+ 109 | "
"+ 110 | "
"+ 111 | ""+ 112 | total+ 113 | ""+ 114 | "
"+ 115 | "
"; 116 | 117 | } 118 | 119 | $(".jsReportes").html(inTemplate); 120 | $(".jsPriceTotallVentas").html(" $"+totalDay); 121 | } 122 | 123 | 124 | }); 125 | 126 | var APIURL = "../ventas/list/efectivo/ " + resultadoFecha; 127 | 128 | 129 | 130 | $.getJSON(APIURL, ventas, false); 131 | 132 | function ventas(data){ 133 | var name; 134 | var total; 135 | var hora; 136 | var fecha; 137 | var inTemplate = ""; 138 | var suma = 0; 139 | var totalDay = 0; 140 | for(var i = 0; i < data.length; i++) { 141 | name = data[i].Mesa; 142 | total = data[i].Total; 143 | fecha = data[i].Fecha; 144 | hora = data[i].Hora; 145 | var formaPago = data[i].Metodopago; 146 | var descuento = data[i].Descuento; 147 | var descuentoTotal = data[i].DescuentoTotal; 148 | var numberoTotall = data[i].Total.replace('$',''); 149 | 150 | var converterNumber = Number(numberoTotall); 151 | 152 | totalDay += converterNumber; 153 | 154 | if(descuento == "" ){ 155 | descuento = "No hay descuento"; 156 | } 157 | if(descuentoTotal.length > 0){ 158 | total = descuentoTotal; 159 | } 160 | 161 | inTemplate += "
" + 162 | "
"+ 163 | ""+name+""+ 164 | "
"+ 165 | ""+ 168 | "
"+ 169 | ""+hora+""+ 170 | "
"+ 171 | "
"+ 172 | ""+formaPago+""+ 173 | "
"+ 174 | "
"+ 175 | ""+descuento+""+ 176 | "
"+ 177 | 178 | "
"+ 179 | ""+ 180 | total+ 181 | ""+ 182 | "
"+ 183 | "
"; 184 | 185 | } 186 | 187 | $(".jsReportes").html(inTemplate); 188 | $(".jsPriceTotallVentas").html(" $"+totalDay); 189 | } 190 | 191 | 192 | 193 | 194 | } 195 | showReportes(); 196 | 197 | function savePrice(){ 198 | $(".guardar--ElTotal").click(function(e){ 199 | e.preventDefault(); 200 | 201 | var total = $(".jsPriceTotallVentas").text(); 202 | var fecha = $(".titleReporteDia").text(); 203 | 204 | $.ajax({ 205 | url: "../ventas/savetotalefectivo", 206 | type: "POST", 207 | dataType: "JSON", 208 | contentType: "application/json", 209 | data: JSON.stringify({ 210 | fecha: fecha, 211 | total: total 212 | }), 213 | success: function(data){ 214 | alert('guardado en total'); 215 | }, 216 | error: function(err) { 217 | alert('error'); 218 | } 219 | }); 220 | 221 | }); 222 | } 223 | savePrice(); 224 | 225 | 226 | }); 227 | -------------------------------------------------------------------------------- /routes/pedidos.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | router.get('/', function(req, res, next) { 5 | res.render('pedidos', { 6 | title: 'Pedidos', 7 | username : req.user.username 8 | }); 9 | }); 10 | 11 | 12 | router.post('/save', function(req, res, next){ 13 | 14 | var db = req.db; 15 | 16 | var mesa = req.body.mesa; 17 | //var personas = req.body.personas; 18 | var pedido = req.body.pedido; 19 | var precio = req.body.precio; 20 | var mozo = req.body.mozo; 21 | var codigo = req.body.codigo; 22 | 23 | var collection = db.get('pedidos'); 24 | var pedidoscerrados = db.get('pedidoscerrados'); 25 | 26 | /*Data*/ 27 | var fecha = new Date(); 28 | var hora = fecha.getHours(); 29 | var minutes = fecha.getMinutes(); 30 | var resultadoHora = hora + ":" + minutes; 31 | 32 | var mes = fecha.getMonth(); 33 | var ano = fecha.getFullYear(); 34 | var dia = fecha.getDate(); 35 | 36 | if(mes == 0) { 37 | mes = "Enero"; 38 | } 39 | else if(mes == 1) { 40 | mes = "Febrero"; 41 | } 42 | else if(mes == 2) { 43 | mes = "Marzo"; 44 | } 45 | else if(mes == 3){ 46 | mes = "Abril"; 47 | } 48 | else if(mes == 4) { 49 | mes = "Mayo"; 50 | } 51 | else if(mes == 5) { 52 | mes = "Junio"; 53 | } 54 | else if(mes == 6) { 55 | mes = "Julio"; 56 | } 57 | else if(mes == 7) { 58 | mes = "Agosto"; 59 | } 60 | else if(mes == 8) { 61 | mes = "Septiembre"; 62 | } 63 | else if(mes == 9) { 64 | mes = "Octubre"; 65 | } 66 | else if(mes == 10) { 67 | mes = "Noviembre"; 68 | } 69 | else if(mes == 11){ 70 | mes = "Diciembre"; 71 | } 72 | else { 73 | mes = "Ningun mes se encontro"; 74 | } 75 | var resultadoFecha = "El " + dia + " de " + mes + " del " + ano; 76 | 77 | 78 | /*End Data*/ 79 | 80 | /*collection.insert({ 81 | 'Mesa': mesa, 82 | 'Pedido': pedido, 83 | 'Precio': precio, 84 | 'Mozo': mozo, 85 | 'Estado': 'Ocupado', 86 | 'Hora': resultadoHora, 87 | 'Fecha': resultadoFecha, 88 | 'Codigo': codigo 89 | 90 | }).success(function(doc){ 91 | res.json({inserted: true}); 92 | }).error(function(err){ 93 | console.log('error'); 94 | });*/ 95 | 96 | collection.insert({ 97 | 'Mesa': mesa, 98 | //'Pedido': pedido, 99 | //'Precio': precio, 100 | 'Mozo': mozo, 101 | 'Estado': 'Ocupado', 102 | 'Hora': resultadoHora, 103 | 'Fecha': resultadoFecha, 104 | 'Codigo': codigo, 105 | 106 | }).success(function(doc){ 107 | res.json({inserted: true}); 108 | }).error(function(err){ 109 | console.log('error'); 110 | }); 111 | 112 | 113 | 114 | 115 | pedidoscerrados.insert({ 116 | 'Mesa': mesa, 117 | //'Pedido': pedido, 118 | //'Precio': precio, 119 | 'Mozo': mozo, 120 | 'Estado': 'Cerrado', 121 | 'Hora': resultadoHora, 122 | 'Fecha': resultadoFecha, 123 | 'Codigo': codigo 124 | }); 125 | 126 | 127 | }); 128 | 129 | router.get('/show', function(req, res, next){ 130 | var db = req.db; 131 | var collection = db.get('pedidos'); 132 | 133 | collection.find({}, function(err, doc){ 134 | res.json(doc); 135 | }) 136 | }); 137 | 138 | router.get('/pedidounico/:id', function(req,res, next){ 139 | var id = req.params.id; 140 | var db = req.db; 141 | var pedido = db.get('pedidos'); 142 | pedido.find({'_id': id}, function(err, doc){ 143 | res.json(doc); 144 | }) 145 | }); 146 | 147 | 148 | 149 | //aqui me de borrando el pedido de las mesas 150 | router.post('/show/pedido/:id/', function(req, res, next){ 151 | var db = req.db; 152 | var pedido = db.get('pedidos'); 153 | //var borrar = req.params.borrar; 154 | var pedidoBorrar = req.body.borrar; 155 | var id = req.params.id; 156 | pedido.findOne({'_id': id}, function(err, doc){ 157 | pedido.update( 158 | {'_id': id}, 159 | {$pull :{ 160 | 'Pedido': pedidoBorrar 161 | } 162 | }) 163 | }).success(function(doc){ 164 | console.log('se borro'); 165 | }).error(function(err){ 166 | console.log(err); 167 | }) 168 | }); 169 | 170 | 171 | router.post('/mesas', function(req, res, next) { 172 | 173 | var db = req.db; 174 | 175 | var mesa = req.body.mesa; 176 | 177 | var mozo = req.body.mozo; 178 | 179 | var codigo = req.body.codigo; 180 | 181 | var collection = db.get('mesas'); 182 | 183 | /*Data*/ 184 | var fecha = new Date(); 185 | var hora = fecha.getHours(); 186 | var minutes = fecha.getMinutes(); 187 | var resultadoHora = hora + ":" + minutes; 188 | 189 | var mes = fecha.getMonth(); 190 | var ano = fecha.getFullYear(); 191 | var dia = fecha.getDate(); 192 | 193 | if(mes == 0) { 194 | mes = "Enero"; 195 | } 196 | else if(mes == 1) { 197 | mes = "Febrero"; 198 | } 199 | else if(mes == 2) { 200 | mes = "Marzo"; 201 | } 202 | else if(mes == 3){ 203 | mes = "Abril"; 204 | } 205 | else if(mes == 4) { 206 | mes = "Mayo"; 207 | } 208 | else if(mes == 5) { 209 | mes = "Junio"; 210 | } 211 | else if(mes == 6) { 212 | mes = "Julio"; 213 | } 214 | else if(mes == 7) { 215 | mes = "Agosto"; 216 | } 217 | else if(mes == 8) { 218 | mes = "Septiembre"; 219 | } 220 | else if(mes == 9) { 221 | mes = "Octubre"; 222 | } 223 | else if(mes == 10) { 224 | mes = "Noviembre"; 225 | } 226 | else if(mes == 11){ 227 | mes = "Diciembre"; 228 | } 229 | else { 230 | mes = "Ningun mes se encontro"; 231 | } 232 | var resultadoFecha = "El " + dia + " de " + mes + " del " + ano; 233 | 234 | 235 | /*End Data*/ 236 | 237 | collection.insert({ 238 | 'Mesa': mesa, 239 | 'Estado': 'Ocupado', 240 | 'Hora': resultadoHora, 241 | 'Fecha': resultadoFecha, 242 | 'Codigo': codigo 243 | 244 | }).success(function(doc){ 245 | res.json({inserted: true}); 246 | 247 | }).error(function(err){ 248 | res.json('hubo un error'); 249 | 250 | }); 251 | 252 | }); 253 | 254 | router.get('/showmesas', function(req, res, next) { 255 | var db = req.db; 256 | var collection = db.get('mesas'); 257 | 258 | collection.find({}, function(err, doc){ 259 | res.json(doc); 260 | }); 261 | }); 262 | 263 | router.post('/deletemesas/:idmesas', function(req, res, next) { 264 | var db = req.db; 265 | var collection = db.get('mesas'); 266 | var pedidos = db.get('pedidos'); 267 | 268 | var findId = req.params.idmesas; 269 | 270 | collection.remove({'Codigo': findId}, function(err, doc){ 271 | if(err){ 272 | console.log(err); 273 | } 274 | else { 275 | console.log('Se borro'); 276 | } 277 | }).success(function(){ 278 | console.log('borrado'); 279 | }); 280 | 281 | pedidos.remove({'Codigo': findId}, function(err, doc){ 282 | if(err){ 283 | console.log('error') 284 | } 285 | else { 286 | console.log('borrado'); 287 | } 288 | }).success(function(){ 289 | console.log('borrado'); 290 | }); 291 | }); 292 | 293 | router.get('/ticket/:id', function(req, res, next){ 294 | var db = req.db; 295 | var id = req.params.id; 296 | var collection = db.get('pedidos'); 297 | 298 | collection.find({'_id': id}, function(err, doc){ 299 | res.json(doc); 300 | }); 301 | }); 302 | 303 | module.exports = router; -------------------------------------------------------------------------------- /aplicacion/css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS and IE text size adjust after device orientation change, 6 | * without disabling user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 29 | * and Firefox. 30 | * Correct `block` display not defined for `main` in IE 11. 31 | */ 32 | 33 | article, 34 | aside, 35 | details, 36 | figcaption, 37 | figure, 38 | footer, 39 | header, 40 | hgroup, 41 | main, 42 | menu, 43 | nav, 44 | section, 45 | summary { 46 | display: block; 47 | } 48 | 49 | /** 50 | * 1. Correct `inline-block` display not defined in IE 8/9. 51 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 52 | */ 53 | 54 | audio, 55 | canvas, 56 | progress, 57 | video { 58 | display: inline-block; /* 1 */ 59 | vertical-align: baseline; /* 2 */ 60 | } 61 | 62 | /** 63 | * Prevent modern browsers from displaying `audio` without controls. 64 | * Remove excess height in iOS 5 devices. 65 | */ 66 | 67 | audio:not([controls]) { 68 | display: none; 69 | height: 0; 70 | } 71 | 72 | /** 73 | * Address `[hidden]` styling not present in IE 8/9/10. 74 | * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22. 75 | */ 76 | 77 | [hidden], 78 | template { 79 | display: none; 80 | } 81 | 82 | /* Links 83 | ========================================================================== */ 84 | 85 | /** 86 | * Remove the gray background color from active links in IE 10. 87 | */ 88 | 89 | a { 90 | background-color: transparent; 91 | } 92 | 93 | /** 94 | * Improve readability of focused elements when they are also in an 95 | * active/hover state. 96 | */ 97 | 98 | a:active, 99 | a:hover { 100 | outline: 0; 101 | } 102 | 103 | /* Text-level semantics 104 | ========================================================================== */ 105 | 106 | /** 107 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 108 | */ 109 | 110 | abbr[title] { 111 | border-bottom: 1px dotted; 112 | } 113 | 114 | /** 115 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 116 | */ 117 | 118 | b, 119 | strong { 120 | font-weight: bold; 121 | } 122 | 123 | /** 124 | * Address styling not present in Safari and Chrome. 125 | */ 126 | 127 | dfn { 128 | font-style: italic; 129 | } 130 | 131 | /** 132 | * Address variable `h1` font-size and margin within `section` and `article` 133 | * contexts in Firefox 4+, Safari, and Chrome. 134 | */ 135 | 136 | h1 { 137 | font-size: 2em; 138 | margin: 0.67em 0; 139 | } 140 | 141 | /** 142 | * Address styling not present in IE 8/9. 143 | */ 144 | 145 | mark { 146 | background: #ff0; 147 | color: #000; 148 | } 149 | 150 | /** 151 | * Address inconsistent and variable font size in all browsers. 152 | */ 153 | 154 | small { 155 | font-size: 80%; 156 | } 157 | 158 | /** 159 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 160 | */ 161 | 162 | sub, 163 | sup { 164 | font-size: 75%; 165 | line-height: 0; 166 | position: relative; 167 | vertical-align: baseline; 168 | } 169 | 170 | sup { 171 | top: -0.5em; 172 | } 173 | 174 | sub { 175 | bottom: -0.25em; 176 | } 177 | 178 | /* Embedded content 179 | ========================================================================== */ 180 | 181 | /** 182 | * Remove border when inside `a` element in IE 8/9/10. 183 | */ 184 | 185 | img { 186 | border: 0; 187 | } 188 | 189 | /** 190 | * Correct overflow not hidden in IE 9/10/11. 191 | */ 192 | 193 | svg:not(:root) { 194 | overflow: hidden; 195 | } 196 | 197 | /* Grouping content 198 | ========================================================================== */ 199 | 200 | /** 201 | * Address margin not present in IE 8/9 and Safari. 202 | */ 203 | 204 | figure { 205 | margin: 1em 40px; 206 | } 207 | 208 | /** 209 | * Address differences between Firefox and other browsers. 210 | */ 211 | 212 | hr { 213 | box-sizing: content-box; 214 | height: 0; 215 | } 216 | 217 | /** 218 | * Contain overflow in all browsers. 219 | */ 220 | 221 | pre { 222 | overflow: auto; 223 | } 224 | 225 | /** 226 | * Address odd `em`-unit font size rendering in all browsers. 227 | */ 228 | 229 | code, 230 | kbd, 231 | pre, 232 | samp { 233 | font-family: monospace, monospace; 234 | font-size: 1em; 235 | } 236 | 237 | /* Forms 238 | ========================================================================== */ 239 | 240 | /** 241 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 242 | * styling of `select`, unless a `border` property is set. 243 | */ 244 | 245 | /** 246 | * 1. Correct color not being inherited. 247 | * Known issue: affects color of disabled elements. 248 | * 2. Correct font properties not being inherited. 249 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 250 | */ 251 | 252 | button, 253 | input, 254 | optgroup, 255 | select, 256 | textarea { 257 | color: inherit; /* 1 */ 258 | font: inherit; /* 2 */ 259 | margin: 0; /* 3 */ 260 | } 261 | 262 | /** 263 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 264 | */ 265 | 266 | button { 267 | overflow: visible; 268 | } 269 | 270 | /** 271 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 272 | * All other form control elements do not inherit `text-transform` values. 273 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 274 | * Correct `select` style inheritance in Firefox. 275 | */ 276 | 277 | button, 278 | select { 279 | text-transform: none; 280 | } 281 | 282 | /** 283 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 284 | * and `video` controls. 285 | * 2. Correct inability to style clickable `input` types in iOS. 286 | * 3. Improve usability and consistency of cursor style between image-type 287 | * `input` and others. 288 | */ 289 | 290 | button, 291 | html input[type="button"], /* 1 */ 292 | input[type="reset"], 293 | input[type="submit"] { 294 | -webkit-appearance: button; /* 2 */ 295 | cursor: pointer; /* 3 */ 296 | } 297 | 298 | /** 299 | * Re-set default cursor for disabled elements. 300 | */ 301 | 302 | button[disabled], 303 | html input[disabled] { 304 | cursor: default; 305 | } 306 | 307 | /** 308 | * Remove inner padding and border in Firefox 4+. 309 | */ 310 | 311 | button::-moz-focus-inner, 312 | input::-moz-focus-inner { 313 | border: 0; 314 | padding: 0; 315 | } 316 | 317 | /** 318 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 319 | * the UA stylesheet. 320 | */ 321 | 322 | input { 323 | line-height: normal; 324 | } 325 | 326 | /** 327 | * It's recommended that you don't attempt to style these elements. 328 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 329 | * 330 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 331 | * 2. Remove excess padding in IE 8/9/10. 332 | */ 333 | 334 | input[type="checkbox"], 335 | input[type="radio"] { 336 | box-sizing: border-box; /* 1 */ 337 | padding: 0; /* 2 */ 338 | } 339 | 340 | /** 341 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 342 | * `font-size` values of the `input`, it causes the cursor style of the 343 | * decrement button to change from `default` to `text`. 344 | */ 345 | 346 | input[type="number"]::-webkit-inner-spin-button, 347 | input[type="number"]::-webkit-outer-spin-button { 348 | height: auto; 349 | } 350 | 351 | /** 352 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 353 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome. 354 | */ 355 | 356 | input[type="search"] { 357 | -webkit-appearance: textfield; /* 1 */ 358 | box-sizing: content-box; /* 2 */ 359 | } 360 | 361 | /** 362 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 363 | * Safari (but not Chrome) clips the cancel button when the search input has 364 | * padding (and `textfield` appearance). 365 | */ 366 | 367 | input[type="search"]::-webkit-search-cancel-button, 368 | input[type="search"]::-webkit-search-decoration { 369 | -webkit-appearance: none; 370 | } 371 | 372 | /** 373 | * Define consistent border, margin, and padding. 374 | */ 375 | 376 | fieldset { 377 | border: 1px solid #c0c0c0; 378 | margin: 0 2px; 379 | padding: 0.35em 0.625em 0.75em; 380 | } 381 | 382 | /** 383 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 384 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 385 | */ 386 | 387 | legend { 388 | border: 0; /* 1 */ 389 | padding: 0; /* 2 */ 390 | } 391 | 392 | /** 393 | * Remove default vertical scrollbar in IE 8/9/10/11. 394 | */ 395 | 396 | textarea { 397 | overflow: auto; 398 | } 399 | 400 | /** 401 | * Don't inherit the `font-weight` (applied by a rule above). 402 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 403 | */ 404 | 405 | optgroup { 406 | font-weight: bold; 407 | } 408 | 409 | /* Tables 410 | ========================================================================== */ 411 | 412 | /** 413 | * Remove most spacing between table cells. 414 | */ 415 | 416 | table { 417 | border-collapse: collapse; 418 | border-spacing: 0; 419 | } 420 | 421 | td, 422 | th { 423 | padding: 0; 424 | } 425 | -------------------------------------------------------------------------------- /public/stylesheets/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 29 | * and Firefox. 30 | * Correct `block` display not defined for `main` in IE 11. 31 | */ 32 | 33 | article, 34 | aside, 35 | details, 36 | figcaption, 37 | figure, 38 | footer, 39 | header, 40 | hgroup, 41 | main, 42 | menu, 43 | nav, 44 | section, 45 | summary { 46 | display: block; 47 | } 48 | 49 | /** 50 | * 1. Correct `inline-block` display not defined in IE 8/9. 51 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 52 | */ 53 | 54 | audio, 55 | canvas, 56 | progress, 57 | video { 58 | display: inline-block; /* 1 */ 59 | vertical-align: baseline; /* 2 */ 60 | } 61 | 62 | /** 63 | * Prevent modern browsers from displaying `audio` without controls. 64 | * Remove excess height in iOS 5 devices. 65 | */ 66 | 67 | audio:not([controls]) { 68 | display: none; 69 | height: 0; 70 | } 71 | 72 | /** 73 | * Address `[hidden]` styling not present in IE 8/9/10. 74 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 75 | */ 76 | 77 | [hidden], 78 | template { 79 | display: none; 80 | } 81 | 82 | /* Links 83 | ========================================================================== */ 84 | 85 | /** 86 | * Remove the gray background color from active links in IE 10. 87 | */ 88 | 89 | a { 90 | background-color: transparent; 91 | } 92 | 93 | /** 94 | * Improve readability when focused and also mouse hovered in all browsers. 95 | */ 96 | 97 | a:active, 98 | a:hover { 99 | outline: 0; 100 | } 101 | 102 | /* Text-level semantics 103 | ========================================================================== */ 104 | 105 | /** 106 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 107 | */ 108 | 109 | abbr[title] { 110 | border-bottom: 1px dotted; 111 | } 112 | 113 | /** 114 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 115 | */ 116 | 117 | b, 118 | strong { 119 | font-weight: bold; 120 | } 121 | 122 | /** 123 | * Address styling not present in Safari and Chrome. 124 | */ 125 | 126 | dfn { 127 | font-style: italic; 128 | } 129 | 130 | /** 131 | * Address variable `h1` font-size and margin within `section` and `article` 132 | * contexts in Firefox 4+, Safari, and Chrome. 133 | */ 134 | 135 | h1 { 136 | font-size: 2em; 137 | margin: 0.67em 0; 138 | } 139 | 140 | /** 141 | * Address styling not present in IE 8/9. 142 | */ 143 | 144 | mark { 145 | background: #ff0; 146 | color: #000; 147 | } 148 | 149 | /** 150 | * Address inconsistent and variable font size in all browsers. 151 | */ 152 | 153 | small { 154 | font-size: 80%; 155 | } 156 | 157 | /** 158 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 159 | */ 160 | 161 | sub, 162 | sup { 163 | font-size: 75%; 164 | line-height: 0; 165 | position: relative; 166 | vertical-align: baseline; 167 | } 168 | 169 | sup { 170 | top: -0.5em; 171 | } 172 | 173 | sub { 174 | bottom: -0.25em; 175 | } 176 | 177 | /* Embedded content 178 | ========================================================================== */ 179 | 180 | /** 181 | * Remove border when inside `a` element in IE 8/9/10. 182 | */ 183 | 184 | img { 185 | border: 0; 186 | } 187 | 188 | /** 189 | * Correct overflow not hidden in IE 9/10/11. 190 | */ 191 | 192 | svg:not(:root) { 193 | overflow: hidden; 194 | } 195 | 196 | /* Grouping content 197 | ========================================================================== */ 198 | 199 | /** 200 | * Address margin not present in IE 8/9 and Safari. 201 | */ 202 | 203 | figure { 204 | margin: 1em 40px; 205 | } 206 | 207 | /** 208 | * Address differences between Firefox and other browsers. 209 | */ 210 | 211 | hr { 212 | -moz-box-sizing: content-box; 213 | box-sizing: content-box; 214 | height: 0; 215 | } 216 | 217 | /** 218 | * Contain overflow in all browsers. 219 | */ 220 | 221 | pre { 222 | overflow: auto; 223 | } 224 | 225 | /** 226 | * Address odd `em`-unit font size rendering in all browsers. 227 | */ 228 | 229 | code, 230 | kbd, 231 | pre, 232 | samp { 233 | font-family: monospace, monospace; 234 | font-size: 1em; 235 | } 236 | 237 | /* Forms 238 | ========================================================================== */ 239 | 240 | /** 241 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 242 | * styling of `select`, unless a `border` property is set. 243 | */ 244 | 245 | /** 246 | * 1. Correct color not being inherited. 247 | * Known issue: affects color of disabled elements. 248 | * 2. Correct font properties not being inherited. 249 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 250 | */ 251 | 252 | button, 253 | input, 254 | optgroup, 255 | select, 256 | textarea { 257 | color: inherit; /* 1 */ 258 | font: inherit; /* 2 */ 259 | margin: 0; /* 3 */ 260 | } 261 | 262 | /** 263 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 264 | */ 265 | 266 | button { 267 | overflow: visible; 268 | } 269 | 270 | /** 271 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 272 | * All other form control elements do not inherit `text-transform` values. 273 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 274 | * Correct `select` style inheritance in Firefox. 275 | */ 276 | 277 | button, 278 | select { 279 | text-transform: none; 280 | } 281 | 282 | /** 283 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 284 | * and `video` controls. 285 | * 2. Correct inability to style clickable `input` types in iOS. 286 | * 3. Improve usability and consistency of cursor style between image-type 287 | * `input` and others. 288 | */ 289 | 290 | button, 291 | html input[type="button"], /* 1 */ 292 | input[type="reset"], 293 | input[type="submit"] { 294 | -webkit-appearance: button; /* 2 */ 295 | cursor: pointer; /* 3 */ 296 | } 297 | 298 | /** 299 | * Re-set default cursor for disabled elements. 300 | */ 301 | 302 | button[disabled], 303 | html input[disabled] { 304 | cursor: default; 305 | } 306 | 307 | /** 308 | * Remove inner padding and border in Firefox 4+. 309 | */ 310 | 311 | button::-moz-focus-inner, 312 | input::-moz-focus-inner { 313 | border: 0; 314 | padding: 0; 315 | } 316 | 317 | /** 318 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 319 | * the UA stylesheet. 320 | */ 321 | 322 | input { 323 | line-height: normal; 324 | } 325 | 326 | /** 327 | * It's recommended that you don't attempt to style these elements. 328 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 329 | * 330 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 331 | * 2. Remove excess padding in IE 8/9/10. 332 | */ 333 | 334 | input[type="checkbox"], 335 | input[type="radio"] { 336 | box-sizing: border-box; /* 1 */ 337 | padding: 0; /* 2 */ 338 | } 339 | 340 | /** 341 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 342 | * `font-size` values of the `input`, it causes the cursor style of the 343 | * decrement button to change from `default` to `text`. 344 | */ 345 | 346 | input[type="number"]::-webkit-inner-spin-button, 347 | input[type="number"]::-webkit-outer-spin-button { 348 | height: auto; 349 | } 350 | 351 | /** 352 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 353 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 354 | * (include `-moz` to future-proof). 355 | */ 356 | 357 | input[type="search"] { 358 | -webkit-appearance: textfield; /* 1 */ 359 | -moz-box-sizing: content-box; 360 | -webkit-box-sizing: content-box; /* 2 */ 361 | box-sizing: content-box; 362 | } 363 | 364 | /** 365 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 366 | * Safari (but not Chrome) clips the cancel button when the search input has 367 | * padding (and `textfield` appearance). 368 | */ 369 | 370 | input[type="search"]::-webkit-search-cancel-button, 371 | input[type="search"]::-webkit-search-decoration { 372 | -webkit-appearance: none; 373 | } 374 | 375 | /** 376 | * Define consistent border, margin, and padding. 377 | */ 378 | 379 | fieldset { 380 | border: 1px solid #c0c0c0; 381 | margin: 0 2px; 382 | padding: 0.35em 0.625em 0.75em; 383 | } 384 | 385 | /** 386 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 387 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 388 | */ 389 | 390 | legend { 391 | border: 0; /* 1 */ 392 | padding: 0; /* 2 */ 393 | } 394 | 395 | /** 396 | * Remove default vertical scrollbar in IE 8/9/10/11. 397 | */ 398 | 399 | textarea { 400 | overflow: auto; 401 | } 402 | 403 | /** 404 | * Don't inherit the `font-weight` (applied by a rule above). 405 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 406 | */ 407 | 408 | optgroup { 409 | font-weight: bold; 410 | } 411 | 412 | /* Tables 413 | ========================================================================== */ 414 | 415 | /** 416 | * Remove most spacing between table cells. 417 | */ 418 | 419 | table { 420 | border-collapse: collapse; 421 | border-spacing: 0; 422 | } 423 | 424 | td, 425 | th { 426 | padding: 0; 427 | } 428 | -------------------------------------------------------------------------------- /views/mesas.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='/stylesheets/normalize.css') 7 | link(rel='stylesheet', href='/stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src="/javascripts/mesaslist.js") 10 | script(src='/javascripts/web.js') 11 | body 12 | header.header(data-role="role") 13 | div.header--Cont 14 | div.header--Cont--Iz 15 | figure.header--Cont--Figure 16 | h1.Title 17 | | LaCatedralDelPisco 18 | div.header--Cont--Center 19 | div.Center--Day 20 | article.article 21 | div.article--Icon 22 | i(class="fa fa-sun-o") 23 | div.article--Data 24 | span.title.jsTitleHeader 25 | | ALMUERZO 26 | span.title.jsTitleSubHeader 27 | strong.jsTitleDay 28 | strong.jsTitleMounth 29 | 30 | div.Center--Time 31 | h1.time--Title 32 | div.Center--Clima 33 | div.headder--Cont--De 34 | nav.header--Cont--Nav 35 | ul.ul 36 | li.list 37 | a.link(href="panel", title="Panel Activar Mesas") 38 | i(class="fa fa-cutlery") 39 | li.list 40 | a.link(href="mesas", title="Listado de Mesas, Agregar Pedidos") 41 | i(class="fa fa-shopping-basket") 42 | li.list 43 | a.link(href="ventas", title="Resumen de ventas") 44 | i(class="fa fa-usd") 45 | li.list 46 | a.link(href="modulos", title="Modulos de activación") 47 | i(class="fa fa-cubes") 48 | li.list 49 | a.link(href="administracion", title="Configuración, agregar platos y mozos") 50 | i(class="fa fa-cog") 51 | li.list 52 | i(class="fa fa-user") 53 | | #{username} 54 | div.headerNotify 55 | div.success 56 | h2.title 57 | i(class="fa fa-check-circle") 58 | |Se agrego un pedido correctamente a la 59 | span.mesaNum 60 | 61 | div.background--Mesa 62 | //div.impresion--Success 63 | h2.title 64 | | Se guardo el ticket vendido 65 | div.background--Error 66 | header.header--Error 67 | h2.title 68 | | Error 69 | div.description--Error 70 | p.description 71 | | Ocurrio un error, deberia selecionar una mesa, gracias 72 | section.impresionMesaCerrada.jsTicket 73 | header.impresion--Header 74 | h2.title 75 | | LACATEDRALDELPISCO 76 | div.impresion--SubHeader 77 | strong.titleAvenida 78 | | Av Corrientes 3126 79 | div.impresion.SubHeader 80 | span.titleTel 81 | | Telf: 2071-6424 82 | span.titleInfo 83 | | info@lacatedraldelpisco.com.ar 84 | div.imprension--Cont 85 | div.numTicket 86 | span.title 87 | | Ticket: 88 | span.titleTicket 89 | div.imprension--Mesa 90 | span.title--Mesa.jsMesaDelete.jsMesaAdd 91 | | Mesa 92 | 93 | div.imprension--Cont 94 | div.imprension--Cont--Header 95 | div.cont--Iz 96 | span.title 97 | | Pedido 98 | div.cont--De 99 | span.title 100 | | Total 101 | div.imprension--Cont--Description 102 | div.cont--Iz 103 | span.titleProduct 104 | | Arroz con pollo 105 | div.con--De 106 | span.titleTotall 107 | | $150 108 | div.imprension--Cont--Description-Cont 109 | div.imprension--Cont--Pagos 110 | span.title.jsPagosText 111 | | 112 | 113 | div.imprension--Cont--Totall 114 | div.totall 115 | div.totall--Iz 116 | span.title 117 | | Total: 118 | div.totall--De 119 | span.title 120 | | $48.50 121 | div.imprension--Cont--Descuento 122 | div.descuento 123 | div.descuento--Iz 124 | span.title 125 | | Descuento del: 126 | div.descuento--De 127 | span.title 128 | | $48.50 129 | div.imprension--Cont--Total-Descuento 130 | div.descuento 131 | div.descuento--Iz 132 | span.title 133 | | Total - Descuento: 134 | div.descuento--De 135 | span.title 136 | 137 | 138 | div.imprension--Cont--Fecha--Abierto 139 | span.title 140 | | Abierto: 141 | strong.fecha-Fecha--Abierto 142 | div.imprension--Cont--Fecha 143 | span.title 144 | | Cerrado: 145 | strong.fecha-Fecha 146 | strong.fecha-Hora 147 | 148 | div.imprension--Cont--Gracias 149 | div.decoration 150 | |****************************** 151 | span.title 152 | | GRACIAS POR SU COMPRA LACATEDRALDELPISCO 153 | div.decoration 154 | |****************************** 155 | div.buttons--Cont 156 | div.buttons--Iz 157 | button.sendBtn.sendImprimir 158 | | Imprimir 159 | 160 | div.buttons--De 161 | button.sendBtn.sendGuardar 162 | | Guardar Pedido 163 | div.buttons--Cont 164 | div.buttons--Iz 165 | button.sendBtn.sendHome 166 | | Regresa a inicio 167 | 168 | section.impresionMesaCerrada.jsCocina 169 | header.impresion--Header(style="display:none;") 170 | h2.title 171 | | LACATEDRALDELPISCO 172 | div.impresion--SubHeader 173 | strong.titleAvenida 174 | | Av Corrientes 3126 175 | div.impresion.SubHeader 176 | span.titleTel 177 | | Telf: 2071-6424 178 | span.titleInfo 179 | | info@lacatedraldelpisco.com.ar 180 | div.imprension--Cont 181 | div.numTicket 182 | span.title 183 | | Ultimas Pedidos 184 | span.titleTicket(style="display:none;") 185 | div.imprension--Mesa 186 | span.title--Mesa 187 | | Mesa 188 | div.imprension--Cont 189 | span.title--Mozo 190 | | Mozo: 191 | span.title--Mozo.jsaddMozo 192 | 193 | div.imprension--Cont 194 | div.imprension--Cont--Header(style="display:none;") 195 | div.cont--Iz 196 | span.title 197 | | Pedido 198 | div.cont--De 199 | span.title 200 | | Total 201 | div.imprension--Cont--Description 202 | div.cont--Iz 203 | span.titleProduct 204 | 205 | div.con--De(style="display:none;") 206 | span.titleTotall 207 | 208 | div.imprension--Cont--Description-Cont 209 | div.imprension--Cont--Pagos(style="display:none;") 210 | span.title 211 | | 212 | 213 | 214 | div.impresion--Cont--Gracias 215 | h5.title 216 | |Comentarios 217 | span.title.jsComentarios 218 | 219 | div.imprension--Cont--Gracias 220 | div.decoration 221 | |****************************** 222 | span.title 223 | | GRACIAS POR SU COMPRA LACATEDRALDELPISCO 224 | div.decoration 225 | |****************************** 226 | div.buttons--Cont 227 | div.buttons--Iz 228 | button.sendBtn.sendImprimir 229 | | Imprimir 230 | div.buttons--De 231 | button.sendBtn.sendHome 232 | | Regresa a inicio 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | main 244 | section.content 245 | header.contenido--Header 246 | h2.title 247 | | Mesas > Pedidos 248 | 249 | section.contenido--Details 250 | ul.ul--Details 251 | li.list 252 | | Mesa 253 | li.list 254 | | Pedido 255 | li.list 256 | | Mozo 257 | li.list 258 | | Fecha 259 | div.details--Cont.jsMesasAdd 260 | 261 | 262 | aside.aside 263 | form.aside--Form.jsEditPedidos 264 | div.asi--Form-Header.jsHide 265 | span.title--DataId.jsOcultar 266 | 267 | header.aside--Form--Header 268 | h2.title 269 | span.title--Mesa.jsMesaTT 270 | | Agregar / Cerrar 271 | 272 | div.jsPreload.cssPreload 273 | img(src="../images/ring-alt.svg", alt="") 274 | header.cssPreload--Header 275 | h2.title 276 | | Mozo Creado 277 | div.aside--Form--Fieldset.jsHide 278 | span.idTitle 279 | //div.aside--Form--Fieldset.jsHide 280 | div.fieldset--Iz 281 | label.title 282 | | Personas: 283 | div.fieldset--De 284 | input(type="number", name="jsPersonas") 285 | div.aside--Form--Fieldset.jsHide 286 | div.fieldset--Iz 287 | label.title 288 | | Pedido Actual: 289 | div.fieldset--De 290 | select(name="jsPedidoActual", class="selectPlatosList") 291 | 292 | div.aside--Form--Cont.jsHide.agregar 293 | div.aside--Form--Cont.jsHide.deletePedido 294 | div.aside--Form--Fieldset.jsHide 295 | div.fieldset--Iz.contSum 296 | label.title.labelCont 297 | span.title--Ad.jsAddPedido 298 | | Agregar + 299 | div.jsDeleteSum 300 | label.title.labelCont 301 | span.title--Ad.jsDeleteP 302 | | Eliminar - 303 | div.aside--Form--Fieldset.jsHide 304 | div.fieldset--Iz 305 | label.title 306 | | Descuento 307 | div.fieldset--De 308 | input(type="number", name="descuento") 309 | div.aside--Form--Fieldset.jsHide 310 | div.fieldset--Iz 311 | label.title 312 | | Mozo: 313 | div.fieldset--De 314 | select(name="jsMozo", class="selectMozo") 315 | div.aside--Form--Fieldset.jsHide 316 | div.fieldset--Iz 317 | label.title 318 | | Pago 319 | div.fieldset--De 320 | select(name="jsPago", class="selectPagos") 321 | option(value="Efectivo") 322 | | Efectivo 323 | option(value="Tarjeta") 324 | | Tarjeta 325 | div.aside--Form--Fieldset.jsHide 326 | div.fieldset--Iz 327 | label.title 328 | | Comentarios 329 | textarea#comentarios(style="resize:none;outline:medium none;", name="", cols="37", rows="2") 330 | div.aside--Form--Fieldset.jsHide 331 | input(class="send editPedido", type="submit", value="Editar Pedido") 332 | button(class="send sendPrint", type="button") 333 | i(class="fa fa-floppy-o") 334 | | Cerrar Mesa 335 | div.aside--Form--Fieldset.jsHide 336 | button(class="send cocinaPrint", type="button") 337 | i(class="fa fa-floppy-o") 338 | | Enviar a cocina 339 | 340 | -------------------------------------------------------------------------------- /public/stylesheets/prepros.cfg: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "About This File": "This is Prepros config file, https://prepros.io . Please do not edit this file, doing so can crash Prepros." 4 | }, 5 | { 6 | "data": { 7 | "id": "", 8 | "cfgVersion": 2, 9 | "name": "stylesheets", 10 | "path": "", 11 | "files": { 12 | "db38fc34": { 13 | "id": "db38fc34", 14 | "path": "app.scss", 15 | "output": "app.css", 16 | "name": "app.scss", 17 | "category": "CSS", 18 | "autoCompile": true, 19 | "autoprefixer": false, 20 | "sourceMaps": false, 21 | "libSass": true, 22 | "compass": false, 23 | "fullCompass": false, 24 | "outputStyle": "expanded", 25 | "customOutput": false, 26 | "imported": false, 27 | "parents": [], 28 | "type": "sass" 29 | }, 30 | "aa810382": { 31 | "id": "aa810382", 32 | "path": "style.css", 33 | "output": "style-dist.css", 34 | "name": "style.css", 35 | "category": "CSS", 36 | "autoCompile": false, 37 | "sourceMaps": false, 38 | "compress": true, 39 | "cssnext": false, 40 | "autoprefixer": false, 41 | "customOutput": false, 42 | "imported": false, 43 | "parents": [], 44 | "type": "css" 45 | }, 46 | "d97f19be": { 47 | "id": "d97f19be", 48 | "path": "normalize.css", 49 | "output": "normalize-dist.css", 50 | "name": "normalize.css", 51 | "category": "CSS", 52 | "autoCompile": false, 53 | "sourceMaps": false, 54 | "compress": true, 55 | "cssnext": false, 56 | "autoprefixer": false, 57 | "customOutput": false, 58 | "imported": false, 59 | "parents": [], 60 | "type": "css" 61 | }, 62 | "48c18f6b": { 63 | "id": "48c18f6b", 64 | "path": "app.css", 65 | "output": "app-dist.css", 66 | "name": "app.css", 67 | "category": "CSS", 68 | "autoCompile": false, 69 | "sourceMaps": false, 70 | "compress": true, 71 | "cssnext": false, 72 | "autoprefixer": false, 73 | "customOutput": false, 74 | "imported": false, 75 | "parents": [], 76 | "type": "css" 77 | }, 78 | "826d7671": { 79 | "id": "826d7671", 80 | "path": "homeLogin.scss", 81 | "output": "homeLogin.css", 82 | "name": "homeLogin.scss", 83 | "category": "CSS", 84 | "autoCompile": false, 85 | "autoprefixer": false, 86 | "sourceMaps": false, 87 | "libSass": true, 88 | "compass": false, 89 | "fullCompass": false, 90 | "outputStyle": "expanded", 91 | "customOutput": false, 92 | "imported": true, 93 | "parents": [ 94 | "db38fc34" 95 | ], 96 | "type": "sass" 97 | }, 98 | "9aa8db94": { 99 | "id": "9aa8db94", 100 | "path": "homeLogin.css", 101 | "output": "homeLogin-dist.css", 102 | "name": "homeLogin.css", 103 | "category": "CSS", 104 | "autoCompile": false, 105 | "sourceMaps": false, 106 | "compress": true, 107 | "cssnext": false, 108 | "autoprefixer": false, 109 | "customOutput": false, 110 | "imported": false, 111 | "parents": [], 112 | "type": "css" 113 | }, 114 | "14f1dfbe": { 115 | "id": "14f1dfbe", 116 | "path": "menu.scss", 117 | "output": "menu.css", 118 | "name": "menu.scss", 119 | "category": "CSS", 120 | "autoCompile": false, 121 | "autoprefixer": false, 122 | "sourceMaps": false, 123 | "libSass": true, 124 | "compass": false, 125 | "fullCompass": false, 126 | "outputStyle": "expanded", 127 | "customOutput": false, 128 | "imported": true, 129 | "parents": [ 130 | "db38fc34" 131 | ], 132 | "type": "sass" 133 | }, 134 | "02679be5": { 135 | "id": "02679be5", 136 | "path": "menu.css", 137 | "output": "menu-dist.css", 138 | "name": "menu.css", 139 | "category": "CSS", 140 | "autoCompile": false, 141 | "sourceMaps": false, 142 | "compress": true, 143 | "cssnext": false, 144 | "autoprefixer": false, 145 | "customOutput": false, 146 | "imported": false, 147 | "parents": [], 148 | "type": "css" 149 | }, 150 | "1ffa30ff": { 151 | "id": "1ffa30ff", 152 | "path": "reset.scss", 153 | "output": "reset.css", 154 | "name": "reset.scss", 155 | "category": "CSS", 156 | "autoCompile": false, 157 | "autoprefixer": false, 158 | "sourceMaps": false, 159 | "libSass": true, 160 | "compass": false, 161 | "fullCompass": false, 162 | "outputStyle": "expanded", 163 | "customOutput": false, 164 | "imported": true, 165 | "parents": [ 166 | "db38fc34" 167 | ], 168 | "type": "sass" 169 | } 170 | }, 171 | "deploymentHistory": {}, 172 | "config": { 173 | "watch": "", 174 | "liveRefresh": true, 175 | "useCustomServer": false, 176 | "port": 0, 177 | "useCustomPort": false, 178 | "customServerUrl": "", 179 | "watchedFileExtensions": "less, sass, scss, styl, md, markdown, coffee, js, jade, haml, slim, ls, html,htm, css, rb, php, asp, aspx, cfm, chm, cms, do, erb, jsp, mhtml, mspx, pl, py, shtml, cshtml, cs,vb, vbs, tpl, ctp, kit, png, jpg, jpeg", 180 | "excludePatterns": "Prepros Build, node_modules, .git, .idea, .sass-cache, .hg, .svn, .cache, config.rb, prepros.cfg, .DS_Store, bower_components", 181 | "autoprefixerBrowsers": "last 4 versions", 182 | "liveRefreshDelay": 0, 183 | "disableImportAutoCompile": true, 184 | "browserFlow": { 185 | "enabled": false, 186 | "mouseSync": true, 187 | "scrollSync": true, 188 | "keyboardSync": true, 189 | "animateCss": true 190 | }, 191 | "deployment": { 192 | "ftpHost": "", 193 | "ftpPort": "21", 194 | "ftpUsePrivateKey": false, 195 | "ftpPrivateKey": "", 196 | "ftpRemotePath": "", 197 | "ftpUserName": "", 198 | "ftpPassword": "", 199 | "ftpType": "FTP", 200 | "ftpSecure": false, 201 | "ftpUploadOnModify": false, 202 | "ftpRefreshAfterUpload": false, 203 | "ignorePreprocessableFiles": true, 204 | "copyPath": "Prepros Build", 205 | "excludePatterns": ".map, Prepros Build, config.rb, prepros.cfg, node_modules, .git, .idea, .sass-cache, .hg, .svn, .cache, .DS_Store, bower_components" 206 | }, 207 | "css": { 208 | "path": "css/", 209 | "outputType": "REPLACE_SEGMENT", 210 | "segmentToReplace": "less, sass, stylus, scss, styl", 211 | "segmentToReplaceWith": "css", 212 | "preprocessableFilesDirs": "less/\nsass/\nstylus/\nscss/\nstyl/\n" 213 | }, 214 | "minCss": { 215 | "path": "", 216 | "outputType": "RELATIVE_FILEDIR", 217 | "segmentToReplace": "", 218 | "segmentToReplaceWith": "", 219 | "types": "", 220 | "preprocessableFilesDirs": "", 221 | "filePrefix": "-dist" 222 | }, 223 | "html": { 224 | "segmentToReplace": "jade, haml, slim, markdown, md, kit", 225 | "segmentToReplaceWith": "html", 226 | "path": "html/", 227 | "extension": ".html", 228 | "outputType": "REPLACE_SEGMENT", 229 | "preprocessableFilesDirs": "jade/\nhaml/\nslim/\nmarkdown/\nmd/\nkit" 230 | }, 231 | "js": { 232 | "segmentToReplace": "coffee, coffeescript, coffeescripts, ls, livescript, livescripts", 233 | "segmentToReplaceWith": "html", 234 | "extension": ".html", 235 | "outputType": "REPLACE_SEGMENT", 236 | "preprocessableFilesDirs": "coffee/\ncoffeescript/\ncoffeescripts/\nls/\nlivescript/\nlivescripts", 237 | "path": "js/" 238 | }, 239 | "minJs": { 240 | "path": "", 241 | "outputType": "RELATIVE_FILEDIR", 242 | "segmentToReplace": "", 243 | "segmentToReplaceWith": "", 244 | "types": "", 245 | "preprocessableFilesDirs": "", 246 | "filePrefix": "-dist" 247 | }, 248 | "compilers": { 249 | "less": { 250 | "autoCompile": true, 251 | "autoprefixer": false, 252 | "compress": false, 253 | "sourceMaps": false 254 | }, 255 | "sass": { 256 | "autoCompile": true, 257 | "autoprefixer": false, 258 | "sourceMaps": false, 259 | "libSass": true, 260 | "compass": false, 261 | "fullCompass": false, 262 | "outputStyle": "expanded" 263 | }, 264 | "stylus": { 265 | "autoCompile": true, 266 | "sourceMaps": false, 267 | "autoprefixer": false, 268 | "nib": false, 269 | "compress": false 270 | }, 271 | "markdown": { 272 | "autoCompile": true, 273 | "sanitize": false, 274 | "gfm": true, 275 | "wrapWithHtml": false 276 | }, 277 | "coffee": { 278 | "autoCompile": true, 279 | "bare": false, 280 | "uglify": false, 281 | "mangle": true, 282 | "iced": false, 283 | "sourceMaps": false 284 | }, 285 | "livescript": { 286 | "autoCompile": true, 287 | "bare": false, 288 | "uglify": false, 289 | "mangle": true 290 | }, 291 | "javascript": { 292 | "autoCompile": false, 293 | "uglify": true, 294 | "mangle": true, 295 | "babel": false, 296 | "sourceMaps": false 297 | }, 298 | "jade": { 299 | "autoCompile": true, 300 | "pretty": true 301 | }, 302 | "haml": { 303 | "autoCompile": true, 304 | "pretty": true, 305 | "doubleQuotes": false 306 | }, 307 | "kit": { 308 | "autoCompile": true, 309 | "minifyHtml": false 310 | }, 311 | "slim": { 312 | "autoCompile": true, 313 | "pretty": true, 314 | "indent": "default" 315 | }, 316 | "css": { 317 | "autoCompile": false, 318 | "sourceMaps": false, 319 | "compress": true, 320 | "cssnext": false, 321 | "autoprefixer": false 322 | }, 323 | "uglify": { 324 | "compress": { 325 | "sequences": true, 326 | "properties": true, 327 | "dead_code": true, 328 | "drop_debugger": true, 329 | "unsafe": false, 330 | "unsafe_comps": false, 331 | "conditionals": true, 332 | "comparisons": true, 333 | "evaluate": true, 334 | "booleans": true, 335 | "loops": true, 336 | "unused": true, 337 | "hoist_funs": true, 338 | "keep_fargs": false, 339 | "hoist_vars": false, 340 | "if_return": true, 341 | "join_vars": true, 342 | "cascade": true, 343 | "side_effects": true, 344 | "pure_getters": false, 345 | "negate_iife": true, 346 | "screw_ie8": false, 347 | "drop_console": false, 348 | "angular": false, 349 | "warnings": true, 350 | "pure_funcs": null, 351 | "global_defs": null 352 | }, 353 | "output": { 354 | "quote_keys": false, 355 | "space_colon": true, 356 | "ascii_only": false, 357 | "unescape_regexps": false, 358 | "inline_script": false, 359 | "beautify": false, 360 | "bracketize": false, 361 | "semicolons": true, 362 | "comments": false, 363 | "preserve_line": false, 364 | "screw_ie8": false, 365 | "preamble": null 366 | } 367 | } 368 | } 369 | } 370 | } 371 | } 372 | ] -------------------------------------------------------------------------------- /views/panel.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html(lang='es') 3 | head 4 | meta(charset='UTF-8') 5 | title #{title} 6 | link(rel='stylesheet', href='stylesheets/normalize.css') 7 | link(rel='stylesheet', href='stylesheets/app.css') 8 | script(src='http://code.jquery.com/jquery-2.1.4.min.js') 9 | script(src='javascripts/jquery.cookie.js') 10 | script(src='javascripts/app.js') 11 | 12 | script(src='javascripts/web.js') 13 | script(src='javascripts/deleteMesas.js') 14 | body 15 | header.header(data-role="role") 16 | div.header--Cont 17 | div.header--Cont--Iz 18 | figure.header--Cont--Figure 19 | h1.Title 20 | | LaCatedralDelPisco 21 | div.header--Cont--Center 22 | div.Center--Day 23 | article.article 24 | div.article--Icon 25 | i(class="fa fa-sun-o") 26 | div.article--Data 27 | span.title.jsTitleHeader 28 | | ALMUERZO 29 | span.title.jsTitleSubHeader 30 | strong.jsTitleDay 31 | strong.jsTitleMounth 32 | 33 | div.Center--Time 34 | h1.time--Title 35 | div.Center--Clima 36 | div.headder--Cont--De 37 | nav.header--Cont--Nav 38 | ul.ul 39 | li.list 40 | a.link(href="panel", title="Panel Activar Mesas") 41 | i(class="fa fa-cutlery") 42 | li.list 43 | a.link(href="mesas", title="Listado de Mesas, Agregar Pedidos") 44 | i(class="fa fa-shopping-basket") 45 | li.list 46 | a.link(href="ventas", title="Resumen de ventas") 47 | i(class="fa fa-usd") 48 | li.list 49 | a.link(href="modulos", title="Modulos de activación") 50 | i(class="fa fa-cubes") 51 | li.list 52 | a.link(href="administracion", title="Configuración, agregar platos y mozos") 53 | i(class="fa fa-cog") 54 | li.list 55 | i(class="fa fa-user") 56 | | #{username} 57 | main 58 | section.content 59 | div.content-Mesa--Iz 60 | figure.content--Bano 61 | h2.title 62 | | Baño 63 | figure.content--Mesa 64 | img(src="images/mesa.png", alt="Mesa 1") 65 | div.content--Mesa--Number 66 | span.titleIdMesa.cssNone 67 | | i1 68 | span.titleMesa 69 | | Mesa 1 70 | figure.content--Mesa 71 | img(src="images/mesa.png") 72 | div.content--Mesa--Number 73 | span.titleIdMesa.cssNone 74 | | i2 75 | span.titleMesa 76 | | Mesa 2 77 | figure.content--Mesa 78 | img(src="images/mesa.png") 79 | div.content--Mesa--Number 80 | span.titleIdMesa.cssNone 81 | | i3 82 | span.titleMesa 83 | | Mesa 3 84 | figure.content--Mesa 85 | img(src="images/mesa.png") 86 | div.content--Mesa--Number 87 | span.titleIdMesa.cssNone 88 | | i4 89 | span.titleMesa 90 | | Mesa 4 91 | figure.content--Mesa 92 | img(src="images/mesa.png") 93 | div.content--Mesa--Number 94 | span.titleIdMesa.cssNone 95 | | i5 96 | span.titleMesa 97 | | Mesa C5 98 | 99 | div.content-Mesa--Center 100 | figure.content--Mesa.mesaRectangular 101 | img(src="images/mesa.png") 102 | div.content--Mesa--Number 103 | span.titleIdMesa.cssNone 104 | | i6 105 | span.titleMesa 106 | | Mesa 6 107 | div.content--Mesas-Dos 108 | figure.content--Mesa 109 | img(src="images/mesa.png") 110 | div.content--Mesa--Number 111 | span.titleIdMesa.cssNone 112 | | i7 113 | span.titleMesa 114 | | Mesa 7 115 | figure.content--Mesa 116 | img(src="images/mesa.png") 117 | div.content--Mesa--Number 118 | span.titleIdMesa.cssNone 119 | | i8 120 | span.titleMesa 121 | | Mesa 8 122 | div.content--Mesas-Dos 123 | figure.content--Mesa 124 | img(src="images/mesa.png") 125 | div.content--Mesa--Number 126 | span.titleIdMesa.cssNone 127 | | i9 128 | span.titleMesa 129 | | Mesa 9 130 | figure.content--Mesa 131 | img(src="images/mesa.png") 132 | div.content--Mesa--Number 133 | span.titleIdMesa.cssNone 134 | | b1 135 | span.titleMesa 136 | | Mesa 10 137 | div.content--Mesas-Dos 138 | figure.content--Mesa 139 | img(src="images/mesa.png") 140 | div.content--Mesa--Number 141 | span.titleIdMesa.cssNone 142 | | b2 143 | span.titleMesa 144 | | Mesa 11 145 | figure.content--Mesa 146 | img(src="images/mesa.png") 147 | div.content--Mesa--Number 148 | span.titleIdMesa.cssNone 149 | | b3 150 | span.titleMesa 151 | | Mesa 12 152 | figure.content--Mesa.mesaRectangular 153 | img(src="images/mesa.png") 154 | div.content--Mesa--Number 155 | span.titleIdMesa.cssNone 156 | | b4 157 | span.titleMesa 158 | | Mesa 13 159 | div.content--Mesas-Dos 160 | figure.content--Mesa 161 | img(src="images/mesa.png") 162 | div.content--Mesa--Number 163 | span.titleIdMesa.cssNone 164 | | b5 165 | span.titleMesa 166 | | Mesa 14 167 | figure.content--Mesa 168 | img(src="images/mesa.png") 169 | div.content--Mesa--Number 170 | span.titleIdMesa.cssNone 171 | | b6 172 | span.titleMesa 173 | | Mesa 15 174 | figure.content--Mesa.mesaRectangular 175 | img(src="images/mesa.png") 176 | div.content--Mesa--Number 177 | span.titleIdMesa.cssNone 178 | | b7 179 | span.titleMesa 180 | | Mesa 16 181 | figure.content--Mesa.mesaRectangular 182 | img(src="images/mesa.png") 183 | div.content--Mesa--Number 184 | span.titleIdMesa.cssNone 185 | | b8 186 | span.titleMesa 187 | | Mesa 17 188 | div.content--Mesas-Dos 189 | figure.content--Mesa 190 | img(src="images/mesa.png") 191 | div.content--Mesa--Number 192 | span.titleIdMesa.cssNone 193 | | b9 194 | span.titleMesa 195 | | Mesa 18 196 | figure.content--Mesa 197 | img(src="images/mesa.png") 198 | div.content--Mesa--Number 199 | span.titleIdMesa.cssNone 200 | | c1 201 | span.titleMesa 202 | | Mesa 19 203 | div.content--Mesas-Dos 204 | div.content--Mesas--One 205 | figure.content--Mesa 206 | img(src="images/mesa.png") 207 | div.content--Mesa--Number 208 | span.titleIdMesa.cssNone 209 | | c2 210 | span.titleMesa 211 | | Mesa 20 212 | figure.content--Mesa 213 | img(src="images/mesa.png") 214 | div.content--Mesa--Number 215 | span.titleIdMesa.cssNone 216 | | c3 217 | span.titleMesa 218 | | Mesa 21 219 | 220 | div.content--Mesas-Large 221 | figure.content--Mesa.mesaLarge 222 | img(src="images/mesa.png") 223 | div.content--Mesa--Number 224 | span.titleIdMesa.cssNone 225 | | c4 226 | span.titleMesa 227 | | Mesa 22 228 | div.content--Mesas-Dos 229 | figure.content--Mesa 230 | img(src="images/mesa.png") 231 | div.content--Mesa--Number 232 | span.titleIdMesa.cssNone 233 | | c5 234 | span.titleMesa 235 | | Mesa 23 236 | figure.content--Mesa 237 | img(src="images/mesa.png") 238 | div.content--Mesa--Number 239 | span.titleIdMesa.cssNone 240 | | c6 241 | span.titleMesa 242 | | Mesa 24 243 | div.content--Mesas-Dos 244 | figure.content--Mesa 245 | img(src="images/mesa.png") 246 | div.content--Mesa--Number 247 | span.titleIdMesa.cssNone 248 | | c7 249 | span.titleMesa 250 | | Mesa 25 251 | figure.content--Mesa 252 | img(src="images/mesa.png") 253 | div.content--Mesa--Number 254 | span.titleIdMesa.cssNone 255 | | c8 256 | span.titleMesa 257 | | Mesa 26 258 | div.content--Mesas-Dos 259 | figure.content--Mesa 260 | img(src="images/mesa.png") 261 | div.content--Mesa--Number 262 | span.titleIdMesa.cssNone 263 | | c9 264 | span.titleMesa 265 | | Mesa 27 266 | figure.content--Mesa 267 | img(src="images/mesa.png") 268 | div.content--Mesa--Number 269 | span.titleIdMesa.cssNone 270 | | h1 271 | span.titleMesa 272 | | Mesa 28 273 | div.content--Mesas-Dos 274 | figure.content--Mesa 275 | img(src="images/mesa.png") 276 | div.content--Mesa--Number 277 | span.titleIdMesa.cssNone 278 | | h2 279 | span.titleMesa 280 | | Mesa 29 281 | figure.content--Mesa 282 | img(src="images/mesa.png") 283 | div.content--Mesa--Number 284 | span.titleIdMesa.cssNone 285 | | h3 286 | span.titleMesa 287 | | Mesa 30 288 | 289 | div.content-Mesa--De 290 | figure.content--Mesa 291 | img(src="images/mesa.png") 292 | div.content--Mesa--Number 293 | span.titleIdMesa.cssNone 294 | | h4 295 | span.titleMesa 296 | | Mesa 31 297 | figure.content--Mesa 298 | img(src="images/mesa.png") 299 | div.content--Mesa--Number 300 | span.titleIdMesa.cssNone 301 | | h5 302 | span.titleMesa 303 | | Mesa 32 304 | figure.content--Mesa.mesaRectangular 305 | img(src="images/mesa.png") 306 | div.content--Mesa--Number 307 | span.titleIdMesa.cssNone 308 | | h6 309 | span.titleMesa 310 | | Mesa 33 311 | figure.content--Mesa.mesaRectangular 312 | img(src="images/mesa.png") 313 | div.content--Mesa--Number 314 | span.titleIdMesa.cssNone 315 | | h7 316 | span.titleMesa 317 | | Mesa 34 318 | figure.content--Mesa.mesaRectangular 319 | img(src="images/mesa.png") 320 | div.content--Mesa--Number 321 | span.titleIdMesa.cssNone 322 | | h8 323 | span.titleMesa 324 | | Mesa 35 325 | figure.content--Mesa.mesaRectangular 326 | img(src="images/mesa.png") 327 | div.content--Mesa--Number 328 | span.titleIdMesa.cssNone 329 | | u1 330 | span.titleMesa 331 | | Mesa 36 332 | figure.content--Mesa.mesaLarge 333 | img(src="images/mesa.png") 334 | div.content--Mesa--Number 335 | span.titleIdMesa.cssNone 336 | | u2 337 | span.titleMesa 338 | | Mesa 37 339 | figure.content--Mesa.mesaLarge 340 | img(src="images/mesa.png") 341 | div.content--Mesa--Number 342 | span.titleIdMesa.cssNone 343 | | u3 344 | span.titleMesa 345 | | Mesa 38 346 | figure.content--Mesa.mesaLarge 347 | img(src="images/mesa.png") 348 | div.content--Mesa--Number 349 | span.titleIdMesa.cssNone 350 | | u4 351 | span.titleMesa 352 | | Mesa 39 353 | figure.content--Mesa.mesaLarge 354 | img(src="images/mesa.png") 355 | div.content--Mesa--Number 356 | span.titleIdMesa.cssNone 357 | | u4 358 | span.titleMesa 359 | | Mesa 40 360 | 361 | aside.aside 362 | form.aside--Form.jsPedidos 363 | header.aside--Form--Header 364 | span.titleCode.jsCodigoMesa.cssNone 365 | 366 | h2.title.jsPedidosMesa 367 | | Mesa 1 368 | div.jsPreload.cssPreload 369 | img(src="../images/ring-alt.svg", alt="") 370 | header.cssPreload--Header 371 | h2.title 372 | | Mesa Abierta 373 | //div.aside--Form--Fieldset 374 | div.fieldset--Iz 375 | label.title 376 | | Personas: 377 | div.fieldset--De 378 | input(type="number", name="jsPersonas") 379 | div.aside--Form--Fieldset 380 | div.fieldset--Iz 381 | label.title 382 | | Pedido: 383 | div.fieldset--De 384 | select(name="jsPedido", class="selectPlatosList" required title="Selecione un pedido") 385 | div.aside--Form--Fieldset 386 | div.fieldset--Iz 387 | label.title 388 | | Mozo: 389 | div.fieldset--De 390 | select(name="jsMozo", class="selectSalon") 391 | div.aside--Form--Fieldset 392 | input(class="send", type="submit", value="Abrir Mesa") 393 | form.aside--Form.jsMesasDisponibilidad 394 | header.aside--Form--Header 395 | h2.title.jsMesasHabilities 396 | | Deshabilitar Mesas 397 | div.aside--Form--Fieldset 398 | div.fieldset--Iz 399 | label.title 400 | | Ocupado: 401 | div.fieldset--De 402 | select(name="jsMesasOccupe", class="mesasOccupe") 403 | option(value="borrarMesa") 404 | | Selecionar Mesa 405 | div.aside--Form--Fieldset 406 | input(class="send sendDelete", type="submit", value="Eliminar Mesa") 407 | 408 | 409 | -------------------------------------------------------------------------------- /public/javascripts/copiamesas.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | var cantPedidos = " "; 4 | var pedido = ""; 5 | 6 | function addPedidos(){ 7 | var API = "pedidos/show"; 8 | $.getJSON(API, success, false); 9 | 10 | function success(data) { 11 | 12 | var template = ""; 13 | var Adicionales; 14 | 15 | for(var i = 0; i < data.length; i++) { 16 | var dataPedidos = data[i].Adicionales; 17 | Adicionales = data[i].Adicionales; 18 | 19 | 20 | 21 | 22 | var mesa = data[i].Mesa; 23 | var pedido = data[i].Pedido; 24 | var mozo = data[i].Mozo; 25 | var fecha = data[i].Hora; 26 | var id = data[i]._id; 27 | var dataOkey = "Si"; 28 | var persona = data[i].Personas; 29 | 30 | template += "
" + 31 | "
"+ 32 | ""+ 33 | ""+ 34 | ""+mesa+""+ 35 | "
"+ 36 | ""+ 39 | "
"+ 40 | ""+mozo+""+ 41 | "
"+ 42 | "
"+ 43 | ""+ 44 | fecha+ 45 | ""+ 46 | "
"+ 47 | "
"; 48 | } 49 | 50 | if(Adicionales) { 51 | for(var i = 0; i < Adicionales.length; i++) { 52 | console.log(Adicionales[i]); 53 | if(Adicionales[i].PedidosCant) { 54 | console.log('a'); 55 | } 56 | 57 | } 58 | } 59 | 60 | $(".jsMesasAdd").html(template); 61 | 62 | //to modify pedidos 63 | $(".mesasSelect").click(function(){ 64 | var id = $(this).find('.details--Name .id').text(); 65 | var mesa = $(this).find('.details--Name .title').text(); 66 | var personas = $(this).find('.details--Name .persona').text(); 67 | var pedido = $(this).find('.jsPedido .title').text(); 68 | var moso = $(this).find('.details--Celu .title').text(); 69 | //alert(id); 70 | $(".jsMesaTT").text(mesa); 71 | //alert(pedido); 72 | 73 | $(".jsEditPedidos .idTitle").text(id); 74 | $(".jsEditPedidos input[name='jsPersonas']").val(personas); 75 | 76 | 77 | var templateMesa = ""; 80 | 81 | var template = ""; 84 | $(".jsEditPedidos select[name='jsPedidoActual']").html(template); 85 | 86 | $(".selectMozo").html(templateMesa); 87 | 88 | //to class} 89 | //unbind, siblings, 90 | $(this).addClass('itemSelect').siblings().removeClass('itemSelect'); 91 | 92 | 93 | }); 94 | 95 | } 96 | 97 | 98 | } 99 | addPedidos(); 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | function roomPedidos(){ 111 | 112 | 113 | 114 | $(".contSum label .title--Ad").on('click', function(){ 115 | 116 | 117 | function pedidosMesas() { 118 | function platosSalon() { 119 | 120 | var APIBEBIDAS = "administracion/platoslist/bebidas"; 121 | 122 | $.getJSON(APIBEBIDAS, bebidas, false); 123 | 124 | function bebidas(data) { 125 | var template = ""; 126 | var optgroup = ""; 127 | var dataId; 128 | var optgroupLabel = ""; 129 | var precio = ""; 130 | for(var i = 0; i < data.length; i++) { 131 | dataId = data[i]._id; 132 | dataName = data[i].Bebidas.Nombre; 133 | optgroupLabel = data[i].Bebidas.Categoria; 134 | precio = data[i].Bebidas.Precio; 135 | template += "" 138 | } 139 | optgroup = ""+ 140 | template 141 | "" 142 | 143 | $(".selectPlatosMesasList").append(optgroup); 144 | } 145 | 146 | 147 | 148 | } 149 | 150 | platosSalon(); 151 | 152 | function platosEntradas() { 153 | 154 | var APIBEBIDAS = "administracion/platoslist/entradas"; 155 | 156 | $.getJSON(APIBEBIDAS, entradas, false); 157 | 158 | function entradas(data) { 159 | var template = ""; 160 | var optgroup = ""; 161 | var dataId; 162 | var optgroupLabel = ""; 163 | var precio = ""; 164 | for(var i = 0; i < data.length; i++) { 165 | dataId = data[i]._id; 166 | dataName = data[i].Entradas.Nombre; 167 | optgroupLabel = data[i].Entradas.Categoria; 168 | precio = data[i].Entradas.Precio 169 | template += "" 172 | } 173 | optgroup = ""+ 174 | template 175 | "" 176 | 177 | $(".selectPlatosMesasList").append(optgroup); 178 | } 179 | 180 | 181 | 182 | } 183 | 184 | platosEntradas(); 185 | 186 | function platosMenus() { 187 | 188 | var APIBEBIDAS = "administracion/platoslist/menus"; 189 | 190 | $.getJSON(APIBEBIDAS, menus, false); 191 | 192 | function menus(data) { 193 | var template = ""; 194 | var optgroup = ""; 195 | var dataId; 196 | var optgroupLabel = ""; 197 | var precio = ""; 198 | for(var i = 0; i < data.length; i++) { 199 | dataId = data[i]._id; 200 | dataName = data[i].Menus.Nombre; 201 | optgroupLabel = data[i].Menus.Categoria; 202 | precio = data[i].Menus.Precio; 203 | template += "" 206 | } 207 | optgroup = ""+ 208 | template 209 | "" 210 | 211 | $(".selectPlatosMesasList").append(optgroup); 212 | } 213 | 214 | 215 | 216 | } 217 | 218 | platosMenus(); 219 | 220 | 221 | function platosCarta() { 222 | 223 | var APIBEBIDAS = "administracion/platoslist/platoscarta"; 224 | 225 | $.getJSON(APIBEBIDAS, carta, false); 226 | 227 | function carta(data) { 228 | var template = ""; 229 | var optgroup = ""; 230 | var dataId; 231 | var optgroupLabel = ""; 232 | var precio = ""; 233 | for(var i = 0; i < data.length; i++) { 234 | dataId = data[i]._id; 235 | dataName = data[i].carta.Nombre; 236 | optgroupLabel = data[i].carta.Categoria; 237 | precio = data[i].carta.Precio; 238 | template += "" 241 | } 242 | optgroup = ""+ 243 | template 244 | "" 245 | 246 | $(".selectPlatosMesasList").append(optgroup); 247 | } 248 | 249 | 250 | 251 | } 252 | 253 | platosCarta(); 254 | 255 | } 256 | 257 | pedidosMesas(); 258 | 259 | var pedidosMas = 260 | "
" + 261 | 262 | "
"+ 263 | 264 | ""+ 265 | "
"+ 266 | 267 | "
"+ 268 | "" + 271 | "
" + 272 | "
"; 273 | var a = $(".agregar").append(pedidosMas); 274 | 275 | cant = $(".conSumSet"); 276 | 277 | 278 | 279 | $(".selectPlatosMesasList").change(function(){ 280 | 281 | $(".selectPlatosMesasList option:selected").each(function(){ 282 | pedido = $(this).text() + " "; 283 | }); 284 | 285 | 286 | }); 287 | 288 | }); 289 | 290 | 291 | } 292 | roomPedidos(); 293 | 294 | 295 | 296 | function saveModify() { 297 | 298 | 299 | 300 | 301 | 302 | 303 | $(".editPedido").click(function(e){ 304 | 305 | e.preventDefault(); 306 | 307 | var pedidosCantidad = ""; 308 | var pedidoAdicional = ""; 309 | var valueSelect = ""; 310 | var title = "PedidosAdicionales" 311 | var contTitle = ""; 312 | for( var i = 0; i < cant.length; i++) { 313 | 314 | var a = cant[i]; 315 | contTitle = title + [i]; 316 | pedidoAdicional = "PedidoAdicional"; 317 | valueSelect += $(a).find("select[name='jsPedidoMas'] option:selected").text(); 318 | 319 | } 320 | 321 | var id = $(".idTitle").text(); 322 | $.ajax({ 323 | url: "mesas/edit/" + id, 324 | type: "POST", 325 | dataType: "JSON", 326 | contentType: "application/json", 327 | data: JSON.stringify({ 328 | mesa: $(".jsEditPedidos .jsMesaTT").text(), 329 | personas: $(".jsEditPedidos input[name='jsPersonas']").val(), 330 | pedido: $(".jsEditPedidos select[name='jsPedidoActual']").val(), 331 | pedidosCant0: { 332 | Pedido: $(".jsEditPedidos .conSumSet:first-child .selectPlatosMesasList option:selected").html(), 333 | Precio: $(".jsEditPedidos .conSumSet:first-child select[name='jsPedidoMas']").val() 334 | }, 335 | pedidosCant1: { 336 | Pedido: $(".jsEditPedidos .conSumSet:first-child .selectPlatosMesasList option:selected").html(), 337 | Precio: $(".jsEditPedidos .conSumSet:first-child select[name='jsPedidoMas']").val() 338 | }, 339 | pedidosCant2: { 340 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(2) .selectPlatosMesasList option:selected").html(), 341 | Precio: $(".jsEditPedidos .conSumSet:nth-child(2) select[name='jsPedidoMas']").val() 342 | }, 343 | pedidosCant3: { 344 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(3) .selectPlatosMesasList option:selected").html(), 345 | Precio: $(".jsEditPedidos .conSumSet:nth-child(3) select[name='jsPedidoMas']").val() 346 | }, 347 | pedidosCant4: { 348 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(4) .selectPlatosMesasList option:selected").html(), 349 | Precio: $(".jsEditPedidos .conSumSet:nth-child(4) select[name='jsPedidoMas']").val() 350 | }, 351 | pedidosCant5: { 352 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(5) .selectPlatosMesasList option:selected").html(), 353 | Precio: $(".jsEditPedidos .conSumSet:nth-child(5) select[name='jsPedidoMas']").val() 354 | }, 355 | pedidosCant6: { 356 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(6) .selectPlatosMesasList option:selected").html(), 357 | Precio: $(".jsEditPedidos .conSumSet:nth-child(6) select[name='jsPedidoMas']").val() 358 | }, 359 | pedidosCant7: { 360 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(7) .selectPlatosMesasList option:selected").html(), 361 | Precio: $(".jsEditPedidos .conSumSet:nth-child(7) select[name='jsPedidoMas']").val() 362 | }, 363 | pedidosCant8: { 364 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(8) .selectPlatosMesasList option:selected").html(), 365 | Precio: $(".jsEditPedidos .conSumSet:nth-child(8) select[name='jsPedidoMas']").val() 366 | }, 367 | pedidosCant9: { 368 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(9) .selectPlatosMesasList option:selected").html(), 369 | Precio: $(".jsEditPedidos .conSumSet:nth-child(9) select[name='jsPedidoMas']").val() 370 | }, 371 | pedidosCant10: { 372 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(10) .selectPlatosMesasList option:selected").html(), 373 | Precio: $(".jsEditPedidos .conSumSet:nth-child(10) select[name='jsPedidoMas']").val() 374 | }, 375 | pedidosCant11: { 376 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(11) .selectPlatosMesasList option:selected").html(), 377 | Precio: $(".jsEditPedidos .conSumSet:nth-child(11) select[name='jsPedidoMas']").val() 378 | }, 379 | pedidosCant12: { 380 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(12) .selectPlatosMesasList option:selected").html(), 381 | Precio: $(".jsEditPedidos .conSumSet:nth-child(12) select[name='jsPedidoMas']").val() 382 | }, 383 | pedidosCant13: { 384 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(13) .selectPlatosMesasList option:selected").html(), 385 | Precio: $(".jsEditPedidos .conSumSet:nth-child(13) select[name='jsPedidoMas']").val() 386 | }, 387 | pedidosCant14: { 388 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(14) .selectPlatosMesasList option:selected").html(), 389 | Precio: $(".jsEditPedidos .conSumSet:nth-child(14) select[name='jsPedidoMas']").val() 390 | }, 391 | pedidosCant15: { 392 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(15) .selectPlatosMesasList option:selected").html(), 393 | Precio: $(".jsEditPedidos .conSumSet:nth-child(15) select[name='jsPedidoMas']").val() 394 | }, 395 | pedidosCant16: { 396 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(16) .selectPlatosMesasList option:selected").html(), 397 | Precio: $(".jsEditPedidos .conSumSet:nth-child(16) select[name='jsPedidoMas']").val() 398 | }, 399 | pedidosCant17: { 400 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(17) .selectPlatosMesasList option:selected").html(), 401 | Precio: $(".jsEditPedidos .conSumSet:nth-child(17) select[name='jsPedidoMas']").val() 402 | }, 403 | pedidosCant18: { 404 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(18) .selectPlatosMesasList option:selected").html(), 405 | Precio: $(".jsEditPedidos .conSumSet:nth-child(18) select[name='jsPedidoMas']").val() 406 | }, 407 | pedidosCant19: { 408 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(19) .selectPlatosMesasList option:selected").html(), 409 | Precio: $(".jsEditPedidos .conSumSet:nth-child(19) select[name='jsPedidoMas']").val() 410 | }, 411 | pedidosCant20: { 412 | Pedido: $(".jsEditPedidos .conSumSet:nth-child(20) .selectPlatosMesasList option:selected").html(), 413 | Precio: $(".jsEditPedidos .conSumSet:nth-child(20) select[name='jsPedidoMas']").val() 414 | }, 415 | mozo: $(".jsEditPedidos select[name='jsMozo']").val() 416 | }), 417 | success: function(data) { 418 | alert('done'); 419 | //alert(cant); 420 | 421 | }, 422 | error: function(err) { 423 | alert('fail'); 424 | } 425 | }); 426 | 427 | 428 | 429 | 430 | }); 431 | 432 | 433 | } 434 | saveModify(); 435 | 436 | 437 | 438 | }); --------------------------------------------------------------------------------