|
|
|
@ -13,6 +13,7 @@ import java.io.FileNotFoundException;
|
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
|
import java.io.FileReader;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.sql.Connection;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
@ -50,6 +51,7 @@ import org.zkoss.zul.Button;
|
|
|
|
|
import org.zkoss.zul.Checkbox;
|
|
|
|
|
import org.zkoss.zul.Combobox;
|
|
|
|
|
import org.zkoss.zul.Comboitem;
|
|
|
|
|
import org.zkoss.zul.Constraint;
|
|
|
|
|
import org.zkoss.zul.Datebox;
|
|
|
|
|
import org.zkoss.zul.Doublebox;
|
|
|
|
|
import org.zkoss.zul.Filedownload;
|
|
|
|
@ -119,6 +121,8 @@ import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
|
|
|
|
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
|
|
|
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
|
|
|
|
import com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.FechamentoParamptovtaListItemRenderer;
|
|
|
|
|
import com.rjconsultores.ventaboletos.web.utilerias.ConstraintEmailOrEmpty;
|
|
|
|
|
import com.rjconsultores.ventaboletos.web.utilerias.ConstraintNoEmpty;
|
|
|
|
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
|
|
|
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
|
|
|
|
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
|
|
|
@ -378,16 +382,15 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
public void aplicarMascara() {
|
|
|
|
|
Clients.evalJavaScript(
|
|
|
|
|
"jQuery('#" + txtNumFax.getUuid() + "').mask('(999)9999-9999?9');" +
|
|
|
|
|
"jQuery('#" + numtelefonodos.getUuid() + "').mask('(999)9999-9999?9');" +
|
|
|
|
|
"jQuery('#" + numtelefonouno.getUuid() + "').mask('(999)9999-9999?9');")
|
|
|
|
|
;
|
|
|
|
|
"jQuery('#" + numtelefonodos.getUuid() + "').mask('(999)9999-9999?9');" +
|
|
|
|
|
"jQuery('#" + numtelefonouno.getUuid() + "').mask('(999)9999-9999?9');");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<String> getLogFiles(){
|
|
|
|
|
private List<String> getLogFiles() {
|
|
|
|
|
List<String> files = new ArrayList<String>();
|
|
|
|
|
File logDir = new File(System.getProperty("jboss.server.log.dir"));
|
|
|
|
|
for (String str : logDir.list()){
|
|
|
|
|
if (str.contains("ws") && !str.contains("zip")){
|
|
|
|
|
for (String str : logDir.list()) {
|
|
|
|
|
if (str.contains("ws") && !str.contains("zip")) {
|
|
|
|
|
files.add(str);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -416,10 +419,10 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
|
|
|
|
|
super.doAfterCompose(comp);
|
|
|
|
|
|
|
|
|
|
cmbBanco.addEventListener("onAfterRender", new org.zkoss.zk.ui.event.EventListener(){
|
|
|
|
|
public void onEvent(Event event) throws Exception{
|
|
|
|
|
cmbBanco.setSelectedIndex(lsBanco.indexOf(puntoVenta.getAgenciaId().getInstiFinanceiraId()));
|
|
|
|
|
}
|
|
|
|
|
cmbBanco.addEventListener("onAfterRender", new org.zkoss.zk.ui.event.EventListener() {
|
|
|
|
|
public void onEvent(Event event) throws Exception {
|
|
|
|
|
cmbBanco.setSelectedIndex(lsBanco.indexOf(puntoVenta.getAgenciaId().getInstiFinanceiraId()));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
aplicarMascara();
|
|
|
|
@ -485,7 +488,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
txtRazonSocial.setValue(puntoVenta.getRazonSocial());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
|
|
|
|
fechamentoParamptovtaList.setData(params);
|
|
|
|
|
}
|
|
|
|
@ -719,49 +721,49 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
txtNome.focus();
|
|
|
|
|
if(puntoVenta.getValidaTempoParaImpressao() != null) {
|
|
|
|
|
if (puntoVenta.getValidaTempoParaImpressao() != null) {
|
|
|
|
|
txtTempoParaImpressao.setDisabled(!puntoVenta.getValidaTempoParaImpressao());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void onClick$btnDownload(Event event) {
|
|
|
|
|
String fileName = System.getProperty("jboss.server.log.dir") + "/" + cmbLogFiles.getSelectedItem().getValue().toString();
|
|
|
|
|
String fileZip = System.getProperty("jboss.server.log.dir") + "/" + cmbLogFiles.getSelectedItem().getValue().toString().replace("log", "zip");
|
|
|
|
|
FileInputStream inputStream;
|
|
|
|
|
try {
|
|
|
|
|
excluirArquivosZip();
|
|
|
|
|
compactarArquivo(fileZip, fileName);
|
|
|
|
|
File file = new File(fileZip);
|
|
|
|
|
if (file.exists()) {
|
|
|
|
|
inputStream = new FileInputStream(file);
|
|
|
|
|
Filedownload.save(inputStream, new MimetypesFileTypeMap().getContentType(file), file.getName());
|
|
|
|
|
}
|
|
|
|
|
file.delete();
|
|
|
|
|
public void onClick$btnDownload(Event event) {
|
|
|
|
|
String fileName = System.getProperty("jboss.server.log.dir") + "/" + cmbLogFiles.getSelectedItem().getValue().toString();
|
|
|
|
|
String fileZip = System.getProperty("jboss.server.log.dir") + "/" + cmbLogFiles.getSelectedItem().getValue().toString().replace("log", "zip");
|
|
|
|
|
FileInputStream inputStream;
|
|
|
|
|
try {
|
|
|
|
|
excluirArquivosZip();
|
|
|
|
|
compactarArquivo(fileZip, fileName);
|
|
|
|
|
File file = new File(fileZip);
|
|
|
|
|
if (file.exists()) {
|
|
|
|
|
inputStream = new FileInputStream(file);
|
|
|
|
|
Filedownload.save(inputStream, new MimetypesFileTypeMap().getContentType(file), file.getName());
|
|
|
|
|
}
|
|
|
|
|
file.delete();
|
|
|
|
|
} catch (FileNotFoundException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String readFile(String fileName) throws IOException {
|
|
|
|
|
BufferedReader br = new BufferedReader(new FileReader(fileName));
|
|
|
|
|
try {
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
String line = br.readLine();
|
|
|
|
|
private String readFile(String fileName) throws IOException {
|
|
|
|
|
BufferedReader br = new BufferedReader(new FileReader(fileName));
|
|
|
|
|
try {
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
String line = br.readLine();
|
|
|
|
|
|
|
|
|
|
while (line != null) {
|
|
|
|
|
sb.append(line);
|
|
|
|
|
sb.append("\n");
|
|
|
|
|
line = br.readLine();
|
|
|
|
|
}
|
|
|
|
|
return sb.toString();
|
|
|
|
|
} finally {
|
|
|
|
|
br.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while (line != null) {
|
|
|
|
|
sb.append(line);
|
|
|
|
|
sb.append("\n");
|
|
|
|
|
line = br.readLine();
|
|
|
|
|
}
|
|
|
|
|
return sb.toString();
|
|
|
|
|
} finally {
|
|
|
|
|
br.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
|
public boolean validaFuncionTipoBoletoBloqueado() {
|
|
|
|
@ -862,7 +864,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
Empresa empresa = (Empresa) cmbEmpresaPtoVta.getSelectedItem().getValue();
|
|
|
|
|
lsEmpresaContaBancarias = ptovtaBancoService.buscarContasBancariasPorIdEmpresa(empresa.getEmpresaId());
|
|
|
|
|
|
|
|
|
|
if(lsEmpresaContaBancarias != null && !lsEmpresaContaBancarias.isEmpty()) {
|
|
|
|
|
if (lsEmpresaContaBancarias != null && !lsEmpresaContaBancarias.isEmpty()) {
|
|
|
|
|
cmbEmpresasContaBancarias.setModel(new BindingListModelList(lsEmpresaContaBancarias, true));
|
|
|
|
|
} else {
|
|
|
|
|
cmbEmpresasContaBancarias.setModel(new BindingListModelList(new ArrayList(), true));
|
|
|
|
@ -899,8 +901,8 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
if (cmbColonia.getSelectedItem() == null) {
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
// Colonia col = (Colonia) cmbColonia.getSelectedItem().getValue();
|
|
|
|
|
// txtCP.setValue(col.getCodpostal());
|
|
|
|
|
// Colonia col = (Colonia) cmbColonia.getSelectedItem().getValue();
|
|
|
|
|
// txtCP.setValue(col.getCodpostal());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -927,12 +929,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
log.info("puntoVentaId=" + puntoVenta.getPuntoventaId() + ";fecInicio=" + dateInicio + ";fecFin=" + dateFim);
|
|
|
|
|
|
|
|
|
|
gerador = new GeradorTitulosIntegracion(myConn, puntoVenta.getPuntoventaId(), dateInicio,
|
|
|
|
|
dateFim,checkTodosPuntosVenta.isChecked());
|
|
|
|
|
dateFim, checkTodosPuntosVenta.isChecked());
|
|
|
|
|
gerador.execute();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("Erro ao integrar",e);
|
|
|
|
|
log.error("Erro ao integrar", e);
|
|
|
|
|
|
|
|
|
|
if (e instanceof WrongValueException) {
|
|
|
|
|
throw (WrongValueException) e;
|
|
|
|
@ -967,7 +968,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
gerenciadorWS.execute();
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("Erro ao integrar",e);
|
|
|
|
|
log.error("Erro ao integrar", e);
|
|
|
|
|
|
|
|
|
|
if (e instanceof WrongValueException) {
|
|
|
|
|
throw (WrongValueException) e;
|
|
|
|
@ -980,14 +981,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
|
|
|
Messagebox.OK, Messagebox.ERROR);
|
|
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
// if (myConn != null) {
|
|
|
|
|
// try {
|
|
|
|
|
// myConn.close();
|
|
|
|
|
// } catch (SQLException e) {
|
|
|
|
|
// log.error("Erro ao fechar a conexão", e);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} finally {
|
|
|
|
|
// if (myConn != null) {
|
|
|
|
|
// try {
|
|
|
|
|
// myConn.close();
|
|
|
|
|
// } catch (SQLException e) {
|
|
|
|
|
// log.error("Erro ao fechar a conexão", e);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1064,10 +1065,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
public void onClick$btnAdicionarPtoVtaSeguro(Event ev) {
|
|
|
|
|
|
|
|
|
|
if (cmbEmpresaSeguro.getSelectedItem() != null &&
|
|
|
|
|
(radIndvendsegopcionalSi.isChecked() || radIndvendsegopcionalNo.isChecked() ||
|
|
|
|
|
radIndestansegopcionalSi.isChecked() || radIndestansegopcionalNo.isChecked()) &&
|
|
|
|
|
(radIndPermisoTasaEmbarqueSi.isChecked() || radIndPermisoTasaEmbarqueNo.isChecked() ||
|
|
|
|
|
radIndEstanTasaEmbarqueSi.isChecked() || radIndEstanTasaEmbarqueNo.isChecked())) {
|
|
|
|
|
(radIndvendsegopcionalSi.isChecked() || radIndvendsegopcionalNo.isChecked() ||
|
|
|
|
|
radIndestansegopcionalSi.isChecked() || radIndestansegopcionalNo.isChecked())
|
|
|
|
|
&&
|
|
|
|
|
(radIndPermisoTasaEmbarqueSi.isChecked() || radIndPermisoTasaEmbarqueNo.isChecked() ||
|
|
|
|
|
radIndEstanTasaEmbarqueSi.isChecked() || radIndEstanTasaEmbarqueNo.isChecked())) {
|
|
|
|
|
|
|
|
|
|
Empresa empresa = (Empresa) cmbEmpresaSeguro.getSelectedItem().getValue();
|
|
|
|
|
|
|
|
|
@ -1149,7 +1151,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
|
|
|
|
|
|
|
|
|
txtMaxCancelacion.getValue();
|
|
|
|
|
txtNome.getValue();
|
|
|
|
|
txtNumPtoVta.getValue();
|
|
|
|
@ -1157,19 +1158,10 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
txtCompl.getValue();
|
|
|
|
|
txtNumAg.getValue();
|
|
|
|
|
txtConta.getValue();
|
|
|
|
|
txtDigito.getValue();
|
|
|
|
|
txtBilhetes.getValue();
|
|
|
|
|
txtCarga.getValue();
|
|
|
|
|
txtTitularNome.getValue();
|
|
|
|
|
txtTitularCpf.getValue();
|
|
|
|
|
txtTitularRg.getValue();
|
|
|
|
|
txtTitularEmissor.getValue();
|
|
|
|
|
txtAntecipRetem.getValue();
|
|
|
|
|
txtAntecipPercentual.getValue();
|
|
|
|
|
|
|
|
|
|
txtResponAluguel.getValue();
|
|
|
|
|
txtResponTel.getValue();
|
|
|
|
|
txtResponEnergia.getValue();
|
|
|
|
|
|
|
|
|
|
cmbEmpresa.getValue();
|
|
|
|
|
cmbParada.getValue();
|
|
|
|
@ -1183,7 +1175,23 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
cmbBanco.getValue();
|
|
|
|
|
cmbPessoa.getValue();
|
|
|
|
|
cmbTipoConta.getValue();
|
|
|
|
|
cmbPosicao.getValue();
|
|
|
|
|
|
|
|
|
|
if (!txtTitularNome.getValue().isEmpty()
|
|
|
|
|
|| !txtTitularNome.getValue().isEmpty()
|
|
|
|
|
|| !txtTitularRg.getValue().isEmpty()
|
|
|
|
|
|| !txtTitularEmissor.getValue().isEmpty()
|
|
|
|
|
|| img.getContent() != null) {
|
|
|
|
|
txtTitularCpf.setConstraint(new ConstraintNoEmpty());
|
|
|
|
|
txtTitularCpf.getValue();
|
|
|
|
|
|
|
|
|
|
puntoVenta.getTitularId().setActivo(Boolean.TRUE);
|
|
|
|
|
puntoVenta.getTitularId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
|
|
|
puntoVenta.getTitularId().setFecmodif(Calendar.getInstance().getTime());
|
|
|
|
|
} else {
|
|
|
|
|
puntoVenta.setTitularId(null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
validarDiversos();
|
|
|
|
|
|
|
|
|
|
String numagencia = txtNumAg.getValue() + (StringUtils.isBlank(txtDigitoAg.getValue()) ? "" : "-" + txtDigitoAg.getValue());
|
|
|
|
|
puntoVenta.getAgenciaId().setNumagencia(numagencia);
|
|
|
|
@ -1217,7 +1225,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(ckValidarTempoParaImpressao.isChecked() && txtTempoParaImpressao.getValue() == null) {
|
|
|
|
|
if (ckValidarTempoParaImpressao.isChecked() && txtTempoParaImpressao.getValue() == null) {
|
|
|
|
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.informarTempoMinimo.value"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
|
txtTempoParaImpressao.focus();
|
|
|
|
@ -1226,7 +1234,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (puntoVenta.getEmpresa() == null) {
|
|
|
|
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.empresa"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
|
|
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.empresa"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
|
} else if (puntoVenta.getTipoPuntoVenta() == null) {
|
|
|
|
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.punto"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
|
|
@ -1235,7 +1243,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.moneda"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
|
/*} else if (puntoVenta.getNodo() == null) {
|
|
|
|
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.nodo"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
|
|
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.nodo"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);*/
|
|
|
|
|
} else if (lsFormaPagoDet.isEmpty()) {
|
|
|
|
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.formaDePago"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
|
|
@ -1309,34 +1317,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
puntoVenta.getAgenciaId().setFecmodif(Calendar.getInstance().getTime());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (txtTitularCpf.getValue().equals("")) {
|
|
|
|
|
puntoVenta.setTitularId(null);
|
|
|
|
|
} else {
|
|
|
|
|
puntoVenta.getTitularId().setActivo(Boolean.TRUE);
|
|
|
|
|
puntoVenta.getTitularId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
|
|
|
puntoVenta.getTitularId().setFecmodif(Calendar.getInstance().getTime());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((txtResponAluguel.getValue().equals("") && (txtResponTel.getValue().equals("")))) {
|
|
|
|
|
puntoVenta.setDiversosId(null);
|
|
|
|
|
} else {
|
|
|
|
|
puntoVenta.getDiversosId().setBilheteInfo(checkBilheteInfo.isChecked());
|
|
|
|
|
puntoVenta.getDiversosId().setInformatizada(checkInformatizada.isChecked());
|
|
|
|
|
puntoVenta.getDiversosId().setVendaInternet(checkVendaInternet.isChecked());
|
|
|
|
|
puntoVenta.getDiversosId().setTeleEntrega(checkTeleEntrega.isChecked());
|
|
|
|
|
puntoVenta.getDiversosId().setDigitacaoSeq(checkDigitacao.isChecked());
|
|
|
|
|
puntoVenta.getDiversosId().setTrabalhaBilhete(checkBilhete.isChecked());
|
|
|
|
|
puntoVenta.getDiversosId().setOfpsPropria(checkOfpsPropria.isChecked());
|
|
|
|
|
puntoVenta.getDiversosId().setOfpsTerceiros(checkOfpsTerceiros.isChecked());
|
|
|
|
|
puntoVenta.getDiversosId().setActivo(Boolean.TRUE);
|
|
|
|
|
puntoVenta.getDiversosId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
|
|
|
puntoVenta.getDiversosId().setFecmodif(Calendar.getInstance().getTime());
|
|
|
|
|
if (cmbPosicao.getSelectedItem() != null) {
|
|
|
|
|
puntoVenta.getDiversosId().setPosicao((String) cmbPosicao.getSelectedItem().getValue());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<PtovtaEmpresa> lsPto = new ArrayList<PtovtaEmpresa>();
|
|
|
|
|
for (PtovtaEmpresa pto : lsPtovtaEmpresa) {
|
|
|
|
|
if (!pto.getActivo()) {
|
|
|
|
@ -1414,6 +1394,32 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void validarDiversos() {
|
|
|
|
|
if ( !txtResponEnergia.getValue().isEmpty()
|
|
|
|
|
|| cmbPosicao.getSelectedItem() != null
|
|
|
|
|
|| checkInformatizada.isChecked()
|
|
|
|
|
|| checkBilheteInfo.isChecked()
|
|
|
|
|
|| checkVendaInternet.isChecked()
|
|
|
|
|
|| checkTeleEntrega.isChecked()
|
|
|
|
|
|| checkDigitacao.isChecked()
|
|
|
|
|
|| checkBilhete.isChecked()
|
|
|
|
|
|| checkOfpsPropria.isChecked()
|
|
|
|
|
|| checkOfpsTerceiros.isChecked()) {
|
|
|
|
|
|
|
|
|
|
txtResponAluguel.setConstraint(new ConstraintNoEmpty());
|
|
|
|
|
txtResponAluguel.getValue();
|
|
|
|
|
txtResponTel.setConstraint(new ConstraintNoEmpty());
|
|
|
|
|
txtResponTel.getValue();
|
|
|
|
|
|
|
|
|
|
puntoVenta.getDiversosId().setActivo(Boolean.TRUE);
|
|
|
|
|
puntoVenta.getDiversosId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
|
|
|
puntoVenta.getDiversosId().setFecmodif(Calendar.getInstance().getTime());
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
puntoVenta.setDiversosId(null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void onClick$btnApagar(Event ev) {
|
|
|
|
|
try {
|
|
|
|
|
int resp = Messagebox.show(
|
|
|
|
@ -1633,14 +1639,13 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
if (!achou) {
|
|
|
|
|
FormaPagoDet fpd = new FormaPagoDet();
|
|
|
|
|
/*
|
|
|
|
|
* Mantis #6874
|
|
|
|
|
* fpd.setCargosextras(new BigDecimal(txtCargosExtras.getValue()));
|
|
|
|
|
* Mantis #6874 fpd.setCargosextras(new BigDecimal(txtCargosExtras.getValue()));
|
|
|
|
|
*/
|
|
|
|
|
fpd.setCargosextras(BigDecimal.ZERO);
|
|
|
|
|
fpd.setFormaPago(formaPago);
|
|
|
|
|
fpd.setPuntoVenta(puntoVenta);
|
|
|
|
|
|
|
|
|
|
if(cmbEmpresaFormaPago.getSelectedItem() != null) {
|
|
|
|
|
if (cmbEmpresaFormaPago.getSelectedItem() != null) {
|
|
|
|
|
fpd.setEmpresa(empresa);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1754,7 +1759,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
ptovtaEmpresa.setEmpresa((Empresa) cmbEmpresaPtoVta.getSelectedItem().getValue());
|
|
|
|
|
|
|
|
|
|
for (PtovtaEmpresa fpd : lsPtovtaEmpresa) {
|
|
|
|
|
if (fpd.getEmpresa().equals(ptovtaEmpresa.getEmpresa())&& fpd.getActivo()) {
|
|
|
|
|
if (fpd.getEmpresa().equals(ptovtaEmpresa.getEmpresa()) && fpd.getActivo()) {
|
|
|
|
|
achou = Boolean.TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1769,7 +1774,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
ptovtaEmpresa.setIndMostrarCaja(checkPtoVtaEmpresaIndMostrarCaja.isChecked());
|
|
|
|
|
ptovtaEmpresa.setNumeroSitef(txtNumeroSitef.getText());
|
|
|
|
|
|
|
|
|
|
if (cmbEmpresasContaBancarias.getSelectedItem() != null){
|
|
|
|
|
if (cmbEmpresasContaBancarias.getSelectedItem() != null) {
|
|
|
|
|
ptovtaEmpresa.setEmpresaContaBancaria((EmpresaContaBancaria) cmbEmpresasContaBancarias.getSelectedItem().getValue());
|
|
|
|
|
}
|
|
|
|
|
lsPtovtaEmpresa.add(ptovtaEmpresa);
|
|
|
|
@ -2532,7 +2537,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
this.txtRazonSocial = txtRazonSocial;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getLogFileSelected() {
|
|
|
|
|
return logFileSelected;
|
|
|
|
|
}
|
|
|
|
@ -2569,7 +2573,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
args.put("ptovtaComissaoList", ptovtaComissaoList);
|
|
|
|
|
|
|
|
|
|
openWindow("/gui/catalogos/editarPuntoVentaComissao.zul",
|
|
|
|
|
Labels.getLabel("editarPuntoVentaComissaoController.window.title", new String[]{ptovtaComissao.getEmpresaId().getNombempresa()}), args, MODAL);
|
|
|
|
|
Labels.getLabel("editarPuntoVentaComissaoController.window.title", new String[] { ptovtaComissao.getEmpresaId().getNombempresa() }), args, MODAL);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2583,11 +2587,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
|
|
|
|
|
if (resp == Messagebox.YES) {
|
|
|
|
|
FechamentoParamptovta fpp = (FechamentoParamptovta) fechamentoParamptovtaList.getSelected();
|
|
|
|
|
if(puntoVenta!= null && puntoVenta.getPuntoventaId()!= null){
|
|
|
|
|
if (puntoVenta != null && puntoVenta.getPuntoventaId() != null) {
|
|
|
|
|
fechamentoParamptovtaService.borrar(fpp);
|
|
|
|
|
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
|
|
|
|
fechamentoParamptovtaList.setData(params);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
fechamentoParamptovtaList.removeItem(fpp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2604,9 +2608,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
(radIntervalofechamentoDiario.isChecked() || radIntervalofechamentoSemanal.isChecked()
|
|
|
|
|
|| radIntervalofechamentoDecendial.isChecked()
|
|
|
|
|
|| radIntervalofechamentoQuinzenal.isChecked()
|
|
|
|
|
|| radIntervalofechamentoMensal.isChecked()
|
|
|
|
|
)
|
|
|
|
|
) {
|
|
|
|
|
|| radIntervalofechamentoMensal.isChecked())) {
|
|
|
|
|
Empresa empresa = (Empresa) cmbEmpresaFechamentoParamptovta.getSelectedItem().getValue();
|
|
|
|
|
|
|
|
|
|
FechamentoParamptovta fechamentoParamptovta = new FechamentoParamptovta();
|
|
|
|
@ -2614,8 +2616,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
fechamentoParamptovta.setPuntoventa(puntoVenta);
|
|
|
|
|
Integer intervalofechamento = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (radIntervalofechamentoSemanal.isChecked()) {
|
|
|
|
|
intervalofechamento = Constantes.INTERVALO_FECHAMENTO_SEMANAL;
|
|
|
|
|
|
|
|
|
@ -2628,13 +2628,13 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
} else if (radIntervalofechamentoMensal.isChecked()) {
|
|
|
|
|
intervalofechamento = Constantes.INTERVALO_FECHAMENTO_MENSAL;
|
|
|
|
|
|
|
|
|
|
}else if (radIntervalofechamentoDiario.isChecked()) {
|
|
|
|
|
} else if (radIntervalofechamentoDiario.isChecked()) {
|
|
|
|
|
intervalofechamento = Constantes.INTERVALO_FECHAMENTO_DIARIO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fechamentoParamptovta.setIntervalofechamento(intervalofechamento);
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(txtDiasemtransito.getValue())) {
|
|
|
|
|
if (StringUtils.isNotBlank(txtDiasemtransito.getValue())) {
|
|
|
|
|
fechamentoParamptovta.setDiasemtransito(Integer.valueOf(txtDiasemtransito.getValue()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2645,11 +2645,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
boolean validado = validaFechamentoParamptovta(fechamentoParamptovta);
|
|
|
|
|
|
|
|
|
|
if (validado) {
|
|
|
|
|
if(puntoVenta!= null && puntoVenta.getPuntoventaId()!=null){
|
|
|
|
|
if (puntoVenta != null && puntoVenta.getPuntoventaId() != null) {
|
|
|
|
|
fechamentoParamptovtaService.suscribir(fechamentoParamptovta);
|
|
|
|
|
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
|
|
|
|
fechamentoParamptovtaList.setData(params);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
fechamentoParamptovtaList.addItemNovo(fechamentoParamptovta);
|
|
|
|
|
}
|
|
|
|
|
resetDadosFechamentoParamptovta();
|
|
|
|
@ -2756,7 +2756,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
this.btnShowLog = btnShowLog;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void compactarArquivo(String arqSaida,String arqEntrada) throws IOException{
|
|
|
|
|
public static void compactarArquivo(String arqSaida, String arqEntrada) throws IOException {
|
|
|
|
|
int cont;
|
|
|
|
|
byte[] dados = new byte[TAMANHO_BUFFER];
|
|
|
|
|
BufferedInputStream origem = null;
|
|
|
|
@ -2772,29 +2772,29 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
origem = new BufferedInputStream(streamDeEntrada, TAMANHO_BUFFER);
|
|
|
|
|
entry = new ZipEntry(file.getName());
|
|
|
|
|
saida.putNextEntry(entry);
|
|
|
|
|
while((cont = origem.read(dados, 0, TAMANHO_BUFFER)) != -1) {
|
|
|
|
|
while ((cont = origem.read(dados, 0, TAMANHO_BUFFER)) != -1) {
|
|
|
|
|
saida.write(dados, 0, cont);
|
|
|
|
|
}
|
|
|
|
|
origem.close();
|
|
|
|
|
saida.close();
|
|
|
|
|
} catch(IOException e) {
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
throw new IOException(e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void excluirArquivosZip(){
|
|
|
|
|
private void excluirArquivosZip() {
|
|
|
|
|
File pasta = new File(System.getProperty("jboss.server.log.dir"));
|
|
|
|
|
File[] arquivos = pasta.listFiles();
|
|
|
|
|
|
|
|
|
|
for(File arquivo : arquivos) {
|
|
|
|
|
if(arquivo.getName().endsWith("zip")) {
|
|
|
|
|
arquivo.delete();
|
|
|
|
|
}
|
|
|
|
|
for (File arquivo : arquivos) {
|
|
|
|
|
if (arquivo.getName().endsWith("zip")) {
|
|
|
|
|
arquivo.delete();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void onClick$ckValidarTempoParaImpressao(Event event) {
|
|
|
|
|
if(ckValidarTempoParaImpressao.isChecked()) {
|
|
|
|
|
if (ckValidarTempoParaImpressao.isChecked()) {
|
|
|
|
|
txtTempoParaImpressao.setDisabled(Boolean.FALSE);
|
|
|
|
|
txtTempoParaImpressao.setValue(null);
|
|
|
|
|
} else {
|
|
|
|
@ -2846,4 +2846,5 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|
|
|
|
public void setCkValidarTempoParaImpressao(Checkbox ckValidarTempoParaImpressao) {
|
|
|
|
|
this.ckValidarTempoParaImpressao = ckValidarTempoParaImpressao;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|