fixes bug#0011602

dev: lucas
qua: renato

Para que o Arquivo Layout Internacional apareça é necessário ativar a propriedade permiteLayoutInternacional=1.

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@84229 d1611594-4594-4d17-8e1d-87c2c4800839
master
emerson 2018-08-14 18:21:52 +00:00
parent 8002dd7c9f
commit 32f4864586
5 changed files with 56 additions and 86 deletions

View File

@ -116,9 +116,9 @@ public class EditarEstacionController extends MyGenericForwardComposer {
private Label lblLibercard;
private Checkbox chkUtilizaCartaoLibercard;
private Checkbox chkStockCentral;
private Label lblTipoArquivoLayoutInternacional;
private Checkbox chkTipoArquivoLayoutInternacional;
private Listheader colunmTipoArquivoLayout;
private Label lblNomeArquivoLayoutInternacional;
private Textbox txtNomeArquivoLayoutInternacional;
private Listheader colunmNomeArquivoLayoutIternacional;
public Estacion getEstacion() {
return estacion;
@ -215,7 +215,7 @@ public class EditarEstacionController extends MyGenericForwardComposer {
ApplicationProperties instance = ApplicationProperties.getInstance();
validaHabilitacaoCamposRioCard(instance)
.validaHabilitacaoCamposCartaoLiberCard(instance)
.validaHabilitacaoTipoArquivoInternacional(instance);
.validaHabilitacaoLayoutInternacional(instance);
}
private EditarEstacionController validaHabilitacaoCamposRioCard(ApplicationProperties instance) {
@ -233,11 +233,11 @@ public class EditarEstacionController extends MyGenericForwardComposer {
return this;
}
private void validaHabilitacaoTipoArquivoInternacional(ApplicationProperties instance) {
if (instance.isPermiteVariasImpressorasMesmaEmpresa()) {
lblTipoArquivoLayoutInternacional.setVisible(true);
chkTipoArquivoLayoutInternacional.setVisible(true);
colunmTipoArquivoLayout.setVisible(true);
private void validaHabilitacaoLayoutInternacional(ApplicationProperties instance) {
if (instance.isPermiteLayoutInternacional()) {
lblNomeArquivoLayoutInternacional.setVisible(true);
txtNomeArquivoLayoutInternacional.setVisible(true);
colunmNomeArquivoLayoutIternacional.setVisible(true);
}
}
@ -541,19 +541,17 @@ public class EditarEstacionController extends MyGenericForwardComposer {
}
String nomeArquivoLayout = txtNomeArquivoLayout.getValue();
EstacionImpresora estacionImpresora = new EstacionImpresora();
estacionImpresora.setEmpresa(empresa);
estacionImpresora.setEstacion(estacion);
estacionImpresora.setNombImpresora(nomeImpresora);
estacionImpresora.setNombArchivoLayout(nomeArquivoLayout);
estacionImpresora.setNombArchivoLayout(txtNomeArquivoLayout.getValue());
estacionImpresora.setActivo(Boolean.TRUE);
estacionImpresora.setFecmodif(Calendar.getInstance().getTime());
estacionImpresora.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
estacionImpresora.setTipoImpressora(getTipoImpressora());
estacionImpresora.setEstacionCentral(estacionCentral);
estacionImpresora.setIndArchivolayoutInternacional(chkTipoArquivoLayoutInternacional.isChecked());
estacionImpresora.setNombArchivoLayoutIternacional(txtNomeArquivoLayoutInternacional.getValue());
estacionImpresoraList.addItemNovo(estacionImpresora);
@ -636,41 +634,30 @@ public class EditarEstacionController extends MyGenericForwardComposer {
cmbEstacion.setModel(dictModelVacio);
if (valor.equals(BEMATECH_FISCAL) || valor.equals(BEMATECH_FISCAL_BLINDADA)) {
txtNomImpressora.setText("BEMATECHFISCAL");
txtNomeArquivoLayout.setText("");
txtNomImpressora.setDisabled(Boolean.TRUE);
txtNomeArquivoLayout.setDisabled(Boolean.TRUE);
} else if (valor.equals(DARUMA_FISCAL)|| valor.equals(DARUMA_FISCAL_BLINDADA)){
txtNomImpressora.setText(DARUMA_FISCAL);
txtNomeArquivoLayout.setText("");
txtNomImpressora.setDisabled(Boolean.TRUE);
txtNomeArquivoLayout.setDisabled(Boolean.TRUE);
} else if (valor.equals(CENTRAL_EMISSAO)){
txtNomImpressora.setText(CENTRAL_EMISSAO);
txtNomeArquivoLayout.setText("");
txtNomImpressora.setDisabled(Boolean.TRUE);
txtNomeArquivoLayout.setDisabled(Boolean.TRUE);
}else if (valor.equals(MATRICIAL)) {
txtNomImpressora.setText("");
txtNomeArquivoLayout.setText("");
txtNomImpressora.setDisabled(Boolean.FALSE);
txtNomeArquivoLayout.setDisabled(Boolean.FALSE);
}else if (valor.equals(STOCK_CENTRAL)) {
configurarTextBox(txtNomImpressora, Boolean.TRUE, "BEMATECHFISCAL");
configurarTextBoxComValorLimpo(txtNomeArquivoLayout, Boolean.TRUE);
configurarTextBoxComValorLimpo(txtNomeArquivoLayoutInternacional, Boolean.TRUE);
} else if (valor.equals(DARUMA_FISCAL)|| valor.equals(DARUMA_FISCAL_BLINDADA)) {
configurarTextBox(txtNomImpressora, Boolean.TRUE, DARUMA_FISCAL);
configurarTextBoxComValorLimpo(txtNomeArquivoLayout, Boolean.TRUE);
configurarTextBoxComValorLimpo(txtNomeArquivoLayoutInternacional, Boolean.TRUE);
} else if (valor.equals(CENTRAL_EMISSAO)) {
configurarTextBox(txtNomImpressora, Boolean.TRUE, CENTRAL_EMISSAO);
configurarTextBoxComValorLimpo(txtNomeArquivoLayout, Boolean.TRUE);
configurarTextBoxComValorLimpo(txtNomeArquivoLayoutInternacional, Boolean.TRUE);
} else if (valor.equals(MATRICIAL)) {
configurarTextBoxComValorLimpo(txtNomImpressora, Boolean.FALSE);
configurarTextBoxComValorLimpo(txtNomeArquivoLayout, Boolean.FALSE);
configurarTextBoxComValorLimpo(txtNomeArquivoLayoutInternacional, Boolean.FALSE);
} else if (valor.equals(STOCK_CENTRAL)) {
if(estacion == null || estacion.getPuntoVenta() == null){
Clients.alert(Labels.getLabel("editarEstacionController.MSG.sinPuntoVenta"),
Labels.getLabel("editarEstacionController.window.title"), org.zkoss.zul.Messagebox.INFORMATION);
cmbTipoImpressora.setSelectedItem(null);
return;
}
txtNomImpressora.setText("");
txtNomeArquivoLayout.setText("");
txtNomImpressora.setDisabled(Boolean.FALSE);
// boolean indStockCentral = chkStockCentral.isChecked();
// if(indStockCentral){
txtNomeArquivoLayout.setDisabled(Boolean.FALSE);
// }else{
// txtNomeArquivoLayout.setDisabled(Boolean.TRUE);
// }
configurarTextBoxComValorLimpo(txtNomImpressora, Boolean.FALSE);
configurarTextBoxComValorLimpo(txtNomeArquivoLayout, Boolean.FALSE);
cmbEstacion.setSelectedItem(null);
List<Estacion> lsEstacion = estacionService.buscarEstacionesStockCentral(estacion.getPuntoVenta());
BindingListModel dictModel = new BindingListModelList(lsEstacion, false);
@ -678,6 +665,20 @@ public class EditarEstacionController extends MyGenericForwardComposer {
}
}
private void configurarTextBox(Textbox textBox, Boolean desabilitado, String valor) {
configurarTextBoxComValorLimpo(textBox, desabilitado);
textBox.setText(valor);
}
private void configurarTextBoxComValorLimpo(Textbox textBox, Boolean desabilitado) {
limparTextBox(textBox);
textBox.setDisabled(desabilitado);
}
private void limparTextBox(Textbox txtBox) {
txtBox.setText("");
}
public void onChange$cmbEstacion(Event ev) {
Comboitem item = (Comboitem) cmbEstacion.getSelectedItem();

View File

@ -1,23 +1,14 @@
package com.rjconsultores.ventaboletos.web.utilerias.render;
import org.zkoss.util.resource.Labels;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.EstacionImpresora;
import com.rjconsultores.ventaboletos.enums.TipoImpressora;
public class RenderEstacionImpresora implements ListitemRenderer {
private static final String MATRICIAL = Labels.getLabel("editarEstacionController.tipoImpressora.matricial");
private static final String BEMATECH_FISCAL = Labels.getLabel("editarEstacionController.tipoImpressora.bematechFiscal");
private static final String BEMATECH_FISCAL_BLINDADA = Labels.getLabel("editarEstacionController.tipoImpressora.bematechFiscalBlindada");
private static final String DARUMA_FISCAL = Labels.getLabel("editarEstacionController.tipoImpressora.darumaFiscal");
private static final String DARUMA_FISCAL_BLINDADA = Labels.getLabel("editarEstacionController.tipoImpressora.darumaFiscalBlindada");
private static final String CENTRAL_EMISSAO = Labels.getLabel("editarEstacionController.tipoImpressora.centralEmissao");
private static final String STOCK_CENTRAL = Labels.getLabel("editarEstacionController.tipoImpressora.stockCentral");
private static final String BPE = Labels.getLabel("editarEstacionController.tipoImpressora.bpe");
public void render(Listitem lstm, Object o) throws Exception {
EstacionImpresora estacionImpresora = (EstacionImpresora) o;
@ -25,12 +16,11 @@ public class RenderEstacionImpresora implements ListitemRenderer {
return;
}
Listcell lc = new Listcell();
lc = new Listcell(estacionImpresora.getEmpresa().getNombempresa());
Listcell lc = new Listcell(estacionImpresora.getEmpresa().getNombempresa());
lc.setParent(lstm);
lc = new Listcell(estacionImpresora.getTipoImpressora() == null ? "" : getTipoImpressora(estacionImpresora));
TipoImpressora tipo = TipoImpressora.getTipoImpressora(estacionImpresora.getTipoImpressora());
lc = new Listcell(tipo == null ? "" : tipo.getNome());
lc.setParent(lstm);
lc = new Listcell(estacionImpresora.getNombImpresora());
@ -39,31 +29,10 @@ public class RenderEstacionImpresora implements ListitemRenderer {
lc = new Listcell(estacionImpresora.getNombArchivoLayout());
lc.setParent(lstm);
lc = new Listcell(estacionImpresora.getIndArchivolayoutInternacional() ? "Sim" : "Não");
lc = new Listcell(estacionImpresora.getNombArchivoLayoutIternacional());
lc.setParent(lstm);
lstm.setAttribute("data", estacionImpresora);
}
private String getTipoImpressora(EstacionImpresora estacionImpresora) {
if (estacionImpresora.getTipoImpressora() == 0) {
return MATRICIAL;
} else if (estacionImpresora.getTipoImpressora() == 1) {
return BEMATECH_FISCAL;
} else if (estacionImpresora.getTipoImpressora() == 2) {
return BEMATECH_FISCAL_BLINDADA;
} else if (estacionImpresora.getTipoImpressora() == 4) {
return DARUMA_FISCAL;
} else if (estacionImpresora.getTipoImpressora() == 5) {
return DARUMA_FISCAL_BLINDADA;
} else if (estacionImpresora.getTipoImpressora() == 3) {
return CENTRAL_EMISSAO;
} else if (estacionImpresora.getTipoImpressora() == 6) {
return STOCK_CENTRAL;
} else if (estacionImpresora.getTipoImpressora() == 7) {
return BPE;
}
return MATRICIAL;
}
}

View File

@ -4115,7 +4115,7 @@ busquedaEstacionController.nomeArquivoLayout.label = Archivo Layout
busquedaEstacionController.lhUtilizaCartaoLibercard.label = Utiliza tarjeta Libercard
busquedaEstacionController.lhStockCentral.label = Stock Central
msg.constraint.cajaObligatorio = Caja obligatoria
busquedaEstacionController.lhTipoArquivoLayoutInternacional.label = Archivo Layout Internacional
busquedaEstacionController.nomeArquivoLayoutInternacional.label = Archivo Layout Internacional
# Editar Estacion
editarEstacionController.window.title = Estación

View File

@ -4323,7 +4323,7 @@ busquedaEstacionController.nomeImpressoraBPe.label = Impressora BPe
busquedaEstacionController.nomeImpressoraSeguro.label = Impressora Seguro
busquedaEstacionController.nomeArquivoLayout.label = Arquivo Layout
msg.constraint.cajaObligatorio = Caixa obligatória
busquedaEstacionController.lhTipoArquivoLayoutInternacional.label = Arquivo Layout Internacional
busquedaEstacionController.nomeArquivoLayoutInternacional.label = Arquivo Layout Internacional
# Editar Estacion
editarEstacionController.window.title = Estação

View File

@ -331,11 +331,11 @@
</row>
<row>
<label
id="lblTipoArquivoLayoutInternacional"
id="lblNomeArquivoLayoutInternacional"
visible="false"
value="${c:l('busquedaEstacionController.lhTipoArquivoLayoutInternacional.label')}" />
<checkbox id="chkTipoArquivoLayoutInternacional"
visible="false"/>
value="${c:l('busquedaEstacionController.nomeArquivoLayoutInternacional.label')}" />
<textbox id="txtNomeArquivoLayoutInternacional"
width="90%" maxlength="20" visible="false"/>
</row>
</rows>
</grid>
@ -362,8 +362,8 @@
label="${c:l('busquedaEstacionController.nomeImpressora.label')}" />
<listheader image="/gui/img/create_doc.gif"
label="${c:l('busquedaEstacionController.nomeArquivoLayout.label')}" />
<listheader id="colunmTipoArquivoLayout" image="/gui/img/create_doc.gif" visible="false"
label="${c:l('busquedaEstacionController.lhTipoArquivoLayoutInternacional.label')}" />
<listheader id="colunmNomeArquivoLayoutIternacional" image="/gui/img/create_doc.gif" visible="false"
label="${c:l('busquedaEstacionController.nomeArquivoLayoutInternacional.label')}" />
</listhead>
</listbox>
</tabpanel>