Notas en factura
This commit is contained in:
parent
71884e9984
commit
e1a683ae23
|
@ -1006,6 +1006,7 @@ def _comprobante(doc, options):
|
|||
|
||||
data['tipocambio'] = 'Tipo de Cambio: $ {:0.2f}'.format(
|
||||
float(data['tipocambio']))
|
||||
data['notas'] = options['notas']
|
||||
|
||||
return data
|
||||
|
||||
|
|
|
@ -2433,6 +2433,8 @@ class Facturas(BaseModel):
|
|||
obj = SATTipoRelacion.get(SATTipoRelacion.key==invoice.tipo_relacion)
|
||||
values['tiporelacion'] = str(obj)
|
||||
|
||||
values['notas'] = invoice.notas
|
||||
|
||||
return values
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -7,6 +7,15 @@ var anticipo = false
|
|||
var donativo = false
|
||||
|
||||
|
||||
var invoices_controllers = {
|
||||
init: function(){
|
||||
$$('cmd_cfdi_notes').attachEvent('onItemClick', cmd_cfdi_notes_click)
|
||||
|
||||
webix.extend($$('grid_invoices'), webix.ProgressBar)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get_condicion_pago(){
|
||||
webix.ajax().get('/values/condicionespago', {
|
||||
error: function(text, data, xhr) {
|
||||
|
@ -129,7 +138,7 @@ function cmd_new_invoice_click(id, e, node){
|
|||
|
||||
default_config()
|
||||
form.adjust()
|
||||
form.setValues({id: 0, id_partner: 0, lbl_client: 'Ninguno'})
|
||||
form.setValues({id: 0, id_partner: 0, lbl_client: 'Ninguno', notas: ''})
|
||||
get_condicion_pago()
|
||||
grid.clearAll()
|
||||
grid_totals.clearAll()
|
||||
|
@ -500,6 +509,7 @@ function guardar_y_timbrar(values){
|
|||
data['tipo_relacion'] = tipo_relacion
|
||||
data['anticipo'] = anticipo
|
||||
data['donativo'] = donativo
|
||||
data['notas'] = values.notas
|
||||
|
||||
var usar_ine = $$('chk_cfdi_usar_ine').getValue()
|
||||
if(usar_ine){
|
||||
|
@ -522,7 +532,7 @@ function guardar_y_timbrar(values){
|
|||
$$('chk_cfdi_donativo').setValue(0)
|
||||
$$('chk_cfdi_usar_ine').setValue(0)
|
||||
|
||||
$$('form_invoice').setValues({id_partner: 0, lbl_partner: 'Ninguno'})
|
||||
$$('form_invoice').setValues({id_partner: 0, lbl_partner: 'Ninguno', notas:''})
|
||||
$$('multi_invoices').setValue('invoices_home')
|
||||
|
||||
}
|
||||
|
@ -540,7 +550,7 @@ function cmd_timbrar_click(id, e, node){
|
|||
if(!validate_invoice(values)){
|
||||
return
|
||||
}
|
||||
|
||||
showvar(values)
|
||||
query = table_relaciones.chain().data()
|
||||
msg = '¿Todos los datos son correctos?<BR><BR>'
|
||||
if(query.length > 0){
|
||||
|
@ -1616,3 +1626,14 @@ function lst_serie_change(nv, ov){
|
|||
$$('lst_tipo_comprobante').refresh()
|
||||
}
|
||||
|
||||
|
||||
function cmd_cfdi_notes_click(){
|
||||
win_invoice_notes.init()
|
||||
$$('win_cfdi_notes').show()
|
||||
}
|
||||
|
||||
|
||||
function cfdi_notes_key_up(){
|
||||
var value = this.getValue()
|
||||
$$('form_invoice').setValues({notas: value}, true)
|
||||
}
|
|
@ -85,10 +85,9 @@ var controllers = {
|
|||
$$('cmd_facturar_preinvoice').attachEvent('onItemClick', cmd_facturar_preinvoice_click)
|
||||
$$('grid_preinvoices').attachEvent('onItemClick', grid_preinvoices_click)
|
||||
|
||||
webix.extend($$('grid_invoices'), webix.ProgressBar)
|
||||
|
||||
products_controllers.init()
|
||||
bancos_controllers.init()
|
||||
invoices_controllers.init()
|
||||
tickets_controllers.init()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,6 +138,38 @@ var ui_invoice = {
|
|||
}}
|
||||
|
||||
|
||||
|
||||
var body_cfdi_notes = {rows: [
|
||||
{minHeight: 5, maxHeight: 5},
|
||||
{view: 'textarea', id: 'cfdi_notes', name: 'cfdi_notes', height: 300,
|
||||
placeholder: 'Captura las notas, se autoguarda al escribir.'},
|
||||
{minHeight: 5, maxHeight: 5},
|
||||
]}
|
||||
|
||||
|
||||
var win_invoice_notes = {
|
||||
init: function(){
|
||||
webix.ui({
|
||||
view: 'window',
|
||||
id: 'win_cfdi_notes',
|
||||
height: 350,
|
||||
width: 500,
|
||||
modal: true,
|
||||
position: 'center',
|
||||
head: {view: 'toolbar',
|
||||
elements: [
|
||||
{view: 'label', label: 'Notas'},
|
||||
{view: 'icon', icon: 'times-circle',
|
||||
click: '$$("win_cfdi_notes").close()'},
|
||||
]
|
||||
},
|
||||
body: body_cfdi_notes,
|
||||
})
|
||||
$$('cfdi_notes').attachEvent('onTimedKeyPress', cfdi_notes_key_up);
|
||||
//~ $$('cmd_cfdi_save_notes').attachEvent('onItemClick', cmd_cfdi_save_notes_click)
|
||||
}}
|
||||
|
||||
|
||||
var toolbar_invoices = [
|
||||
{view: "button", id: "cmd_new_invoice", label: "Nueva", type: "iconButton",
|
||||
autowidth: true, icon: "plus"},
|
||||
|
@ -161,6 +193,8 @@ var toolbar_invoices_util = [
|
|||
|
||||
|
||||
var toolbar_invoices_generate = {view: 'toolbar', elements: [{},
|
||||
{view: 'button', id: 'cmd_cfdi_notes', label: 'Notas',
|
||||
type: 'iconButton', autowidth: true, icon: 'commenting-o'},
|
||||
{view: 'button', id: 'cmd_cfdi_relacionados', label: 'CFDI Relacionados',
|
||||
type: 'iconButton', autowidth: true, icon: 'file-o'},
|
||||
{view: 'checkbox', id: 'chk_cfdi_anticipo', labelRight: 'Es Anticipo',
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue