fixes bug #6817
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@53446 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
dd35b3e6e1
commit
2490c6a074
|
@ -75,7 +75,7 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
|||
sql.append(" end as importeoutros, ");
|
||||
sql.append(" case b.importeseguro when 0 then null else b.importeseguro ");
|
||||
sql.append(" end as importeseguro, ");
|
||||
sql.append(" case when b.motivocancelacion_id is null then 'N' else 'C' end status ");
|
||||
sql.append(" case when b.indstatusboleto = 'V' or b.motivocancelacion_id is null THEN 'N' ELSE 'C' END status ");
|
||||
sql.append("from boleto b ");
|
||||
sql.append(" left join fiscal_r4 r4 on b.boleto_id = r4.boleto_id ");
|
||||
sql.append(" left outer join fiscal_r5 r5 on r4.numserie20 = r5.numserie20 ");
|
||||
|
@ -129,7 +129,8 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
|||
sql.append(" r4.usuario_id, ");
|
||||
sql.append(" eo.cveestado, ");
|
||||
sql.append(" ed.cveestado, ");
|
||||
sql.append(" b.motivocancelacion_id ");
|
||||
sql.append(" b.motivocancelacion_id, ");
|
||||
sql.append(" b.indstatusboleto ");
|
||||
|
||||
List<ImportacionManualFiscalVO> listManuais = new ArrayList<ImportacionManualFiscalVO>();
|
||||
|
||||
|
|
|
@ -533,7 +533,7 @@ public class FiscalServiceImpl implements FiscalService {
|
|||
|
||||
String coo = StringHelper.preencherStringEspacoDireita(fiscal.getCoo(), 9);
|
||||
|
||||
BigDecimal valorTotal = fiscal.getValorTotal() == null ? BigDecimal.ZERO : fiscal.getValorTotal();
|
||||
BigDecimal valorTotal = valorTotalItensECF(item);
|
||||
String valorTotalDocumanto = StringHelper.preencherStringEspacoDireita(valorTotal.toString(), 14);
|
||||
String valorItens = StringHelper.preencherStringEspacoDireita(valorTotal.toString(), 14);
|
||||
|
||||
|
@ -614,6 +614,17 @@ public class FiscalServiceImpl implements FiscalService {
|
|||
return null;
|
||||
}
|
||||
|
||||
private BigDecimal valorTotalItensECF(ItemFiscalVO item) {
|
||||
BigDecimal valorTotal = item.getValorTotal() == null ? BigDecimal.ZERO : item.getValorTotal();
|
||||
if (valorTotal.equals(BigDecimal.ZERO)) {
|
||||
BigDecimal valorTarifa = item.getValorTarifa() == null ? BigDecimal.ZERO : item.getValorTarifa();
|
||||
BigDecimal valorPedagio = item.getValorPedagio() == null ? BigDecimal.ZERO : item.getValorPedagio();
|
||||
BigDecimal valorEmbarque = item.getValorEmbarque() == null ? BigDecimal.ZERO : item.getValorEmbarque();
|
||||
valorTotal = valorTotal.add(valorTarifa).add(valorPedagio).add(valorEmbarque);
|
||||
}
|
||||
return valorTotal;
|
||||
}
|
||||
|
||||
private void grabarHeaderItens(PrintWriter gravarArq, String header, List<String> itensDocs) {
|
||||
gravarArq.print(header + QUEBRA_LINHA);
|
||||
|
||||
|
|
Loading…
Reference in New Issue