wilian 2015-11-25 20:12:24 +00:00
parent 6d380e5937
commit b64e327181
3 changed files with 45 additions and 11 deletions

View File

@ -214,6 +214,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private List<Empresa> lsEmpresasBloquear;
private List<Empresa> lsEmpresas;
private List<Empresa> lsEmpresasFormapago;
private List<EmpresaContaBancaria> lsEmpresaContaBancarias;
private List<InstiFinanceira> lsBanco;
private List<TipoPuntoVenta> lsTipoPuntoVenta;
@ -251,6 +252,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private Button btnAdicionarEmpresaComissao;
private MyComboboxPuntoVenta cmbPuntoVentaPadre;
private Combobox cmbFormaPago;
private Combobox cmbEmpresaFormaPago;
private Combobox cmbEmpresa;
private Combobox cmbEmpresaPtoVta;
private Combobox cmbEmpresaPtoVtaUsuarioBancario;
@ -398,7 +400,12 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
lsBanco = ptovtaBancoService.obtenerTodos();
lsColonia = new ArrayList<Colonia>();
lsNodos = nodoService.obtenerTodos();
lsFormaPago = formaPagoService.obtenerTodos();
lsEmpresasFormapago = new ArrayList<Empresa>();
lsEmpresasFormapago.add(empresaService.obtenerID(-1));
lsEmpresasFormapago.addAll(UsuarioLogado.getUsuarioLogado().getEmpresa());
lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodosExceto(TipoPuntoVenta.TODOS);
lsUsuarioBancario = usuarioBancarioService.obtenerTodos();
lsLogFiles = getLogFiles();
@ -1587,24 +1594,33 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
public void onClick$btnSalvarFormaPago(Event ev) throws InterruptedException {
cmbFormaPago.getValue();
txtCargosExtras.getValue();
cmbEmpresaFormaPago.getValue();
try {
FormaPago formaPago = new FormaPago();
try {
formaPago = (FormaPago) cmbFormaPago.getSelectedItem().getValue();
Boolean achou = Boolean.FALSE;
Empresa empresa = (Empresa) cmbEmpresaFormaPago.getSelectedItem().getValue();
if (formaPago != null) {
for (FormaPagoDet fpd : lsFormaPagoDet) {
if (fpd.getFormaPago().getFormapagoId().equals(formaPago.getFormapagoId())) {
if (fpd.getFormaPago().equals(formaPago) && empresa.equals(fpd.getEmpresa())) {
achou = Boolean.TRUE;
}
}
if (!achou) {
FormaPagoDet fpd = new FormaPagoDet();
fpd.setCargosextras(new BigDecimal(txtCargosExtras.getValue()));
/*
* Mantis #6874
* fpd.setCargosextras(new BigDecimal(txtCargosExtras.getValue()));
*/
fpd.setCargosextras(BigDecimal.ZERO);
fpd.setFormaPago(formaPago);
fpd.setPuntoVenta(puntoVenta);
if(cmbEmpresaFormaPago.getSelectedItem() != null) {
fpd.setEmpresa(empresa);
}
fpd.setActivo(Boolean.TRUE);
fpd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
fpd.setFecmodif(Calendar.getInstance().getTime());
@ -2778,5 +2794,13 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
public void setCmbEmpresasContaBancarias(MyComboboxEstandar cmbEmpresasContaBancarias) {
this.cmbEmpresasContaBancarias = cmbEmpresasContaBancarias;
}
public List<Empresa> getLsEmpresasFormapago() {
return lsEmpresasFormapago;
}
public void setLsEmpresasFormapago(List<Empresa> lsEmpresasFormapago) {
this.lsEmpresasFormapago = lsEmpresasFormapago;
}
}

View File

@ -18,10 +18,10 @@ public class FormaPagoDetRender implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
FormaPagoDet formaPagoDet = (FormaPagoDet) o;
Listcell lc = new Listcell(formaPagoDet.getFormaPago().getDescpago());
Listcell lc = new Listcell(formaPagoDet.getEmpresa() != null ? formaPagoDet.getEmpresa().getNombempresa() : "");
lc.setParent(lstm);
lc = new Listcell(formaPagoDet.getCargosextras().toString());
lc = new Listcell(formaPagoDet.getFormaPago() != null ? formaPagoDet.getFormaPago().getDescpago() : "TODOS");
lc.setParent(lstm);
lstm.setAttribute("data", formaPagoDet);

View File

@ -811,8 +811,8 @@
<tabpanel height="300px">
<grid fixedLayout="true">
<columns>
<column width="40%" />
<column width="60%" />
<column width="25%" />
<column width="75%" />
</columns>
<rows>
<row>
@ -824,6 +824,15 @@
constraint="no empty"
model="@{winEditarPuntoVenta$composer.lsFormaPago}" />
</row>
<row>
<label
value="${c:l('editarPuntoVentaController.lbEmpresa.value')}" />
<combobox id="cmbEmpresaFormaPago"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
constraint="no empty" mold="rounded" buttonVisible="true"
width="70%" model="@{winEditarPuntoVenta$composer.lsEmpresasFormapago}" />
</row>
<!--
<row>
<label id="lblCargosExtras"
value="${c:l('editarConfiguracionFormaPagoController.lblCargosExtras.value')}" />
@ -831,6 +840,7 @@
width="80%" value="0.0" maxlength="7"
constraint="no empty, no negative" />
</row>
-->
</rows>
</grid>
@ -850,12 +860,12 @@
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" multiple="false">
<listhead sizable="true">
<listheader id="lhEmpresaFormaPago"
image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionFormaPagoController.lblEmpresa.value')}" />
<listheader id="lhFormaPago"
image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionFormaPagoController.lblInicial.value')}" />
<listheader id="lhCargosExtras"
image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionFormaPagoController.lblCargosExtras.value')}" />
label="${c:l('editarConfiguracionFormaPagoController.lblFormaPago.value')}" />
</listhead>
</listbox>
</tabpanel>