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):
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:
forma_pago = ''
else:
@ -3782,6 +3782,7 @@ class PreFacturasDetalle(BaseModel):
'rfc': q.cliente.rfc,
'forma_pago': forma_pago,
'uso_cfdi': uso_cfdi,
'notas': q.notas,
}
productos = PreFacturasDetalle.select().where(

View File

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