Fixes Bug #0009192
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@71396 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
8ae0c20638
commit
9abc231d79
|
@ -4,15 +4,9 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas;
|
package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.SeguroKm;
|
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTaxaEmbarqueOrgao;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
@ -24,6 +18,15 @@ import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zul.Paging;
|
import org.zkoss.zul.Paging;
|
||||||
import org.zkoss.zul.Textbox;
|
import org.zkoss.zul.Textbox;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.SeguroKm;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.render.SeguroPorIntervalo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
|
@ -37,8 +40,17 @@ public class BusquedaSeguroKmController extends MyGenericForwardComposer {
|
||||||
private MyListbox seguroKmList;
|
private MyListbox seguroKmList;
|
||||||
private Paging pagingSeguroKm;
|
private Paging pagingSeguroKm;
|
||||||
private Textbox txtOrgao;
|
private Textbox txtOrgao;
|
||||||
|
private boolean exibeTpp;
|
||||||
|
|
||||||
public Paging getPagingSeguroKm() {
|
public Textbox getTxtOrgao() {
|
||||||
|
return txtOrgao;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTxtOrgao(Textbox txtOrgao) {
|
||||||
|
this.txtOrgao = txtOrgao;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Paging getPagingSeguroKm() {
|
||||||
return pagingSeguroKm;
|
return pagingSeguroKm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,12 +73,13 @@ public class BusquedaSeguroKmController extends MyGenericForwardComposer {
|
||||||
public void setSeguroKmList(MyListbox seguroKmList) {
|
public void setSeguroKmList(MyListbox seguroKmList) {
|
||||||
this.seguroKmList = seguroKmList;
|
this.seguroKmList = seguroKmList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
exibeTpp = ApplicationProperties.getInstance().exibeTpp();
|
||||||
seguroKmList.setItemRenderer(new RenderTaxaEmbarqueOrgao());
|
|
||||||
|
seguroKmList.setItemRenderer(new SeguroPorIntervalo());
|
||||||
seguroKmList.addEventListener("onDoubleClick", new EventListener() {
|
seguroKmList.addEventListener("onDoubleClick", new EventListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -91,9 +104,15 @@ public class BusquedaSeguroKmController extends MyGenericForwardComposer {
|
||||||
// args.put("seguroKm", null);
|
// args.put("seguroKm", null);
|
||||||
args.put("seguroKmList", seguroKmList);
|
args.put("seguroKmList", seguroKmList);
|
||||||
|
|
||||||
openWindow("/gui/tarifas/editarSeguroKm.zul",
|
if (!exibeTpp) {
|
||||||
Labels.getLabel("busquedaSeguroKmController.window.title"),
|
openWindow("/gui/tarifas/editarSeguroKm.zul",
|
||||||
args, MODAL);
|
Labels.getLabel("busquedaSeguroKmController.semTpp.window.title"),
|
||||||
|
args, MODAL);
|
||||||
|
} else {
|
||||||
|
openWindow("/gui/tarifas/editarSeguroKm.zul",
|
||||||
|
Labels.getLabel("busquedaSeguroKmController.window.title"),
|
||||||
|
args, MODAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshLista() {
|
private void refreshLista() {
|
||||||
|
@ -102,18 +121,14 @@ public class BusquedaSeguroKmController extends MyGenericForwardComposer {
|
||||||
new HibernateSearchObject<OrgaoConcedente>(OrgaoConcedente.class,
|
new HibernateSearchObject<OrgaoConcedente>(OrgaoConcedente.class,
|
||||||
pagingSeguroKm.getPageSize());
|
pagingSeguroKm.getPageSize());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
seguroKmBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
seguroKmBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
|
|
||||||
if (!txtOrgao.getValue().equals("")) {
|
if (!txtOrgao.getValue().equals("")) {
|
||||||
seguroKmBusqueda.addFilterLike("descOrgao",
|
seguroKmBusqueda.addFilterLike("descOrgao", "%" + txtOrgao.getText().trim().concat("%"));
|
||||||
"%" + txtOrgao.getText().trim().concat("%"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
seguroKmBusqueda.addSortAsc("descOrgao");
|
seguroKmBusqueda.addSortAsc("descOrgao");
|
||||||
|
|
||||||
|
|
||||||
plwOrgao.init(seguroKmBusqueda, seguroKmList, pagingSeguroKm);
|
plwOrgao.init(seguroKmBusqueda, seguroKmList, pagingSeguroKm);
|
||||||
|
|
||||||
if (seguroKmList.getData().length == 0) {
|
if (seguroKmList.getData().length == 0) {
|
||||||
|
@ -148,8 +163,14 @@ public class BusquedaSeguroKmController extends MyGenericForwardComposer {
|
||||||
args.put("seguroKm", tx);
|
args.put("seguroKm", tx);
|
||||||
args.put("seguroKmList", seguroKmList);
|
args.put("seguroKmList", seguroKmList);
|
||||||
|
|
||||||
openWindow("/gui/tarifas/editarSeguroKm.zul",
|
if (!exibeTpp) {
|
||||||
Labels.getLabel("busquedaSeguroKmController.window.title"),
|
openWindow("/gui/tarifas/editarSeguroKm.zul",
|
||||||
args, MODAL);
|
Labels.getLabel("busquedaSeguroKmController.semTpp.window.title"),
|
||||||
|
args, MODAL);
|
||||||
|
} else {
|
||||||
|
openWindow("/gui/tarifas/editarSeguroKm.zul",
|
||||||
|
Labels.getLabel("busquedaSeguroKmController.window.title"),
|
||||||
|
args, MODAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zkplus.databind.BindingListModelList;
|
import org.zkoss.zkplus.databind.BindingListModelList;
|
||||||
import org.zkoss.zul.Button;
|
import org.zkoss.zul.Button;
|
||||||
import org.zkoss.zul.Combobox;
|
import org.zkoss.zul.Combobox;
|
||||||
|
import org.zkoss.zul.Listheader;
|
||||||
import org.zkoss.zul.Paging;
|
import org.zkoss.zul.Paging;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
||||||
|
@ -48,6 +49,7 @@ import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
|
||||||
import com.rjconsultores.ventaboletos.service.UsuarioService;
|
import com.rjconsultores.ventaboletos.service.UsuarioService;
|
||||||
import com.rjconsultores.ventaboletos.service.ViaService;
|
import com.rjconsultores.ventaboletos.service.ViaService;
|
||||||
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
@ -126,6 +128,7 @@ public class BusquedaTarifaController extends MyGenericForwardComposer {
|
||||||
private Parada destino;
|
private Parada destino;
|
||||||
private Ruta ruta;
|
private Ruta ruta;
|
||||||
private Via via;
|
private Via via;
|
||||||
|
private Listheader listheaderTPP;
|
||||||
|
|
||||||
private final String PERMISSAO_EXCLUIR_TODAS_PESQUISA = "COM.RJCONSULTORES.VENTABOLETOS.GUI.ADM.PRECO.EXCLUIR.TODAS.PESQUISA";
|
private final String PERMISSAO_EXCLUIR_TODAS_PESQUISA = "COM.RJCONSULTORES.VENTABOLETOS.GUI.ADM.PRECO.EXCLUIR.TODAS.PESQUISA";
|
||||||
|
|
||||||
|
@ -338,7 +341,7 @@ public class BusquedaTarifaController extends MyGenericForwardComposer {
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
listheaderTPP.setVisible(ApplicationProperties.getInstance().exibeTpp());
|
||||||
this.
|
this.
|
||||||
cmbMarca.addEventListener("onChange", new EventListener() {
|
cmbMarca.addEventListener("onChange", new EventListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.zkoss.zk.ui.Component;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zk.ui.event.EventListener;
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zul.Combobox;
|
import org.zkoss.zul.Combobox;
|
||||||
|
import org.zkoss.zul.Listheader;
|
||||||
import org.zkoss.zul.Paging;
|
import org.zkoss.zul.Paging;
|
||||||
import org.zkoss.zul.Textbox;
|
import org.zkoss.zul.Textbox;
|
||||||
|
|
||||||
|
@ -35,6 +36,7 @@ import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
||||||
import com.rjconsultores.ventaboletos.service.MarcaService;
|
import com.rjconsultores.ventaboletos.service.MarcaService;
|
||||||
import com.rjconsultores.ventaboletos.service.MonedaService;
|
import com.rjconsultores.ventaboletos.service.MonedaService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
@ -88,6 +90,7 @@ public class BusquedaTarifaOficialController extends MyGenericForwardComposer {
|
||||||
private Combobox cmbMoneda;
|
private Combobox cmbMoneda;
|
||||||
private Combobox cmbVigenciaTarifaOficial;
|
private Combobox cmbVigenciaTarifaOficial;
|
||||||
private MyListbox tarifaList;
|
private MyListbox tarifaList;
|
||||||
|
private Listheader listheaderTPP;
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger(BusquedaTarifaOficialController.class);
|
private static final Logger log = Logger.getLogger(BusquedaTarifaOficialController.class);
|
||||||
|
|
||||||
|
@ -202,6 +205,7 @@ public class BusquedaTarifaOficialController extends MyGenericForwardComposer {
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
listheaderTPP.setVisible(ApplicationProperties.getInstance().exibeTpp());
|
||||||
|
|
||||||
tarifaList.setItemRenderer(new RenderTarifaOficial());
|
tarifaList.setItemRenderer(new RenderTarifaOficial());
|
||||||
tarifaList.addEventListener("onDoubleClick", new EventListener() {
|
tarifaList.addEventListener("onDoubleClick", new EventListener() {
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class CalcularPeajeController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
public void onClick$btnCalcularPeaje(Event ev) throws InterruptedException {
|
public void onClick$btnCalcularPeaje(Event ev) throws InterruptedException {
|
||||||
OrgaoConcedente orgao ;
|
OrgaoConcedente orgao ;
|
||||||
boolean orgaoListaRutasHasIndices = true;
|
boolean orgaoListaRutasHasIndices = true;
|
||||||
if(!listSelectedRutas.isEmpty()){
|
if(!listSelectedRutas.isEmpty()){
|
||||||
orgao = null;
|
orgao = null;
|
||||||
for(Ruta r : listSelectedRutas){
|
for(Ruta r : listSelectedRutas){
|
||||||
|
|
|
@ -6,7 +6,6 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
@ -16,14 +15,15 @@ import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zul.Combobox;
|
import org.zkoss.zul.Combobox;
|
||||||
import org.zkoss.zul.Messagebox;
|
import org.zkoss.zul.Messagebox;
|
||||||
import org.zkoss.zul.Radio;
|
import org.zkoss.zul.Radio;
|
||||||
|
import org.zkoss.zul.Row;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
|
||||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||||
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
||||||
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
|
||||||
|
@ -54,14 +54,19 @@ public class CopiarTarifaOficialController extends MyGenericForwardComposer {
|
||||||
private Radio rdComTarifa;
|
private Radio rdComTarifa;
|
||||||
private Radio rdComTaxaEmbarque;
|
private Radio rdComTaxaEmbarque;
|
||||||
private Radio rdComSeguro;
|
private Radio rdComSeguro;
|
||||||
|
private Radio rdComTPP;
|
||||||
|
private Row exibeTPP;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos();
|
lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos();
|
||||||
lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
lsOrgao = orgaoConcedenteService.obtenerTodosExceto(-1);
|
lsOrgao = orgaoConcedenteService.obtenerTodosExceto(-1);
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
if (!ApplicationProperties.getInstance().exibeTpp()) {
|
||||||
|
exibeTPP.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnGenerarVigencia(Event ev) throws InterruptedException {
|
public void onClick$btnGenerarVigencia(Event ev) throws InterruptedException {
|
||||||
|
@ -71,11 +76,12 @@ public class CopiarTarifaOficialController extends MyGenericForwardComposer {
|
||||||
Boolean calculaTarifa = (rdComTarifa.getValue() == null) ? Boolean.FALSE : rdComTarifa.isChecked();
|
Boolean calculaTarifa = (rdComTarifa.getValue() == null) ? Boolean.FALSE : rdComTarifa.isChecked();
|
||||||
Boolean calculaTaxaEmbarque = (rdComTaxaEmbarque.getValue() == null) ? Boolean.FALSE : rdComTaxaEmbarque.isChecked();
|
Boolean calculaTaxaEmbarque = (rdComTaxaEmbarque.getValue() == null) ? Boolean.FALSE : rdComTaxaEmbarque.isChecked();
|
||||||
Boolean calculaSeguro = (rdComSeguro.getValue() == null) ? Boolean.FALSE : rdComSeguro.isChecked();
|
Boolean calculaSeguro = (rdComSeguro.getValue() == null) ? Boolean.FALSE : rdComSeguro.isChecked();
|
||||||
|
Boolean calculaTPP = (rdComTPP.getValue() == null) ? Boolean.FALSE : rdComTPP.isChecked();
|
||||||
Empresa empresaSelecionada = cmbEmpresa.getSelectedItem() != null ? (Empresa) cmbEmpresa.getSelectedItem().getValue() : null;
|
Empresa empresaSelecionada = cmbEmpresa.getSelectedItem() != null ? (Empresa) cmbEmpresa.getSelectedItem().getValue() : null;
|
||||||
OrgaoConcedente orgaoConcedenteSelecionado = cmbOrgao.getSelectedItem() != null ? (OrgaoConcedente) cmbOrgao.getSelectedItem().getValue() : null;
|
OrgaoConcedente orgaoConcedenteSelecionado = cmbOrgao.getSelectedItem() != null ? (OrgaoConcedente) cmbOrgao.getSelectedItem().getValue() : null;
|
||||||
|
|
||||||
tarifaOficialService.copiarParaTarifa((VigenciaTarifa) cmbVigencia.getSelectedItem().getValue(),
|
tarifaOficialService.copiarParaTarifa((VigenciaTarifa) cmbVigencia.getSelectedItem().getValue(),
|
||||||
calculaPedagio, calculaTarifa, calculaTaxaEmbarque, calculaSeguro, empresaSelecionada, orgaoConcedenteSelecionado);
|
calculaPedagio, calculaTarifa, calculaTaxaEmbarque, calculaSeguro, calculaTPP, empresaSelecionada, orgaoConcedenteSelecionado);
|
||||||
|
|
||||||
Messagebox.show(Labels.getLabel("copiarTarifaOficialController.MSG.copiaOK"),
|
Messagebox.show(Labels.getLabel("copiarTarifaOficialController.MSG.copiaOK"),
|
||||||
Labels.getLabel("indexController.mniGenerarTarifaOrgao.label"),
|
Labels.getLabel("indexController.mniGenerarTarifaOrgao.label"),
|
||||||
|
|
|
@ -4,11 +4,8 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas;
|
package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
@ -21,17 +18,23 @@ import org.zkoss.zk.ui.Component;
|
||||||
import org.zkoss.zk.ui.Executions;
|
import org.zkoss.zk.ui.Executions;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zul.Button;
|
import org.zkoss.zul.Button;
|
||||||
|
import org.zkoss.zul.Combobox;
|
||||||
|
import org.zkoss.zul.Intbox;
|
||||||
|
import org.zkoss.zul.Row;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
import com.rjconsultores.ventaboletos.entidad.SeguroKm;
|
import com.rjconsultores.ventaboletos.entidad.SeguroKm;
|
||||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||||
import com.rjconsultores.ventaboletos.service.SeguroKmService;
|
import com.rjconsultores.ventaboletos.service.SeguroKmService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSeguroKm;
|
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSeguroKm;
|
||||||
import org.zkoss.zul.Intbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSeguroSemTpp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -50,14 +53,78 @@ public class EditarSeguroKmController extends MyGenericForwardComposer {
|
||||||
private List<SeguroKm> lsSeguroKm;
|
private List<SeguroKm> lsSeguroKm;
|
||||||
private List<OrgaoConcedente> lsOrgaoConcedente;
|
private List<OrgaoConcedente> lsOrgaoConcedente;
|
||||||
private MyListbox seguroKmList;
|
private MyListbox seguroKmList;
|
||||||
|
private MyListbox seguroKmListTpm;
|
||||||
private MyComboboxEstandar cmbOrgao;
|
private MyComboboxEstandar cmbOrgao;
|
||||||
private Button btnApagar;
|
private Button btnApagar;
|
||||||
private Button btnAdicionarSeguroKm;
|
private Button btnAdicionarSeguroKm;
|
||||||
private Intbox txtKm;
|
private Intbox txtKm;
|
||||||
|
private Intbox txtKmSemTpp;
|
||||||
private MyTextboxDecimal txtValor;
|
private MyTextboxDecimal txtValor;
|
||||||
private static Logger log = Logger.getLogger(EditarSeguroKmController.class);
|
private static Logger log = Logger.getLogger(EditarSeguroKmController.class);
|
||||||
|
private Combobox cmbTipoSeguro;
|
||||||
|
private List<TipoSeguro> lsTipoSeguro = new ArrayList<TipoSeguro>();
|
||||||
|
private Boolean exibeTpp;
|
||||||
|
private Row rowExibeTpp;
|
||||||
|
private Row columTpp;
|
||||||
|
private Row columSemTpp;
|
||||||
|
|
||||||
|
public SeguroKmService getSeguroKmService() {
|
||||||
|
return seguroKmService;
|
||||||
|
}
|
||||||
|
|
||||||
public Button getBtnApagar() {
|
public void setSeguroKmService(SeguroKmService seguroKmService) {
|
||||||
|
this.seguroKmService = seguroKmService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyListbox getSeguroKmListTpm() {
|
||||||
|
return seguroKmListTpm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeguroKmListTpm(MyListbox seguroKmListTpm) {
|
||||||
|
this.seguroKmListTpm = seguroKmListTpm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Intbox getTxtKm() {
|
||||||
|
return txtKm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTxtKm(Intbox txtKm) {
|
||||||
|
this.txtKm = txtKm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyTextboxDecimal getTxtValor() {
|
||||||
|
return txtValor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTxtValor(MyTextboxDecimal txtValor) {
|
||||||
|
this.txtValor = txtValor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Row getRowExibeTpp() {
|
||||||
|
return rowExibeTpp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRowExibeTpp(Row rowExibeTpp) {
|
||||||
|
this.rowExibeTpp = rowExibeTpp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Combobox getCmbTipoSeguro() {
|
||||||
|
return cmbTipoSeguro;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCmbTipoSeguro(Combobox cmbTipoSeguro) {
|
||||||
|
this.cmbTipoSeguro = cmbTipoSeguro;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TipoSeguro> getLsTipoSeguro() {
|
||||||
|
return lsTipoSeguro;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLsTipoSeguro(List<TipoSeguro> lsTipoSeguro) {
|
||||||
|
this.lsTipoSeguro = lsTipoSeguro;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Button getBtnApagar() {
|
||||||
return btnApagar;
|
return btnApagar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,24 +174,48 @@ public class EditarSeguroKmController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
exibeTpp = ApplicationProperties.getInstance().exibeTpp();
|
||||||
lsOrgaoConcedente = orgaoConcedenteService.obtenerTodos();
|
lsOrgaoConcedente = orgaoConcedenteService.obtenerTodos();
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
|
lsTipoSeguro.add(TipoSeguro.SEGURO);
|
||||||
|
lsTipoSeguro.add(TipoSeguro.TPP);
|
||||||
|
|
||||||
orgao = (OrgaoConcedente) Executions.getCurrent().getArg().get("orgao");
|
orgao = (OrgaoConcedente) Executions.getCurrent().getArg().get("orgao");
|
||||||
//seguroKm = (SeguroKm) Executions.getCurrent().getArg().get("seguroKm");
|
//seguroKm = (SeguroKm) Executions.getCurrent().getArg().get("seguroKm");
|
||||||
|
|
||||||
seguroKmList.setItemRenderer(new RenderSeguroKm());
|
seguroKmList.setItemRenderer(new RenderSeguroKm());
|
||||||
lsSeguroKm = new ArrayList<SeguroKm>();
|
seguroKmListTpm.setItemRenderer(new RenderSeguroSemTpp());
|
||||||
|
|
||||||
|
lsSeguroKm = new ArrayList<SeguroKm>();
|
||||||
|
|
||||||
if (orgao != null
|
if (orgao != null
|
||||||
&& orgao.getOrgaoConcedenteId() != null) {
|
&& orgao.getOrgaoConcedenteId() != null) {
|
||||||
lsSeguroKm = seguroKmService.buscarPorOrgao(orgao);
|
lsSeguroKm = seguroKmService.buscarPorOrgao(orgao);
|
||||||
seguroKmList.setData(lsSeguroKm);
|
seguroKmList.setData(lsSeguroKm);
|
||||||
|
seguroKmListTpm.setData(lsSeguroKm);
|
||||||
cmbOrgao.setDisabled(Boolean.TRUE);
|
cmbOrgao.setDisabled(Boolean.TRUE);
|
||||||
cmbOrgao.setValue(orgao.getDescOrgao());
|
cmbOrgao.setValue(orgao.getDescOrgao());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!exibeTpp) {
|
||||||
|
seguroKmList.setVisible(true);
|
||||||
|
seguroKmListTpm.setVisible(false);
|
||||||
|
rowExibeTpp.setVisible(false);
|
||||||
|
columTpp.setVisible(true);
|
||||||
|
columSemTpp.setVisible(false);
|
||||||
|
txtKm.setVisible(true);
|
||||||
|
txtKmSemTpp.setVisible(false);
|
||||||
|
} else {
|
||||||
|
seguroKmList.setVisible(false);
|
||||||
|
seguroKmListTpm.setVisible(true);
|
||||||
|
rowExibeTpp.setVisible(true);
|
||||||
|
columTpp.setVisible(false);
|
||||||
|
columSemTpp.setVisible(true);
|
||||||
|
txtKm.setVisible(false);
|
||||||
|
txtKmSemTpp.setVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
||||||
|
@ -161,49 +252,19 @@ public class EditarSeguroKmController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void onClick$btnApagar(Event ev) throws InterruptedException {
|
|
||||||
// try {
|
|
||||||
// int resp = Messagebox.show(
|
|
||||||
// Labels.getLabel("editarSeguroKmController.MSG.borrarPergunta"),
|
|
||||||
// Labels.getLabel("editarSeguroKmController.window.title"),
|
|
||||||
// Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
|
||||||
//
|
|
||||||
// if (resp == Messagebox.YES) {
|
|
||||||
//
|
|
||||||
// seguroKmService.borrar(seguroKm);
|
|
||||||
//
|
|
||||||
// Messagebox.show(
|
|
||||||
// Labels.getLabel("editarSeguroKmController.MSG.borrarOK"),
|
|
||||||
// Labels.getLabel("editarSeguroKmController.window.title"),
|
|
||||||
// Messagebox.OK, Messagebox.INFORMATION);
|
|
||||||
//
|
|
||||||
// seguroKmList.removeItem(seguroKm);
|
|
||||||
//
|
|
||||||
// closeWindow();
|
|
||||||
// }
|
|
||||||
// } catch (Exception ex) {
|
|
||||||
// log.error(ex);
|
|
||||||
// Messagebox.show(
|
|
||||||
// Labels.getLabel("MSG.Error"),
|
|
||||||
// Labels.getLabel("editarSeguroKmController.window.title"),
|
|
||||||
// Messagebox.OK, Messagebox.ERROR);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
public void onClick$btnAdicionarSeguroKm(Event ev) throws InterruptedException {
|
public void onClick$btnAdicionarSeguroKm(Event ev) throws InterruptedException {
|
||||||
cmbOrgao.getValue();
|
|
||||||
txtKm.getValue();
|
|
||||||
txtValor.getValue();
|
|
||||||
|
|
||||||
if (lsSeguroKm.isEmpty()) {
|
if (lsSeguroKm.isEmpty()) {
|
||||||
|
|
||||||
lsSeguroKm = seguroKmService.buscarPorOrgao((OrgaoConcedente) cmbOrgao.getSelectedItem().getValue());
|
lsSeguroKm = seguroKmService.buscarPorOrgao((OrgaoConcedente) cmbOrgao.getSelectedItem().getValue());
|
||||||
seguroKmList.setData(lsSeguroKm);
|
seguroKmList.setData(lsSeguroKm);
|
||||||
|
seguroKmListTpm.setData(lsSeguroKm);
|
||||||
}
|
}
|
||||||
|
|
||||||
//ChecandoDuplicado
|
//ChecandoDuplicado
|
||||||
boolean existe = false;
|
boolean existe = false;
|
||||||
for (SeguroKm km : lsSeguroKm) {
|
for (SeguroKm km : lsSeguroKm) {
|
||||||
if (km.getKmate().equals(txtKm.getValue())) {
|
if ((txtKm.isVisible() && km.getKmate().equals(txtKm.getValue())) || (txtKmSemTpp.isVisible() && km.getKmate().equals(txtKmSemTpp.getValue()))) {
|
||||||
existe = true;
|
existe = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,7 +280,12 @@ public class EditarSeguroKmController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
SeguroKm km = new SeguroKm();
|
SeguroKm km = new SeguroKm();
|
||||||
km.setOrgaoconcedente((OrgaoConcedente) cmbOrgao.getSelectedItem().getValue());
|
km.setOrgaoconcedente((OrgaoConcedente) cmbOrgao.getSelectedItem().getValue());
|
||||||
km.setKmate(txtKm.getValue());
|
km.setTipoSeguro(cmbTipoSeguro.getSelectedItem() != null ? cmbTipoSeguro.getSelectedItem().getLabel() : TipoSeguro.SEGURO.toString());
|
||||||
|
if (!exibeTpp) {
|
||||||
|
km.setKmate(txtKm.getValue());
|
||||||
|
} else {
|
||||||
|
km.setKmate(txtKmSemTpp.getValue());
|
||||||
|
}
|
||||||
km.setValortaxa(txtValor.getValueDecimal());
|
km.setValortaxa(txtValor.getValueDecimal());
|
||||||
km.setActivo(true);
|
km.setActivo(true);
|
||||||
km.setFecmodif(Calendar.getInstance().getTime());
|
km.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
@ -227,6 +293,7 @@ public class EditarSeguroKmController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
lsSeguroKm.add(km);
|
lsSeguroKm.add(km);
|
||||||
seguroKmList.setData(lsSeguroKm);
|
seguroKmList.setData(lsSeguroKm);
|
||||||
|
seguroKmListTpm.setData(lsSeguroKm);
|
||||||
|
|
||||||
cmbOrgao.setDisabled(Boolean.TRUE);
|
cmbOrgao.setDisabled(Boolean.TRUE);
|
||||||
limparInput();
|
limparInput();
|
||||||
|
@ -234,11 +301,18 @@ public class EditarSeguroKmController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void limparInput() {
|
private void limparInput() {
|
||||||
txtKm.setConstraint("");
|
if (txtKm.isVisible()) {
|
||||||
|
txtKm.setConstraint("");
|
||||||
|
txtKm.setText("");
|
||||||
|
txtKm.setConstraint("no empty, no zero, no negative");
|
||||||
|
}
|
||||||
|
if (txtKmSemTpp.isVisible()) {
|
||||||
|
txtKmSemTpp.setConstraint("");
|
||||||
|
txtKmSemTpp.setText("");
|
||||||
|
txtKmSemTpp.setConstraint("no empty, no zero, no negative");
|
||||||
|
}
|
||||||
txtValor.setConstraint("");
|
txtValor.setConstraint("");
|
||||||
txtKm.setText("");
|
|
||||||
txtValor.setText("");
|
txtValor.setText("");
|
||||||
txtKm.setConstraint("no empty, no zero, no negative");
|
|
||||||
txtValor.setConstraint("no empty, no zero, no negative");
|
txtValor.setConstraint("no empty, no zero, no negative");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,5 +327,15 @@ public class EditarSeguroKmController extends MyGenericForwardComposer {
|
||||||
lsSeguroKm.remove(cd);
|
lsSeguroKm.remove(cd);
|
||||||
seguroKmList.setData(lsSeguroKm);
|
seguroKmList.setData(lsSeguroKm);
|
||||||
}
|
}
|
||||||
|
cd = (SeguroKm) seguroKmListTpm.getSelected();
|
||||||
|
if (cd != null) {
|
||||||
|
cd.setActivo(Boolean.FALSE);
|
||||||
|
cd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
cd.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
seguroKmService.actualizacion(cd);
|
||||||
|
|
||||||
|
lsSeguroKm.remove(cd);
|
||||||
|
seguroKmListTpm.setData(lsSeguroKm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.poi.hssf.util.HSSFColor.ORCHID;
|
|
||||||
import org.hibernate.LazyInitializationException;
|
import org.hibernate.LazyInitializationException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
|
@ -21,6 +20,7 @@ import org.zkoss.zul.Combobox;
|
||||||
import org.zkoss.zul.Constraint;
|
import org.zkoss.zul.Constraint;
|
||||||
import org.zkoss.zul.Messagebox;
|
import org.zkoss.zul.Messagebox;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
||||||
import com.rjconsultores.ventaboletos.dao.TarifaOficialDAO;
|
import com.rjconsultores.ventaboletos.dao.TarifaOficialDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
|
@ -33,6 +33,7 @@ import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaEmpresaService;
|
import com.rjconsultores.ventaboletos.service.RutaEmpresaService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
@ -75,6 +76,7 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
private Checkbox chkSeguro;
|
private Checkbox chkSeguro;
|
||||||
private Checkbox chkZerarTabela;
|
private Checkbox chkZerarTabela;
|
||||||
private Checkbox chkPedagio;
|
private Checkbox chkPedagio;
|
||||||
|
private Checkbox chkTipoSeguro;
|
||||||
private List<Ruta> listSelectedRutas;
|
private List<Ruta> listSelectedRutas;
|
||||||
private MyListbox selectedRutasList;
|
private MyListbox selectedRutasList;
|
||||||
private List<Empresa> lsEmpresaSelected;
|
private List<Empresa> lsEmpresaSelected;
|
||||||
|
@ -110,6 +112,10 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
selectedRutasList.setItemRenderer(new RenderRutaDesc());
|
selectedRutasList.setItemRenderer(new RenderRutaDesc());
|
||||||
listSelectedRutas = new ArrayList<Ruta>();
|
listSelectedRutas = new ArrayList<Ruta>();
|
||||||
lsEmpresaSelected = new ArrayList<Empresa>();
|
lsEmpresaSelected = new ArrayList<Empresa>();
|
||||||
|
|
||||||
|
if (!ApplicationProperties.getInstance().exibeTpp()) {
|
||||||
|
chkTipoSeguro.setVisible(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$chkZerarTabela(Event ev)
|
public void onClick$chkZerarTabela(Event ev)
|
||||||
|
@ -122,7 +128,9 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
chkTaxaEmbarque.setDisabled(true);
|
chkTaxaEmbarque.setDisabled(true);
|
||||||
chkSeguro.setChecked(false);
|
chkSeguro.setChecked(false);
|
||||||
chkSeguro.setDisabled(true);
|
chkSeguro.setDisabled(true);
|
||||||
|
chkTipoSeguro.setDisabled(true);
|
||||||
chkPedagio.setChecked(false);
|
chkPedagio.setChecked(false);
|
||||||
|
chkTipoSeguro.setChecked(false);
|
||||||
chkPedagio.setDisabled(true);
|
chkPedagio.setDisabled(true);
|
||||||
chkArredondarTaxaEmbarque.setChecked(false);
|
chkArredondarTaxaEmbarque.setChecked(false);
|
||||||
chkArredondarTaxaEmbarque.setDisabled(true);
|
chkArredondarTaxaEmbarque.setDisabled(true);
|
||||||
|
@ -132,6 +140,7 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
chkTarifa.setChecked(true);
|
chkTarifa.setChecked(true);
|
||||||
chkTaxaEmbarque.setDisabled(false);
|
chkTaxaEmbarque.setDisabled(false);
|
||||||
chkSeguro.setDisabled(false);
|
chkSeguro.setDisabled(false);
|
||||||
|
chkTipoSeguro.setDisabled(false);
|
||||||
chkPedagio.setDisabled(false);
|
chkPedagio.setDisabled(false);
|
||||||
chkArredondarTaxaEmbarque.setDisabled(false);
|
chkArredondarTaxaEmbarque.setDisabled(false);
|
||||||
chkArredondarTaxaEmbarque.setChecked(true);
|
chkArredondarTaxaEmbarque.setChecked(true);
|
||||||
|
@ -181,14 +190,22 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chkSeguro.isChecked()) {
|
if (chkSeguro.isChecked()) {
|
||||||
tarifaOficialService.atualizarSeguro(listSelectedRutas, orgaoConcedenteId);
|
tarifaOficialService.atualizarSeguro(listSelectedRutas, orgaoConcedenteId, TipoSeguro.SEGURO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chkTipoSeguro.isChecked()) {
|
||||||
|
tarifaOficialService.atualizarSeguro(listSelectedRutas, orgaoConcedenteId, TipoSeguro.TPP);
|
||||||
|
}
|
||||||
|
|
||||||
if (chkPedagio.isChecked()) {
|
if (chkPedagio.isChecked()) {
|
||||||
tarifaOficialService.atualizarPedagio();
|
tarifaOficialService.atualizarPedagio();
|
||||||
}
|
}
|
||||||
|
|
||||||
tarifaOficialService.aplicarArredondamentoTarifa(orgaoConcedenteId, chkArredondarTaxaEmbarque.isChecked());
|
tarifaOficialService.aplicarArredondamentoTarifa(orgaoConcedenteId, chkArredondarTaxaEmbarque.isChecked());
|
||||||
|
|
||||||
|
if (chkTipoSeguro.isChecked()) {
|
||||||
|
tarifaOficialService.atualizarSeguroTPP(listSelectedRutas, orgaoConcedenteId, TipoSeguro.TPP);
|
||||||
|
}
|
||||||
|
|
||||||
long l = tarifaOficialService.obtenerCount(lsEmpresaSelected);
|
long l = tarifaOficialService.obtenerCount(lsEmpresaSelected);
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ import com.rjconsultores.ventaboletos.service.RutaCombinacionService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
import com.rjconsultores.ventaboletos.service.TarifaService;
|
import com.rjconsultores.ventaboletos.service.TarifaService;
|
||||||
import com.rjconsultores.ventaboletos.service.UsuarioEmpresaService;
|
import com.rjconsultores.ventaboletos.service.UsuarioEmpresaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
@ -348,42 +349,44 @@ public class TarifaOficialExcelController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
HSSFRow rowCabecalho = sheet1.createRow(0);
|
HSSFRow rowCabecalho = sheet1.createRow(0);
|
||||||
|
|
||||||
HSSFCell cell = rowCabecalho.createCell(0);
|
int j = 0;
|
||||||
|
HSSFCell cell = rowCabecalho.createCell(j++);
|
||||||
cell.setCellValue(
|
cell.setCellValue(
|
||||||
Labels.getLabel("busquedaTarifaController.lhId.label"));
|
Labels.getLabel("busquedaTarifaController.lhId.label"));
|
||||||
cell.setCellStyle(estilo);
|
cell.setCellStyle(estilo);
|
||||||
|
|
||||||
HSSFCell cell0 = rowCabecalho.createCell(1);
|
HSSFCell cell0 = rowCabecalho.createCell(j++);
|
||||||
cell0.setCellValue(
|
cell0.setCellValue(
|
||||||
Labels.getLabel("busquedaTarifaController.lhTramo.label"));
|
Labels.getLabel("busquedaTarifaController.lhTramo.label"));
|
||||||
cell0.setCellStyle(estilo);
|
cell0.setCellStyle(estilo);
|
||||||
|
|
||||||
HSSFCell cell1 = rowCabecalho.createCell(2);
|
HSSFCell cell1 = rowCabecalho.createCell(j++);
|
||||||
cell1.setCellValue(
|
cell1.setCellValue(
|
||||||
Labels.getLabel("busquedaTarifaController.lhOrigen.label"));
|
Labels.getLabel("busquedaTarifaController.lhOrigen.label"));
|
||||||
cell1.setCellStyle(estilo);
|
cell1.setCellStyle(estilo);
|
||||||
|
|
||||||
HSSFCell cell2 = rowCabecalho.createCell(3);
|
HSSFCell cell2 = rowCabecalho.createCell(j++);
|
||||||
cell2.setCellValue(
|
cell2.setCellValue(
|
||||||
Labels.getLabel("busquedaTarifaController.lhDestino.label"));
|
Labels.getLabel("busquedaTarifaController.lhDestino.label"));
|
||||||
cell2.setCellStyle(estilo);
|
cell2.setCellStyle(estilo);
|
||||||
|
|
||||||
HSSFCell cell3 = rowCabecalho.createCell(4);
|
HSSFCell cell3 = rowCabecalho.createCell(j++);
|
||||||
cell3.setCellValue(
|
cell3.setCellValue(
|
||||||
Labels.getLabel("busquedaTarifaController.lhRuta.label"));
|
Labels.getLabel("busquedaTarifaController.lhRuta.label"));
|
||||||
cell3.setCellStyle(estilo);
|
cell3.setCellStyle(estilo);
|
||||||
|
|
||||||
HSSFCell cell4 = rowCabecalho.createCell(5);
|
HSSFCell cell4 = rowCabecalho.createCell(j++);
|
||||||
cell4.setCellValue(
|
cell4.setCellValue(
|
||||||
Labels.getLabel("busquedaTarifaController.lhMarca.label"));
|
Labels.getLabel("busquedaTarifaController.lhMarca.label"));
|
||||||
cell4.setCellStyle(estilo);
|
cell4.setCellStyle(estilo);
|
||||||
|
|
||||||
//Preco original I - 6
|
//Preco original I - 6
|
||||||
HSSFCell cell5 = rowCabecalho.createCell(6);
|
HSSFCell cell5 = rowCabecalho.createCell(j++);
|
||||||
cell5.setCellValue(
|
cell5.setCellValue(
|
||||||
Labels.getLabel("busquedaTarifaController.lhClaseServicio.label"));
|
Labels.getLabel("busquedaTarifaController.lhClaseServicio.label"));
|
||||||
cell5.setCellStyle(estilo);
|
cell5.setCellStyle(estilo);
|
||||||
|
|
||||||
|
j++;
|
||||||
// H - 6
|
// H - 6
|
||||||
// HSSFCell cell6 = rowCabecalho.createCell(7);
|
// HSSFCell cell6 = rowCabecalho.createCell(7);
|
||||||
// cell6.setCellValue(
|
// cell6.setCellValue(
|
||||||
|
@ -391,43 +394,49 @@ public class TarifaOficialExcelController extends MyGenericForwardComposer {
|
||||||
// cell6.setCellStyle(estilo);
|
// cell6.setCellStyle(estilo);
|
||||||
|
|
||||||
//I - 8
|
//I - 8
|
||||||
HSSFCell cell7 = rowCabecalho.createCell(8);
|
HSSFCell cell7 = rowCabecalho.createCell(j++);
|
||||||
cell7.setCellValue(
|
cell7.setCellValue(
|
||||||
Labels.getLabel("busquedaTarifaController.lhMoneda.label"));
|
Labels.getLabel("busquedaTarifaController.lhMoneda.label"));
|
||||||
cell7.setCellStyle(estilo);
|
cell7.setCellStyle(estilo);
|
||||||
|
|
||||||
//J - 9
|
//J - 9
|
||||||
HSSFCell cell8 = rowCabecalho.createCell(9);
|
HSSFCell cell8 = rowCabecalho.createCell(j++);
|
||||||
cell8.setCellValue(
|
cell8.setCellValue(
|
||||||
Labels.getLabel("busquedaTarifaController.lhPrecioOriginal.label"));
|
Labels.getLabel("busquedaTarifaController.lhPrecioOriginal.label"));
|
||||||
cell8.setCellStyle(estilo);
|
cell8.setCellStyle(estilo);
|
||||||
|
|
||||||
//J - 9
|
//J - 9
|
||||||
HSSFCell cell9 = rowCabecalho.createCell(10);
|
HSSFCell cell9 = rowCabecalho.createCell(j++);
|
||||||
cell9.setCellValue(
|
cell9.setCellValue(
|
||||||
Labels.getLabel("busquedaTarifaController.lhPrecioExcel.label"));
|
Labels.getLabel("busquedaTarifaController.lhPrecioExcel.label"));
|
||||||
cell9.setCellStyle(estilo);
|
cell9.setCellStyle(estilo);
|
||||||
|
|
||||||
//h - 10
|
//h - 10
|
||||||
HSSFCell cell10 = rowCabecalho.createCell(11);
|
HSSFCell cell10 = rowCabecalho.createCell(j++);
|
||||||
cell10.setCellValue("Taxa");
|
cell10.setCellValue("Taxa");
|
||||||
cell10.setCellStyle(estilo);
|
cell10.setCellStyle(estilo);
|
||||||
|
|
||||||
HSSFCell cell11 = rowCabecalho.createCell(12);
|
HSSFCell cell11 = rowCabecalho.createCell(j++);
|
||||||
cell11.setCellValue("Seguro");
|
cell11.setCellValue("Seguro");
|
||||||
cell11.setCellStyle(estilo);
|
cell11.setCellStyle(estilo);
|
||||||
|
|
||||||
HSSFCell cell12 = rowCabecalho.createCell(13);
|
if (ApplicationProperties.getInstance().exibeTpp()) {
|
||||||
cell12.setCellValue("Pedagio");
|
HSSFCell cell12 = rowCabecalho.createCell(j++);
|
||||||
cell12.setCellStyle(estilo);
|
cell12.setCellValue("TPP");
|
||||||
|
cell12.setCellStyle(estilo);
|
||||||
HSSFCell cell13 = rowCabecalho.createCell(14);
|
}
|
||||||
cell13.setCellValue("Outros");
|
|
||||||
|
HSSFCell cell13 = rowCabecalho.createCell(j++);
|
||||||
|
cell13.setCellValue("Pedagio");
|
||||||
cell13.setCellStyle(estilo);
|
cell13.setCellStyle(estilo);
|
||||||
|
|
||||||
HSSFCell cell14 = rowCabecalho.createCell(15);
|
HSSFCell cell14 = rowCabecalho.createCell(j++);
|
||||||
cell14.setCellValue("Total");
|
cell14.setCellValue("Outros");
|
||||||
cell14.setCellStyle(estilo);
|
cell14.setCellStyle(estilo);
|
||||||
|
|
||||||
|
HSSFCell cell15 = rowCabecalho.createCell(j++);
|
||||||
|
cell15.setCellValue("Total");
|
||||||
|
cell15.setCellStyle(estilo);
|
||||||
}
|
}
|
||||||
|
|
||||||
HSSFRow row = sheet1.createRow(contRow++);
|
HSSFRow row = sheet1.createRow(contRow++);
|
||||||
|
@ -458,9 +467,21 @@ public class TarifaOficialExcelController extends MyGenericForwardComposer {
|
||||||
BigDecimal taxa = tx == null ? new BigDecimal(BigInteger.ZERO) : BigDecimal.valueOf(Double.valueOf(tx));
|
BigDecimal taxa = tx == null ? new BigDecimal(BigInteger.ZERO) : BigDecimal.valueOf(Double.valueOf(tx));
|
||||||
String seg = obj[17] == null ? "0" : obj[17].toString();
|
String seg = obj[17] == null ? "0" : obj[17].toString();
|
||||||
BigDecimal seguro = seg == null ? new BigDecimal(BigInteger.ZERO) : BigDecimal.valueOf(Double.valueOf(seg));
|
BigDecimal seguro = seg == null ? new BigDecimal(BigInteger.ZERO) : BigDecimal.valueOf(Double.valueOf(seg));
|
||||||
String ped = obj[18] == null ? "0" : obj[18].toString();
|
|
||||||
|
String tpp;
|
||||||
|
String ped;
|
||||||
|
String otr;
|
||||||
|
BigDecimal seguroTpp = null;
|
||||||
|
if (ApplicationProperties.getInstance().exibeTpp()) {
|
||||||
|
tpp = obj[18] == null ? "0" : obj[18].toString();
|
||||||
|
ped = obj[19] == null ? "0" : obj[19].toString();
|
||||||
|
otr = obj[20] == null ? "0" : obj[20].toString();
|
||||||
|
seguroTpp = tpp == null ? new BigDecimal(BigInteger.ZERO) : BigDecimal.valueOf(Double.valueOf(tpp));
|
||||||
|
} else {
|
||||||
|
ped = obj[18] == null ? "0" : obj[19].toString();
|
||||||
|
otr = obj[19] == null ? "0" : obj[20].toString();
|
||||||
|
}
|
||||||
BigDecimal pedagio = ped == null ? new BigDecimal(BigInteger.ZERO) : BigDecimal.valueOf(Double.valueOf(ped));
|
BigDecimal pedagio = ped == null ? new BigDecimal(BigInteger.ZERO) : BigDecimal.valueOf(Double.valueOf(ped));
|
||||||
String otr = obj[19] == null ? "0" : obj[19].toString();
|
|
||||||
BigDecimal outros = otr == null ? new BigDecimal(BigInteger.ZERO) : BigDecimal.valueOf(Double.valueOf(otr));
|
BigDecimal outros = otr == null ? new BigDecimal(BigInteger.ZERO) : BigDecimal.valueOf(Double.valueOf(otr));
|
||||||
|
|
||||||
row.createCell(9).setCellValue(original.setScale(2).doubleValue());
|
row.createCell(9).setCellValue(original.setScale(2).doubleValue());
|
||||||
|
@ -468,10 +489,16 @@ public class TarifaOficialExcelController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
row.createCell(11).setCellValue(taxa.setScale(2).doubleValue());
|
row.createCell(11).setCellValue(taxa.setScale(2).doubleValue());
|
||||||
row.createCell(12).setCellValue(seguro.setScale(2).doubleValue());
|
row.createCell(12).setCellValue(seguro.setScale(2).doubleValue());
|
||||||
row.createCell(13).setCellValue(pedagio.setScale(2).doubleValue());
|
if (ApplicationProperties.getInstance().exibeTpp()) {
|
||||||
row.createCell(14).setCellValue(outros.setScale(2).doubleValue());
|
row.createCell(13).setCellValue(seguroTpp.setScale(2).doubleValue());
|
||||||
|
row.createCell(14).setCellValue(pedagio.setScale(2).doubleValue());
|
||||||
row.createCell(15).setCellValue(atual.add(taxa).add(seguro).add(pedagio).add(outros).setScale(2).doubleValue());
|
row.createCell(15).setCellValue(outros.setScale(2).doubleValue());
|
||||||
|
row.createCell(16).setCellValue(atual.add(taxa).add(seguro).add(pedagio).add(outros).setScale(2).doubleValue());
|
||||||
|
} else {
|
||||||
|
row.createCell(13).setCellValue(pedagio.setScale(2).doubleValue());
|
||||||
|
row.createCell(14).setCellValue(outros.setScale(2).doubleValue());
|
||||||
|
row.createCell(15).setCellValue(atual.add(taxa).add(seguro).add(pedagio).add(outros).setScale(2).doubleValue());
|
||||||
|
}
|
||||||
|
|
||||||
// novo preco:
|
// novo preco:
|
||||||
// BigDecimal novoPrecio = atual;
|
// BigDecimal novoPrecio = atual;
|
||||||
|
|
Loading…
Reference in New Issue