Totvs - WS Fornecedor / WS Cliente / WS Pedido Compra (fixes bug #6127)
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@42651 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
0ced0a9bb3
commit
fcb053e48d
|
@ -165,7 +165,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
private UsuarioService usuarioService;
|
||||
@Autowired
|
||||
private FechamentoParamptovtaService fechamentoParamptovtaService;
|
||||
|
||||
|
||||
private PuntoVenta puntoVenta;
|
||||
private Textbox txtCP;
|
||||
private MyListbox puntoVentaList;
|
||||
|
@ -182,7 +182,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
private MyListbox ptovtaComissaoList;
|
||||
private MyListbox ptovtaCatIndList;
|
||||
private MyListbox fechamentoParamptovtaList;
|
||||
|
||||
|
||||
private List<Categoria> lsCategoriaBloquear;
|
||||
|
||||
private List<Empresa> lsEmpresasBloquear;
|
||||
|
@ -211,12 +211,12 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
private Radio radIndvendsegopcionalNo;
|
||||
private Radio radIndestansegopcionalSi;
|
||||
private Radio radIndestansegopcionalNo;
|
||||
|
||||
|
||||
private Radio radIntervalofechamentoSemanal;
|
||||
private Radio radIntervalofechamentoDecendial;
|
||||
private Radio radIntervalofechamentoQuinzenal;
|
||||
private Radio radIntervalofechamentoMensal;
|
||||
|
||||
|
||||
private Button btnAdicionarEmpresaComissao;
|
||||
private MyComboboxPuntoVenta cmbPuntoVentaPadre;
|
||||
private Combobox cmbFormaPago;
|
||||
|
@ -292,12 +292,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
private Checkbox checkOfpsTerceiros;
|
||||
private Checkbox checkStock;
|
||||
private Checkbox checkPermisoTasaEmbarque;
|
||||
|
||||
private Checkbox ckIsento;
|
||||
private MyTextbox txtNumIEPuntoVenta;
|
||||
|
||||
public static final int INTERVALO_FECHAMENTO_SEMANAL = 7;
|
||||
public static final int INTERVALO_FECHAMENTO_DECENDIAL = 10;
|
||||
public static final int INTERVALO_FECHAMENTO_QUINZENAL = 15;
|
||||
public static final int INTERVALO_FECHAMENTO_MENSAL = 30;
|
||||
|
||||
|
||||
public Button getBtnApagar() {
|
||||
return btnApagar;
|
||||
}
|
||||
|
@ -398,7 +400,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
if (puntoVenta.getRazonSocial() != null) {
|
||||
txtRazonSocial.setValue(puntoVenta.getRazonSocial());
|
||||
}
|
||||
|
||||
|
||||
fechamentoParamptovtaList.setItemRenderer(new FechamentoParamptovtaListItemRenderer());
|
||||
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
||||
fechamentoParamptovtaList.setData(params);
|
||||
|
@ -598,7 +600,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
cmbParada.setText(puntoVenta.getParada().getDescparada());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("Punto de Venta: " + e);
|
||||
Messagebox.show(
|
||||
|
@ -701,7 +703,19 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
public void onSelect$cmbBanco() {
|
||||
InstiFinanceira banco = (InstiFinanceira) cmbBanco.getSelectedItem().getValue();
|
||||
txtNomeBanco.setValue(banco.getNome());
|
||||
}
|
||||
|
||||
public void onClick$ckIsento(Event ev) {
|
||||
if (ckIsento.isChecked()) {
|
||||
puntoVenta.setNumIEPuntoVenta("ISENTO");
|
||||
txtNumIEPuntoVenta.setValue("ISENTO");
|
||||
txtNumIEPuntoVenta.setDisabled(true);
|
||||
|
||||
} else {
|
||||
puntoVenta.setNumIEPuntoVenta("");
|
||||
txtNumIEPuntoVenta.setValue("");
|
||||
txtNumIEPuntoVenta.setDisabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void onChange$cmbCiudad(Event ev) {
|
||||
|
@ -1118,14 +1132,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
closeWindow();
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (IntegracionException ex) {
|
||||
log.error("editarPuntoVentaController: ", ex);
|
||||
Messagebox.show(
|
||||
ex.getMessage(),
|
||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||
Messagebox.OK, Messagebox.ERROR);
|
||||
|
||||
|
||||
} catch (Exception ex) {
|
||||
log.error("editarPuntoVentaController: ", ex);
|
||||
Messagebox.show(
|
||||
|
@ -2254,7 +2268,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
Labels.getLabel("ededitarPuntoVentaComissaoController.window.title"), args, MODAL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void onClick$btnApagarFechamentoParamptovta(Event ev) {
|
||||
try {
|
||||
if (fechamentoParamptovtaList.getSelected() != null) {
|
||||
|
@ -2267,7 +2281,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
|
||||
FechamentoParamptovta fpp = (FechamentoParamptovta) fechamentoParamptovtaList.getSelected();
|
||||
fechamentoParamptovtaService.borrar(fpp);
|
||||
|
||||
|
||||
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
||||
fechamentoParamptovtaList.setData(params);
|
||||
}
|
||||
|
@ -2276,96 +2290,97 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
log.error(ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnAdicionarFechamentoParamptovta(Event ev) {
|
||||
if (cmbEmpresaFechamentoParamptovta.getSelectedItem() != null &&
|
||||
(StringUtils.isNotEmpty(txtIntervalofechamento.getValue()) ||
|
||||
(radIntervalofechamentoSemanal.isChecked()
|
||||
|| radIntervalofechamentoDecendial.isChecked()
|
||||
|| radIntervalofechamentoQuinzenal.isChecked()
|
||||
|| radIntervalofechamentoMensal.isChecked()
|
||||
)
|
||||
) ) {
|
||||
if (cmbEmpresaFechamentoParamptovta.getSelectedItem() != null &&
|
||||
(StringUtils.isNotEmpty(txtIntervalofechamento.getValue()) ||
|
||||
(radIntervalofechamentoSemanal.isChecked()
|
||||
|| radIntervalofechamentoDecendial.isChecked()
|
||||
|| radIntervalofechamentoQuinzenal.isChecked()
|
||||
|| radIntervalofechamentoMensal.isChecked()
|
||||
)
|
||||
)) {
|
||||
Empresa empresa = (Empresa) cmbEmpresaFechamentoParamptovta.getSelectedItem().getValue();
|
||||
|
||||
FechamentoParamptovta fechamentoParamptovta = new FechamentoParamptovta();
|
||||
fechamentoParamptovta.setEmpresa(empresa);
|
||||
fechamentoParamptovta.setPuntoventa(puntoVenta);
|
||||
Integer intervalofechamento = 0;
|
||||
|
||||
if(radIntervalofechamentoSemanal.isChecked()){
|
||||
|
||||
if (radIntervalofechamentoSemanal.isChecked()) {
|
||||
intervalofechamento = INTERVALO_FECHAMENTO_SEMANAL;
|
||||
|
||||
} else if(radIntervalofechamentoDecendial.isChecked()){
|
||||
|
||||
} else if (radIntervalofechamentoDecendial.isChecked()) {
|
||||
intervalofechamento = INTERVALO_FECHAMENTO_DECENDIAL;
|
||||
|
||||
} else if(radIntervalofechamentoQuinzenal.isChecked()){
|
||||
|
||||
} else if (radIntervalofechamentoQuinzenal.isChecked()) {
|
||||
intervalofechamento = INTERVALO_FECHAMENTO_QUINZENAL;
|
||||
|
||||
} else if(radIntervalofechamentoMensal.isChecked()){
|
||||
|
||||
} else if (radIntervalofechamentoMensal.isChecked()) {
|
||||
intervalofechamento = INTERVALO_FECHAMENTO_MENSAL;
|
||||
|
||||
}else{
|
||||
|
||||
} else {
|
||||
intervalofechamento = Integer.valueOf(txtIntervalofechamento.getValue());
|
||||
}
|
||||
|
||||
|
||||
fechamentoParamptovta.setIntervalofechamento(intervalofechamento);
|
||||
|
||||
|
||||
fechamentoParamptovta.setActivo(true);
|
||||
fechamentoParamptovta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
fechamentoParamptovta.setFecmodif(new Date());
|
||||
|
||||
|
||||
boolean validado = validaFechamentoParamptovta(fechamentoParamptovta);
|
||||
|
||||
if(validado){
|
||||
|
||||
if (validado) {
|
||||
fechamentoParamptovtaService.suscribir(fechamentoParamptovta);
|
||||
|
||||
|
||||
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
||||
fechamentoParamptovtaList.setData(params);
|
||||
|
||||
|
||||
resetDadosFechamentoParamptovta();
|
||||
} else{
|
||||
|
||||
} else {
|
||||
|
||||
try {
|
||||
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarPuntoVentaController.MSG.fechamentoParamptovtaInvalidado"),
|
||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||
Messagebox.OK, Messagebox.ERROR);
|
||||
|
||||
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarPuntoVentaController.MSG.fechamentoParamptovtaInvalidado"),
|
||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||
Messagebox.OK, Messagebox.ERROR);
|
||||
|
||||
} catch (Exception ex) {
|
||||
log.error(ex.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void resetDadosFechamentoParamptovta(){
|
||||
|
||||
|
||||
private void resetDadosFechamentoParamptovta() {
|
||||
|
||||
cmbEmpresaFechamentoParamptovta.setSelectedItem(null);
|
||||
|
||||
|
||||
radIntervalofechamentoSemanal.setChecked(false);
|
||||
radIntervalofechamentoDecendial.setChecked(false);
|
||||
radIntervalofechamentoQuinzenal.setChecked(false);
|
||||
radIntervalofechamentoMensal.setChecked(false);
|
||||
txtIntervalofechamento.setValue(null);
|
||||
}
|
||||
|
||||
private boolean validaFechamentoParamptovta(FechamentoParamptovta fechamentoParamptovta){
|
||||
|
||||
private boolean validaFechamentoParamptovta(FechamentoParamptovta fechamentoParamptovta) {
|
||||
boolean validado = true;
|
||||
|
||||
|
||||
Object[] params = fechamentoParamptovtaList.getData();
|
||||
|
||||
for(Object objectData : params){
|
||||
|
||||
FechamentoParamptovta param = (FechamentoParamptovta) objectData;
|
||||
if(fechamentoParamptovta.getEmpresa().getEmpresaId() == param.getEmpresa().getEmpresaId()){
|
||||
|
||||
for (Object objectData : params) {
|
||||
|
||||
FechamentoParamptovta param = (FechamentoParamptovta) objectData;
|
||||
if (fechamentoParamptovta.getEmpresa().getEmpresaId() == param.getEmpresa().getEmpresaId()) {
|
||||
validado = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return validado;
|
||||
}
|
||||
|
||||
|
||||
public Textbox getTxtIntervalofechamento() {
|
||||
return txtIntervalofechamento;
|
||||
}
|
||||
|
@ -2382,5 +2397,4 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
this.cmbEmpresaFechamentoParamptovta = cmbEmpresaFechamentoParamptovta;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -60,11 +60,12 @@
|
|||
label="${c:l('editarPuntoVentaController.tab.label.localidades')}" />
|
||||
<tab
|
||||
label="${c:l('editarPuntoVentaController.tab.label.seguro')}" />
|
||||
<tab visible="@{winEditarPuntoVenta$composer.validaFuncionTipoBoletoBloqueado}"
|
||||
<tab
|
||||
visible="@{winEditarPuntoVenta$composer.validaFuncionTipoBoletoBloqueado}"
|
||||
label="${c:l('editarPuntoVentaController.tab.label.tipoPassageiroBloqueio')}" />
|
||||
<tab
|
||||
label="${c:l('editarPuntoVentaController.tab.label.fechamentocntcorrente')}" />
|
||||
|
||||
|
||||
</tabs>
|
||||
|
||||
<tabpanels>
|
||||
|
@ -275,19 +276,24 @@
|
|||
</row>
|
||||
<row>
|
||||
<!-- Inscrição Estadual -->
|
||||
<label
|
||||
value="${c:l('editarPuntoVentaController.lbIE.value')}" />
|
||||
<textbox width="70%"
|
||||
maxlength="20"
|
||||
value="@{winEditarPuntoVenta$composer.puntoVenta.numIEPuntoVenta}"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
<label value="${c:l('editarPuntoVentaController.lbIE.value')}" />
|
||||
<hbox>
|
||||
|
||||
<textbox id="txtNumIEPuntoVenta" width="100%" maxlength="20"
|
||||
value="@{winEditarPuntoVenta$composer.puntoVenta.numIEPuntoVenta}"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
|
||||
<checkbox id="ckIsento"
|
||||
checked="@{winEditarPuntoVenta$composer.puntoVenta.incProgConcessaoCredito}" />
|
||||
<label value="ISENTO" />
|
||||
</hbox>
|
||||
</row>
|
||||
<row>
|
||||
<!-- Inscrição Programa concessão de Crédito -->
|
||||
<label
|
||||
value="${c:l('editarPuntoVentaController.lbProgConcessao.value')}" />
|
||||
<checkbox
|
||||
checked="@{winEditarPuntoVenta$composer.puntoVenta.incProgConcessaoCredito}"/>
|
||||
<checkbox
|
||||
checked="@{winEditarPuntoVenta$composer.puntoVenta.incProgConcessaoCredito}" />
|
||||
</row>
|
||||
<row>
|
||||
<!-- Comentarios -->
|
||||
|
@ -1179,7 +1185,7 @@
|
|||
</tabpanel>
|
||||
|
||||
<!-- TIPO BOLETO BLOQUEADO -->
|
||||
|
||||
|
||||
<tabpanel height="400px">
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
|
@ -1219,66 +1225,78 @@
|
|||
</listbox>
|
||||
</tabpanel>
|
||||
|
||||
<tabpanel>
|
||||
<tabpanel>
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="30%" />
|
||||
<column width="70%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="${c:l('editarPuntoVentaController.lbEmpresa.value')}" />
|
||||
<combobox id="cmbEmpresaFechamentoParamptovta"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded"
|
||||
buttonVisible="true"
|
||||
model="@{winEditarPuntoVenta$composer.lsEmpresas}"
|
||||
constraint="no empty" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarPuntoVentaController.intervalofechamento.label')}" />
|
||||
<radiogroup Id="radIntervalofechamento">
|
||||
<radio id="radIntervalofechamentoSemanal"
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarPuntoVentaController.lbEmpresa.value')}" />
|
||||
<combobox
|
||||
id="cmbEmpresaFechamentoParamptovta"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded" buttonVisible="true"
|
||||
model="@{winEditarPuntoVenta$composer.lsEmpresas}"
|
||||
constraint="no empty" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarPuntoVentaController.intervalofechamento.label')}" />
|
||||
<radiogroup
|
||||
Id="radIntervalofechamento">
|
||||
<radio
|
||||
id="radIntervalofechamentoSemanal"
|
||||
label="${c:l('editarPuntoVentaController.radIntervalofechamentoSemanal.value')}" />
|
||||
<radio id="radIntervalofechamentoDecendial"
|
||||
<radio
|
||||
id="radIntervalofechamentoDecendial"
|
||||
label="${c:l('editarPuntoVentaController.radIntervalofechamentoDecendial.value')}" />
|
||||
<radio id="radIntervalofechamentoQuinzenal"
|
||||
<radio
|
||||
id="radIntervalofechamentoQuinzenal"
|
||||
label="${c:l('editarPuntoVentaController.radIntervalofechamentoQuinzenal.value')}" />
|
||||
<radio id="radIntervalofechamentoMensal"
|
||||
<radio
|
||||
id="radIntervalofechamentoMensal"
|
||||
label="${c:l('editarPuntoVentaController.radIntervalofechamentoMensal.value')}" />
|
||||
</radiogroup>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarPuntoVentaController.intervalofechamento.label')}" />
|
||||
<textbox id="txtIntervalofechamento"
|
||||
width="50px"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<toolbar>
|
||||
<button id="btnApagarFechamentoParamptovta"
|
||||
height="20" image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarEmpresaController.btnApagar.tooltiptext')}" />
|
||||
<button id="btnAdicionarFechamentoParamptovta"
|
||||
height="20" image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('busquedaEmpresaController.btnNovo.tooltiptext')}" />
|
||||
|
||||
</toolbar>
|
||||
|
||||
<listbox id="fechamentoParamptovtaList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarPuntoVentaController.intervalofechamento.label')}" />
|
||||
<textbox id="txtIntervalofechamento"
|
||||
width="50px"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<toolbar>
|
||||
<button id="btnApagarFechamentoParamptovta"
|
||||
height="20" image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarEmpresaController.btnApagar.tooltiptext')}" />
|
||||
<button id="btnAdicionarFechamentoParamptovta"
|
||||
height="20" image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('busquedaEmpresaController.btnNovo.tooltiptext')}" />
|
||||
|
||||
</toolbar>
|
||||
|
||||
<listbox id="fechamentoParamptovtaList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="false">
|
||||
|
||||
<listhead sizable="true">
|
||||
<listheader image="/gui/img/create_doc.gif" align="right"
|
||||
label="${c:l('editarPuntoVentaController.lbEmpresa.value')}" sort="auto(empresa)"/>
|
||||
|
||||
<listheader image="/gui/img/create_doc.gif" align="right"
|
||||
label="${c:l('editarPuntoVentaController.intervalofechamento.label')}" sort="auto(intervalofechamento)"/>
|
||||
|
||||
</listhead>
|
||||
</listbox>
|
||||
|
||||
<listhead sizable="true">
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
align="right"
|
||||
label="${c:l('editarPuntoVentaController.lbEmpresa.value')}"
|
||||
sort="auto(empresa)" />
|
||||
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
align="right"
|
||||
label="${c:l('editarPuntoVentaController.intervalofechamento.label')}"
|
||||
sort="auto(intervalofechamento)" />
|
||||
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
|
||||
</tabpanels>
|
||||
|
|
Loading…
Reference in New Issue