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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
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.Empresa;
|
||||
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.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.OCDParamService;
|
||||
import com.rjconsultores.ventaboletos.service.OCDPtoVtaParamService;
|
||||
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.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderOCDPtoVtaParam;
|
||||
|
||||
@Controller("editarOCDParamController")
|
||||
@Scope("prototype")
|
||||
|
@ -38,6 +44,9 @@ public class EditarOCDParamController extends MyGenericForwardComposer {
|
|||
@Autowired
|
||||
private OCDParamService ocdParamService;
|
||||
|
||||
@Autowired
|
||||
private OCDPtoVtaParamService ocdPtoVtaParamService ;
|
||||
|
||||
@Autowired
|
||||
private EmpresaService empresaService;
|
||||
|
||||
|
@ -47,15 +56,20 @@ public class EditarOCDParamController extends MyGenericForwardComposer {
|
|||
private OCDParam ocdParamCorrente;
|
||||
|
||||
private MyListbox ocdParamList;
|
||||
private MyComboboxPuntoVenta cmbPuntoVenta;
|
||||
|
||||
private Combobox cmbEmpresa;
|
||||
private List<Empresa> lsEmpresas;
|
||||
private List<PuntoVenta> lsPuntoVenta;
|
||||
|
||||
private Textbox txtDiasPagar;
|
||||
private Textbox txtPenalizacion;
|
||||
private Textbox txtTiempoLimitePenalizacion;
|
||||
|
||||
private Button btnApagar;
|
||||
private Button btnApagarPtoVtaOCDParam;
|
||||
private Button btnAdicionarPtoVtaOCDParam;
|
||||
private MyListbox ptoVtaOCDParamList;
|
||||
private Checkbox chkOCDDefault;
|
||||
private Checkbox chkOCDTroca;
|
||||
private Checkbox chkOCDTransferencia;
|
||||
|
@ -107,9 +121,14 @@ public class EditarOCDParamController extends MyGenericForwardComposer {
|
|||
chkIndtotalbilhete.setChecked(ocdParamCorrente.getIndtotalbilhete() == null ? false : ocdParamCorrente.getIndtotalbilhete());
|
||||
txtPenalizacion.setDisabled(!ocdParamCorrente.getIndPenalizacionOCD());
|
||||
txtTiempoLimitePenalizacion.setDisabled(!ocdParamCorrente.getIndPenalizacionOCD());
|
||||
ptoVtaOCDParamList.setItemRenderer(new RenderOCDPtoVtaParam());
|
||||
initRadios(ocdParamCorrente.getIndPenalizacionOCD());
|
||||
if (ocdParamCorrente.getOcdparamId() == null)
|
||||
if (ocdParamCorrente.getOcdparamId() == null){
|
||||
btnApagar.setVisible(Boolean.FALSE);
|
||||
ocdParamCorrente.setListOCDPtoVtaParam(new ArrayList<OCDPtoVtaParam>());
|
||||
}else{
|
||||
ptoVtaOCDParamList.setData(ocdParamCorrente.getListOCDPtoVtaParam());
|
||||
}
|
||||
}
|
||||
|
||||
private void initRadios(Boolean indPenalizacionOCD) {
|
||||
|
@ -210,6 +229,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() {
|
||||
return txtDiasPagar;
|
||||
}
|
||||
|
@ -282,4 +341,32 @@ public class EditarOCDParamController extends MyGenericForwardComposer {
|
|||
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>com.rjconsultores.ventaboletos.entidad.OCDParam
|
||||
</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.OCDPtoVtaParam
|
||||
</value>
|
||||
<!-- value>com.rjconsultores.ventaboletos.entidad.ControleEstoqueMigracao</value -->
|
||||
<value>com.rjconsultores.ventaboletos.entidad.FiscalImpressora</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.borrarPergunta = Desea eliminar el Parametro OCD?
|
||||
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.ocdTroca.label = OCD Cambio
|
||||
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.borrarPergunta = Deseja eliminar o Parâmetro OCD?
|
||||
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.ocdTroca.label = OCD Troca
|
||||
busquedaOCDParamController.ocdTransferencia.label = OCD Transferencia
|
||||
|
|
|
@ -24,6 +24,16 @@
|
|||
</hbox>
|
||||
</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">
|
||||
<columns>
|
||||
<column width="40%" />
|
||||
|
@ -38,6 +48,7 @@
|
|||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
width="70%" mold="rounded" buttonVisible="true"
|
||||
model="@{winEditarOCDParam$composer.lsEmpresas}"
|
||||
constraint="no empty"
|
||||
selectedItem="@{winEditarOCDParam$composer.ocdParamCorrente.empresa}"/>
|
||||
</row>
|
||||
|
||||
|
@ -100,7 +111,48 @@
|
|||
</row>
|
||||
</rows>
|
||||
</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>
|
||||
</zk>
|
Loading…
Reference in New Issue