Validate add products
This commit is contained in:
parent
920ff62e98
commit
585632882d
|
@ -581,7 +581,6 @@ function save_invoice(data){
|
|||
table_totals.clear()
|
||||
grid.clearAll()
|
||||
$$('grid_totals').clearAll()
|
||||
|
||||
}
|
||||
|
||||
return result
|
||||
|
|
|
@ -442,13 +442,42 @@ function cmd_products_add_click(id, e, node){
|
|||
|
||||
//~ Close add products
|
||||
function cmd_close_products_add_click(id, e, node){
|
||||
var grid = $$('grid_partner_products')
|
||||
|
||||
$$('multi_invoices').setValue('products_home')
|
||||
$$('lbl_partner').setValue('')
|
||||
grid.clearAll()
|
||||
}
|
||||
|
||||
//~ Save add products
|
||||
function cmd_save_products_add_click(id, e, node){
|
||||
msg_ok('Guardado')
|
||||
var grid = $$('grid_partner_products')
|
||||
var count = 0
|
||||
var products = []
|
||||
|
||||
grid.eachRow(function(row){
|
||||
var r = grid.getItem(row)
|
||||
if(r.select){
|
||||
var p = {}
|
||||
count += 1
|
||||
p.id_product = r.id_product
|
||||
p.key_sat = r.key_sat1
|
||||
p.description = r.description1
|
||||
p.unit_value = r.unit_value1
|
||||
p.cant = r.cant1
|
||||
products.push(p)
|
||||
}
|
||||
})
|
||||
|
||||
if(!count){
|
||||
msg = 'Selecciona al menos un registro'
|
||||
msg_error(msg)
|
||||
return
|
||||
}
|
||||
|
||||
$$('multi_invoices').setValue('products_home')
|
||||
$$('lbl_partner').setValue('')
|
||||
grid.clearAll()
|
||||
}
|
||||
|
||||
//~ Import from xml
|
||||
|
|
Loading…
Reference in New Issue