Browse Source

1650 - Melhorias e Alterações no Projeto TLK

master
Lucas Favaro da Silva 7 years ago
parent
commit
b92f6ae4ce
4 changed files with 512 additions and 57 deletions
  1. +60
    -21
      03 - Painéis/DRE.xml
  2. +342
    -0
      03 - Painéis/INDICADORES - Gastos Caminhao.xml
  3. +93
    -18
      03 - Painéis/LANÇAMENTO - Créditos.xml
  4. +17
    -18
      03 - Painéis/LANÇAMENTO - Despesas.xml

+ 60
- 21
03 - Painéis/DRE.xml View File

@ -25,6 +25,8 @@
engine.setGlobalVariable('fncLimpaCampos', fncLimpaCampos);
engine.getField('dataInicio').setValue(data);
engine.getField('dataFinal').setValue(d);
engine.getField('dataInicioDespesas').setValue(data);
engine.getField('dataFinalDespesas').setValue(d);
engine.getField('tbLancamentos').refresh();
engine.getField('tbResultados').refresh();
@ -37,7 +39,7 @@
<components>
<VerticalLayout margin="true" width="100%" >
<VerticalLayout spacing="true" width="100%" height="100%">
<Panel width="100%" expandRatio="0.1" align="TOP_LEFT" height="100%">
<Panel width="100%" expandRatio="0.1" height="100%">
<VerticalLayout width="100%" margin="true" spacing="true">
<HorizontalLayout width="100%" spacing="true" height="100%">
<ImageWidget id="img1" height="75" width="441" align="TOP_LEFT">
@ -49,9 +51,19 @@
</base64>
</image>
</ImageWidget>
<HorizontalLayout width="450" spacing="true" align="BOTTOM_RIGHT">
<DateField type="date" id="dataInicio" caption="Data inicial" width="150" expandRatio="0.5" description="Data inicial da exibição" format="dd/MM/yyyy" />
<DateField type="date" id="dataFinal" caption="Data final" width="150" expandRatio="0.5" description="Data final da exibição" format="dd/MM/yyyy" />
<HorizontalLayout width="100%" expandRatio="1" spacing="true" align="BOTTOM_RIGHT">
<Panel width="100%" expanRatio="0.5" caption="Período faturamento" align="TOP_RIGHT" margin="true" >
<HorizontalLayout width="100%" spacing="true" >
<DateField type="date" id="dataInicio" caption="Data inicial" width="100%" expandRatio="0.5" description="Data inicial da exibição" format="dd/MM/yyyy" />
<DateField type="date" id="dataFinal" caption="Data final" width="100%" expandRatio="0.5" description="Data final da exibição" format="dd/MM/yyyy" />
</HorizontalLayout>
</Panel>
<Panel width="100%" expanRatio="0.5" caption="Período despesas" align="TOP_RIGHT" margin="true" >
<HorizontalLayout width="100%" spacing="true" >
<DateField type="date" id="dataInicioDespesas" caption="Data inicial" width="100%" expandRatio="0.5" description="Data inicial da exibição" format="dd/MM/yyyy" />
<DateField type="date" id="dataFinalDespesas" caption="Data final" width="100%" expandRatio="0.5" description="Data final da exibição" format="dd/MM/yyyy" />
</HorizontalLayout>
</Panel>
<ButtonWidget id="btnFiltrar" caption="Filtrar" description="Aplica filtro de data" width="100" >
<onClickScript language="JavaScript">
<![CDATA[
@ -76,37 +88,49 @@
if(engine) {
var sql = "";
if (engine.getField('dataInicio').getValue() && engine.getField('dataFinal').getValue()) {
if (engine.getField('dataInicio').getValue() && engine.getField('dataFinal').getValue() && engine.getField('dataInicioDespesas').getValue() && engine.getField('dataFinalDespesas').getValue()) {
var c = java.util.Calendar.getInstance();
var formatter = new java.text.SimpleDateFormat("dd/MM/yyyy");
c.setTime(engine.getField('dataInicio').getValue());
var data = c.getTime();
var dataInicio = formatter.format(data);
var f = java.util.Calendar.getInstance();
f.setTime(engine.getField('dataFinal').getValue());
data = f.getTime();
var dataFinal = formatter.format(data);
var cDespesas = java.util.Calendar.getInstance();
cDespesas.setTime(engine.getField('dataInicioDespesas').getValue());
data = cDespesas.getTime();
var dataInicioDespesas = formatter.format(data);
var cDespesasF = java.util.Calendar.getInstance();
cDespesasF.setTime(engine.getField('dataFinalDespesas').getValue());
data = cDespesasF.getTime();
var dataFinalDespesas = formatter.format(data);
sql = "Select s.nome, " +
"case s.faturamento when 0 then '0,00' else replace(to_char(s.faturamento,'FM999999999.00'),'.',',') end faturado, " +
"case (s.despesa_combustivel + s.despesa_operacional) when 0 then '0,00' else replace(to_char((s.despesa_combustivel + s.despesa_operacional),'FM999999999.00'),'.',',') end despesa, " +
"case (s.faturamento - (s.despesa_combustivel + s.despesa_operacional)) when 0 then '0,00' else replace(to_char(s.faturamento - (s.despesa_combustivel + s.despesa_operacional), 'FM999999999.00'),'.',',') end liquido, " +
" case s.faturamento when 0 then '0,00' else replace(to_char(((s.faturamento - (s.despesa_combustivel + s.despesa_operacional))/s.faturamento * 100),'FM999999999.00'),'.',',') end perc_lucro " +
"case s.faturamento when 0 then 'R$ 0,00' else 'R$ ' || replace(to_char(s.faturamento,'FM999999999.00'),'.',',') end faturado, " +
"case (s.despesa_combustivel + s.despesa_operacional) when 0 then 'R$ 0,00' else 'R$ ' || replace(to_char((s.despesa_combustivel + s.despesa_operacional),'FM999999999.00'),'.',',') end despesa, " +
"case (s.faturamento - (s.despesa_combustivel + s.despesa_operacional)) when 0 then 'R$ 0,00' else 'R$ ' || replace(to_char(s.faturamento - (s.despesa_combustivel + s.despesa_operacional), 'FM999999999.00'),'.',',') end liquido, " +
" case s.faturamento when 0 then 'R$ 0,00' else 'R$ ' || replace(to_char(((s.faturamento - (s.despesa_combustivel + s.despesa_operacional))/s.faturamento * 100),'FM999999999.00'),'.',',') end perc_lucro " +
" from (Select o.codigo, o.nome, " +
" (Select coalesce(sum(crf.valor_liquido),0) from controle_receitas_fretes crf where crf.chave_operacao = o.codigo and crf.data between to_date('"+dataInicio+"','dd/MM/yyyy') and to_date('"+dataFinal+"','dd/MM/yyyy')) faturamento, " +
" (Select coalesce(sum(cdb.total_combustivel),0) from controle_despesas_combustiveis cdb where cdb.chave_operacao = o.codigo and cdb.data between to_date('"+dataInicio+"','dd/MM/yyyy') and to_date('"+dataFinal+"','dd/MM/yyyy')) despesa_combustivel, " +
" (Select coalesce(sum(cdo.valor),0) from controle_despesas_operacionais cdo where cdo.chave_operacao = o.codigo and cdo.data between to_date('"+dataInicio+"','dd/MM/yyyy') and to_date('"+dataFinal+"','dd/MM/yyyy')) despesa_operacional " +
"from operacao o) s " +
" (Select coalesce(sum(crf.valor_liquido),0) from controle_receitas_fretes crf where crf.chave_cliente = o.codigo and crf.data between to_date('"+dataInicio+"','dd/MM/yyyy') and to_date('"+dataFinal+"','dd/MM/yyyy')) faturamento, " +
" (Select coalesce(sum(cdb.total_combustivel),0) from controle_despesas_combustiveis cdb where cdb.chave_cliente = o.codigo and cdb.data between to_date('"+dataInicioDespesas+"','dd/MM/yyyy') and to_date('"+dataFinalDespesas+"','dd/MM/yyyy')) despesa_combustivel, " +
" (Select coalesce(sum(cdo.valor),0) from controle_despesas_operacionais cdo where cdo.chave_cliente = o.codigo and cdo.data between to_date('"+dataInicioDespesas+"','dd/MM/yyyy') and to_date('"+dataFinalDespesas+"','dd/MM/yyyy')) despesa_operacional " +
"from clientes o) s " +
"union all " +
" Select 'TOTAL' nome, " +
"case s.faturamento when 0 then '0,00' else replace(to_char(s.faturamento,'FM999999999.00'),'.',',') end faturado, " +
"case (s.despesa_combustivel + s.despesa_operacional) when 0 then '0,00' else replace(to_char((s.despesa_combustivel + s.despesa_operacional),'FM999999999.00'),'.',',') end despesa, " +
"case (s.faturamento - (s.despesa_combustivel + s.despesa_operacional)) when 0 then '0,00' else replace(to_char(s.faturamento - (s.despesa_combustivel + s.despesa_operacional), 'FM999999999.00'),'.',',') end liquido, " +
" case s.faturamento when 0 then '0,00' else replace(to_char(((s.faturamento - (s.despesa_combustivel + s.despesa_operacional))/s.faturamento * 100),'FM999999999.00'),'.',',') end perc_lucro " +
"case s.faturamento when 0 then 'R$ 0,00' else 'R$ ' || replace(to_char(s.faturamento,'FM999999999.00'),'.',',') end faturado, " +
"case (s.despesa_combustivel + s.despesa_operacional) when 0 then 'R$ 0,00' else 'R$ ' || replace(to_char((s.despesa_combustivel + s.despesa_operacional),'FM999999999.00'),'.',',') end despesa, " +
"case (s.faturamento - (s.despesa_combustivel + s.despesa_operacional)) when 0 then 'R$ 0,00' else 'R$ ' || replace(to_char(s.faturamento - (s.despesa_combustivel + s.despesa_operacional), 'FM999999999.00'),'.',',') end liquido, " +
" case s.faturamento when 0 then 'R$ 0,00' else 'R$ ' || replace(to_char(((s.faturamento - (s.despesa_combustivel + s.despesa_operacional))/s.faturamento * 100),'FM999999999.00'),'.',',') end perc_lucro " +
" from (Select " +
" (Select coalesce(sum(crf.valor_liquido),0) from controle_receitas_fretes crf where crf.data between to_date('"+dataInicio+"','dd/MM/yyyy') and to_date('"+dataFinal+"','dd/MM/yyyy')) faturamento, " +
" (Select coalesce(sum(cdb.total_combustivel),0) from controle_despesas_combustiveis cdb where cdb.data between to_date('"+dataInicio+"','dd/MM/yyyy') and to_date('"+dataFinal+"','dd/MM/yyyy')) despesa_combustivel, " +
" (Select coalesce(sum(cdo.valor),0) from controle_despesas_operacionais cdo where cdo.data between to_date('"+dataInicio+"','dd/MM/yyyy') and to_date('"+dataFinal+"','dd/MM/yyyy')) despesa_operacional) s";
" (Select coalesce(sum(cdb.total_combustivel),0) from controle_despesas_combustiveis cdb where cdb.data between to_date('"+dataInicioDespesas+"','dd/MM/yyyy') and to_date('"+dataFinalDespesas+"','dd/MM/yyyy')) despesa_combustivel, " +
" (Select coalesce(sum(cdo.valor),0) from controle_despesas_operacionais cdo where cdo.data between to_date('"+dataInicioDespesas+"','dd/MM/yyyy') and to_date('"+dataFinalDespesas+"','dd/MM/yyyy')) despesa_operacional) s";
return sql;
@ -123,7 +147,7 @@
</datasource>
<key-field>NOME</key-field>
<columns>
<column name="NOME" caption="Operação TLK" align="RIGHT" expand-ratio="0.3"/>
<column name="NOME" caption="Cliente" align="RIGHT" expand-ratio="0.3"/>
<column name="FATURADO" caption="Faturamento" align="RIGHT" expand-ratio="0.1"/>
<column name="DESPESA" caption="Despesas" align="RIGHT" expand-ratio="0.1"/>
<column name="LIQUIDO" caption="Lucro Líquido" align="RIGHT" expand-ratio="0.1"/>
@ -158,17 +182,32 @@
if (engine.getField('dataInicio').getValue() && engine.getField('dataFinal').getValue()) {
var c = java.util.Calendar.getInstance();
var formatter = new java.text.SimpleDateFormat("dd/MM/yyyy");
c.setTime(engine.getField('dataInicio').getValue());
var data = c.getTime();
var dataInicio = formatter.format(data);
var f = java.util.Calendar.getInstance();
f.setTime(engine.getField('dataFinal').getValue());
data = f.getTime();
var dataFinal = formatter.format(data);
sql = "select fnc_dre_pivot(to_date('" + dataInicio + "','dd/MM/yyyy'),to_date('" + dataFinal + "','dd/MM/yyyy')) as sql_return";
var cDespesas = java.util.Calendar.getInstance();
cDespesas.setTime(engine.getField('dataInicioDespesas').getValue());
data = cDespesas.getTime();
var dataInicioDespesas = formatter.format(data);
var fDespesas = java.util.Calendar.getInstance();
fDespesas.setTime(engine.getField('dataFinalDespesas').getValue());
data = fDespesas.getTime();
var dataFinalDespesas = formatter.format(data);
sql = "select fnc_dre_pivot(to_date('" + dataInicio + "','dd/MM/yyyy'),to_date('" + dataFinal + "','dd/MM/yyyy'),to_date('" + dataInicioDespesas + "','dd/MM/yyyy'),to_date('" + dataFinalDespesas + "','dd/MM/yyyy')) as sql_return";
var ds = vQueryService.executeQuery('vitruvio', sql);
ds.next();
return ds.getString('sql_return');
} else {
return "select ' ' indicador, 0 total";
}


+ 342
- 0
03 - Painéis/INDICADORES - Gastos Caminhao.xml
File diff suppressed because it is too large
View File


+ 93
- 18
03 - Painéis/LANÇAMENTO - Créditos.xml View File

@ -24,6 +24,7 @@
engine.getField('ufOrigem')["setValue(java.lang.Object)"](null);
engine.getField('ufDestino')["setValue(java.lang.Object)"](null);
engine.getField('formaPagamento')["setValue(java.lang.Object)"](null);
engine.getField('placaCarreta')["setValue(java.lang.Object)"](null);
}
function fncSubTotal() {
@ -74,7 +75,6 @@
function run() {
engine.getField('valorImposto').setEnabled(false);
engine.getField('valorLiquido').setEnabled(false);
engine.getField('placaCarreta').setEnabled(false);
engine.setGlobalVariable('abertura',1);
engine.getField('frotaTerceiro').setValue('F');
engine.getField('ftFrotaTerceiro').setValue('A');
@ -142,7 +142,17 @@
</valueChange>
</events>
</DBComboBox>
<TextField type="string" id="placaCarreta" caption="Placa carreta" width="100%" expandRatio="0.1" />
<DBComboBox type="string" id="placaCarreta" width="100%" required="true" expandRatio="0.2" align="TOP_LEFT" caption="Placa carreta">
<datasource>
<freeQuery connection-key="vitruvio">
<![CDATA[
Select * from veiculo where placa_carreta is not null
]]>
</freeQuery>
</datasource>
<key-field>PLACA_CARRETA</key-field>
<caption-field>PLACA_CARRETA</caption-field>
</DBComboBox>
<DBComboBox type="string" id="funcionario" required="true" width="100%" expandRatio="0.2" align="TOP_LEFT" caption="Funcionário">
<datasource>
<freeQuery connection-key="vitruvio">
@ -218,18 +228,18 @@
</freeQuery>
</datasource>
<key-field>CHAVE_ESTADO</key-field>
<caption-field>NOME</caption-field>
<caption-field>SIGLA</caption-field>
</DBComboBox>
<DBComboBox type="string" id="ufDestino" caption="UF Destino" width="100%" expandRatio="0.1" >
<datasource>
<freeQuery connection-key="vitruvio">
<![CDATA[
Select cp.chave_estado, e.nome from clientes_praca cp inner join estados e on e.chave_estado = cp.chave_estado where cp.chave_cliente = ${codigo}
Select cp.chave_estado, e.sigla from clientes_praca cp inner join estados e on e.chave_estado = cp.chave_estado where cp.chave_cliente = ${codigo}
]]>
</freeQuery>
</datasource>
<key-field>CHAVE_ESTADO</key-field>
<caption-field>NOME</caption-field>
<caption-field>SIGLA</caption-field>
<bind>
<parameter value-type="number" defaultValue="-1" parameterName="codigo" field-ref="cliente"/>
</bind>
@ -273,7 +283,7 @@
<caption-field>NOME</caption-field>
</DBComboBox>
<DecimalField type="decimal" id="valorImposto" caption="Valor impostos (R$)" format="#,##0.00" description="Valor impostos" width="100%" expandRatio="0.2" />
<DecimalField type="decimal" id="valorLiquido" caption="Frete - Impostos (R$)" format="#,##0.00" description="Valor frete menos o valor dos impostos" width="100%" expandRatio="0.2" />
<DecimalField type="decimal" id="valorLiquido" caption="Valor Líquido (Frete - Impostos) (R$)" format="#,##0.00" description="Valor frete menos o valor dos impostos" width="100%" expandRatio="0.2" />
<ButtonWidget id="btnGravar" caption="Gravar" align="BOTTOM_RIGHT" description="Grava o lançamento" width="100" >
<onClickScript language="JavaScript">
<![CDATA[
@ -284,8 +294,8 @@
var dbVitruvio = new db('vitruvio');
var sql;
dbVitruvio.transaction(function() {
sql = "insert into controle_receitas_fretes (chave_receita_frete,data,chave_cliente,chave_veiculo,chave_funcionario,valor_frete,valor_imposto,valor_liquido,chave_tipo_frete,cte,frota_terceiro,uf_origem,uf_destino,chave_forma_pagamento) " +
" values (" + dbVitruvio.getSequenceNextValSql('controle_rec_fr_seq') + ",:data,:chave_cliente,:chave_veiculo,:chave_funcionario,:valor_frete,:valor_imposto,:valor_liquido,:tipo_frete,:cte,:frota_terceiro,:uf_origem,:uf_destino,:forma_pagamento)";
sql = "insert into controle_receitas_fretes (chave_receita_frete,data,chave_cliente,chave_veiculo,chave_funcionario,valor_frete,valor_imposto,valor_liquido,chave_tipo_frete,cte,frota_terceiro,uf_origem,uf_destino,chave_forma_pagamento,placa_carreta) " +
" values (" + dbVitruvio.getSequenceNextValSql('controle_rec_fr_seq') + ",:data,:chave_cliente,:chave_veiculo,:chave_funcionario,:valor_frete,:valor_imposto,:valor_liquido,:tipo_frete,:cte,:frota_terceiro,:uf_origem,:uf_destino,:forma_pagamento,:placa_carreta)";
this.update(sql, {
data: engine.getField('dataLancamento').getValue(),
chave_cliente: Number(engine.getField('cliente').getValue()),
@ -299,7 +309,8 @@
frota_terceiro: String(engine.getField('frotaTerceiro').getValue()),
uf_origem: Number(engine.getField('ufOrigem').getValue()),
uf_destino: Number(engine.getGlobalVariable('praca')),
forma_pagamento: engine.getField('formaPagamento').getValue()
forma_pagamento: engine.getField('formaPagamento').getValue(),
placa_carreta: engine.getField('placaCarreta').getValue()
});
});
engine.getField('tbLancamentos').refresh();
@ -367,7 +378,7 @@
</freeQuery>
</datasource>
<key-field>CHAVE_ESTADO</key-field>
<caption-field>NOME</caption-field>
<caption-field>SIGLA</caption-field>
</DBComboBox>
<ButtonWidget id="btnFiltrar" caption="Filtrar" align="MIDDLE_LEFT" description="Aplica filtro" width="100" >
<onClickScript language="JavaScript">
@ -415,7 +426,7 @@
</value>
</Label>
</HorizontalLayout>
<DBTable id="tbLancamentos" type="number" showRowCount="true" width="100%" rows="9" selectable="false" exportXLS="true" editable="true" >
<DBTable id="tbLancamentos" type="number" showRowCount="true" width="100%" rows="6" selectable="false" exportXLS="true" editable="true" >
<datasource>
<sqlBuilderDataSource connection-key="vitruvio" language="JavaScript">
<![CDATA[
@ -423,7 +434,6 @@
var sql = "Select ccf.chave_receita_frete, ccf.data, " +
" (select co.nome from clientes co where co.codigo = ccf.chave_cliente) cliente," +
" (select cv.placa from veiculo cv where cv.codigo = ccf.chave_veiculo) veiculo," +
" (select cv.placa_carreta from veiculo cv where cv.codigo = ccf.chave_veiculo) placa_carreta," +
" (select cf.nome from funcionario cf where cf.codigo = ccf.chave_funcionario) funcionario," +
" ccf.cte," +
" (select descricao from tipo_frete where codigo = ccf.chave_tipo_frete) tipo_frete," +
@ -433,14 +443,14 @@
" (select nome from forma_pagamento where codigo = ccf.chave_forma_pagamento) forma_pagamento," +
" replace(replace(replace(to_char(ccf.valor_frete, '9999999999D99'),',','-' ),'.',','),'-','.') valor_frete, " +
" replace(replace(replace(to_char(ccf.valor_imposto, '9999999999D99'),',','-' ),'.',','),'-','.') valor_imposto, " +
" replace(replace(replace(to_char(ccf.valor_liquido, '9999999999D99'),',','-' ),'.',','),'-','.') valor_liquido " +
" replace(replace(replace(to_char(ccf.valor_liquido, '9999999999D99'),',','-' ),'.',','),'-','.') valor_liquido, " +
" ccf.placa_carreta placa_carreta " +
" from controle_receitas_fretes ccf" +
" where 1 = 2";
if (engine) {
sql = "Select ccf.chave_receita_frete, ccf.data, " +
" (select co.nome from clientes co where co.codigo = ccf.chave_cliente) cliente," +
" (select cv.placa from veiculo cv where cv.codigo = ccf.chave_veiculo) veiculo," +
" (select cv.placa_carreta from veiculo cv where cv.codigo = ccf.chave_veiculo) placa_carreta," +
" (select cf.nome from funcionario cf where cf.codigo = ccf.chave_funcionario) funcionario," +
" ccf.cte," +
" (select descricao from tipo_frete where codigo = ccf.chave_tipo_frete) tipo_frete," +
@ -450,7 +460,8 @@
" (select nome from forma_pagamento where codigo = ccf.chave_forma_pagamento) forma_pagamento," +
" ccf.valor_frete valor_frete, " +
" ccf.valor_imposto valor_imposto, " +
" ccf.valor_liquido valor_liquido " +
" ccf.valor_liquido valor_liquido, " +
" ccf.placa_carreta placa_carreta " +
" from controle_receitas_fretes ccf" +
" where ccf.data between '" + engine.getField('dataInicio') + "' and '" + engine.getField('dataFinal') + "'";
if (engine.getField('ftFuncionario').getValue()) {
@ -594,7 +605,71 @@
]]>
</scriptColumnGenerator>
</generated>
<column name="PLACA_CARRETA" caption="Placa carreta" expand-ratio="0.1" commitOnValueChange="true" />
<generated name="PLACA_CARRETA" caption="Placa carreta" cache="false" expand-ratio="0.05" >
<scriptColumnGenerator language="JavaScript">
<![CDATA[
importClass(Packages.com.vaadin.ui.ComboBox);
importClass(Packages.br.com.davinti.base.vaadin.components.data.container.ContainerUtils);
importClass(Packages.com.vaadin.data.Property);
var setUsuario = function(chave, cliente) {
if (cliente) {
var sqlAtualiza = "UPDATE controle_receitas_fretes SET placa_carreta = ? "+
" WHERE CHAVE_RECEITA_FRETE = ? ";
var params = new java.util.ArrayList();
params.add(cliente);
params.add(chave);
vQueryService.executePSUpdateQuery('vitruvio', sqlAtualiza, params.toArray());
} else {
var sqlAtualiza = "UPDATE controle_receitas_fretes SET placa_carreta = null "+
" WHERE CHAVE_RECEITA_FRETE = ? ";
var params = new java.util.ArrayList();
params.add(chave);
vQueryService.executePSUpdateQuery('vitruvio', sqlAtualiza, params.toArray());
}
};
function generate(itemId, columnId, item, container) {
var sql = "Select placa_carreta from veiculo where placa_carreta is not null";
var ds = vQueryService.executeQuery('vitruvio', sql);
if(ds == null){
return null;
}
var map = new java.util.LinkedHashMap();
while(ds.next()) {
map.put(ds.getString('PLACA_CARRETA'), ds.getString('PLACA_CARRETA'));
}
var combo = new ComboBox();
combo.setWidth("100%");
ContainerUtils.createAndConfigureContainerFromCaptionMap(map, combo);
var linha = item;
if(linha.getItemProperty('PLACA_CARRETA').getValue()) {
combo.setValue(linha.getItemProperty('PLACA_CARRETA').getValue());
}
combo.addValueChangeListener(new Property.ValueChangeListener() {
valueChange: function(event) {
setUsuario(linha.getItemProperty('CHAVE_RECEITA_FRETE').getValue().longValue(),
event.getProperty().getValue());
},
hashCode: function() {
return combo.hashCode();
}
});
return combo;
}
]]>
</scriptColumnGenerator>
</generated>
<generated name="FUNCIONARIO" caption="Funcionário" cache="false" expand-ratio="0.1" >
<scriptColumnGenerator language="JavaScript">
<![CDATA[
@ -1050,8 +1125,8 @@
]]>
</scriptColumnGenerator>
</generated>
<column name="VALOR_IMPOSTO" caption="Valor impostos" format="#.##0,00" decimalSeparator=","/>
<column name="VALOR_LIQUIDO" caption="Lucro (Frete - Impostos)" format="#.##0,00" decimalSeparator=","/>
<column name="VALOR_IMPOSTO" caption="Valor impostos" format="###0.00" decimalSeparator="," expand-ratio="0.2"/>
<column name="VALOR_LIQUIDO" caption="Lucro (Frete - Impostos)" format="###0.00" decimalSeparator="," expand-ratio="1"/>
</columns>
<events>
<itemChange>


+ 17
- 18
03 - Painéis/LANÇAMENTO - Despesas.xml View File

@ -148,7 +148,7 @@
engine.getField('dataLancamento').setRequired(true);
engine.getField('dataPessoal').setRequired(false);
engine.getField('dataCombustivel').setRequired(false);
engine.getField('placa').setRequired(true);
engine.getField('placa').setRequired(false);
engine.getField('cliente').setRequired(true);
engine.getField('categoria').setRequired(true);
engine.getField('valor').setRequired(true);
@ -508,7 +508,7 @@
</sqlBuilderDataSource>
</datasource>
<key-field>chave_despesa_operacional</key-field>
<columns>
<columns>
<generated name="EXCLUIR" caption="" expand-ratio="0.02" >
<scriptColumnGenerator language="JavaScript">
<![CDATA[
@ -532,7 +532,7 @@
}
});
engine.getField('tbLancamentos').refresh();
engine.getGlobalVariable('fncSubTotalOperacional')();
engine.getGlobalVariable('fncSubTotal')();
}
var msg = 'Confirma a exclusão?'
@ -1043,10 +1043,8 @@
var db = libService.loadScript('db');
var dbVitruvio = new db('vitruvio');
dbVitruvio.transaction(function() {
//if (event.isChanged('DATA')) {
var sqlAtualiza = "UPDATE controle_despesas_operacionais SET data = :data, numero_documento = :nrDocumento, valor = :valor " +
" WHERE CHAVE_DESPESA_OPERACIONAL = :chave";
//}
var sqlAtualiza = "UPDATE controle_despesas_operacionais SET data = :data, numero_documento = :nrDocumento, valor = :valor " +
" WHERE CHAVE_DESPESA_OPERACIONAL = :chave";
this.update(sqlAtualiza, {
chave: Number(event.getItemId()),
data: event.getField('DATA').getValue(),
@ -1195,7 +1193,7 @@
</Label>
</HorizontalLayout>
<HorizontalLayout width="100%" spacing="true">
<DBTable id="tbPessoal" type="number" width="100%" height="100%" expandRatio="1" rows="11" selectable="false" exportXLS="true" editable="true" >
<DBTable id="tbPessoal" type="number" width="100%" height="100%" expandRatio="1" rows="10" selectable="false" exportXLS="true" editable="true" >
<datasource>
<sqlBuilderDataSource connection-key="vitruvio" language="JavaScript">
<![CDATA[
@ -1475,7 +1473,7 @@
</itemChange>
</events>
</DBTable>
<DBTable id="tbTotalSocios" align="TOP_LEFT" type="string" width="100%" expandRatio="0.3" rows="11" exportXLS="true" editable="false" selectable="false">
<DBTable id="tbTotalSocios" align="TOP_LEFT" type="string" width="100%" expandRatio="0.3" rows="10" exportXLS="true" editable="false" selectable="false">
<datasource>
<sqlBuilderDataSource connection-key="vitruvio" language="JavaScript">
<![CDATA[
@ -1744,7 +1742,7 @@
</Label>
</HorizontalLayout>
<HorizontalLayout width="100%" spacing="true">
<DBTable id="tbCombustivel" requireFilter="true" immediate="true" showRowCount="true" type="number" width="100%" height="100%" expandRatio="0.75" rows="11" selectable="false" exportXLS="true" editable="true" >
<DBTable id="tbCombustivel" requireFilter="true" showRowCount="true" type="number" width="100%" height="100%" expandRatio="0.75" rows="10" selectable="false" exportXLS="true" editable="true" >
<datasource>
<sqlBuilderDataSource connection-key="vitruvio" language="JavaScript">
<![CDATA[
@ -2078,13 +2076,13 @@
]]>
</scriptColumnGenerator>
</generated>
<column name="LITROS" caption="Litros" expand-ratio="0.05" commitOnValueChange="true" editable="true" align="RIGHT" decimalSeparator=","/>
<column name="VALOR_LITRO" caption="Vlr. litro" expand-ratio="0.05" commitOnValueChange="true" editable="true" align="RIGHT" decimalSeparator=","/>
<column name="TOTAL_COMBUSTIVEL" caption="Total" expand-ratio="0.05" align="RIGHT" decimalSeparator=","/>
<column name="KM_INICIAL" caption="Km inicial" expand-ratio="0.05" commitOnValueChange="true" editable="true" align="RIGHT" decimalSeparator=","/>
<column name="KM_FINAL" caption="Km final" expand-ratio="0.05" commitOnValueChange="true" editable="true" align="RIGHT" decimalSeparator=","/>
<column name="KM_RODADO" caption="Km Rodado" expand-ratio="0.05" align="RIGHT" decimalSeparator="," />
<column name="MEDIA_CONSUMO" caption="Média consumo" expand-ratio="0.05" align="RIGHT" decimalSeparator="," />
<column name="LITROS" caption="Litros" expand-ratio="0.05" commitOnValueChange="true" commitOnEnter="true" editable="true" align="RIGHT" decimalSeparator="," />
<column name="VALOR_LITRO" caption="Vlr. litro" expand-ratio="0.05" commitOnValueChange="true" commitOnEnter="true" editable="true" align="RIGHT" decimalSeparator=","/>
<column name="TOTAL_COMBUSTIVEL" format="###0.00" caption="Total" expand-ratio="0.05" align="RIGHT" decimalSeparator=","/>
<column name="KM_INICIAL" format="#.##0,00" caption="Km inicial" expand-ratio="0.05" commitOnEnter="true" commitOnValueChange="true" editable="true" align="RIGHT" decimalSeparator=","/>
<column name="KM_FINAL" format="#.##0,00" caption="Km final" expand-ratio="0.05" commitOnValueChange="true" commitOnEnter="true" editable="true" align="RIGHT" decimalSeparator=","/>
<column name="KM_RODADO" format="###0.00" caption="Km Rodado" expand-ratio="0.05" align="RIGHT" decimalSeparator="," />
<column name="MEDIA_CONSUMO" format="###0.00" caption="Média consumo" expand-ratio="0.05" align="RIGHT" decimalSeparator="," />
</columns>
<events>
<itemChange>
@ -2120,7 +2118,7 @@
</itemChange>
</events>
</DBTable>
<DBTable id="tbTotalCombustivel" type="string" width="100%" expandRatio="0.25" rows="11" selectable="false" exportXLS="true" editable="false" >
<DBTable id="tbTotalCombustivel" type="string" width="100%" expandRatio="0.25" rows="10" selectable="false" exportXLS="true" editable="false" >
<datasource>
<sqlBuilderDataSource connection-key="vitruvio" language="JavaScript">
<![CDATA[
@ -2162,6 +2160,7 @@
if (engine.getField('ftClienteCombustivel').getValue()) {
sql += " and cdc.chave_cliente = " + engine.getField('ftClienteCombustivel').getValue();
}
sql += " order by 1";
}
return sql;
}


Loading…
Cancel
Save