From dbc1a2c0590fbf4f3e196d55acb09623e6b93c6b Mon Sep 17 00:00:00 2001 From: Ana Elisa dos Santos Date: Fri, 22 Feb 2019 12:36:43 +0000 Subject: [PATCH] =?UTF-8?q?2258=20-=20Criar=20op=C3=A7=C3=A3o=20para=20sep?= =?UTF-8?q?arar=20lan=C3=A7amentos=20do=20tipo=20Caminh=C3=A3o=20ou=20Carr?= =?UTF-8?q?eta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Outra atividade também vinculada a este painel: 2259 - Adicionar filtro por Caminhão ou Carreta no grid --- 03 - Painéis/LANÇAMENTO - Despesas.xml | 4926 ++++++++++++---------- 1 file changed, 2714 insertions(+), 2212 deletions(-) diff --git a/03 - Painéis/LANÇAMENTO - Despesas.xml b/03 - Painéis/LANÇAMENTO - Despesas.xml index e62b7e6..9c0a345 100644 --- a/03 - Painéis/LANÇAMENTO - Despesas.xml +++ b/03 - Painéis/LANÇAMENTO - Despesas.xml @@ -1,2213 +1,2715 @@ - - -
- Lançar Valor - Regras Contábeis - - Subtotal R' + r.total + ''); - } else { - engine.getLabel('sub').setValue('Subtotal R$ 0,00'); - } - }); - } - - function fncSubTotalPessoal() { - var params = {id: 0}; - var db = vScriptService.loadScript('db', 'javascript'); - var vitruvio = new db('vitruvio'); - var sql = "Select replace(replace(replace(to_char(sum(cdp.valor), 'L9G999G990D99'),',','-' ),'.',','),'-','.') total from controle_despesas_pessoais cdp where cdp.data between '" + engine.getField('dataInicioPessoal') + "' and '" + engine.getField('dataFinalPessoal') + "'"; - if (engine.getField('ftResponsavelPessoal').getValue()) { - sql += " and cdp.chave_responsavel = " + engine.getField('ftResponsavelPessoal').getValue(); - } - vitruvio.query(sql).each(function (r) { - if (r.total) { - engine.getLabel('subPessoal').setValue('Subtotal R' + r.total + ''); - } else { - engine.getLabel('subPessoal').setValue('Subtotal R$ 0,00'); - } - }); - } - - function fncSubTotalCombustivel() { - var params = {id: 0}; - var db = vScriptService.loadScript('db', 'javascript'); - var vitruvio = new db('vitruvio'); - var sql = "Select replace(replace(replace(to_char(sum(cdc.total_combustivel), 'L9G999G990D99'),',','-' ),'.',','),'-','.') total from controle_despesas_combustiveis cdc where cdc.data between '" + engine.getField('dataInicioCombustivel') + "' and '" + engine.getField('dataFinalCombustivel') + "'"; - if (engine.getField('ftPlacaCombustivel').getValue()) { - sql += " and cdc.chave_veiculo = " + engine.getField('ftPlacaCombustivel').getValue(); - } - if (engine.getField('ftCombustivel').getValue()) { - sql += " and cdc.chave_combustivel = " + engine.getField('ftCombustivel').getValue(); - } - if (engine.getField('ftClienteCombustivel').getValue()) { - sql += " and cdc.chave_cliente = " + engine.getField('ftClienteCombustivel').getValue(); - } - vitruvio.query(sql).each(function (r) { - if (r.total) { - engine.getLabel('subCombustivel').setValue('Subtotal R' + r.total + ''); - } else { - engine.getLabel('subCombustivel').setValue('Subtotal R$ 0,00'); - } - }); - } - - function run() { - engine.getField('totalCombustivel').setEnabled(false); - engine.getField('kmRodado').setEnabled(false); - engine.getField('mediaCombustivel').setEnabled(false); - - - var d = new java.util.Date(); - engine.setGlobalVariable('fncLimpaCampos', fncLimpaCampos); - engine.setGlobalVariable('fncSubTotal', fncSubTotal); - engine.setGlobalVariable('fncSubTotalPessoal', fncSubTotalPessoal); - engine.setGlobalVariable('fncSubTotalCombustivel', fncSubTotalCombustivel); - engine.getField('dataInicio').setValue(d); - engine.getField('dataFinal').setValue(d); - engine.getField('dataInicioPessoal').setValue(d); - engine.getField('dataFinalPessoal').setValue(d); - engine.getField('dataInicioCombustivel').setValue(d); - engine.getField('dataFinalCombustivel').setValue(d); - engine.getField('tbLancamentos').refresh(); - engine.getField('tbPessoal').refresh(); - engine.getField('tbTotalSocios').refresh(); - engine.getField('tbCombustivel').refresh(); - engine.getField('tbTotalCombustivel').refresh(); - engine.getGlobalVariable('fncSubTotal')(); - engine.getGlobalVariable('fncSubTotalPessoal')(); - engine.getGlobalVariable('fncSubTotalCombustivel')(); - - // Registrando icones - engine.getWidgetController('btnGravar').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.SALVAR)); - engine.getWidgetController('btnFiltrar').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.FILTRAR)); - engine.getWidgetController('btnLimparFiltro').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.LIMPAR)); - engine.getWidgetController('btnGravarPessoal').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.SALVAR)); - engine.getWidgetController('btnFiltrarPessoal').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.FILTRAR)); - engine.getWidgetController('btnLimparFiltroPessoal').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.LIMPAR)); - engine.getWidgetController('btnGravarCombustivel').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.SALVAR)); - engine.getWidgetController('btnFiltrarCombustivel').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.FILTRAR)); - engine.getWidgetController('btnLimparFiltroCombustivel').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.LIMPAR)); - } - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - CODIGO - PLACA - - - - - - - - CODIGO - NOME - - - - - - - - CODIGO - DESCRICAO - - - - - - - - CODIGO - DESCRICAO - - - - - - - - - - - - - CODIGO - NOME - - - - - - - - - CODIGO - NOME - - - - - - - - CODIGO - RAZAO_SOCIAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CODIGO - NOME - - - - - - - - CODIGO - PLACA - - - - - - - - CODIGO - NOME - - - - - - - - CODIGO - RAZAO_SOCIAL - - - - - - - - - - - - - - - - - - - - chave_despesa_operacional - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - importClass(Packages.br.com.davinti.vitruvio.ui.core.VitruvioTheme); - importClass(Packages.com.vaadin.ui.VerticalLayout); - - function Generator() { - var com = libService.loadScript('vaadinComponents'); - this.generate = function(itemId, columnId, item, container) { - var titulo = item.getItemProperty('OBSERVACOES').getValue(); - if (titulo.length() >= 20) { - titulo = titulo.substring(0,19) + '...'; - } - var btn = com.linkButton(titulo, function(){ - var subContent = new VerticalLayout(); - subContent.setId('teste'); - subContent.setMargin(true); - var linha = item; - - var textArea = com.textArea(null, item.getItemProperty('OBSERVACOES').getValue()); - var instGravar = function run() { - var sqlAtualiza = 'UPDATE controle_despesas_operacionais SET observacoes = ? ' + - ' WHERE CHAVE_DESPESA_OPERACIONAL = ? '; - var params = new java.util.ArrayList(); - params.add(textArea.getValue()); - params.add(linha.getItemProperty('CHAVE_DESPESA_OPERACIONAL').getValue().longValue()); - vQueryService.executePSUpdateQuery('vitruvio', sqlAtualiza, params.toArray()); - engine.getField('tbLancamentos').refresh(); - window.close(); - }; - var gravar = com.button('Gravar',instGravar,null); - subContent.addComponent(textArea); - subContent.addComponent(gravar); - var window = com.openWindow(item.getItemProperty('CLIENTE').getValue(), subContent,500,200); - - textArea.setSizeFull(); - textArea.addStyleName(com.theme().TEXTAREA_BORDERLESS); - window.setModal(true); - }); - btn.setDescription(item.getItemProperty('OBSERVACOES').getValue()); - var container = com.horizontalLayout([btn]); - container.setSpacing(false); - return container; - } - } - var script = new Generator(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CODIGO - DESCRICAO - - - - - - - - CODIGO - NOME - - - - - - - - - - - - - - - - - - - - - - - - - - CODIGO - NOME - - - - - - - - - - - - - - - - - - - - - chave_pessoal - - - - - - - - - - - - - - - - - - - - - importClass(Packages.br.com.davinti.vitruvio.ui.core.VitruvioTheme); - importClass(Packages.com.vaadin.ui.VerticalLayout); - - function Generator() { - var com = libService.loadScript('vaadinComponents'); - this.generate = function(itemId, columnId, item, container) { - var titulo = item.getItemProperty('OBSERVACOES').getValue(); - if (titulo.length() >= 20) { - titulo = titulo.substring(0,19) + '...'; - } - var btn = com.linkButton(titulo, function(){ - var subContent = new VerticalLayout(); - subContent.setId('teste'); - subContent.setMargin(true); - var linha = item; - - var textArea = com.textArea(null, item.getItemProperty('OBSERVACOES').getValue()); - var instGravar = function run() { - var sqlAtualiza = 'UPDATE controle_despesas_pessoais SET observacoes = ? ' + - ' WHERE CHAVE_PESSOAL = ? '; - var params = new java.util.ArrayList(); - params.add(textArea.getValue()); - params.add(linha.getItemProperty('CHAVE_PESSOAL').getValue().longValue()); - vQueryService.executePSUpdateQuery('vitruvio', sqlAtualiza, params.toArray()); - engine.getField('tbPessoal').refresh(); - window.close(); - }; - var gravar = com.button('Gravar',instGravar,null); - subContent.addComponent(textArea); - subContent.addComponent(gravar); - var window = com.openWindow(item.getItemProperty('CATEGORIA').getValue(), subContent,500,200); - - textArea.setSizeFull(); - textArea.addStyleName(com.theme().TEXTAREA_BORDERLESS); - window.setModal(true); - }); - btn.setDescription(item.getItemProperty('OBSERVACOES').getValue()); - var container = com.horizontalLayout([btn]); - container.setSpacing(false); - return container; - } - } - var script = new Generator(); - - - - - - - - - - - - - - - - NOME - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CODIGO - PLACA - - - - - - - - CODIGO - NOME - - - - - - - - - - - CODIGO - DESCRICAO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CODIGO - PLACA - - - - - - - - CODIGO - DESCRICAO - - - - - - - - CODIGO - NOME - - - - - - - - - - - - - - - - - - - - - chave_despesa_combustivel - - - - - - - - - - - - - - - - - - - - importClass(Packages.br.com.davinti.vitruvio.ui.core.VitruvioTheme); - importClass(Packages.com.vaadin.ui.VerticalLayout); - - function Generator() { - var com = libService.loadScript('vaadinComponents'); - this.generate = function(itemId, columnId, item, container) { - var titulo = item.getItemProperty('OBSERVACOES').getValue(); - if (titulo.length() >= 20) { - titulo = titulo.substring(0,19) + '...'; - } - var btn = com.linkButton(titulo, function(){ - var subContent = new VerticalLayout(); - subContent.setId('teste'); - subContent.setMargin(true); - var linha = item; - - var textArea = com.textArea(null, item.getItemProperty('OBSERVACOES').getValue()); - var instGravar = function run() { - var sqlAtualiza = 'UPDATE controle_despesas_combustiveis SET observacoes = ? ' + - ' WHERE CHAVE_DESPESA_COMBUSTIVEL = ? '; - var params = new java.util.ArrayList(); - params.add(textArea.getValue()); - params.add(linha.getItemProperty('CHAVE_DESPESA_COMBUSTIVEL').getValue().longValue()); - vQueryService.executePSUpdateQuery('vitruvio', sqlAtualiza, params.toArray()); - engine.getField('tbCombustivel').refresh(); - engine.getField('tbTotalCombustivel').refresh(); - engine.getGlobalVariable('fncSubTotalCombustivel')(); - window.close(); - }; - var gravar = com.button('Gravar',instGravar,null); - subContent.addComponent(textArea); - subContent.addComponent(gravar); - var window = com.openWindow(item.getItemProperty('CLIENTE').getValue(), subContent,500,200); - - textArea.setSizeFull(); - textArea.addStyleName(com.theme().TEXTAREA_BORDERLESS); - window.setModal(true); - }); - btn.setDescription(item.getItemProperty('OBSERVACOES').getValue()); - var container = com.horizontalLayout([btn]); - container.setSpacing(false); - return container; - } - } - var script = new Generator(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - DESCRICAO - - - - - - - - - - - - - - - -
+ + +
+ Lançar Valor + Regras Contábeis + + Subtotal R' + r.total + ''); + } else { + engine.getLabel('sub').setValue('Subtotal R$ 0,00'); + } + }); + } + + function fncSubTotalPessoal() { + var params = {id: 0}; + var db = vScriptService.loadScript('db', 'javascript'); + var vitruvio = new db('vitruvio'); + var sql = "Select replace(replace(replace(to_char(sum(cdp.valor), 'L9G999G990D99'),',','-' ),'.',','),'-','.') total from controle_despesas_pessoais cdp where cdp.data between '" + engine.getField('dataInicioPessoal') + "' and '" + engine.getField('dataFinalPessoal') + "'"; + if (engine.getField('ftResponsavelPessoal').getValue()) { + sql += " and cdp.chave_responsavel = " + engine.getField('ftResponsavelPessoal').getValue(); + } + vitruvio.query(sql).each(function (r) { + if (r.total) { + engine.getLabel('subPessoal').setValue('Subtotal R' + r.total + ''); + } else { + engine.getLabel('subPessoal').setValue('Subtotal R$ 0,00'); + } + }); + } + + function fncSubTotalCombustivel() { + var params = {id: 0}; + var db = vScriptService.loadScript('db', 'javascript'); + var vitruvio = new db('vitruvio'); + var sql = "Select replace(replace(replace(to_char(sum(cdc.total_combustivel), 'L9G999G990D99'),',','-' ),'.',','),'-','.') total from controle_despesas_combustiveis cdc where cdc.data between '" + engine.getField('dataInicioCombustivel') + "' and '" + engine.getField('dataFinalCombustivel') + "'"; + if (engine.getField('ftPlacaCombustivel').getValue()) { + sql += " and cdc.chave_veiculo = " + engine.getField('ftPlacaCombustivel').getValue(); + } + if (engine.getField('ftCombustivel').getValue()) { + sql += " and cdc.chave_combustivel = " + engine.getField('ftCombustivel').getValue(); + } + if (engine.getField('ftClientesCombustivel').getValue() && engine.getField('ftClientesCombustivel').getValue() != '[]') { + sql += " and cdc.chave_cliente in (" + engine.getField('ftClientesCombustivel').getValue().toString().replace('[','').replace(']','') + ")"; + } + if (engine.getField('ftposto').getValue()) { + sql += " and cdc.chave_posto = " + engine.getField('ftposto').getValue(); + } + if (engine.getField('ftFrotaTerceiroOperacionalCombustivel').getValue() == 'F') { + sql += " and cdc.frota_terceiro = 'F'"; + } else if (engine.getField('ftFrotaTerceiroOperacionalCombustivel').getValue() == 'T') { + sql += " and cdc.frota_terceiro = 'T'"; + } + if (engine.getField('ftCaminhaoCarretaOperacionalCombustivel').getValue() == 'C') { + sql += " and cdc.caminhao_carreta = 'C'"; + } else if (engine.getField('ftCaminhaoCarretaOperacionalCombustivel').getValue() == 'T') { + sql += " and cdc.caminhao_carreta = 'T'"; + } else if (engine.getField('ftCaminhaoCarretaOperacionalCombustivel').getValue() == 'O') { + sql += " and cdc.caminhao_carreta = 'O'"; + } + vitruvio.query(sql).each(function (r) { + if (r.total) { + engine.getLabel('subCombustivel').setValue('Subtotal R' + r.total + ''); + } else { + engine.getLabel('subCombustivel').setValue('Subtotal R$ 0,00'); + } + }); + } + + function run() { + engine.getField('totalCombustivel').setEnabled(false); + engine.getField('kmRodado').setEnabled(false); + engine.getField('mediaCombustivel').setEnabled(false); + engine.getField('ftFrotaTerceiroOperacional').setValue('A'); + engine.getField('ftFrotaTerceiroOperacionalCombustivel').setValue('A'); + engine.getField('ftCaminhaoCarretaOperacional').setValue('A'); + engine.getField('ftCaminhaoCarretaOperacionalCombustivel').setValue('A'); + + var d = new java.util.Date(); + engine.setGlobalVariable('fncLimpaCampos', fncLimpaCampos); + engine.setGlobalVariable('fncSubTotal', fncSubTotal); + engine.setGlobalVariable('fncSubTotalPessoal', fncSubTotalPessoal); + engine.setGlobalVariable('fncSubTotalCombustivel', fncSubTotalCombustivel); + engine.getField('dataInicio').setValue(d); + engine.getField('dataFinal').setValue(d); + engine.getField('dataInicioPessoal').setValue(d); + engine.getField('dataFinalPessoal').setValue(d); + engine.getField('dataInicioCombustivel').setValue(d); + engine.getField('dataFinalCombustivel').setValue(d); + engine.getField('tbLancamentos').refresh(); + engine.getField('tbPessoal').refresh(); + engine.getField('tbTotalSocios').refresh(); + engine.getField('tbCombustivel').refresh(); + engine.getField('tbTotalCombustivel').refresh(); + engine.getGlobalVariable('fncSubTotal')(); + engine.getGlobalVariable('fncSubTotalPessoal')(); + engine.getGlobalVariable('fncSubTotalCombustivel')(); + + // Registrando icones + engine.getWidgetController('btnGravar').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.SALVAR)); + engine.getWidgetController('btnFiltrar').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.FILTRAR)); + engine.getWidgetController('btnLimparFiltro').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.LIMPAR)); + engine.getWidgetController('btnGravarPessoal').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.SALVAR)); + engine.getWidgetController('btnFiltrarPessoal').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.FILTRAR)); + engine.getWidgetController('btnLimparFiltroPessoal').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.LIMPAR)); + engine.getWidgetController('btnGravarCombustivel').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.SALVAR)); + engine.getWidgetController('btnFiltrarCombustivel').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.FILTRAR)); + engine.getWidgetController('btnLimparFiltroCombustivel').getButton().setIcon(IconFactory.instance().getIconAsResource(IconLibraryAPISmall.LIMPAR)); + } + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CODIGO + PLACA + + + + + + + + + CODIGO + NOME + + + + + + + + + + + + + + + + + + + CODIGO + DESCRICAO + + + + + + + + + CODIGO + DESCRICAO + + + + + + + + + + + + CODIGO + NOME + + + + + + + + + + + + CODIGO + NOME + + + + + + + + CODIGO + RAZAO_SOCIAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + CODIGO + NOME + + + + + + + + + + + + CODIGO + NOME + + + + + + + + CODIGO + PLACA + + + + + + + + CODIGO + RAZAO_SOCIAL + + + + + + + + + + + + + + + + + + + + + + CODIGO + DESCRICAO + + + + + + + + + CODIGO + DESCRICAO + + + + + + + + + + + + + + + + + + + + + + + chave_despesa_operacional + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + importClass(Packages.br.com.davinti.vitruvio.ui.core.VitruvioTheme); + importClass(Packages.com.vaadin.ui.VerticalLayout); + + function Generator() { + var com = libService.loadScript('vaadinComponents'); + this.generate = function(itemId, columnId, item, container) { + var titulo = item.getItemProperty('OBSERVACOES').getValue(); + if (titulo.length() >= 20) { + titulo = titulo.substring(0,19) + '...'; + } + var btn = com.linkButton(titulo, function(){ + var subContent = new VerticalLayout(); + subContent.setId('teste'); + subContent.setMargin(true); + var linha = item; + + var textArea = com.textArea(null, item.getItemProperty('OBSERVACOES').getValue()); + var instGravar = function run() { + var sqlAtualiza = 'UPDATE controle_despesas_operacionais SET observacoes = ? ' + + ' WHERE CHAVE_DESPESA_OPERACIONAL = ? '; + var params = new java.util.ArrayList(); + params.add(textArea.getValue()); + params.add(linha.getItemProperty('CHAVE_DESPESA_OPERACIONAL').getValue().longValue()); + vQueryService.executePSUpdateQuery('vitruvio', sqlAtualiza, params.toArray()); + engine.getField('tbLancamentos').refresh(); + window.close(); + }; + var gravar = com.button('Gravar',instGravar,null); + subContent.addComponent(textArea); + subContent.addComponent(gravar); + var window = com.openWindow(item.getItemProperty('CLIENTE').getValue(), subContent,500,200); + + textArea.setSizeFull(); + textArea.addStyleName(com.theme().TEXTAREA_BORDERLESS); + window.setModal(true); + }); + btn.setDescription(item.getItemProperty('OBSERVACOES').getValue()); + var container = com.horizontalLayout([btn]); + container.setSpacing(false); + return container; + } + } + var script = new Generator(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CODIGO + DESCRICAO + + + + + + + + CODIGO + NOME + + + + + + + + + + + + + + + + + + + + + + + + + + CODIGO + NOME + + + + + + + + + + + + + + + + + + + + + chave_pessoal + + + + + + + + + + + + + + + + + + + + + importClass(Packages.br.com.davinti.vitruvio.ui.core.VitruvioTheme); + importClass(Packages.com.vaadin.ui.VerticalLayout); + + function Generator() { + var com = libService.loadScript('vaadinComponents'); + this.generate = function(itemId, columnId, item, container) { + var titulo = item.getItemProperty('OBSERVACOES').getValue(); + if (titulo.length() >= 20) { + titulo = titulo.substring(0,19) + '...'; + } + var btn = com.linkButton(titulo, function(){ + var subContent = new VerticalLayout(); + subContent.setId('teste'); + subContent.setMargin(true); + var linha = item; + + var textArea = com.textArea(null, item.getItemProperty('OBSERVACOES').getValue()); + var instGravar = function run() { + var sqlAtualiza = 'UPDATE controle_despesas_pessoais SET observacoes = ? ' + + ' WHERE CHAVE_PESSOAL = ? '; + var params = new java.util.ArrayList(); + params.add(textArea.getValue()); + params.add(linha.getItemProperty('CHAVE_PESSOAL').getValue().longValue()); + vQueryService.executePSUpdateQuery('vitruvio', sqlAtualiza, params.toArray()); + engine.getField('tbPessoal').refresh(); + window.close(); + }; + var gravar = com.button('Gravar',instGravar,null); + subContent.addComponent(textArea); + subContent.addComponent(gravar); + var window = com.openWindow(item.getItemProperty('CATEGORIA').getValue(), subContent,500,200); + + textArea.setSizeFull(); + textArea.addStyleName(com.theme().TEXTAREA_BORDERLESS); + window.setModal(true); + }); + btn.setDescription(item.getItemProperty('OBSERVACOES').getValue()); + var container = com.horizontalLayout([btn]); + container.setSpacing(false); + return container; + } + } + var script = new Generator(); + + + + + + + + + + + + + + + + NOME + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CODIGO + PLACA + + + + + + + + + + + + + CODIGO + NOME + + + + + + + + CODIGO + NOME + + + + + + + + + + + + + + + + + + + + + + + + CODIGO + DESCRICAO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CODIGO + NOME + + + + + + + + + + + + CODIGO + PLACA + + + + + + + + CODIGO + DESCRICAO + + + + + + + + + + + + + + + + + + + + + + CODIGO + NOME + + + + + + + + + + + + + + + + + + + + 0 "; + if (engine.getField('dataInicioCombustivel').getValue()) { + sql += " and cdc.data between '" + engine.getField('dataInicioCombustivel').getValue() + "' and '" + engine.getField('dataFinalCombustivel').getValue() + "'"; + } + if (engine.getField('ftPlacaCombustivel').getValue()) { + sql += " and cdc.chave_veiculo = " + engine.getField('ftPlacaCombustivel').getValue(); + } + if (engine.getField('ftCombustivel').getValue()) { + sql += " and cdc.chave_combustivel = " + engine.getField('ftCombustivel').getValue(); + } + if (engine.getField('ftClientesCombustivel').getValue() && engine.getField('ftClientesCombustivel').getValue() != '[]') { + sql += " and cdc.chave_cliente in (" + engine.getField('ftClientesCombustivel').getValue().toString().replace('[','').replace(']','') + ")"; + } + if (engine.getField('ftposto').getValue()) { + sql += " and cdc.chave_posto = " + engine.getField('ftposto').getValue(); + } + if (engine.getField('ftFrotaTerceiroOperacionalCombustivel').getValue() == 'F') { + sql += " and cdc.frota_terceiro = 'F'"; + } else if (engine.getField('ftFrotaTerceiroOperacionalCombustivel').getValue() == 'T') { + sql += " and cdc.frota_terceiro = 'T'"; + } + if (engine.getField('ftCaminhaoCarretaOperacionalCombustivel').getValue() == 'C') { + sql += " and cdc.caminhao_carreta = 'C'"; + } else if (engine.getField('ftCaminhaoCarretaOperacionalCombustivel').getValue() == 'T') { + sql += " and cdc.caminhao_carreta = 'T'"; + } else if (engine.getField('ftCaminhaoCarretaOperacionalCombustivel').getValue() == 'O') { + sql += " and cdc.caminhao_carreta = 'O'"; + } + + sql += " order by data desc"; + } + return sql; + } + ]]> + + + chave_despesa_combustivel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + importClass(Packages.br.com.davinti.vitruvio.ui.core.VitruvioTheme); + importClass(Packages.com.vaadin.ui.VerticalLayout); + + function Generator() { + var com = libService.loadScript('vaadinComponents'); + this.generate = function(itemId, columnId, item, container) { + var titulo = item.getItemProperty('OBSERVACOES').getValue(); + if (titulo.length() >= 20) { + titulo = titulo.substring(0,19) + '...'; + } + var btn = com.linkButton(titulo, function(){ + var subContent = new VerticalLayout(); + subContent.setId('teste'); + subContent.setMargin(true); + var linha = item; + + var textArea = com.textArea(null, item.getItemProperty('OBSERVACOES').getValue()); + var instGravar = function run() { + var sqlAtualiza = 'UPDATE controle_despesas_combustiveis SET observacoes = ? ' + + ' WHERE CHAVE_DESPESA_COMBUSTIVEL = ? '; + var params = new java.util.ArrayList(); + params.add(textArea.getValue()); + params.add(linha.getItemProperty('CHAVE_DESPESA_COMBUSTIVEL').getValue().longValue()); + vQueryService.executePSUpdateQuery('vitruvio', sqlAtualiza, params.toArray()); + engine.getField('tbCombustivel').refresh(); + engine.getField('tbTotalCombustivel').refresh(); + engine.getGlobalVariable('fncSubTotalCombustivel')(); + window.close(); + }; + var gravar = com.button('Gravar',instGravar,null); + subContent.addComponent(textArea); + subContent.addComponent(gravar); + var window = com.openWindow(item.getItemProperty('CLIENTE').getValue(), subContent,500,200); + + textArea.setSizeFull(); + textArea.addStyleName(com.theme().TEXTAREA_BORDERLESS); + window.setModal(true); + }); + btn.setDescription(item.getItemProperty('OBSERVACOES').getValue()); + var container = com.horizontalLayout([btn]); + container.setSpacing(false); + return container; + } + } + var script = new Generator(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DESCRICAO + + + + + + + + + + + + + + + +
\ No newline at end of file