Invoice, guardar notas

This commit is contained in:
Mauricio Baeza 2018-01-10 23:21:37 -06:00
parent 59de554b2b
commit 3029f84874
5 changed files with 27 additions and 19 deletions

View File

@ -1007,6 +1007,7 @@ class PrintTicket(object):
self._set('center', 'B', 'B', 2)
self._t(data['rfc'])
self._set('center', 'A')
self._t(data['regimen'])
self._t(data['address'])
return

View File

@ -4416,6 +4416,7 @@ class Tickets(BaseModel):
formapago = SATFormaPago.get(SATFormaPago.key==obj['forma_pago'])
emisor = util.get_dict(Emisor.select().dicts()[0])
emisor['nointerior'] = emisor['no_interior']
emisor['noexterior'] = emisor['no_exterior']
emisor['codigopostal'] = emisor['codigo_postal']
@ -4467,11 +4468,13 @@ class Tickets(BaseModel):
def _format_ticket(self, id):
emisor = util.get_dict(Emisor.select().dicts()[0])
regimen = Emisor.select()[0].regimenes[0].name
ticket = Tickets.select().where(Tickets.id==id).dicts()[0]
products = TicketsDetalle.get_by_print(id)
print (regimen)
emisor['name'] = '{}\n'.format(emisor['nombre'])
emisor['rfc'] = 'RFC: {}\n'.format(emisor['rfc'])
emisor['regimen'] = 'Regimen: {}\n'.format(regimen)
interior = ''
if emisor['no_interior']:
interior = ', {}'.format(emisor['no_interior'])

View File

@ -1704,13 +1704,18 @@ function lst_serie_change(nv, ov){
function cmd_cfdi_notes_click(){
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(){
var value = this.getValue()
function cmd_invoice_save_note_click(){
var value = $$('invoice_notes').getValue()
$$('form_invoice').setValues({notas: value}, true)
$$('win_invoice_notes').close()
}

View File

@ -138,11 +138,14 @@ 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.'},
{view: 'textarea', id: 'invoice_notes', name: 'invoice_notes', height: 300,
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},
]}
@ -151,22 +154,17 @@ var win_invoice_notes = {
init: function(){
webix.ui({
view: 'window',
id: 'win_cfdi_notes',
height: 350,
id: 'win_invoice_notes',
height: 400,
width: 500,
modal: true,
position: 'center',
head: {view: 'toolbar',
elements: [
{view: 'label', label: 'Notas'},
{view: 'icon', icon: 'times-circle',
click: '$$("win_cfdi_notes").close()'},
]
},
head: 'Notas',
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 = [

View File

@ -476,4 +476,5 @@ var win_ticket_notes = {
body: body_ticket_notes,
})
$$('cmd_ticket_save_note').attachEvent('onItemClick', cmd_ticket_save_note_click)
}}
}
}