forked from elmau/empresa-libre
Permitir editar la descripción de un movimiento bancario
This commit is contained in:
parent
485dc4154e
commit
d7260a8a95
|
@ -1,6 +1,7 @@
|
||||||
v 1.28.3 [09-mar-2019]
|
v 1.29.0 [08-mar-2019]
|
||||||
----------------------
|
----------------------
|
||||||
- Error: Al mostrar detalle en facturas importadas #343
|
- Error: Al mostrar detalle en facturas importadas #343
|
||||||
|
- Mejora: Editar la descripción de un movimiento bancario.
|
||||||
|
|
||||||
v 1.28.2 [04-mar-2019]
|
v 1.28.2 [04-mar-2019]
|
||||||
----------------------
|
----------------------
|
||||||
|
|
|
@ -2908,6 +2908,18 @@ class MovimientosBanco(BaseModel):
|
||||||
CuentasBanco.actualizar_saldo(row.cuenta, saldo)
|
CuentasBanco.actualizar_saldo(row.cuenta, saldo)
|
||||||
return saldo
|
return saldo
|
||||||
|
|
||||||
|
def _update_description(self, values):
|
||||||
|
try:
|
||||||
|
obj = MovimientosBanco.get(MovimientosBanco.id==values['id'])
|
||||||
|
except MovimientosBanco.DoesNotExist:
|
||||||
|
msg = 'No se encontró el movimiento'
|
||||||
|
return {'ok': False, 'msg': msg}
|
||||||
|
|
||||||
|
obj.descripcion = values['description']
|
||||||
|
obj.save()
|
||||||
|
msg = 'Descripción actualizada correctamente'
|
||||||
|
return {'ok': True, 'msg': msg}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def post(cls, values):
|
def post(cls, values):
|
||||||
opt = values.pop('opt')
|
opt = values.pop('opt')
|
||||||
|
|
|
@ -47,7 +47,7 @@ except ImportError:
|
||||||
|
|
||||||
|
|
||||||
DEBUG = DEBUG
|
DEBUG = DEBUG
|
||||||
VERSION = '1.28.3'
|
VERSION = '1.29.0'
|
||||||
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
||||||
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@ var bancos_controllers = {
|
||||||
$$('filter_invoice_pay_year').attachEvent('onChange', filter_invoice_pay_change)
|
$$('filter_invoice_pay_year').attachEvent('onChange', filter_invoice_pay_change)
|
||||||
$$('filter_invoice_pay_month').attachEvent('onChange', filter_invoice_pay_change)
|
$$('filter_invoice_pay_month').attachEvent('onChange', filter_invoice_pay_change)
|
||||||
$$('grid_bank_invoice_pay').attachEvent('onItemClick', grid_bank_invoice_pay_click)
|
$$('grid_bank_invoice_pay').attachEvent('onItemClick', grid_bank_invoice_pay_click)
|
||||||
|
$$('grid_cuentabanco').attachEvent('onItemDblClick', grid_cuentabanco_double_click)
|
||||||
|
|
||||||
init_config_bank()
|
init_config_bank()
|
||||||
}
|
}
|
||||||
|
@ -1293,3 +1294,60 @@ function grid_cfdi_por_pagar_on_after_filter(){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function save_mov_description(value){
|
||||||
|
var row = $$('grid_cuentabanco').getSelectedId()
|
||||||
|
var data = new Object()
|
||||||
|
|
||||||
|
data['opt'] = 'update_description'
|
||||||
|
data['id'] = row.id
|
||||||
|
data['description'] = value
|
||||||
|
|
||||||
|
webix.ajax().post('/movbanco', data, {
|
||||||
|
error:function(text, data, XmlHttpRequest){
|
||||||
|
},
|
||||||
|
success:function(text, data, XmlHttpRequest){
|
||||||
|
values = data.json();
|
||||||
|
if(values.ok){
|
||||||
|
var item = $$('grid_cuentabanco').getItem(row.row)
|
||||||
|
item[row.column] = value
|
||||||
|
$$('grid_cuentabanco').updateItem(row.row, item)
|
||||||
|
msg_ok(values.msg)
|
||||||
|
}else{
|
||||||
|
msg_error(values.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function grid_cuentabanco_double_click(id, e, node){
|
||||||
|
if(id.column != 'descripcion'){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var row = this.getSelectedItem()
|
||||||
|
win_mov_description.init()
|
||||||
|
$$('mov_description').setValue(row.descripcion)
|
||||||
|
$$('win_mov_description').show()
|
||||||
|
to_end('mov_description')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_save_mov_description_click(){
|
||||||
|
var value = $$('mov_description').getValue().trim()
|
||||||
|
if(!value){
|
||||||
|
focus('mov_description')
|
||||||
|
msg = 'La descripción no puede estar vacía'
|
||||||
|
msg_error(msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
save_mov_description(value)
|
||||||
|
cmd_close_mov_description_click()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_close_mov_description_click(){
|
||||||
|
$$('win_mov_description').close()
|
||||||
|
}
|
||||||
|
|
|
@ -575,3 +575,35 @@ var app_bancos = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var win_body_mov_description = {rows: [
|
||||||
|
{minHeight: 5, maxHeight: 5},
|
||||||
|
{view: 'textarea', id: 'mov_description', name: 'mov_description',
|
||||||
|
height: 300},
|
||||||
|
{minHeight: 5, maxHeight: 5},
|
||||||
|
{cols: [{},
|
||||||
|
{view: 'button', id: 'cmd_save_mov_description', autowidth: true,
|
||||||
|
label: 'Guardar', type: 'iconButton', icon: 'save', hotkey: 'Ctrl+enter'},
|
||||||
|
{maxWidth: 50},
|
||||||
|
{view: 'button', id: 'cmd_close_mov_description', autowidth: true,
|
||||||
|
label: 'Cerrar', type: 'iconButton', icon: 'times-circle', hotkey: 'esc'},
|
||||||
|
{}]},
|
||||||
|
{minHeight: 5, maxHeight: 5},
|
||||||
|
],}
|
||||||
|
|
||||||
|
|
||||||
|
var win_mov_description = {
|
||||||
|
init: function(){
|
||||||
|
webix.ui({
|
||||||
|
view: 'window',
|
||||||
|
id: 'win_mov_description',
|
||||||
|
height: 400,
|
||||||
|
width: 600,
|
||||||
|
modal: true,
|
||||||
|
position: 'center',
|
||||||
|
head: 'Descripción del movimiento',
|
||||||
|
body: win_body_mov_description,
|
||||||
|
})
|
||||||
|
$$('cmd_save_mov_description').attachEvent('onItemClick', cmd_save_mov_description_click)
|
||||||
|
$$('cmd_close_mov_description').attachEvent('onItemClick', cmd_close_mov_description_click)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue