0020082: Cadastro de Forma Pagamento

bug#20082
dev:valdevir
qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@102844 d1611594-4594-4d17-8e1d-87c2c4800839
master
valdir 2020-08-07 20:04:36 +00:00
parent c758c0838d
commit 372c010b93
6 changed files with 123 additions and 16 deletions

View File

@ -67,6 +67,8 @@ public class EditarFormaPagoController extends MyGenericForwardComposer {
private boolean exibeTipoRestricaoFormaPago;
private Checkbox chkIndEstorno;
private Checkbox chkIndVoucherRodoviaria;
private MyComboboxEstandar cmbTipoFormapago;
@ -125,6 +127,7 @@ public class EditarFormaPagoController extends MyGenericForwardComposer {
}
chkIndEstorno.setChecked(formaPago.getIndProcessoEstorno());
chkIndVoucherRodoviaria.setChecked(formaPago.getIndVoucherRodoviaria());
if (formaPago.getFormapagoId() == 1) {
cmbTipoFormapago.setDisabled(Boolean.TRUE);
@ -221,6 +224,7 @@ public class EditarFormaPagoController extends MyGenericForwardComposer {
}
formaPago.setIndProcessoEstorno(chkIndEstorno.isChecked());
formaPago.setIndVoucherRodoviaria(chkIndVoucherRodoviaria.isChecked());
if (formaPago.getFormapagoId() == null) {
List<FormaPago> lsFP =
@ -387,4 +391,11 @@ public class EditarFormaPagoController extends MyGenericForwardComposer {
this.chkIndEstorno = chkIndEstorno;
}
public Checkbox getChkIndVoucherRodoviaria() {
return chkIndVoucherRodoviaria;
}
public void setChkIndVoucherRodoviaria(Checkbox chkIndVoucherRodoviaria) {
this.chkIndVoucherRodoviaria = chkIndVoucherRodoviaria;
}
}

View File

@ -24,16 +24,20 @@ import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Button;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Longbox;
import org.zkoss.zul.Radio;
import org.zkoss.zul.Row;
import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.CuponSecretaria;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.FormaPago;
import com.rjconsultores.ventaboletos.entidad.Secretaria;
import com.rjconsultores.ventaboletos.entidad.SecretariaEmpresa;
import com.rjconsultores.ventaboletos.service.CuponSecretariaService;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.FormaPagoService;
import com.rjconsultores.ventaboletos.service.SecretariaEmpresaService;
import com.rjconsultores.ventaboletos.service.SecretariaService;
import com.rjconsultores.ventaboletos.utilerias.TraslaparUtil;
@ -86,7 +90,6 @@ public class EditarSecretariaController extends MyGenericForwardComposer {
private Textbox txtCiudad;
private Button btnApagar;
private Button btnAdicionarCuponSecretaria;
private Button btnSalvar;
private Radio rdPrecioTotal;
private Radio rdPrecioDescuento;
private Radio rdDescuento;
@ -95,6 +98,14 @@ public class EditarSecretariaController extends MyGenericForwardComposer {
private Checkbox chkVoucherRod;
private MyComboboxEstandar cmbEmpresa;
private static Logger log = Logger.getLogger(EditarSecretariaController.class);
private Row rowComboFormaPago;
private Combobox cmbFormaPago;
private List<FormaPago> lsFormaPago;
@Autowired
private FormaPagoService formaPagoService;
public Button getBtnApagar() {
return btnApagar;
@ -239,16 +250,6 @@ public class EditarSecretariaController extends MyGenericForwardComposer {
public void setChkVoucherRod(Checkbox chkVoucherRod) {
this.chkVoucherRod = chkVoucherRod;
}
private void verificaVoucherRod(){
Secretaria voucher = secretariaService.buscarSecretariaVoucherRod();
if (voucher != null){
chkVoucherRod.setDisabled(true);
} else {
chkVoucherRod.setDisabled(false);
}
}
@Override
public void doAfterCompose(Component comp) throws Exception {
@ -261,6 +262,9 @@ public class EditarSecretariaController extends MyGenericForwardComposer {
lsSecretariaEmpresa = new ArrayList<SecretariaEmpresa>();
}
lsEmpresas = empresaService.obtenerTodosIncluindoEmpresaTodas();
lsFormaPago = bucarFormasPagoVoucherRodoviaria();
super.doAfterCompose(comp);
empresasList.setItemRenderer(new RenderSecretariaEmpresa());
@ -286,6 +290,11 @@ public class EditarSecretariaController extends MyGenericForwardComposer {
chkValidaFolio.setChecked(secretaria.getValidafolio());
chkValidaFolio.setDisabled(Boolean.FALSE);
chkVoucherRod.setChecked(secretaria.getIndVoucherRod());
if(secretaria.getFormaPago() != null) {
cmbFormaPago.setValue(secretaria.getFormaPago().toString());
}
onClick$chkValidaFolio(null);
// Prenche Serie e subserie
chkValidaSerieSubserie.setChecked(secretaria.getValidaSerieSubSerie() == null ? false : secretaria.getValidaSerieSubSerie());
@ -298,11 +307,33 @@ public class EditarSecretariaController extends MyGenericForwardComposer {
txtDirSecretaria.setText(secretaria.getDireccion());
txtCiudad.setText(secretaria.getCiudad());
}
rowComboFormaPago.setVisible(chkVoucherRod.isChecked());
insereConstrants();
txtDescSecretaria.focus();
}
private List<FormaPago> bucarFormasPagoVoucherRodoviaria() {
try {
List<FormaPago> listaTodasFormasPago = formaPagoService.obtenerTodos();
List<FormaPago> formaPagoVoucher = new ArrayList<FormaPago>();
for(FormaPago fp : listaTodasFormasPago) {
if(fp.getIndVoucherRodoviaria()) {
formaPagoVoucher.add(fp);
}
}
return formaPagoVoucher;
} catch (Exception e) {
log.error("Erro ao buscar formas de pagamento: ", e);
}
return null;
}
public void onClick$btnRemoverEmpresa(Event ev) throws InterruptedException {
if (empresasList.getSelectedItem() == null) {
org.zkoss.zul.Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.selecionarEmpresa"),
@ -360,18 +391,35 @@ public class EditarSecretariaController extends MyGenericForwardComposer {
}
}
@SuppressWarnings("deprecation")
public void onClick$btnSalvar(Event ev) throws InterruptedException {
txtDescSecretaria.getValue();
txtCveSecretaria.getValue();
cmbFormaPago.getValue();
try {
Secretaria voucher = secretariaService.buscarSecretariaVoucherRod();
if (voucher != null && !secretaria.equals(voucher) && chkVoucherRod.isChecked()){
FormaPago formaPago = cmbFormaPago.getSelectedItem() != null ? (FormaPago) cmbFormaPago.getSelectedItem().getValue() : null;
if(chkVoucherRod.isChecked() && formaPago == null) {
org.zkoss.zul.Messagebox.show(
Labels.getLabel("editarSecretariaController.MSG.voucherRodDuplicado.value"),
Labels.getLabel("editarSecretariaController.MSG.voucherRodSemFormaPago.value"),
Labels.getLabel("editarSecretariaController.window.title"),
org.zkoss.zul.Messagebox.OK, org.zkoss.zul.Messagebox.EXCLAMATION);
return;
}
if(chkVoucherRod.isChecked() && formaPago != null) {
Secretaria voucher = secretariaService.buscarSecretariaVoucherRod(formaPago.getFormapagoId());
if (voucher != null && !secretaria.equals(voucher) && chkVoucherRod.isChecked()){
org.zkoss.zul.Messagebox.show(
Labels.getLabel("editarSecretariaController.MSG.voucherRodDuplicado.value"),
Labels.getLabel("editarSecretariaController.window.title"),
org.zkoss.zul.Messagebox.OK, org.zkoss.zul.Messagebox.EXCLAMATION);
return;
}
}
if (lsCuponSecretaria.isEmpty()) {
org.zkoss.zul.Messagebox.show(
Labels.getLabel("editarSecretariaController.MSG.necessaitaPorcentaje.value"),
@ -385,7 +433,13 @@ public class EditarSecretariaController extends MyGenericForwardComposer {
secretaria.setLsCuponSecretaria(lsCuponSecretaria);
secretaria.setValidafolio(chkValidaFolio.isChecked());
secretaria.setValidaSerieSubSerie(chkValidaSerieSubserie.isChecked());
secretaria.setIndVoucherRod(chkVoucherRod.isChecked());
if(chkVoucherRod.isChecked() && formaPago != null) {
secretaria.setFormaPago(formaPago);
}
secretaria.setRut(txtRUT.getValue());
secretaria.setCiudad(txtCiudad.getText());
secretaria.setDireccion(txtDirSecretaria.getText());
@ -735,6 +789,10 @@ public class EditarSecretariaController extends MyGenericForwardComposer {
}
}
public void onCheck$chkVoucherRod(Event event) {
rowComboFormaPago.setVisible(chkVoucherRod.isChecked());
}
public List<SecretariaEmpresa> getLsSecretariaEmpresa() {
return lsSecretariaEmpresa;
}
@ -798,4 +856,20 @@ public class EditarSecretariaController extends MyGenericForwardComposer {
public void setTxtCiudad(Textbox txtCiudad) {
this.txtCiudad = txtCiudad;
}
public List<FormaPago> getLsFormaPago() {
return lsFormaPago;
}
public void setLsFormaPago(List<FormaPago> lsFormaPago) {
this.lsFormaPago = lsFormaPago;
}
public Combobox getCmbFormaPago() {
return cmbFormaPago;
}
public void setCmbFormaPago(Combobox cmbFormaPago) {
this.cmbFormaPago = cmbFormaPago;
}
}

View File

@ -1076,6 +1076,7 @@ editarFormaPagoController.lblTarifaTaxa.label=Compone Tarifa y Taxas
editarFormaPagoController.lblSomenteTarifa.label=Compone Tarifa
editarFormaPagoController.lblCarteiraDigital.label=Billetera digital
editarFormaPagoController.lblAtivaProcessoEstorno.label=Activa el proceso de contracargo
editarFormaPagoController.lblVoucherRodoviaria.label=Voucher Rodoviária
# Muestra o tipo de Búsqueda Punto de venta
busquedaTipoPuntoVentaController.window.title = Canal de venta
@ -4896,9 +4897,10 @@ editarSecretariaController.MSG.borrarPergunta = Eliminar secretaria?
editarSecretariaController.MSG.borrarOK = Secretaria se eliminó exitosamente
editarSecretariaController.MSG.folio = Número del documento final es menor o igual al número del documento inicial
editarSecretariaController.MSG.necessaitaPorcentaje.value = Necesita informar un porcentaje
editarSecretariaController.MSG.voucherRodDuplicado.value = Já existe um registro marcado como Voucher Rod. Só é permitido 1 registro.
editarSecretariaController.MSG.voucherRodDuplicado.value = Já existe um registro marcado como Voucher Rod con esta forma de pagamento. Só é permitido 1 registro.
editarSecretariaController.MSG.registroTraslapado = El numero de documento informado se traslapa con otro ya existente
editarSecretariaController.MSG.pocentaje = Mas de un descuento permitido para rango de pasajes distintos
editarSecretariaController.MSG.voucherRodSemFormaPago.value=Es necesario elegir una forma de pago cuando el registro está marcado como Voucher Rodoviaria.
# Búsqueda Ciudad
busquedaCiudadController.window.title = Ciudad

View File

@ -1162,6 +1162,7 @@ editarFormaPagoController.lblTarifaTaxa.label=Compõe Tarifa e Taxas
editarFormaPagoController.lblSomenteTarifa.label=Compõe Tarifa
editarFormaPagoController.lblCarteiraDigital.label=Carteira Digital
editarFormaPagoController.lblAtivaProcessoEstorno.label=Ativa processo de estorno
editarFormaPagoController.lblVoucherRodoviaria.label=Voucher Rodoviária
# Muestra o tipo de Pesquisa Ponto Venda
busquedaTipoPuntoVentaController.window.title = Canal de Venda
@ -5131,10 +5132,11 @@ editarSecretariaController.MSG.borrarPergunta = Eliminar Secretaria?
editarSecretariaController.MSG.borrarOK = Secretaria Excluida com Sucesso.
editarSecretariaController.MSG.folio = Número do documento final é menor ou igual ao número do documento inicial.
editarSecretariaController.MSG.necessaitaPorcentaje.value = Necessita informar uma porcentagem
editarSecretariaController.MSG.voucherRodDuplicado.value = Já existe um registro marcado como Voucher Rod. Só é permitido 1 registro.
editarSecretariaController.MSG.voucherRodDuplicado.value = Já existe um registro marcado como Voucher Rod com essa forma de pagamento. Só é permitido 1 registro.
editarSecretariaController.MSG.registroTraslapado = O número do documento informado se sobrepõe com outro já existente
editarSecretariaController.MSG.pocentaje = Mais de um desconto permitido para rango de passagens diferentes
editarSecretariaController.MSG.necessarioRemoverCupon.value = Existe registro com número de documento vazio, para validar documento é necessário apagar estes registros.
editarSecretariaController.MSG.voucherRodSemFormaPago.value=E Necessário escolher uma forma de pagamento quando marcado o registro como Voucher Rodoviaria.
# Pesquisa Cidade
busquedaCiudadController.window.title = Cidade

View File

@ -79,11 +79,19 @@
mold="rounded"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" />
</row>
<row >
<label
value="${c:l('editarFormaPagoController.lblAtivaProcessoEstorno.label')}" />
<checkbox id="chkIndEstorno" checked="false"/>
</row>
<row >
<label
value="${c:l('editarFormaPagoController.lblVoucherRodoviaria.label')}" />
<checkbox id="chkIndVoucherRodoviaria" checked="false"/>
</row>
<row id="rowRestricaoFormaPago">
<label
value="${c:l('editarFormaPagoController.lblRestricaoFormaPago.label')}" />

View File

@ -100,6 +100,16 @@
<checkbox id="chkVoucherRod"
value="@{winEditarSecretaria$composer.secretaria.indVoucherRod}" />
</row>
<row id="rowComboFormaPago">
<label value="${c:l('relatorioEstornoCartaoController.lbFormaPago.value')}" />
<combobox id="cmbFormaPago"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
width="95%" mold="rounded" buttonVisible="true"
model="@{winEditarSecretaria$composer.lsFormaPago}" />
</row>
<row spans="2">
<label
value="${c:l('editarSecretariaController.Impression.value')}" />