forked from elmau/empresa-libre
FIX - Obtener cliente
This commit is contained in:
parent
e0532b7cb0
commit
03a7c5cf67
|
@ -183,6 +183,8 @@ class Emisor(BaseModel):
|
|||
correo = TextField(default='')
|
||||
web = TextField(default='')
|
||||
curp = TextField(default='')
|
||||
token_timbrado = TextField(default='')
|
||||
token_soporte = TextField(default='')
|
||||
regimenes = ManyToManyField(SATRegimenes, related_name='emisores')
|
||||
|
||||
def __str__(self):
|
||||
|
@ -683,12 +685,12 @@ class Socios(BaseModel):
|
|||
Socios.id, Socios.nombre, Socios.rfc,
|
||||
SATFormaPago.key.alias('forma_pago'),
|
||||
SATUsoCfdi.key.alias('uso_cfdi'))
|
||||
.join(SATFormaPago).switch(Socios)
|
||||
.join(SATUsoCfdi).switch(Socios)
|
||||
.where(
|
||||
(Socios.id==id) & (Socios.es_cliente==True))
|
||||
.join(SATFormaPago, JOIN.LEFT_OUTER).switch(Socios)
|
||||
.join(SATUsoCfdi, JOIN.LEFT_OUTER).switch(Socios)
|
||||
.where((Socios.id==id) & (Socios.es_cliente==True))
|
||||
.dicts()
|
||||
)
|
||||
print (id, row)
|
||||
if len(row):
|
||||
return {'ok': True, 'row': row[0]}
|
||||
return {'ok': False}
|
||||
|
@ -699,8 +701,8 @@ class Socios(BaseModel):
|
|||
.select(Socios.id, Socios.nombre, Socios.rfc,
|
||||
SATFormaPago.key.alias('forma_pago'),
|
||||
SATUsoCfdi.key.alias('uso_cfdi'))
|
||||
.join(SATFormaPago).switch(Socios)
|
||||
.join(SATUsoCfdi).switch(Socios)
|
||||
.join(SATFormaPago, JOIN.LEFT_OUTER).switch(Socios)
|
||||
.join(SATUsoCfdi, JOIN.LEFT_OUTER).switch(Socios)
|
||||
.where((Socios.es_cliente==True) &
|
||||
(Socios.rfc.contains(name) |
|
||||
Socios.nombre.contains(name)))
|
||||
|
@ -763,7 +765,7 @@ class Socios(BaseModel):
|
|||
class Productos(BaseModel):
|
||||
categoria = ForeignKeyField(Categorias, null=True)
|
||||
clave = TextField(unique=True, index=True)
|
||||
clave_sat = TextField()
|
||||
clave_sat = TextField(default='')
|
||||
descripcion = TextField(index=True)
|
||||
unidad = ForeignKeyField(SATUnidades)
|
||||
valor_unitario = DecimalField(default=0.0, decimal_places=6, auto_round=True)
|
||||
|
@ -979,6 +981,7 @@ class Facturas(BaseModel):
|
|||
name = '{}{}_{}.xml'.format(obj.serie, obj.folio, obj.cliente.rfc)
|
||||
return obj.xml, name
|
||||
|
||||
#~ Revisar
|
||||
def _get_data_cfdi_to_pdf(self, xml, cancel, version):
|
||||
pre_nomina = PRE['NOMINA'][version]
|
||||
|
||||
|
@ -1089,7 +1092,10 @@ class Facturas(BaseModel):
|
|||
@classmethod
|
||||
def send(cls, id, rfc):
|
||||
values = Configuracion.get_({'fields': 'correo'})
|
||||
#~ print (server)
|
||||
if not values:
|
||||
msg = 'No esta configurado el servidor de correo de salida'
|
||||
return {'ok': False, 'msg': msg}
|
||||
|
||||
obj = Facturas.get(Facturas.id==id)
|
||||
if obj.uuid is None:
|
||||
msg = 'La factura no esta timbrada'
|
||||
|
@ -1576,7 +1582,7 @@ def _crear_tablas():
|
|||
except IntegrityError:
|
||||
msg = 'El usuario ya existe'
|
||||
log.error(msg)
|
||||
return
|
||||
return False
|
||||
|
||||
log.info('SuperUsuario creado correctamente...')
|
||||
return True
|
||||
|
|
|
@ -135,7 +135,9 @@ function get_emisor(){
|
|||
var emisor = values.row.emisor
|
||||
$$('lst_emisor_regimen').parse(values.row.regimenes)
|
||||
form.setValues(emisor, true)
|
||||
$$('lst_emisor_regimen').select(emisor.regimenes)
|
||||
if(emisor.regimenes){
|
||||
$$('lst_emisor_regimen').select(emisor.regimenes)
|
||||
}
|
||||
}else{
|
||||
msg_error(values.msg)
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ function get_monedas(){
|
|||
$$('lst_moneda').setValue(pre.id)
|
||||
if(values.length == 1){
|
||||
$$('fs_moneda').hide()
|
||||
$$('fs_moneda').refresh()
|
||||
//~ $$('fs_moneda').refresh()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ function get_regimen_fiscal(){
|
|||
$$('lst_regimen_fiscal').setValue(pre.id)
|
||||
if(values.length == 1){
|
||||
$$('fs_regimen_fiscal').hide()
|
||||
$$('fs_regimen_fiscal').refresh()
|
||||
//~ $$('fs_regimen_fiscal').refresh()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -87,6 +87,11 @@ var emisor_otros_datos= [
|
|||
{cols: [{view: 'datepicker', id: 'ong_fecha_dof', name: 'ong_fecha_dof',
|
||||
label: 'Fecha de DOF: ', disabled: true, format: '%d-%M-%Y',
|
||||
placeholder: 'Fecha de publicación en el DOF'}, {}]},
|
||||
{template: 'Timbrado y Soporte', type: 'section'},
|
||||
{view: 'text', id: 'token_timbrado',
|
||||
name: 'token_timbrado', label: 'Token de Timbrado: '},
|
||||
{view: 'text', id: 'token_soporte',
|
||||
name: 'token_soporte', label: 'Token de Soporte: '},
|
||||
]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue