Refacturar

This commit is contained in:
Mauricio Baeza 2018-02-23 01:46:42 -06:00
parent 99abfd5859
commit cc56139665
1 changed files with 46 additions and 2 deletions

View File

@ -1113,7 +1113,6 @@ function grid_details_header_click(id){
callback:function(result){
if (result){
grid.clearAll()
//~ calculate_taxes()
calcular_impuestos()
}
}
@ -1121,8 +1120,53 @@ function grid_details_header_click(id){
}
function refacturar_invoice(id){
//~ webix.ajax().get('/values/preproductos', {'id': id}, {
//~ error: function(text, data, xhr) {
//~ msg_error('Error al consultar')
//~ },
//~ success: function(text, data, xhr){
//~ var values = data.json()
//~ set_client(values.receptor)
//~ for(var p of values.rows){
//~ agregar_preproducto(p)
//~ }
//~ calcular_impuestos()
//~ $$('tv_invoice').getTabbar().setValue('Generar')
//~ }
//~ })
}
function cmd_refacturar_click(){
showvar('Refacturar')
if(gi.count() == 0){
return
}
var row = gi.getSelectedItem()
if (row == undefined){
msg_error('Selecciona una factura')
return
}
if (row instanceof Array){
msg_error('Selecciona solo una factura')
return
}
var msg = '¿Estás seguro de refacturar la siguiente factura?<BR><BR>'
msg += '(' + row['serie'] + '-' + row['folio'] + ') ' + row['cliente']
webix.confirm({
title: 'Refacturar',
ok: 'Si',
cancel: 'No',
type: 'confirm-error',
text: msg,
callback:function(result){
if (result){
refacturar_invoice(row['id'])
}
}
})
}