diff --git a/.gitignore b/.gitignore index 8f02e89..ef33de4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ test/ node_modules/ +src/public/files/ diff --git a/src/app.js b/src/app.js index 782a5f5..88de483 100644 --- a/src/app.js +++ b/src/app.js @@ -5,7 +5,7 @@ const mysql = require('mysql'); const cloud_file = require('express-fileupload'); const myConecction = require('express-myconnection'); -var puerto = 3001 +var puerto = 3001; const app = express(); //importando rutas @@ -21,7 +21,7 @@ app.set('views',path.join(__dirname, 'views')); //app.set('vistas',path.join(__dirname, 'vistas')); //middlewares - +app.use(express.static(__dirname+'/public'));//para usar la carpeta public *js*css*img app.use(morgan('dev')); app.use(myConecction(mysql,{ //host:'192.168.10.50', @@ -37,7 +37,7 @@ app.use(express.urlencoded({limit:'25mb',extended:false})); // //app.use(cloud_file); app.use(cloud_file({ - limits: { fileSize: 50 * 1024 * 1024 }, + limits: { fileSize: 50000 * 1024 * 1024 }, })); //rutas diff --git a/src/controladores/controlador_Items.js b/src/controladores/controlador_Items.js index e6da397..b445c8a 100644 --- a/src/controladores/controlador_Items.js +++ b/src/controladores/controlador_Items.js @@ -1,4 +1,5 @@ const controlador = {}; +const fs = require('fs'); controlador.verItemsJson = (req, res) => { req.getConnection((err, conn) => { @@ -174,6 +175,13 @@ controlador.app_consultaItemsPrecios = (req,res) => { where grupo_precio = ? and (nombre like ? or descripcion like ?)` ,[grupo,item,item],(err,rows)=>{ //res.json(rows); + //if(err) return res.status(500).send("Error en Consulta de Items"); + rows.map( + dat => { + //console.log(var_b64(dat.imagen)); + //fs.writeFileSync(path.join(__dirname,"../img/db_img"+image.codigo_prdcto+".png"),image.imagen); + } + ) res.json(rows); console.log(err); //res.render('clientesV',{ data:rows }); @@ -181,6 +189,21 @@ controlador.app_consultaItemsPrecios = (req,res) => { }); }; +let blob_b64 = (blob) =>{ + return new Promise((resolve,reject)=>{ + const reader = new FileReader(); + reader.readAsDataURL(blob); + reader.onloadend = () => { + resolve(reader.result); + } + }) +}; + +var_b64 = (blob) => { + const reader = new FileReader(); + return reader.readAsDataURL(blob); +}; + //********* CONSULTA ADICIONALES X MODIFICAR ********// controlador.cierresCaja = (req, res) => { req.getConnection((err, conn) => { diff --git a/src/controladores/controlador_cloud.js b/src/controladores/controlador_cloud.js index 36fc396..542c8ab 100644 --- a/src/controladores/controlador_cloud.js +++ b/src/controladores/controlador_cloud.js @@ -25,11 +25,11 @@ const procesarPath = (path) => { const fs = require('fs'); function leer_dir(dir){ var json = []; - var files = fs.readdirSync(dirPath); + var files = fs.readdirSync(dirPath,{ withFileTypes: true }); files.forEach(function(arch,idx){ - json.push({"indice": idx, "archivo": arch}); + json.push({"indice": idx, "archivo": arch.name,"link":"files/"+arch}); + //console.log(arch.name); }); - //console.log(json); return json; } diff --git a/src/public/css/cloud.css b/src/public/css/cloud.css index 268072f..21e7dcd 100644 --- a/src/public/css/cloud.css +++ b/src/public/css/cloud.css @@ -3,15 +3,26 @@ body{ color: rgb(255, 255, 255); } .files{ - background: rgba(100, 100, 100, 0.5); - margin: 10px; - padding: 5px; } .info{ font-family: sigma_font; font-size: 20px; - margin-left: 10px; } .upload{ - margin: 2px; + +} + +.icon { + width: 2em; + height: 2em; +} +#titulo{ + color: rgb(0, 0, 0); +} +#rep-video{ + width: 600; + height:400; +} +#ctrl_audio{ + margin-top: -60px; } diff --git a/src/public/img/Music-icon.png b/src/public/img/Music-icon.png new file mode 100644 index 0000000..29803f7 Binary files /dev/null and b/src/public/img/Music-icon.png differ diff --git a/src/public/img/arch_desconocido.png b/src/public/img/arch_desconocido.png new file mode 100644 index 0000000..935062b Binary files /dev/null and b/src/public/img/arch_desconocido.png differ diff --git a/src/public/img/archivo_desc.eps b/src/public/img/archivo_desc.eps new file mode 100644 index 0000000..0f353aa --- /dev/null +++ b/src/public/img/archivo_desc.eps @@ -0,0 +1,134 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: cairo 1.16.0 (https://cairographics.org) +%%CreationDate: Wed Mar 23 02:33:13 2022 +%%Pages: 1 +%%DocumentData: Clean7Bit +%%LanguageLevel: 2 +%%BoundingBox: 0 1 4001 4001 +%%EndComments +%%BeginProlog +50 dict begin +/q { gsave } bind def +/Q { grestore } bind def +/cm { 6 array astore concat } bind def +/w { setlinewidth } bind def +/J { setlinecap } bind def +/j { setlinejoin } bind def +/M { setmiterlimit } bind def +/d { setdash } bind def +/m { moveto } bind def +/l { lineto } bind def +/c { curveto } bind def +/h { closepath } bind def +/re { exch dup neg 3 1 roll 5 3 roll moveto 0 rlineto + 0 exch rlineto 0 rlineto closepath } bind def +/S { stroke } bind def +/f { fill } bind def +/f* { eofill } bind def +/n { newpath } bind def +/W { clip } bind def +/W* { eoclip } bind def +/BT { } bind def +/ET { } bind def +/BDC { mark 3 1 roll /BDC pdfmark } bind def +/EMC { mark /EMC pdfmark } bind def +/cairo_store_point { /cairo_point_y exch def /cairo_point_x exch def } def +/Tj { show currentpoint cairo_store_point } bind def +/TJ { + { + dup + type /stringtype eq + { show } { -0.001 mul 0 cairo_font_matrix dtransform rmoveto } ifelse + } forall + currentpoint cairo_store_point +} bind def +/cairo_selectfont { cairo_font_matrix aload pop pop pop 0 0 6 array astore + cairo_font exch selectfont cairo_point_x cairo_point_y moveto } bind def +/Tf { pop /cairo_font exch def /cairo_font_matrix where + { pop cairo_selectfont } if } bind def +/Td { matrix translate cairo_font_matrix matrix concatmatrix dup + /cairo_font_matrix exch def dup 4 get exch 5 get cairo_store_point + /cairo_font where { pop cairo_selectfont } if } bind def +/Tm { 2 copy 8 2 roll 6 array astore /cairo_font_matrix exch def + cairo_store_point /cairo_font where { pop cairo_selectfont } if } bind def +/g { setgray } bind def +/rg { setrgbcolor } bind def +/d1 { setcachedevice } bind def +/cairo_data_source { + CairoDataIndex CairoData length lt + { CairoData CairoDataIndex get /CairoDataIndex CairoDataIndex 1 add def } + { () } ifelse +} def +/cairo_flush_ascii85_file { cairo_ascii85_file status { cairo_ascii85_file flushfile } if } def +/cairo_image { image cairo_flush_ascii85_file } def +/cairo_imagemask { imagemask cairo_flush_ascii85_file } def +%%EndProlog +%%BeginSetup +%%EndSetup +%%Page: 1 1 +%%BeginPageSetup +%%PageBoundingBox: 0 1 4001 4001 +%%EndPageSetup +q 0 1 4001 4000 rectclip +1 0 0 -1 0 4001 cm q +1 g +0 -0.004 4000.004 4000.004 re f +0.980392 g +699.223 273.559 m 699.223 3726.43 l 3300.781 3726.43 l 3300.781 1041.527 + l 2532.812 273.559 l 699.223 273.559 l f +0.901961 g +2533.199 274.57 m 3297.781 1039.129 l 2533.199 1039.129 l 2533.199 274.57 + l f +0.737255 0.705882 0.690196 rg +699.223 2668.32 2601.559 1058.109 re f +0.501961 g +714.223 3711.438 m 3285.785 3711.438 l 3285.785 1047.73 l 2526.594 288.562 + l 714.223 288.562 l h +3315.785 3741.438 m 684.223 3741.438 l 684.223 258.562 l 2539.035 258.562 + l 2543.418 262.949 l 3315.785 1035.312 l 3315.785 3741.438 l f +2548.203 1024.129 m 3261.562 1024.129 l 2548.203 310.766 l h +3297.785 1054.133 m 2533.211 1054.133 l 2524.926 1054.133 2518.223 1047.43 + 2518.223 1039.121 c 2518.223 274.566 l 2518.223 268.508 2521.871 263.02 + 2527.473 260.703 c 2533.074 258.383 2539.523 259.668 2543.816 263.961 c + 3308.391 1028.535 l 3312.66 1032.828 3313.969 1039.281 3311.652 1044.879 + c 3309.309 1050.48 3303.848 1054.133 3297.785 1054.133 c f +1 g +1634.059 3197.379 m 1634.059 3309.648 1543.051 3400.672 1430.766 3400.672 + c 1318.484 3400.672 1227.469 3309.648 1227.469 3197.379 c 1227.469 3085.102 + 1318.484 2994.082 1430.766 2994.082 c 1543.051 2994.082 1634.059 3085.102 + 1634.059 3197.379 c f +2203.305 3197.379 m 2203.305 3309.648 2112.277 3400.668 2000.004 3400.668 + c 1887.719 3400.668 1796.707 3309.648 1796.707 3197.379 c 1796.707 3085.098 + 1887.719 2994.078 2000.004 2994.078 c 2112.277 2994.078 2203.305 3085.098 + 2203.305 3197.379 c f +2772.531 3197.379 m 2772.531 3309.648 2681.516 3400.668 2569.234 3400.668 + c 2456.957 3400.668 2365.938 3309.648 2365.938 3197.379 c 2365.938 3085.102 + 2456.957 2994.078 2569.234 2994.078 c 2681.516 2994.078 2772.531 3085.102 + 2772.531 3197.379 c f +0.737255 0.705882 0.690196 rg +1835.594 2000.172 m 2115.375 2000.172 l 2115.375 2279.945 l 1835.594 2279.945 + l h +1858.066 1680.559 m 1873.715 1634.273 1892.777 1594.781 1915.246 1562.105 + c 1937.703 1529.434 1967.316 1491.324 2004.074 1447.766 c 2033.332 1413.707 + 2056.148 1384.965 2072.488 1361.457 c 2088.844 1337.988 2102.613 1312.109 + 2113.852 1283.859 c 2125.074 1255.629 2130.703 1224.812 2130.703 1191.465 + c 2130.703 1190.438 l 2130.703 1144.152 2119.285 1108.238 2096.488 1082.715 + c 2073.672 1057.172 2041.512 1044.41 1999.984 1044.41 c 1959.156 1044.41 + 1927.324 1058.555 1904.527 1086.805 c 1881.707 1115.055 1869.965 1154.703 + 1869.297 1205.75 c 1869.297 1206.777 l 1579.305 1206.777 l 1579.305 1205.75 + l 1582.695 1115.902 1601.418 1039.156 1635.465 975.484 c 1669.496 911.855 + 1717.305 863.355 1778.926 829.992 c 1840.527 796.645 1913.875 779.953 1998.98 + 779.953 c 2087.461 779.953 2163.379 794.926 2226.672 824.875 c 2289.988 + 854.844 2338.129 898.242 2371.16 955.078 c 2404.172 1011.914 2420.688 1080.504 + 2420.688 1160.824 c 2420.688 1161.852 l 2420.688 1214.262 2413.355 1261.574 + 2398.738 1303.773 c 2384.082 1345.988 2366.062 1382.91 2344.609 1414.559 + c 2323.176 1446.227 2294.75 1482.812 2259.348 1524.336 c 2226 1564.496 +2199.945 1598.199 2181.238 1625.422 c 2162.508 1652.664 2146.688 1684.133 + 2133.746 1719.871 c 2120.809 1755.605 2114.348 1794.918 2114.348 1837.805 + c 1834.578 1837.805 l 1834.578 1779.273 1842.395 1726.863 1858.066 1680.559 + c f +Q Q +showpage +%%Trailer +end +%%EOF diff --git a/src/public/img/desc256.png b/src/public/img/desc256.png new file mode 100644 index 0000000..6d3d8f4 Binary files /dev/null and b/src/public/img/desc256.png differ diff --git a/src/public/img/etiquetas_bar.html b/src/public/img/etiquetas_bar.html new file mode 100644 index 0000000..17d398b --- /dev/null +++ b/src/public/img/etiquetas_bar.html @@ -0,0 +1,57 @@ + + + + + + + + +
+
Nombre Producto
+
+ Codigo Barra +
+
+
$15.23
+
$15.23
+
+
+ + diff --git a/src/public/js/api_consulta.js b/src/public/js/api_consulta.js new file mode 100644 index 0000000..ac40c3a --- /dev/null +++ b/src/public/js/api_consulta.js @@ -0,0 +1,17 @@ +function consulta_ruc() { + var numeroruc = document.getElementById('cli_ciRuc').value; + //console.log(numeroruc); + if (numeroruc !== "" && numeroruc.length > 9) { + var url = "https://bot-sigma.ngrok.io/busquedaSRI?ruc=" + numeroruc; + axios.get(url).then(function (res) { + var json = res.data; + txt_nom = document.getElementById('cli_nombre').value = json.nombre; + txt_dir = document.getElementById('Direccion').value = json.direccion; + //txt_tel = document.getElementById('txt_telf').value = arr[1]; + //txt_mai = document.getElementById('txt_mail').value = arr[1]; + }); + }else{ + alert("Identificacion de Usuario No valida"); + document.getElementById('cli_ciRuc').focus(); + } +} diff --git a/src/public/plantilla_mail/fact_mail.html b/src/public/plantilla_mail/fact_mail.html new file mode 100644 index 0000000..182489a --- /dev/null +++ b/src/public/plantilla_mail/fact_mail.html @@ -0,0 +1,85 @@ + + + + + Notificacion Docmento Electrónico + + +
+ +
+ + +
Notificación Electrónica
+ +
+ +
+ + + + + + + + + + + + + + + +
Fecha: lunes, 27 de junio de 2022 19:02:31
Estimado/a:   ZAMBRANO RENDON KLEBER ADALBERTO()
Su FACTURA ELECTRÓNICA se ha realizado con éxito.
+ + + + + + + + + + +
DETALLE DE LA FACTURA ELECTRÓNICA
Numero de Documento: 002-002-000002011
Clave de Acceso: 2706202201171484698500120020020000020110000246219
Valor: $ 48.75
+ + + + + + + + + + +
INFORMACIÓN ADICIONAL
Vendedor: OBANDO LOAIZA ELIZABETH DEL ROCIO(ELIZABETH)
Email: malicha_santo@hotmail.com
Teléfono: 0992186472
Gracias por utilizar nuestro servicio + +Atentamente, +DISBAR
Adjunto encontrarás el XML y RIDE que te servirá para declaración tributaria
+ +
+ +
+ +
DISBAR + +Dirección (Matriz): Km. 3 Recinto San Pablo de Chila, Via a San Jacinto del Búa s/n Margen Derecho. | Sucursal: | Teléfono: Contact: 0997599620 / E-mail: proaluc.jpo@gmail.com
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
© Copyright 2020 Grupo Anfibius
+ + diff --git a/src/public/plantilla_mail/plantilla_mail.html b/src/public/plantilla_mail/plantilla_mail.html new file mode 100644 index 0000000..3274310 --- /dev/null +++ b/src/public/plantilla_mail/plantilla_mail.html @@ -0,0 +1,69 @@ + + + + + + + + + + +
+ +
+
Logo
+
Notificación Electrónica
+
+ + + +
+
Fecha:
lunes, 27 de junio de 2022 19:02:31
+
Estimado/a:
ZAMBRANO RENDON KLEBER ADALBERTO()
+
+ +
+
DETALLE DE LA FACTURA ELECTRÓNICA
+
+
Documento N#:
002-002-000002011
+
Clave de Acceso:
2706202201171484698500120020020000020110000246219
+
Valor Documento:
$ 48.75
+
+
+ +
+
INFORMACIÓN ADICIONAL
+
+
Vendedor:
OBANDO LOAIZA ELIZABETH DEL ROCIO(ELIZABETH)
+
Email:
malicha_santo@hotmail.com
+
Teléfono:
+
+
+ +
+
Gracias por utilizar nuestro servicio
+
Atentamente,
+
Empresa
+
Adjunto encontrarás el XML y RIDE que te servirá para declaración tributaria
+
+ +
+
Empresa
+
Dirección (Matriz): Km. 3 Recinto San Pablo de Chila, Via a San Jacinto del Búa s/n Margen Derecho. | Sucursal: | Teléfono: Contact: 0997599620 / E-mail: proaluc.jpo@gmail.com
+
+
+ +
+ + diff --git a/src/public/tool/facturador.html b/src/public/tool/facturador.html new file mode 100644 index 0000000..f455676 --- /dev/null +++ b/src/public/tool/facturador.html @@ -0,0 +1,57 @@ + + + + + + + + + +
+
+
+

Quick Example

+
+
+
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+Upload +
+
+
+
+ + +
+
+ + +
+
+
+ +
+
+
+
+
+
+ + diff --git a/src/public/tool/tab_cli.html b/src/public/tool/tab_cli.html new file mode 100644 index 0000000..3f6232f --- /dev/null +++ b/src/public/tool/tab_cli.html @@ -0,0 +1,12 @@ +
+ + + + + + + + + +
IDUserDateStatusReason
183John Doe11-7-2014ApprovedBacon ipsum dolor sit amet salami venison chicken flank fatback doner.
+
diff --git a/src/views/app_pedidos.ejs b/src/views/app_pedidos.ejs index 7908351..044a1d0 100644 --- a/src/views/app_pedidos.ejs +++ b/src/views/app_pedidos.ejs @@ -120,7 +120,7 @@
- +
@@ -218,8 +218,10 @@
  • - - + + +
    +
  • diff --git a/src/views/clienteNuevo.ejs b/src/views/clienteNuevo.ejs index 9fb31b7..30a9db4 100644 --- a/src/views/clienteNuevo.ejs +++ b/src/views/clienteNuevo.ejs @@ -79,7 +79,7 @@ Cancelar - + diff --git a/src/views/clientesV.ejs b/src/views/clientesV.ejs index e0a863e..24ee222 100644 --- a/src/views/clientesV.ejs +++ b/src/views/clientesV.ejs @@ -70,7 +70,6 @@ <% } %> - diff --git a/src/views/cloud.ejs b/src/views/cloud.ejs index 84382af..e6f1dbf 100644 --- a/src/views/cloud.ejs +++ b/src/views/cloud.ejs @@ -1,50 +1,184 @@ + + + + Cloud SIGMA + + + + + + + + -