Copiar mercancias del CFDI
This commit is contained in:
parent
f9df0d34d0
commit
c79e8492d3
|
@ -2487,28 +2487,6 @@ function get_leyendas_fiscales(){
|
|||
|
||||
//~ Delete
|
||||
function _tab_carta_porte(){
|
||||
var g1 = $$('grid_details')
|
||||
var g2 = $$('grid_carta_mercancias')
|
||||
|
||||
if(!g1.count()){
|
||||
msg = 'Agrega primero "todos" los productos a trasladar'
|
||||
msg_error(msg)
|
||||
activate_tab('tv_invoice', 'Generar')
|
||||
return
|
||||
}
|
||||
|
||||
g2.clearAll()
|
||||
|
||||
g1.eachRow(function(row){
|
||||
const r = g1.getItem(row)
|
||||
var data = new Object()
|
||||
data['BienesTransp'] = r.clave_sat
|
||||
data['Descripcion'] = r.descripcion
|
||||
data['Cantidad'] = r.cantidad
|
||||
data['ClaveUnidad'] = r.unidad
|
||||
//~ data['ValorMercancia'] = r.importe
|
||||
g2.add(data)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
@ -2621,8 +2599,49 @@ function cmd_invoice_ask_cancel_click(){
|
|||
|
||||
|
||||
function cmd_carta_add_product_click(){
|
||||
var g = $$('grid_carta_mercancias')
|
||||
g.add({delete: '-'})
|
||||
}
|
||||
|
||||
|
||||
function _copy_from_invoice(){
|
||||
var g1 = $$('grid_details')
|
||||
var g2 = $$('grid_carta_mercancias')
|
||||
|
||||
if(!g1.count()){
|
||||
msg = 'Agrega primero "todos" los productos a trasladar'
|
||||
msg_error(msg)
|
||||
return
|
||||
}
|
||||
|
||||
g2.clearAll()
|
||||
|
||||
g1.eachRow(function(row){
|
||||
const r = g1.getItem(row)
|
||||
var data = new Object()
|
||||
data['delete'] = '-'
|
||||
data['BienesTransp'] = r.clave_sat
|
||||
data['Descripcion'] = r.descripcion
|
||||
data['Cantidad'] = r.cantidad
|
||||
data['ClaveUnidad'] = r.unidad
|
||||
//~ data['ValorMercancia'] = r.importe
|
||||
g2.add(data)
|
||||
})
|
||||
}
|
||||
|
||||
function cmd_carta_copy_from_invoice_click(){
|
||||
msg = '¿Estás seguro de copiar los productos?<BR><BR> \
|
||||
Esto reemplazara todos los datos actuales'
|
||||
webix.confirm({
|
||||
title: 'Copiar productos',
|
||||
ok: 'Si',
|
||||
cancel: 'No',
|
||||
type: 'confirm-error',
|
||||
text: msg,
|
||||
callback:function(result){
|
||||
if(result){
|
||||
_copy_from_invoice()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -924,10 +924,11 @@ var grid_cols_carta_ubicaciones = [
|
|||
|
||||
var grid_cols_carta_mercancias = [
|
||||
{id: 'id', header: 'ID', hidden: true},
|
||||
{id: 'BienesTransp', header: 'Clave SAT', fillspace: 1},
|
||||
{id: 'Descripcion', header: 'Descripción', fillspace: 1},
|
||||
{id: 'Cantidad', header: 'Cantidad', format: webix.i18n.numberFormat, css: 'right', fillspace: 1},
|
||||
{id: 'ClaveUnidad', header: 'Unidad', options: 'values/unidades', fillspace: 1},
|
||||
{id: 'delete', header: '', width: 30, css: 'delete'},
|
||||
{id: 'BienesTransp', header: 'Clave SAT', editor: 'text', fillspace: 1},
|
||||
{id: 'Descripcion', header: 'Descripción', editor: 'text', fillspace: 1},
|
||||
{id: 'Cantidad', header: 'Cantidad', editor: 'text', format: webix.i18n.numberFormat, css: 'right', fillspace: 1},
|
||||
{id: 'ClaveUnidad', header: 'Unidad', editor: 'select', options: 'values/unidades', fillspace: 1},
|
||||
//~ {id: 'ValorMercancia', header: 'Valor Mercancia', format: webix.i18n.priceFormat, css: 'right', footer: 'Total peso:', fillspace: 1},
|
||||
{id: 'PesoEnKg', header: 'Peso (Kg)', format: webix.i18n.numberFormat, css: 'right', editor: 'text', footer: {content: 'summColumn', css: 'right'}, fillspace: 1},
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue