fixed bug #8662 - Alteração em código para permitir a restrição do tipo de OCD por ponto de venda.
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@66280 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
6176ea0e4d
commit
74c6239094
|
@ -1,5 +1,6 @@
|
||||||
package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
|
package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -22,12 +23,17 @@ import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.OCDParam;
|
import com.rjconsultores.ventaboletos.entidad.OCDParam;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.OCDPtoVtaParam;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
||||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||||
import com.rjconsultores.ventaboletos.service.OCDParamService;
|
import com.rjconsultores.ventaboletos.service.OCDParamService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.OCDPtoVtaParamService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
|
||||||
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.render.RenderOCDPtoVtaParam;
|
||||||
|
|
||||||
@Controller("editarOCDParamController")
|
@Controller("editarOCDParamController")
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
|
@ -37,6 +43,9 @@ public class EditarOCDParamController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OCDParamService ocdParamService;
|
private OCDParamService ocdParamService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OCDPtoVtaParamService ocdPtoVtaParamService ;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmpresaService empresaService;
|
private EmpresaService empresaService;
|
||||||
|
@ -47,15 +56,20 @@ public class EditarOCDParamController extends MyGenericForwardComposer {
|
||||||
private OCDParam ocdParamCorrente;
|
private OCDParam ocdParamCorrente;
|
||||||
|
|
||||||
private MyListbox ocdParamList;
|
private MyListbox ocdParamList;
|
||||||
|
private MyComboboxPuntoVenta cmbPuntoVenta;
|
||||||
|
|
||||||
private Combobox cmbEmpresa;
|
private Combobox cmbEmpresa;
|
||||||
private List<Empresa> lsEmpresas;
|
private List<Empresa> lsEmpresas;
|
||||||
|
private List<PuntoVenta> lsPuntoVenta;
|
||||||
|
|
||||||
private Textbox txtDiasPagar;
|
private Textbox txtDiasPagar;
|
||||||
private Textbox txtPenalizacion;
|
private Textbox txtPenalizacion;
|
||||||
private Textbox txtTiempoLimitePenalizacion;
|
private Textbox txtTiempoLimitePenalizacion;
|
||||||
|
|
||||||
private Button btnApagar;
|
private Button btnApagar;
|
||||||
|
private Button btnApagarPtoVtaOCDParam;
|
||||||
|
private Button btnAdicionarPtoVtaOCDParam;
|
||||||
|
private MyListbox ptoVtaOCDParamList;
|
||||||
private Checkbox chkOCDDefault;
|
private Checkbox chkOCDDefault;
|
||||||
private Checkbox chkOCDTroca;
|
private Checkbox chkOCDTroca;
|
||||||
private Checkbox chkOCDTransferencia;
|
private Checkbox chkOCDTransferencia;
|
||||||
|
@ -107,9 +121,14 @@ public class EditarOCDParamController extends MyGenericForwardComposer {
|
||||||
chkIndtotalbilhete.setChecked(ocdParamCorrente.getIndtotalbilhete() == null ? false : ocdParamCorrente.getIndtotalbilhete());
|
chkIndtotalbilhete.setChecked(ocdParamCorrente.getIndtotalbilhete() == null ? false : ocdParamCorrente.getIndtotalbilhete());
|
||||||
txtPenalizacion.setDisabled(!ocdParamCorrente.getIndPenalizacionOCD());
|
txtPenalizacion.setDisabled(!ocdParamCorrente.getIndPenalizacionOCD());
|
||||||
txtTiempoLimitePenalizacion.setDisabled(!ocdParamCorrente.getIndPenalizacionOCD());
|
txtTiempoLimitePenalizacion.setDisabled(!ocdParamCorrente.getIndPenalizacionOCD());
|
||||||
|
ptoVtaOCDParamList.setItemRenderer(new RenderOCDPtoVtaParam());
|
||||||
initRadios(ocdParamCorrente.getIndPenalizacionOCD());
|
initRadios(ocdParamCorrente.getIndPenalizacionOCD());
|
||||||
if (ocdParamCorrente.getOcdparamId() == null)
|
if (ocdParamCorrente.getOcdparamId() == null){
|
||||||
btnApagar.setVisible(Boolean.FALSE);
|
btnApagar.setVisible(Boolean.FALSE);
|
||||||
|
ocdParamCorrente.setListOCDPtoVtaParam(new ArrayList<OCDPtoVtaParam>());
|
||||||
|
}else{
|
||||||
|
ptoVtaOCDParamList.setData(ocdParamCorrente.getListOCDPtoVtaParam());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initRadios(Boolean indPenalizacionOCD) {
|
private void initRadios(Boolean indPenalizacionOCD) {
|
||||||
|
@ -209,6 +228,46 @@ public class EditarOCDParamController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onClick$btnAdicionarPtoVtaOCDParam(Event ev) {
|
||||||
|
|
||||||
|
if (cmbPuntoVenta.getSelectedItem() != null) {
|
||||||
|
|
||||||
|
PuntoVenta puntoVenta = (PuntoVenta) cmbPuntoVenta.getSelectedItem().getValue();
|
||||||
|
|
||||||
|
OCDPtoVtaParam ocdPtoVtaParam = new OCDPtoVtaParam();
|
||||||
|
ocdPtoVtaParam.setOcdParam(ocdParamCorrente);
|
||||||
|
ocdPtoVtaParam.setPuntoventa(puntoVenta);
|
||||||
|
|
||||||
|
ocdParamCorrente.addOCDPtoVtaParam(ocdPtoVtaParam);
|
||||||
|
|
||||||
|
ptoVtaOCDParamList.setData(ocdParamCorrente.getListOCDPtoVtaParam());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnApagarPtoVtaOCDParam(Event ev) {
|
||||||
|
try {
|
||||||
|
if (ptoVtaOCDParamList.getSelected() != null) {
|
||||||
|
int resp = Messagebox.show(
|
||||||
|
Labels.getLabel("editarPuntoVentaController.MSG.borrarPtoVtaCheckin"),
|
||||||
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
|
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||||
|
|
||||||
|
if (resp == Messagebox.YES) {
|
||||||
|
|
||||||
|
OCDPtoVtaParam ocdPtoVtaParam = (OCDPtoVtaParam) ptoVtaOCDParamList.getSelected();
|
||||||
|
if (ocdPtoVtaParam.getOcdPtoVtaParamId() != null) {
|
||||||
|
ocdPtoVtaParamService.borrar(ocdPtoVtaParam);
|
||||||
|
}
|
||||||
|
ocdParamCorrente.removePtovtaOCDParam(ocdPtoVtaParam);
|
||||||
|
ptoVtaOCDParamList.setData(ocdParamCorrente.getListOCDPtoVtaParam());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
log.error(ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Textbox getTxtDiasPagar() {
|
public Textbox getTxtDiasPagar() {
|
||||||
return txtDiasPagar;
|
return txtDiasPagar;
|
||||||
|
@ -281,5 +340,33 @@ public class EditarOCDParamController extends MyGenericForwardComposer {
|
||||||
public void setTxtTiempoLimitePenalizacion(Textbox txtTiempoLimitePenalizacion) {
|
public void setTxtTiempoLimitePenalizacion(Textbox txtTiempoLimitePenalizacion) {
|
||||||
this.txtTiempoLimitePenalizacion = txtTiempoLimitePenalizacion;
|
this.txtTiempoLimitePenalizacion = txtTiempoLimitePenalizacion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the cmbPuntoVenta
|
||||||
|
*/
|
||||||
|
public MyComboboxPuntoVenta getCmbPuntoVenta() {
|
||||||
|
return cmbPuntoVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param cmbPuntoVenta the cmbPuntoVenta to set
|
||||||
|
*/
|
||||||
|
public void setCmbPuntoVenta(MyComboboxPuntoVenta cmbPuntoVenta) {
|
||||||
|
this.cmbPuntoVenta = cmbPuntoVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the lsPuntoVenta
|
||||||
|
*/
|
||||||
|
public List<PuntoVenta> getLsPuntoVenta() {
|
||||||
|
return lsPuntoVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param lsPuntoVenta the lsPuntoVenta to set
|
||||||
|
*/
|
||||||
|
public void setLsPuntoVenta(List<PuntoVenta> lsPuntoVenta) {
|
||||||
|
this.lsPuntoVenta = lsPuntoVenta;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||||
|
|
||||||
|
import org.zkoss.zul.Listcell;
|
||||||
|
import org.zkoss.zul.Listitem;
|
||||||
|
import org.zkoss.zul.ListitemRenderer;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.OCDPtoVtaParam;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Thiago
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class RenderOCDPtoVtaParam implements ListitemRenderer {
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.zkoss.zul.ListitemRenderer#render(org.zkoss.zul.Listitem, java.lang.Object)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void render(Listitem item, Object data) throws Exception {
|
||||||
|
OCDPtoVtaParam puntoVenta = (OCDPtoVtaParam) data;
|
||||||
|
|
||||||
|
Listcell lc = new Listcell(puntoVenta.getPuntoventa().getNombpuntoventa());
|
||||||
|
lc.setParent(item);
|
||||||
|
|
||||||
|
item.setAttribute("data", puntoVenta);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -378,6 +378,8 @@
|
||||||
</value>
|
</value>
|
||||||
<value>com.rjconsultores.ventaboletos.entidad.OCDParam
|
<value>com.rjconsultores.ventaboletos.entidad.OCDParam
|
||||||
</value>
|
</value>
|
||||||
|
<value>com.rjconsultores.ventaboletos.entidad.OCDPtoVtaParam
|
||||||
|
</value>
|
||||||
<!-- value>com.rjconsultores.ventaboletos.entidad.ControleEstoqueMigracao</value -->
|
<!-- value>com.rjconsultores.ventaboletos.entidad.ControleEstoqueMigracao</value -->
|
||||||
<value>com.rjconsultores.ventaboletos.entidad.FiscalImpressora</value>
|
<value>com.rjconsultores.ventaboletos.entidad.FiscalImpressora</value>
|
||||||
<value>com.rjconsultores.ventaboletos.entidad.FechamentoParamgeral</value>
|
<value>com.rjconsultores.ventaboletos.entidad.FechamentoParamgeral</value>
|
||||||
|
|
|
@ -6812,6 +6812,9 @@ editarOCDParamController.MSG.suscribirOK=Parametro guardado exitosamente!
|
||||||
editarOCDParamController.MSG.empresaJaCadastrada=No fue posible incluir Parametro OCD. Empresa ya registrada!
|
editarOCDParamController.MSG.empresaJaCadastrada=No fue posible incluir Parametro OCD. Empresa ya registrada!
|
||||||
editarOCDParamController.MSG.borrarPergunta = Desea eliminar el Parametro OCD?
|
editarOCDParamController.MSG.borrarPergunta = Desea eliminar el Parametro OCD?
|
||||||
editarOCDParamController.MSG.borrarOK = Parametro OCD eliminado exitosamente.
|
editarOCDParamController.MSG.borrarOK = Parametro OCD eliminado exitosamente.
|
||||||
|
editarOCDParamController.tab.label.ptovtaSomenteEstorno=Puntos Ventas permitidas solo para estorno
|
||||||
|
editarOCDParamController.puntoVenta.label=Punto Venta
|
||||||
|
editarOCDParamController.grid.puntoVenta.label=Puntos Ventas
|
||||||
busquedaOCDParamController.ocdDefault.label = OCD como default
|
busquedaOCDParamController.ocdDefault.label = OCD como default
|
||||||
busquedaOCDParamController.ocdTroca.label = OCD Cambio
|
busquedaOCDParamController.ocdTroca.label = OCD Cambio
|
||||||
busquedaOCDParamController.ocdTransferencia.label = OCD Transferencia
|
busquedaOCDParamController.ocdTransferencia.label = OCD Transferencia
|
||||||
|
|
|
@ -6222,6 +6222,9 @@ editarOCDParamController.MSG.suscribirOK=Parametro gravado com sucesso!
|
||||||
editarOCDParamController.MSG.empresaJaCadastrada=Não foi possível incluir Parâmetro OCD. Empresa já cadastrada!
|
editarOCDParamController.MSG.empresaJaCadastrada=Não foi possível incluir Parâmetro OCD. Empresa já cadastrada!
|
||||||
editarOCDParamController.MSG.borrarPergunta = Deseja eliminar o Parâmetro OCD?
|
editarOCDParamController.MSG.borrarPergunta = Deseja eliminar o Parâmetro OCD?
|
||||||
editarOCDParamController.MSG.borrarOK = Parâmetro OCD eliminado com sucesso.
|
editarOCDParamController.MSG.borrarOK = Parâmetro OCD eliminado com sucesso.
|
||||||
|
editarOCDParamController.tab.label.ptovtaSomenteEstorno=Agências permitidas somente para estorno
|
||||||
|
editarOCDParamController.puntoVenta.label=Agência
|
||||||
|
editarOCDParamController.grid.puntoVenta.label=Agências
|
||||||
busquedaOCDParamController.ocdDefault.label = OCD como padrão
|
busquedaOCDParamController.ocdDefault.label = OCD como padrão
|
||||||
busquedaOCDParamController.ocdTroca.label = OCD Troca
|
busquedaOCDParamController.ocdTroca.label = OCD Troca
|
||||||
busquedaOCDParamController.ocdTransferencia.label = OCD Transferencia
|
busquedaOCDParamController.ocdTransferencia.label = OCD Transferencia
|
||||||
|
|
|
@ -23,7 +23,17 @@
|
||||||
tooltiptext="${c:l('editarOCDParamController.btnFechar.tooltiptext')}" />
|
tooltiptext="${c:l('editarOCDParamController.btnFechar.tooltiptext')}" />
|
||||||
</hbox>
|
</hbox>
|
||||||
</toolbar>
|
</toolbar>
|
||||||
|
|
||||||
|
<tabbox id="tabboxTitle">
|
||||||
|
<tabs>
|
||||||
|
<tab
|
||||||
|
label="${c:l('editarOCDParamController.window.title')}" />
|
||||||
|
<tab
|
||||||
|
label="${c:l('editarOCDParamController.tab.label.ptovtaSomenteEstorno')}" />
|
||||||
|
</tabs>
|
||||||
|
|
||||||
|
<tabpanels>
|
||||||
|
<tabpanel style="overflow:auto;">
|
||||||
<grid fixedLayout="true">
|
<grid fixedLayout="true">
|
||||||
<columns>
|
<columns>
|
||||||
<column width="40%" />
|
<column width="40%" />
|
||||||
|
@ -38,6 +48,7 @@
|
||||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||||
width="70%" mold="rounded" buttonVisible="true"
|
width="70%" mold="rounded" buttonVisible="true"
|
||||||
model="@{winEditarOCDParam$composer.lsEmpresas}"
|
model="@{winEditarOCDParam$composer.lsEmpresas}"
|
||||||
|
constraint="no empty"
|
||||||
selectedItem="@{winEditarOCDParam$composer.ocdParamCorrente.empresa}"/>
|
selectedItem="@{winEditarOCDParam$composer.ocdParamCorrente.empresa}"/>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
|
@ -100,7 +111,48 @@
|
||||||
</row>
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
|
</tabpanel>
|
||||||
|
<tabpanel style="overflow:auto;">
|
||||||
|
<grid fixedLayout="true">
|
||||||
|
<columns>
|
||||||
|
<column width="40%" />
|
||||||
|
<column width="60%" />
|
||||||
|
</columns>
|
||||||
|
<rows>
|
||||||
|
<row>
|
||||||
|
<label
|
||||||
|
value="${c:l('editarOCDParamController.puntoVenta.label')}" />
|
||||||
|
<combobox id="cmbPuntoVenta"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
|
||||||
|
|
||||||
|
mold="rounded" buttonVisible="true" width="90%" />
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
<toolbar>
|
||||||
|
<hbox spacing="5px" style="padding:1px"
|
||||||
|
align="right">
|
||||||
|
<button id="btnApagarPtoVtaOCDParam"
|
||||||
|
height="20" image="/gui/img/remove.png" width="35px"
|
||||||
|
tooltiptext="${c:l('editarEmpresaController.btnApagar.tooltiptext')}" />
|
||||||
|
<button id="btnAdicionarPtoVtaOCDParam"
|
||||||
|
height="20" image="/gui/img/add.png" width="35px"
|
||||||
|
tooltiptext="${c:l('busquedaEmpresaController.btnNovo.tooltiptext')}" />
|
||||||
|
</hbox>
|
||||||
|
</toolbar>
|
||||||
|
<listbox id="ptoVtaOCDParamList"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
|
vflex="true" multiple="false">
|
||||||
|
<listhead sizable="true">
|
||||||
|
<listheader id="lhPtoVtaOCDParam"
|
||||||
|
image="/gui/img/builder.gif"
|
||||||
|
label="${c:l('editarOCDParamController.grid.puntoVenta.label')}" />
|
||||||
|
</listhead>
|
||||||
|
</listbox>
|
||||||
|
|
||||||
|
</tabpanel>
|
||||||
|
</tabpanels>
|
||||||
|
|
||||||
|
</tabbox>
|
||||||
</window>
|
</window>
|
||||||
</zk>
|
</zk>
|
Loading…
Reference in New Issue