Prefacturas, guardar y recuperar notas

This commit is contained in:
Mauricio Baeza 2018-01-10 23:39:15 -06:00
parent 3029f84874
commit ead466e90c
2 changed files with 6 additions and 3 deletions

View File

@ -3765,7 +3765,7 @@ class PreFacturasDetalle(BaseModel):
def facturar(cls, id): def facturar(cls, id):
data = [] data = []
q = PreFacturas.select(PreFacturas.cliente).where(PreFacturas.id==id)[0] q = PreFacturas.select().where(PreFacturas.id==id)[0]
if q.cliente.forma_pago is None: if q.cliente.forma_pago is None:
forma_pago = '' forma_pago = ''
else: else:
@ -3782,6 +3782,7 @@ class PreFacturasDetalle(BaseModel):
'rfc': q.cliente.rfc, 'rfc': q.cliente.rfc,
'forma_pago': forma_pago, 'forma_pago': forma_pago,
'uso_cfdi': uso_cfdi, 'uso_cfdi': uso_cfdi,
'notas': q.notas,
} }
productos = PreFacturasDetalle.select().where( productos = PreFacturasDetalle.select().where(

View File

@ -651,11 +651,13 @@ function search_client_by_id(id){
function set_client(row){ function set_client(row){
showvar(row)
var form = $$('form_invoice') var form = $$('form_invoice')
var html = '<span class="webix_icon fa-user"></span><span class="lbl_partner">' var html = '<span class="webix_icon fa-user"></span><span class="lbl_partner">'
form.setValues({ form.setValues({
id_partner:row.id, search_client_id:'', search_client_name:'', id_partner:row.id, search_client_id:'', search_client_name:'',
forma_pago: row.forma_pago, uso_cfdi: row.uso_cfdi}, true) forma_pago: row.forma_pago, uso_cfdi: row.uso_cfdi,
notas: row.notas}, true)
html += row.nombre + ' (' + row.rfc + ')</span>' html += row.nombre + ' (' + row.rfc + ')</span>'
$$('lbl_client').setValue(html) $$('lbl_client').setValue(html)
$$('cmd_cfdi_relacionados').enable() $$('cmd_cfdi_relacionados').enable()
@ -1306,6 +1308,7 @@ function cmd_prefactura_click(){
data['metodo_pago'] = $$('lst_metodo_pago').getValue() data['metodo_pago'] = $$('lst_metodo_pago').getValue()
data['uso_cfdi'] = $$('lst_uso_cfdi').getValue() data['uso_cfdi'] = $$('lst_uso_cfdi').getValue()
data['regimen_fiscal'] = $$('lst_regimen_fiscal').getValue() data['regimen_fiscal'] = $$('lst_regimen_fiscal').getValue()
data['notas'] = values.notas
if(!save_preinvoice(data)){ if(!save_preinvoice(data)){
return return
@ -1457,7 +1460,6 @@ function refacturar_preinvoice(id){
for(var p of values.rows){ for(var p of values.rows){
agregar_preproducto(p) agregar_preproducto(p)
} }
//~ calculate_taxes()
calcular_impuestos() calcular_impuestos()
$$('tv_invoice').getTabbar().setValue('Generar') $$('tv_invoice').getTabbar().setValue('Generar')
} }