Commit eb8a6522 authored by Manuel De la Penna's avatar Manuel De la Penna

lecturas planas

parent 242e255b
......@@ -126,6 +126,7 @@ class AppPointCollector extends backendPlus.AppBackend{
]},
{menuType:'menu', name:'administrar', menuContent:[
{menuType:'table', name:'lecturas', selectedByDefault:true},
{menuType:'table', name:'lecturas_planas'},
]},
{menuType:'menu', name:'configuración', menuContent:[
{menuType:'table', name:'variables', selectedByDefault:true},
......@@ -142,6 +143,7 @@ class AppPointCollector extends backendPlus.AppBackend{
'tokens',
'tareas',
'lecturas',
'lecturas_planas',
'puntos'
]);
}
......
"use strict";
module.exports = function(context){
var admin=context.user.rol==='admin';
return context.be.tableDefAdapt({
name:'lecturas_planas',
tableName: 'lecturas',
title:'Lecturas (tabla plana)',
editable: admin,
fields:[
{name:'id' , typeName:'integer' , nullable:false, sequence:{name: 'secuencia_lecturas', firstValue: 1}},
{name:'fecha_relevamiento' , typeName:'timestamp' , nullable:false },
{name:'sector' , typeName:'text' , nullable:false },
{name:'manzana' , typeName:'text' , nullable:false },
{name:'lado' , typeName:'text' , nullable:false },
{name:'secuencia' , typeName:'integer' , nullable:false },
{name:'puerta' , typeName:'text' },
{name:'nivel' , typeName:'integer' , nullable:false },
{name:'latitud' , typeName:'decimal' , nullable:false },
{name:'longitud' , typeName:'decimal' , nullable:false },
{name:'observaciones' , typeName:'text' }
],
primaryKey:['id'],
sql: {
from: `(select distinct l.id, l.fecha_relevamiento, l.sector, l.manzana, l.lado, l.secuencia, l.puerta, l.nivel, l.observaciones, p.latitud, p.longitud
from lecturas l join puntos p on l.id = p.lectura)`
}
}, context);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment