fixed bug #9091 - Criação de campos para cobrança da taxa de conveniencia na venda.

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@69878 d1611594-4594-4d17-8e1d-87c2c4800839
master
thiago 2017-06-13 14:01:05 +00:00
parent e430d34f26
commit d9d785496f
6 changed files with 98 additions and 19 deletions

View File

@ -57,6 +57,7 @@ import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Decimalbox;
import org.zkoss.zul.Doublebox;
import org.zkoss.zul.Filedownload;
import org.zkoss.zul.Image;
@ -135,6 +136,7 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.FechamentoParamptovtaListItemRenderer;
import com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.PuntoVendaHistoricoBloqueioListItemRenderer;
import com.rjconsultores.ventaboletos.web.utilerias.ConstraintNoEmpty;
import com.rjconsultores.ventaboletos.web.utilerias.ConstraintPorcentagem;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@ -409,7 +411,10 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private String logFileSelected;
private Textbox descCorreo;
private String statusAprobacionInicial = "";
private Decimalbox txtTaxaConvenienciaPorc;
private Doublebox txtMaximoTaxaConveniencia;
private ConstraintPorcentagem ct;
private static final String EMAIL_PATTERN =
"^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
@ -451,6 +456,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
@Override
public void doAfterCompose(Component comp) throws Exception {
setCt(new ConstraintPorcentagem());
lsCategoriaBloquear = categoriaService.obtenerTodasCategoriasVisibles();
lsEmpresasBloquear = empresaService.obtenerTodos();
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
@ -471,7 +477,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
super.doAfterCompose(comp);
getTxtTaxaConvenienciaPorc().setConstraint(getCt());
cmbBanco.addEventListener("onAfterRender", new org.zkoss.zk.ui.event.EventListener() {
public void onEvent(Event event) throws Exception {
cmbBanco.setSelectedIndex(lsBanco.indexOf(puntoVenta.getAgenciaId().getInstiFinanceiraId()));
@ -1385,6 +1391,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
txtCarga.getValue();
txtAntecipRetem.getValue();
txtAntecipPercentual.getValue();
getTxtTaxaConvenienciaPorc().getValue();
if(getTxtTaxaConvenienciaPorc().getValue().compareTo(BigDecimal.ZERO) == 1){
txtMaximoTaxaConveniencia.setConstraint("no empty");
}
txtMaximoTaxaConveniencia.getValue();
cmbEmpresa.getValue();
cmbParada.getValue();
@ -3432,5 +3443,48 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
public void setLsCategoriaBloquear(List<Categoria> lsCategoriaBloquear) {
this.lsCategoriaBloquear = lsCategoriaBloquear;
}
/**
* @return the txtTaxaConvenienciaPorc
*/
public Decimalbox getTxtTaxaConvenienciaPorc() {
return txtTaxaConvenienciaPorc;
}
/**
* @param txtTaxaConvenienciaPorc the txtTaxaConvenienciaPorc to set
*/
public void setTxtTaxaConvenienciaPorc(Decimalbox txtTaxaConvenienciaPorc) {
this.txtTaxaConvenienciaPorc = txtTaxaConvenienciaPorc;
}
/**
* @return the txtMaximoTaxaConveniencia
*/
public Doublebox getTxtMaximoTaxaConveniencia() {
return txtMaximoTaxaConveniencia;
}
/**
* @param txtMaximoTaxaConveniencia the txtMaximoTaxaConveniencia to set
*/
public void setTxtMaximoTaxaConveniencia(Doublebox txtMaximoTaxaConveniencia) {
this.txtMaximoTaxaConveniencia = txtMaximoTaxaConveniencia;
}
/**
* @return the ct
*/
public ConstraintPorcentagem getCt() {
return ct;
}
/**
* @param ct the ct to set
*/
public void setCt(ConstraintPorcentagem ct) {
this.ct = ct;
}
}

View File

@ -26,7 +26,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoEventoExtra;
/**
*
*
* @author Rafius
*/
@Controller("busquedaTipoEventoExtraController")
@ -50,7 +50,16 @@ public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer
@Override
public void onEvent(Event event) throws Exception {
TipoEventoExtra emp = (TipoEventoExtra) tipoEventoExtraList.getSelected();
if (emp.getCveSistema() != null) {
Messagebox.show(
Labels.getLabel("MSG.noEditabled"),
Labels.getLabel("editarCategoriaController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
return;
}
verEventoExtra(emp);
}
});

View File

@ -39,7 +39,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
/**
*
*
* @author Rafius
*/
@Controller("editarTipoEventoExtraController")
@ -53,7 +53,7 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
private TipoEventoExtraEmpresaService tipoEventoExtraEmpresaService;
@Autowired
private EmpresaService empresaService;
private TipoEventoExtra tipoEventoExtra;
private MyListbox tipoEventoExtraList;
private MyListbox empresasList;
@ -66,12 +66,11 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
private Radio raTipo22;
private MyComboboxEstandar cmbEmpresa;
private List<Empresa> lsEmpresas;
private List<TipoEventoExtraEmpresa> lsTipoEventoExtraEmpresas;
private List<com.rjconsultores.ventaboletos.constantes.TipoEventoExtra> lsEventoExtrasConstantes;
private MyComboboxEstandar cmbCveTipoEvento;
private static Logger log = Logger.getLogger(EditarTipoEventoExtraController.class);
public TipoEventoExtra getTipoEventoExtra() {
return tipoEventoExtra;
}
@ -84,7 +83,7 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
public void doAfterCompose(Component comp) throws Exception {
lsEmpresas = empresaService.obtenerTodosIncluindoEmpresaTodas();
lsEventoExtrasConstantes = Arrays.asList(com.rjconsultores.ventaboletos.constantes.TipoEventoExtra.values());
super.doAfterCompose(comp);
tipoEventoExtra = (TipoEventoExtra) Executions.getCurrent().getArg().get("tipoEventoExtra");
@ -92,7 +91,7 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
//lsTipoEventoExtraEmpresas = tipoEventoExtra.getTipoeventoextraId() == null ? new ArrayList<TipoEventoExtraEmpresa>() : tipoEventoExtraEmpresaService.buscarPorTipoEventoExtra(tipoEventoExtra);
empresasList.setData(tipoEventoExtra.getEmpresas());
if (tipoEventoExtra.getTipoeventoextraId() != null) {
cbValidaDocumento.setChecked(tipoEventoExtra.getIndvalidadocumento());
} else {
@ -108,12 +107,12 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
raTipo22.setChecked(Boolean.TRUE);
}
}
if( (tipoEventoExtra.getTipoeventoextraId() != null) && (tipoEventoExtra.getTipoeventoextraId() > Constantes.LIMITE_EVENTO_EXTRA_EDITAVEL) ){
btnApagar.setVisible(false);
btnSalvar.setVisible(false);
}
if(tipoEventoExtra.getCvetipoevento() != null) {
cmbCveTipoEvento.setValue(tipoEventoExtra.getCvetipoevento().toString());
}
@ -127,8 +126,8 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
Labels.getLabel("editarTipoEventoExtraController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
return;
}
}
TipoEventoExtraEmpresa t = (TipoEventoExtraEmpresa) empresasList.getSelected();
tipoEventoExtraEmpresaService.borrar(t);
@ -136,7 +135,7 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
tipoEventoExtra.removeEmpresa(t);
empresasList.setData(tipoEventoExtra.getEmpresas());
}
public void onClick$btnAdicionarEmpresa(Event ev) throws InterruptedException {
if (cmbEmpresa.getSelectedItem() == null){
Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.selecionarEmpresa"),
@ -150,16 +149,16 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
empresasList.setData(tipoEventoExtra.getEmpresas());
}
public void onClick$btnSalvar(Event ev) throws InterruptedException {
txtNome.getValue();
impMax.getValue();
tipoEventoExtra.setIndoperacion(TipoEventoExtra.OPERACION_NORMAL);
tipoEventoExtra.setIndboleto(Boolean.FALSE);// não valida boleto
tipoEventoExtra.setPorciva(BigDecimal.ZERO);
tipoEventoExtra.setIndtipo(raTipo11.isChecked() ? "1" : "0");
if(cmbCveTipoEvento.getSelectedItem() != null) {
tipoEventoExtra.setCvetipoevento(com.rjconsultores.ventaboletos.constantes.TipoEventoExtra.valueOf(cmbCveTipoEvento.getSelectedItem().getValue().toString()));
}

View File

@ -57,7 +57,6 @@ import com.rjconsultores.ventaboletos.entidad.Ruta;
import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
import com.rjconsultores.ventaboletos.service.CategoriaService;
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.MarcaService;
import com.rjconsultores.ventaboletos.service.ParadaService;
import com.rjconsultores.ventaboletos.service.PricingCategoriaService;

View File

@ -64,6 +64,11 @@ import com.trg.search.Filter;
@Scope("prototype")
public class BusquedaTarifaController extends MyGenericForwardComposer {
/**
*
*/
private static final long serialVersionUID = 152133603059627025L;
@Autowired
private TarifaService tarifaService;

View File

@ -368,6 +368,19 @@
<checkbox id="ckIndEstoqueMotorista"
checked="@{winEditarPuntoVenta$composer.puntoVenta.indEstoqueMotorista}" />
</row>
<row>
<!-- Taxa de Conveniencia % -->
<label value="Taxa de Conveniencia %" />
<decimalbox id="txtTaxaConvenienciaPorc" format=",###.##" constraint="no negative" maxlength="6"
value="@{winEditarPuntoVenta$composer.puntoVenta.taxaConvenienciaPorc}" />
</row>
<row>
<!--Máximo Taxa de Conveniencia -->
<label value="Máximo Taxa de Conveniencia" />
<doublebox id="txtMaximoTaxaConveniencia" format=",###.##" constraint="no negative"
value="@{winEditarPuntoVenta$composer.puntoVenta.maximoTaxaConveniencia}" />
</row>
<row>
<label
value="${c:l('editarPuntoVentaController.lbIndBloqueiaCancelamentoImpressaoPosterior.value')}" />