Merge branch 'develop'

Cuenta predial
This commit is contained in:
Mauricio Baeza 2017-12-06 23:31:01 -06:00
commit 37af9178f9
6 changed files with 55 additions and 8 deletions

View File

@ -203,6 +203,7 @@ class CFDI(object):
complemento = {}
if 'complemento' in row:
complemento = row.pop('complemento')
cuenta_predial = row.pop('CuentaPredial', '')
taxes = {}
if 'impuestos' in row:
@ -234,8 +235,8 @@ class CFDI(object):
node_name = '{}:InformacionAduanera'.format(self._pre)
ET.SubElement(concepto, node_name, attributes)
if 'CuentaPredial' in row:
attributes = {'numero': row['CuentaPredial']}
if cuenta_predial:
attributes = {'Numero': cuenta_predial}
node_name = '{}:CuentaPredial'.format(self._pre)
ET.SubElement(concepto, node_name, attributes)

View File

@ -1033,6 +1033,12 @@ def _conceptos(doc, version):
values['noidentificacion'], values['ClaveProdServ'])
values['unidad'] = '({})\n{}'.format(
values['ClaveUnidad'], values['unidad'])
n = c.find('{}CuentaPredial'.format(PRE[version]))
if n is not None:
v = CaseInsensitiveDict(n.attrib.copy())
info = '\nCuenta Predial Número: {}'.format(v['numero'])
values['descripcion'] += info
data.append(values)
return data

View File

@ -180,12 +180,21 @@ class Configuracion(BaseModel):
elif keys['fields'] == 'configotros':
fields = (
'chk_config_anticipo',
'chk_config_cuenta_predial',
'chk_config_ine',
)
data = (Configuracion
.select()
.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}
return values
@ -1770,6 +1779,7 @@ class Productos(BaseModel):
Productos.descripcion,
Productos.unidad,
Productos.valor_unitario,
Productos.cuenta_predial,
)
.where(Productos.id==id).dicts()[0]
)
@ -2319,6 +2329,7 @@ class Facturas(BaseModel):
product['unidad'] = p.unidad.key
product['clave'] = p.clave
product['clave_sat'] = p.clave_sat
product['cuenta_predial'] = p.cuenta_predial
product['factura'] = invoice.id
product['producto'] = id_product
@ -2535,6 +2546,9 @@ class Facturas(BaseModel):
if row.descuento:
concepto['Descuento'] = FORMAT.format(row.descuento)
if row.cuenta_predial:
concepto['CuentaPredial'] = row.cuenta_predial
taxes = {}
traslados = []
retenciones = []

View File

@ -51,6 +51,7 @@ var controllers = {
$$('txt_plantilla_donataria').attachEvent('onItemClick', txt_plantilla_donataria_click)
$$('chk_config_anticipo').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)
$$('up_bdfl').attachEvent('onUploadComplete', up_bdfl_upload_complete)

View File

@ -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(){
webix.ajax().sync().get('/values/categorias', function(text, data){
var values = data.json()
@ -9,6 +24,7 @@ function get_categorias(){
function cmd_new_product_click(id, e, node){
configurar_productos()
$$('form_product').setValues({
id: 0, es_activo_producto: true})
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){
configurar_productos()
var grid = $$('grid_products')
var row = grid.getSelectedItem()
if(row == undefined){

View File

@ -43,7 +43,7 @@ var admin_ui_windows = {
$$('form_editar_usuario').bind($$('grid_usuarios'))
}
},
}
@ -488,10 +488,19 @@ var options_templates = [
var options_admin_otros = [
{maxHeight: 15},
{template: 'Ayudas varias', type: 'section'},
{cols: [{maxWidth: 15},
{view: 'checkbox', id: 'chk_config_anticipo', labelWidth: 0,
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},
{view: 'checkbox', id: 'chk_config_ine', labelWidth: 0,
labelRight: 'Mostrar el complemento INE al facturar'},
@ -504,14 +513,13 @@ var tab_options = {
view: 'tabview',
id: 'tab_options',
multiview: true,
tabbar: {options: [
'Plantillas',
'Otros']},
//~ tabbar: {options: [
//~ 'Plantillas',
//~ 'Otros']},
animate: true,
cells: [
{id: 'Plantillas', rows: options_templates},
{id: 'Otros', rows: options_admin_otros},
{},
],
}
@ -835,7 +843,7 @@ var grid_usuarios = {
obj.delete = '-'
})
}
}
},
}