diff --git a/source/static/js/ui/invoices.js b/source/static/js/ui/invoices.js index ec4fc99..e479d9c 100644 --- a/source/static/js/ui/invoices.js +++ b/source/static/js/ui/invoices.js @@ -844,27 +844,74 @@ var opt_entrada_salida = [ ] +var opt_origen_destino = [ + {id: 'Origen', value: 'Origen'}, + {id: 'Destino', value: 'Destino'}, +] + + +webix.editors.$popup = { + date: { + view: "popup", + body: {view: "calendar", timepicker:true, icons:true} + } +}; + + var grid_cols_carta_ubicaciones = [ {id: 'id', header: 'ID', hidden: true}, - {id: 'TipoUbicacion', header: 'Tipo de Ubicación', fillspace: 1}, - {id: 'IDUbicacion', header: 'ID Ubicación', fillspace: 1}, - {id: 'RFCRemitenteDestinatario', header: 'RFC Rem/Des', fillspace: 1}, - {id: 'NombreRemitenteDestinatario', header: 'Nombre Rem/Des', fillspace: 1}, + {id: 'delete', header: '', width: 30, css: 'delete'}, + {id: 'TipoUbicacion', header: 'Tipo de Ubicación', editor: 'select', options: opt_origen_destino, fillspace: 1}, + {id: 'RFCRemitenteDestinatario', header: 'RFC Rem/Des', editor: 'text', fillspace: 1}, + {id: 'FechaHoraSalidaLlegada', header: 'Fecha/Hora', editor: 'date', format: webix.Date.dateToStr("%D, %d-%M-%Y %h:%i"), footer: 'Total distancia:', fillspace: 1}, + {id: 'DistanciaRecorrida', header: 'Distancia (KM)', editor: 'text', css: 'right', footer: {content: 'summColumn', css: 'right'}, fillspace: 1}, +] + + +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', css: 'right', footer: {content: 'summColumn', css: 'right'}, fillspace: 1}, + {id: 'ClaveUnidad', header: 'Unidad', fillspace: 1}, + {id: 'PesoEnKg', header: 'Peso (Kg)', css: 'right', footer: {content: 'summColumn', css: 'right'}, fillspace: 1}, ] var grid_carta_ubicaciones = { view: 'datatable', id: 'grid_carta_ubicaciones', - select: 'row', multiselect: false, adjust: true, autoheight: true, headermenu: true, + editable: true, + footer: true, columns: grid_cols_carta_ubicaciones, + data: [ + {delete: '-', TipoUbicacion: 'Origen'}, + {delete: '-', TipoUbicacion: 'Destino'}, + ] } +var grid_carta_mercancias = { + view: 'datatable', + id: 'grid_carta_mercancias', + multiselect: false, + adjust: true, + autoheight: true, + headermenu: true, + editable: true, + footer: true, + columns: grid_cols_carta_mercancias, +} + + +var body_carta_mercancias = {rows:[ + grid_carta_mercancias, +]} + var body_carta_ubicaciones = {rows:[ grid_carta_ubicaciones, ]} @@ -875,6 +922,7 @@ var controls_carta_porte = [ {view: 'checkbox', id: 'chk_cfdi_usar_cartaporte', labelWidth: 0, labelRight: 'Usar el complemento Carta Porte'}, {}]}, + {view: 'fieldset', label: 'Mercancias', body: body_carta_mercancias}, {cols: [{maxWidth: 15}, {view: 'richselect', id: 'lst_carta_TranspInternac', labelPosition: 'top', label: 'Transporte Internacional', options: opt_transporte_internacional,