Imprimir Ticket directamente
This commit is contained in:
parent
ef08e750bb
commit
5a104b4a57
|
@ -164,6 +164,7 @@ def config_timbrar():
|
||||||
def config_ticket():
|
def config_ticket():
|
||||||
conf = {
|
conf = {
|
||||||
'open_pdf': Configuracion.get_bool('chk_ticket_pdf_show'),
|
'open_pdf': Configuracion.get_bool('chk_ticket_pdf_show'),
|
||||||
|
'direct_print': Configuracion.get_bool('chk_ticket_direct_print'),
|
||||||
}
|
}
|
||||||
return conf
|
return conf
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
var query = []
|
var query = []
|
||||||
var msg = ''
|
var msg = ''
|
||||||
var cfg_ticket = new Object()
|
var cfg_ticket = new Object()
|
||||||
|
var last_forma_pago = ''
|
||||||
|
|
||||||
|
|
||||||
var tickets_controllers = {
|
var tickets_controllers = {
|
||||||
|
@ -117,6 +118,7 @@ function configuracion_inicial_ticket(){
|
||||||
var values = data.json()
|
var values = data.json()
|
||||||
//~ showvar(values)
|
//~ showvar(values)
|
||||||
cfg_ticket['open_pdf'] = values.open_pdf
|
cfg_ticket['open_pdf'] = values.open_pdf
|
||||||
|
cfg_ticket['direct_print'] = values.direct_print
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +170,7 @@ function configuracion_inicial_nuevo_ticket(){
|
||||||
grid.clearAll()
|
grid.clearAll()
|
||||||
table_pt.clear()
|
table_pt.clear()
|
||||||
table_totals.clear()
|
table_totals.clear()
|
||||||
$$('form_new_ticket').setValues({notas: ''})
|
$$('form_new_ticket').setValues({notas: '', forma_pago: last_forma_pago})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -218,6 +220,7 @@ function guardar_ticket(values){
|
||||||
rows[i]['descuento'] = parseFloat(rows[i]['descuento'])
|
rows[i]['descuento'] = parseFloat(rows[i]['descuento'])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
last_forma_pago = values.forma_pago
|
||||||
var data = new Object()
|
var data = new Object()
|
||||||
data['opt'] = 'add'
|
data['opt'] = 'add'
|
||||||
data['productos'] = rows
|
data['productos'] = rows
|
||||||
|
@ -240,6 +243,9 @@ function guardar_ticket(values){
|
||||||
if(cfg_ticket.open_pdf){
|
if(cfg_ticket.open_pdf){
|
||||||
get_ticket_pdf(values.row.id)
|
get_ticket_pdf(values.row.id)
|
||||||
}
|
}
|
||||||
|
if(cfg_ticket.direct_print){
|
||||||
|
print_ticket(values.row.id)
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
msg_error(values.msg)
|
msg_error(values.msg)
|
||||||
}
|
}
|
||||||
|
@ -727,5 +733,6 @@ function cmd_ticket_report_xls_click(){
|
||||||
filename: 'Reporte_Tickets',
|
filename: 'Reporte_Tickets',
|
||||||
name: 'Tickets',
|
name: 'Tickets',
|
||||||
ignore: {'pdf': true, 'print': true},
|
ignore: {'pdf': true, 'print': true},
|
||||||
|
rawValues: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -129,18 +129,34 @@ webix.protoUI({
|
||||||
}, webix.ui.text)
|
}, webix.ui.text)
|
||||||
|
|
||||||
|
|
||||||
//~ webix.ui.datafilter.rowCount = webix.extend({
|
|
||||||
//~ refresh:function(master, node, value){
|
|
||||||
//~ node.firstChild.innerHTML = master.count();
|
|
||||||
//~ }
|
|
||||||
//~ }, webix.ui.datafilter.summColumn)
|
|
||||||
|
|
||||||
webix.ui.datafilter.countRows = webix.extend({
|
webix.ui.datafilter.countRows = webix.extend({
|
||||||
refresh:function(master, node, value){
|
refresh:function(master, node, value){
|
||||||
node.firstChild.innerHTML = master.count();
|
node.firstChild.innerHTML = master.count();
|
||||||
}
|
}
|
||||||
}, webix.ui.datafilter.summColumn);
|
}, webix.ui.datafilter.summColumn);
|
||||||
|
|
||||||
|
|
||||||
|
webix.ui.datafilter.summActive = webix.extend({
|
||||||
|
refresh:function(master, node, value){
|
||||||
|
node.firstChild.innerHTML = this.summGenerate(master);
|
||||||
|
},
|
||||||
|
summGenerate:function(master){
|
||||||
|
var sum = 0
|
||||||
|
master.eachRow(function(id){
|
||||||
|
var row = master.getItem(id)
|
||||||
|
if(row.estatus == 'Generado'){
|
||||||
|
var importe = row.total
|
||||||
|
if(typeof importe === 'string'){
|
||||||
|
importe = row.total.to_float()
|
||||||
|
}
|
||||||
|
sum += importe
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return webix.i18n.priceFormat(sum)
|
||||||
|
}
|
||||||
|
}, webix.ui.datafilter.summColumn);
|
||||||
|
|
||||||
|
|
||||||
function validate_rfc(value){
|
function validate_rfc(value){
|
||||||
rfc = value.trim().toUpperCase();
|
rfc = value.trim().toUpperCase();
|
||||||
if ( rfc == ""){
|
if ( rfc == ""){
|
||||||
|
|
|
@ -42,7 +42,7 @@ var grid_tickets_cols = [
|
||||||
adjust: "data", sort:"string"},
|
adjust: "data", sort:"string"},
|
||||||
{id: 'total', header: ['Total', {content: 'numberFilter'}], width: 150,
|
{id: 'total', header: ['Total', {content: 'numberFilter'}], width: 150,
|
||||||
sort: 'int', format: webix.i18n.priceFormat, css: 'right',
|
sort: 'int', format: webix.i18n.priceFormat, css: 'right',
|
||||||
footer: {content: 'summColumn', css: 'right'}},
|
footer: {content: 'summActive', css: 'right'}},
|
||||||
{id: "cliente", header: ["Razón Social", {content: "selectFilter"}],
|
{id: "cliente", header: ["Razón Social", {content: "selectFilter"}],
|
||||||
fillspace:true, sort:"string", hidden: true},
|
fillspace:true, sort:"string", hidden: true},
|
||||||
{id: 'pdf', header: 'PDF', adjust: 'data', template: get_icon('pdf')},
|
{id: 'pdf', header: 'PDF', adjust: 'data', template: get_icon('pdf')},
|
||||||
|
|
Loading…
Reference in New Issue