forked from elmau/empresa-libre
Reporte en facturas
This commit is contained in:
commit
0993bee9ed
|
@ -13,6 +13,8 @@ var invoices_controllers = {
|
||||||
//~ Invoices
|
//~ Invoices
|
||||||
$$('cmd_new_invoice').attachEvent("onItemClick", cmd_new_invoice_click)
|
$$('cmd_new_invoice').attachEvent("onItemClick", cmd_new_invoice_click)
|
||||||
$$('cmd_refacturar').attachEvent("onItemClick", cmd_refacturar_click)
|
$$('cmd_refacturar').attachEvent("onItemClick", cmd_refacturar_click)
|
||||||
|
$$('cmd_invoice_report_pdf').attachEvent('onItemClick', cmd_invoice_report_pdf_click)
|
||||||
|
$$('cmd_invoice_report_xls').attachEvent('onItemClick', cmd_invoice_report_xls_click)
|
||||||
$$('cmd_delete_invoice').attachEvent("onItemClick", cmd_delete_invoice_click)
|
$$('cmd_delete_invoice').attachEvent("onItemClick", cmd_delete_invoice_click)
|
||||||
$$('cmd_timbrar').attachEvent('onItemClick', cmd_timbrar_click)
|
$$('cmd_timbrar').attachEvent('onItemClick', cmd_timbrar_click)
|
||||||
$$('cmd_close_invoice').attachEvent('onItemClick', cmd_close_invoice_click)
|
$$('cmd_close_invoice').attachEvent('onItemClick', cmd_close_invoice_click)
|
||||||
|
@ -148,8 +150,8 @@ function default_config(){
|
||||||
//~ showvar(values)
|
//~ showvar(values)
|
||||||
show('chk_cfdi_anticipo', values.cfdi_anticipo)
|
show('chk_cfdi_anticipo', values.cfdi_anticipo)
|
||||||
show('chk_cfdi_donativo', values.cfdi_donativo)
|
show('chk_cfdi_donativo', values.cfdi_donativo)
|
||||||
show('lst_metodo_pago', values.cfdi_metodo_pago)
|
show('lst_metodo_pago', !values.cfdi_metodo_pago)
|
||||||
show('txt_condicion_pago', values.cfdi_condicion_pago)
|
show('txt_condicion_pago', !values.cfdi_condicion_pago)
|
||||||
if(!values.cfdi_ine){
|
if(!values.cfdi_ine){
|
||||||
$$('tv_invoice').getTabbar().hideOption('INE')
|
$$('tv_invoice').getTabbar().hideOption('INE')
|
||||||
}else{
|
}else{
|
||||||
|
@ -1676,3 +1678,34 @@ function cfdi_notes_key_up(){
|
||||||
var value = this.getValue()
|
var value = this.getValue()
|
||||||
$$('form_invoice').setValues({notas: value}, true)
|
$$('form_invoice').setValues({notas: value}, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_invoice_report_pdf_click(){
|
||||||
|
webix.toPDF($$('grid_invoices'), {
|
||||||
|
ignore: {'xml': true, 'pdf': true, 'zip': true, 'mail': true},
|
||||||
|
filename: 'Reporte_de_Facturas',
|
||||||
|
width: 612,
|
||||||
|
height: 792,
|
||||||
|
autowidth: true,
|
||||||
|
columns:{
|
||||||
|
index: true,
|
||||||
|
serie: {width: 50},
|
||||||
|
folio: {width: 50},
|
||||||
|
fecha: {width: 125},
|
||||||
|
tipo_comprobante: {width: 25},
|
||||||
|
estatus: true,
|
||||||
|
total_mn: {css: 'right'},
|
||||||
|
cliente: true,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function cmd_invoice_report_xls_click(){
|
||||||
|
webix.toExcel($$('grid_invoices'), {
|
||||||
|
filename: 'Reporte_de_Facturas',
|
||||||
|
name: 'Facturas',
|
||||||
|
ignore: {'xml': true, 'pdf': true, 'zip': true, 'mail': true},
|
||||||
|
rawValues: true,
|
||||||
|
})
|
||||||
|
}
|
|
@ -157,6 +157,27 @@ webix.ui.datafilter.summActive = webix.extend({
|
||||||
}, webix.ui.datafilter.summColumn);
|
}, webix.ui.datafilter.summColumn);
|
||||||
|
|
||||||
|
|
||||||
|
webix.ui.datafilter.summTimbrada = 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 == 'Timbrada'){
|
||||||
|
var importe = row.total_mn
|
||||||
|
if(typeof importe === 'string'){
|
||||||
|
importe = row.total_mn.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 == ""){
|
||||||
|
|
|
@ -175,6 +175,11 @@ var toolbar_invoices = [
|
||||||
{view: "button", id: "cmd_refacturar", label: "Refacturar", type: "iconButton",
|
{view: "button", id: "cmd_refacturar", label: "Refacturar", type: "iconButton",
|
||||||
autowidth: true, icon: "pencil"},
|
autowidth: true, icon: "pencil"},
|
||||||
{},
|
{},
|
||||||
|
{view: 'button', id: 'cmd_invoice_report_pdf', label: 'Reporte',
|
||||||
|
type: 'iconButton', autowidth: true, icon: 'file-pdf-o'},
|
||||||
|
{view: 'button', id: 'cmd_invoice_report_xls', label: 'Reporte',
|
||||||
|
type: 'iconButton', autowidth: true, icon: 'table'},
|
||||||
|
{},
|
||||||
{view: "button", id: "cmd_delete_invoice", label: "Eliminar", type: "iconButton",
|
{view: "button", id: "cmd_delete_invoice", label: "Eliminar", type: "iconButton",
|
||||||
autowidth: true, icon: "minus"},
|
autowidth: true, icon: "minus"},
|
||||||
]
|
]
|
||||||
|
@ -229,8 +234,9 @@ var grid_invoices_cols = [
|
||||||
adjust: 'header', sort: 'string'},
|
adjust: 'header', sort: 'string'},
|
||||||
{id: "estatus", header: ["Estatus", {content: "selectFilter"}],
|
{id: "estatus", header: ["Estatus", {content: "selectFilter"}],
|
||||||
adjust: "data", sort:"string"},
|
adjust: "data", sort:"string"},
|
||||||
{id: 'total_mn', header: ['Total M.N.', {content: 'numberFilter'}], width: 150,
|
{id: 'total_mn', header: ['Total M.N.', {content: 'numberFilter'}],
|
||||||
sort: 'int', format: webix.i18n.priceFormat, css: 'right'},
|
width: 150, sort: 'int', format: webix.i18n.priceFormat, css: 'right',
|
||||||
|
footer: {content: 'summTimbrada', css: 'right'}},
|
||||||
{id: "cliente", header: ["Razón Social", {content: "selectFilter"}],
|
{id: "cliente", header: ["Razón Social", {content: "selectFilter"}],
|
||||||
fillspace:true, sort:"string"},
|
fillspace:true, sort:"string"},
|
||||||
{id: 'xml', header: 'XML', adjust: 'data', template: get_icon('xml')},
|
{id: 'xml', header: 'XML', adjust: 'data', template: get_icon('xml')},
|
||||||
|
|
Loading…
Reference in New Issue