Configurar y usar Cuenta Predial
This commit is contained in:
parent
ef27dd8672
commit
9c4aebf3d8
|
@ -180,12 +180,21 @@ class Configuracion(BaseModel):
|
||||||
elif keys['fields'] == 'configotros':
|
elif keys['fields'] == 'configotros':
|
||||||
fields = (
|
fields = (
|
||||||
'chk_config_anticipo',
|
'chk_config_anticipo',
|
||||||
|
'chk_config_cuenta_predial',
|
||||||
'chk_config_ine',
|
'chk_config_ine',
|
||||||
)
|
)
|
||||||
data = (Configuracion
|
data = (Configuracion
|
||||||
.select()
|
.select()
|
||||||
.where(Configuracion.clave.in_(fields))
|
.where(Configuracion.clave.in_(fields))
|
||||||
)
|
)
|
||||||
|
elif keys['fields'] == 'productos':
|
||||||
|
fields = (
|
||||||
|
'chk_config_cuenta_predial',
|
||||||
|
)
|
||||||
|
data = (Configuracion
|
||||||
|
.select()
|
||||||
|
.where(Configuracion.clave.in_(fields))
|
||||||
|
)
|
||||||
|
|
||||||
values = {r.clave: r.valor for r in data}
|
values = {r.clave: r.valor for r in data}
|
||||||
return values
|
return values
|
||||||
|
@ -1770,6 +1779,7 @@ class Productos(BaseModel):
|
||||||
Productos.descripcion,
|
Productos.descripcion,
|
||||||
Productos.unidad,
|
Productos.unidad,
|
||||||
Productos.valor_unitario,
|
Productos.valor_unitario,
|
||||||
|
Productos.cuenta_predial,
|
||||||
)
|
)
|
||||||
.where(Productos.id==id).dicts()[0]
|
.where(Productos.id==id).dicts()[0]
|
||||||
)
|
)
|
||||||
|
|
|
@ -51,6 +51,7 @@ var controllers = {
|
||||||
$$('txt_plantilla_donataria').attachEvent('onItemClick', txt_plantilla_donataria_click)
|
$$('txt_plantilla_donataria').attachEvent('onItemClick', txt_plantilla_donataria_click)
|
||||||
$$('chk_config_anticipo').attachEvent('onItemClick', chk_config_item_click)
|
$$('chk_config_anticipo').attachEvent('onItemClick', chk_config_item_click)
|
||||||
$$('chk_config_ine').attachEvent('onItemClick', chk_config_item_click)
|
$$('chk_config_ine').attachEvent('onItemClick', chk_config_item_click)
|
||||||
|
$$('chk_config_cuenta_predial').attachEvent('onItemClick', chk_config_item_click)
|
||||||
|
|
||||||
$$('cmd_subir_bdfl').attachEvent('onItemClick', cmd_subir_bdfl_click)
|
$$('cmd_subir_bdfl').attachEvent('onItemClick', cmd_subir_bdfl_click)
|
||||||
$$('up_bdfl').attachEvent('onUploadComplete', up_bdfl_upload_complete)
|
$$('up_bdfl').attachEvent('onUploadComplete', up_bdfl_upload_complete)
|
||||||
|
|
|
@ -1,5 +1,20 @@
|
||||||
|
|
||||||
|
|
||||||
|
function configurar_productos(){
|
||||||
|
webix.ajax().get('/config', {'fields': 'productos'}, {
|
||||||
|
error: function(text, data, xhr) {
|
||||||
|
msg = 'Error al consultar'
|
||||||
|
msg_error(msg)
|
||||||
|
},
|
||||||
|
success: function(text, data, xhr) {
|
||||||
|
var values = data.json()
|
||||||
|
//~ showvar(values)
|
||||||
|
show('cuenta_predial', values.chk_config_cuenta_predial)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_categorias(){
|
function get_categorias(){
|
||||||
webix.ajax().sync().get('/values/categorias', function(text, data){
|
webix.ajax().sync().get('/values/categorias', function(text, data){
|
||||||
var values = data.json()
|
var values = data.json()
|
||||||
|
@ -9,6 +24,7 @@ function get_categorias(){
|
||||||
|
|
||||||
|
|
||||||
function cmd_new_product_click(id, e, node){
|
function cmd_new_product_click(id, e, node){
|
||||||
|
configurar_productos()
|
||||||
$$('form_product').setValues({
|
$$('form_product').setValues({
|
||||||
id: 0, es_activo_producto: true})
|
id: 0, es_activo_producto: true})
|
||||||
add_config({'key': 'id_product', 'value': ''})
|
add_config({'key': 'id_product', 'value': ''})
|
||||||
|
@ -22,6 +38,7 @@ function cmd_new_product_click(id, e, node){
|
||||||
|
|
||||||
|
|
||||||
function cmd_edit_product_click(id, e, node){
|
function cmd_edit_product_click(id, e, node){
|
||||||
|
configurar_productos()
|
||||||
var grid = $$('grid_products')
|
var grid = $$('grid_products')
|
||||||
var row = grid.getSelectedItem()
|
var row = grid.getSelectedItem()
|
||||||
if(row == undefined){
|
if(row == undefined){
|
||||||
|
|
|
@ -43,7 +43,7 @@ var admin_ui_windows = {
|
||||||
|
|
||||||
$$('form_editar_usuario').bind($$('grid_usuarios'))
|
$$('form_editar_usuario').bind($$('grid_usuarios'))
|
||||||
|
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -488,10 +488,19 @@ var options_templates = [
|
||||||
|
|
||||||
var options_admin_otros = [
|
var options_admin_otros = [
|
||||||
{maxHeight: 15},
|
{maxHeight: 15},
|
||||||
|
{template: 'Ayudas varias', type: 'section'},
|
||||||
{cols: [{maxWidth: 15},
|
{cols: [{maxWidth: 15},
|
||||||
{view: 'checkbox', id: 'chk_config_anticipo', labelWidth: 0,
|
{view: 'checkbox', id: 'chk_config_anticipo', labelWidth: 0,
|
||||||
labelRight: 'Ayuda para generar anticipos'},
|
labelRight: 'Ayuda para generar anticipos'},
|
||||||
{}]},
|
{}]},
|
||||||
|
{maxHeight: 20},
|
||||||
|
{template: 'Productos y Servicios', type: 'section'},
|
||||||
|
{cols: [{maxWidth: 15},
|
||||||
|
{view: 'checkbox', id: 'chk_config_cuenta_predial', labelWidth: 0,
|
||||||
|
labelRight: 'Mostrar cuenta predial'},
|
||||||
|
{}]},
|
||||||
|
{maxHeight: 20},
|
||||||
|
{template: 'Complementos', type: 'section'},
|
||||||
{cols: [{maxWidth: 15},
|
{cols: [{maxWidth: 15},
|
||||||
{view: 'checkbox', id: 'chk_config_ine', labelWidth: 0,
|
{view: 'checkbox', id: 'chk_config_ine', labelWidth: 0,
|
||||||
labelRight: 'Mostrar el complemento INE al facturar'},
|
labelRight: 'Mostrar el complemento INE al facturar'},
|
||||||
|
@ -504,14 +513,13 @@ var tab_options = {
|
||||||
view: 'tabview',
|
view: 'tabview',
|
||||||
id: 'tab_options',
|
id: 'tab_options',
|
||||||
multiview: true,
|
multiview: true,
|
||||||
tabbar: {options: [
|
//~ tabbar: {options: [
|
||||||
'Plantillas',
|
//~ 'Plantillas',
|
||||||
'Otros']},
|
//~ 'Otros']},
|
||||||
animate: true,
|
animate: true,
|
||||||
cells: [
|
cells: [
|
||||||
{id: 'Plantillas', rows: options_templates},
|
{id: 'Plantillas', rows: options_templates},
|
||||||
{id: 'Otros', rows: options_admin_otros},
|
{id: 'Otros', rows: options_admin_otros},
|
||||||
{},
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -835,7 +843,7 @@ var grid_usuarios = {
|
||||||
obj.delete = '-'
|
obj.delete = '-'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue