forked from elmau/empresa-libre
Invoice, guardar notas
This commit is contained in:
parent
59de554b2b
commit
3029f84874
|
@ -1007,6 +1007,7 @@ class PrintTicket(object):
|
||||||
self._set('center', 'B', 'B', 2)
|
self._set('center', 'B', 'B', 2)
|
||||||
self._t(data['rfc'])
|
self._t(data['rfc'])
|
||||||
self._set('center', 'A')
|
self._set('center', 'A')
|
||||||
|
self._t(data['regimen'])
|
||||||
self._t(data['address'])
|
self._t(data['address'])
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -4416,6 +4416,7 @@ class Tickets(BaseModel):
|
||||||
formapago = SATFormaPago.get(SATFormaPago.key==obj['forma_pago'])
|
formapago = SATFormaPago.get(SATFormaPago.key==obj['forma_pago'])
|
||||||
|
|
||||||
emisor = util.get_dict(Emisor.select().dicts()[0])
|
emisor = util.get_dict(Emisor.select().dicts()[0])
|
||||||
|
|
||||||
emisor['nointerior'] = emisor['no_interior']
|
emisor['nointerior'] = emisor['no_interior']
|
||||||
emisor['noexterior'] = emisor['no_exterior']
|
emisor['noexterior'] = emisor['no_exterior']
|
||||||
emisor['codigopostal'] = emisor['codigo_postal']
|
emisor['codigopostal'] = emisor['codigo_postal']
|
||||||
|
@ -4467,11 +4468,13 @@ class Tickets(BaseModel):
|
||||||
|
|
||||||
def _format_ticket(self, id):
|
def _format_ticket(self, id):
|
||||||
emisor = util.get_dict(Emisor.select().dicts()[0])
|
emisor = util.get_dict(Emisor.select().dicts()[0])
|
||||||
|
regimen = Emisor.select()[0].regimenes[0].name
|
||||||
ticket = Tickets.select().where(Tickets.id==id).dicts()[0]
|
ticket = Tickets.select().where(Tickets.id==id).dicts()[0]
|
||||||
products = TicketsDetalle.get_by_print(id)
|
products = TicketsDetalle.get_by_print(id)
|
||||||
|
print (regimen)
|
||||||
emisor['name'] = '{}\n'.format(emisor['nombre'])
|
emisor['name'] = '{}\n'.format(emisor['nombre'])
|
||||||
emisor['rfc'] = 'RFC: {}\n'.format(emisor['rfc'])
|
emisor['rfc'] = 'RFC: {}\n'.format(emisor['rfc'])
|
||||||
|
emisor['regimen'] = 'Regimen: {}\n'.format(regimen)
|
||||||
interior = ''
|
interior = ''
|
||||||
if emisor['no_interior']:
|
if emisor['no_interior']:
|
||||||
interior = ', {}'.format(emisor['no_interior'])
|
interior = ', {}'.format(emisor['no_interior'])
|
||||||
|
|
|
@ -1704,13 +1704,18 @@ function lst_serie_change(nv, ov){
|
||||||
|
|
||||||
function cmd_cfdi_notes_click(){
|
function cmd_cfdi_notes_click(){
|
||||||
win_invoice_notes.init()
|
win_invoice_notes.init()
|
||||||
$$('win_cfdi_notes').show()
|
var values = $$('form_invoice').getValues()
|
||||||
|
$$('invoice_notes').setValue(values.notas)
|
||||||
|
$$('win_invoice_notes').show()
|
||||||
|
to_end('invoice_notes')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function cfdi_notes_key_up(){
|
function cmd_invoice_save_note_click(){
|
||||||
var value = this.getValue()
|
var value = $$('invoice_notes').getValue()
|
||||||
$$('form_invoice').setValues({notas: value}, true)
|
$$('form_invoice').setValues({notas: value}, true)
|
||||||
|
$$('win_invoice_notes').close()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -138,11 +138,14 @@ var ui_invoice = {
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var body_cfdi_notes = {rows: [
|
var body_cfdi_notes = {rows: [
|
||||||
{minHeight: 5, maxHeight: 5},
|
{minHeight: 5, maxHeight: 5},
|
||||||
{view: 'textarea', id: 'cfdi_notes', name: 'cfdi_notes', height: 300,
|
{view: 'textarea', id: 'invoice_notes', name: 'invoice_notes', height: 300,
|
||||||
placeholder: 'Captura las notas, se autoguarda al escribir.'},
|
placeholder: 'Captura las notas.'},
|
||||||
|
{minHeight: 5, maxHeight: 5},
|
||||||
|
{cols: [{}, {view: 'button', id: 'cmd_invoice_save_note', autowidth: true,
|
||||||
|
label: 'Guardar y Cerrar', type: 'iconButton', hotkey: 'Ctrl+enter'},
|
||||||
|
{}]},
|
||||||
{minHeight: 5, maxHeight: 5},
|
{minHeight: 5, maxHeight: 5},
|
||||||
]}
|
]}
|
||||||
|
|
||||||
|
@ -151,22 +154,17 @@ var win_invoice_notes = {
|
||||||
init: function(){
|
init: function(){
|
||||||
webix.ui({
|
webix.ui({
|
||||||
view: 'window',
|
view: 'window',
|
||||||
id: 'win_cfdi_notes',
|
id: 'win_invoice_notes',
|
||||||
height: 350,
|
height: 400,
|
||||||
width: 500,
|
width: 500,
|
||||||
modal: true,
|
modal: true,
|
||||||
position: 'center',
|
position: 'center',
|
||||||
head: {view: 'toolbar',
|
head: 'Notas',
|
||||||
elements: [
|
|
||||||
{view: 'label', label: 'Notas'},
|
|
||||||
{view: 'icon', icon: 'times-circle',
|
|
||||||
click: '$$("win_cfdi_notes").close()'},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
body: body_cfdi_notes,
|
body: body_cfdi_notes,
|
||||||
})
|
})
|
||||||
$$('cfdi_notes').attachEvent('onTimedKeyPress', cfdi_notes_key_up);
|
$$('cmd_invoice_save_note').attachEvent('onItemClick', cmd_invoice_save_note_click)
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var toolbar_invoices = [
|
var toolbar_invoices = [
|
||||||
|
|
|
@ -476,4 +476,5 @@ var win_ticket_notes = {
|
||||||
body: body_ticket_notes,
|
body: body_ticket_notes,
|
||||||
})
|
})
|
||||||
$$('cmd_ticket_save_note').attachEvent('onItemClick', cmd_ticket_save_note_click)
|
$$('cmd_ticket_save_note').attachEvent('onItemClick', cmd_ticket_save_note_click)
|
||||||
}}
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue