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> lsEmpresasBloquear;
private List<Empresa> lsEmpresas; private List<Empresa> lsEmpresas;
private List<Empresa> lsEmpresasFormapago;
private List<EmpresaContaBancaria> lsEmpresaContaBancarias; private List<EmpresaContaBancaria> lsEmpresaContaBancarias;
private List<InstiFinanceira> lsBanco; private List<InstiFinanceira> lsBanco;
private List<TipoPuntoVenta> lsTipoPuntoVenta; private List<TipoPuntoVenta> lsTipoPuntoVenta;
@ -251,6 +252,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private Button btnAdicionarEmpresaComissao; private Button btnAdicionarEmpresaComissao;
private MyComboboxPuntoVenta cmbPuntoVentaPadre; private MyComboboxPuntoVenta cmbPuntoVentaPadre;
private Combobox cmbFormaPago; private Combobox cmbFormaPago;
private Combobox cmbEmpresaFormaPago;
private Combobox cmbEmpresa; private Combobox cmbEmpresa;
private Combobox cmbEmpresaPtoVta; private Combobox cmbEmpresaPtoVta;
private Combobox cmbEmpresaPtoVtaUsuarioBancario; private Combobox cmbEmpresaPtoVtaUsuarioBancario;
@ -398,7 +400,12 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
lsBanco = ptovtaBancoService.obtenerTodos(); lsBanco = ptovtaBancoService.obtenerTodos();
lsColonia = new ArrayList<Colonia>(); lsColonia = new ArrayList<Colonia>();
lsNodos = nodoService.obtenerTodos(); lsNodos = nodoService.obtenerTodos();
lsFormaPago = formaPagoService.obtenerTodos(); lsFormaPago = formaPagoService.obtenerTodos();
lsEmpresasFormapago = new ArrayList<Empresa>();
lsEmpresasFormapago.add(empresaService.obtenerID(-1));
lsEmpresasFormapago.addAll(UsuarioLogado.getUsuarioLogado().getEmpresa());
lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodosExceto(TipoPuntoVenta.TODOS); lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodosExceto(TipoPuntoVenta.TODOS);
lsUsuarioBancario = usuarioBancarioService.obtenerTodos(); lsUsuarioBancario = usuarioBancarioService.obtenerTodos();
lsLogFiles = getLogFiles(); lsLogFiles = getLogFiles();
@ -1587,24 +1594,33 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
public void onClick$btnSalvarFormaPago(Event ev) throws InterruptedException { public void onClick$btnSalvarFormaPago(Event ev) throws InterruptedException {
cmbFormaPago.getValue(); cmbFormaPago.getValue();
txtCargosExtras.getValue(); cmbEmpresaFormaPago.getValue();
try { try {
FormaPago formaPago = new FormaPago(); FormaPago formaPago = new FormaPago();
try { try {
formaPago = (FormaPago) cmbFormaPago.getSelectedItem().getValue(); formaPago = (FormaPago) cmbFormaPago.getSelectedItem().getValue();
Boolean achou = Boolean.FALSE; Boolean achou = Boolean.FALSE;
Empresa empresa = (Empresa) cmbEmpresaFormaPago.getSelectedItem().getValue();
if (formaPago != null) { if (formaPago != null) {
for (FormaPagoDet fpd : lsFormaPagoDet) { for (FormaPagoDet fpd : lsFormaPagoDet) {
if (fpd.getFormaPago().getFormapagoId().equals(formaPago.getFormapagoId())) { if (fpd.getFormaPago().equals(formaPago) && empresa.equals(fpd.getEmpresa())) {
achou = Boolean.TRUE; achou = Boolean.TRUE;
} }
} }
if (!achou) { if (!achou) {
FormaPagoDet fpd = new FormaPagoDet(); 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.setFormaPago(formaPago);
fpd.setPuntoVenta(puntoVenta); fpd.setPuntoVenta(puntoVenta);
if(cmbEmpresaFormaPago.getSelectedItem() != null) {
fpd.setEmpresa(empresa);
}
fpd.setActivo(Boolean.TRUE); fpd.setActivo(Boolean.TRUE);
fpd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); fpd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
fpd.setFecmodif(Calendar.getInstance().getTime()); fpd.setFecmodif(Calendar.getInstance().getTime());
@ -2779,4 +2795,12 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
public void setCmbEmpresasContaBancarias(MyComboboxEstandar cmbEmpresasContaBancarias) { public void setCmbEmpresasContaBancarias(MyComboboxEstandar cmbEmpresasContaBancarias) {
this.cmbEmpresasContaBancarias = 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 { public void render(Listitem lstm, Object o) throws Exception {
FormaPagoDet formaPagoDet = (FormaPagoDet) o; 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.setParent(lstm);
lc = new Listcell(formaPagoDet.getCargosextras().toString()); lc = new Listcell(formaPagoDet.getFormaPago() != null ? formaPagoDet.getFormaPago().getDescpago() : "TODOS");
lc.setParent(lstm); lc.setParent(lstm);
lstm.setAttribute("data", formaPagoDet); lstm.setAttribute("data", formaPagoDet);

View File

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