PRICING - Ocupação | Antecipação (fixes bug #5836)
Tempo: 03 horas git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@43707 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
4880a1cfff
commit
9dc27f02a0
|
@ -16,7 +16,6 @@ import org.zkoss.zhtml.Messagebox;
|
||||||
import org.zkoss.zk.ui.Component;
|
import org.zkoss.zk.ui.Component;
|
||||||
import org.zkoss.zk.ui.Executions;
|
import org.zkoss.zk.ui.Executions;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zul.Button;
|
|
||||||
import org.zkoss.zul.Intbox;
|
import org.zkoss.zul.Intbox;
|
||||||
import org.zkoss.zul.Radio;
|
import org.zkoss.zul.Radio;
|
||||||
|
|
||||||
|
@ -35,251 +34,244 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingOcupaAnt
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
public class EditarPricingOcupaAntecipaAutomaticoController extends MyGenericForwardComposer {
|
public class EditarPricingOcupaAntecipaAutomaticoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final int CANTDIASMAXDEFAULT = 365;
|
private final int CANTDIASMAXDEFAULT = 365;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PricingOcupaAntecipaService pricingOcupaAntecipaService;
|
private PricingOcupaAntecipaService pricingOcupaAntecipaService;
|
||||||
private PricingOcupaAntecipa pricingOcupaAntecipa;
|
private PricingOcupaAntecipa pricingOcupaAntecipa;
|
||||||
private MyListbox pricingOcupaAntecipaList;
|
private MyListbox pricingOcupaAntecipaList;
|
||||||
private MyListbox parentPricingOcupaAntecipaList;
|
private MyListbox parentPricingOcupaAntecipaList;
|
||||||
private Intbox ocupacioninicial;
|
private Intbox ocupacioninicial;
|
||||||
private Intbox ocupacionfinal;
|
private Intbox ocupacionfinal;
|
||||||
private Intbox cantdiasmin;
|
private Intbox cantdiasmin;
|
||||||
private Intbox cantdiasmax;
|
private MyTextboxDecimal porcentaje;
|
||||||
private Intbox cantasientosmin;
|
private List<PricingOcupaAntecipa> lsPricingOcupaAntecipa;
|
||||||
private Intbox cantasientosmax;
|
private Radio rdOcupacao;
|
||||||
private MyTextboxDecimal porcentaje;
|
private Boolean hasNoElements;
|
||||||
private MyTextboxDecimal importe;
|
|
||||||
private List<PricingOcupaAntecipa> lsPricingOcupaAntecipa;
|
|
||||||
private Radio rdPoltronas;
|
|
||||||
private Radio rdOcupacao;
|
|
||||||
private Boolean hasNoElements;
|
|
||||||
private Button btnAdicionarOcupaAntecipa;
|
|
||||||
|
|
||||||
private List<PricingOcupaAntecipa> argList;
|
private List<PricingOcupaAntecipa> argList;
|
||||||
private Pricing pricing;
|
private Pricing pricing;
|
||||||
|
|
||||||
private ConstraintPorcentagem ct;
|
private ConstraintPorcentagem ct;
|
||||||
private static Logger log = Logger.getLogger(EditarPricingOcupaAntecipaController.class);
|
private static Logger log = Logger.getLogger(EditarPricingOcupaAntecipaController.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
super.doAfterCompose(comp);
|
||||||
|
/*
|
||||||
|
* Transformar a tabela (valores de exemplo) :
|
||||||
|
*
|
||||||
|
* Qtd. Dias Qtd. Dias Ocup. Min. Ocup. Máx. Porcentagem Minimo Máximo
|
||||||
|
*
|
||||||
|
* 12 * 0% 20% -30% 12 * 21% 80% -15% 12 * 81% 90% -10% 8 11 0% 80% -15% 8 11 81% 90% -10% 4 7 0% 90% -10%
|
||||||
|
*
|
||||||
|
* Na forma:
|
||||||
|
*
|
||||||
|
* 12 dias ----> 30% (ocupação de 0% -> 20%) 08 dias ----> 15% (ocupação de 21% -> 80%) 04 dias ----> 10% (ocupação de 81% -> 90%)
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
argList = (List<PricingOcupaAntecipa>) Executions.getCurrent().getArg().get("clasePricingOcupaAntecipaList");
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
parentPricingOcupaAntecipaList = (MyListbox) Executions.getCurrent().getArg().get("pricingOcupaAntecipaList");
|
||||||
super.doAfterCompose(comp);
|
pricing = (Pricing) Executions.getCurrent().getArg().get("pricing");
|
||||||
/*
|
pricingOcupaAntecipaList.setItemRenderer(new RenderPricingOcupaAntecipa());
|
||||||
* Transformar a tabela (valores de exemplo) :
|
lsPricingOcupaAntecipa = new ArrayList<PricingOcupaAntecipa>();
|
||||||
*
|
|
||||||
* Qtd. Dias Qtd. Dias Ocup. Min. Ocup. Máx. Porcentagem
|
|
||||||
* Minimo Máximo
|
|
||||||
*
|
|
||||||
* 12 * 0% 20% -30%
|
|
||||||
* 12 * 21% 80% -15%
|
|
||||||
* 12 * 81% 90% -10%
|
|
||||||
* 8 11 0% 80% -15%
|
|
||||||
* 8 11 81% 90% -10%
|
|
||||||
* 4 7 0% 90% -10%
|
|
||||||
*
|
|
||||||
* Na forma:
|
|
||||||
*
|
|
||||||
* 12 dias ----> 30% (ocupação de 0% -> 20%)
|
|
||||||
* 08 dias ----> 15% (ocupação de 21% -> 80%)
|
|
||||||
* 04 dias ----> 10% (ocupação de 81% -> 90%)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
argList = (List<PricingOcupaAntecipa>) Executions.getCurrent().getArg().get("clasePricingOcupaAntecipaList");
|
try {
|
||||||
parentPricingOcupaAntecipaList = (MyListbox)Executions.getCurrent().getArg().get("pricingOcupaAntecipaList");
|
Collections.sort(argList, Collections.reverseOrder(new PricingOcupaAntecipaComparator()));
|
||||||
pricing = (Pricing)Executions.getCurrent().getArg().get("pricing");
|
} catch (Exception e) {
|
||||||
pricingOcupaAntecipaList.setItemRenderer(new RenderPricingOcupaAntecipa());
|
e.printStackTrace();
|
||||||
lsPricingOcupaAntecipa = new ArrayList<PricingOcupaAntecipa>();
|
Messagebox.show(Labels.getLabel("editarPricingOcupaAntecipaAutomaticoController.MSG.FormatoDados"),
|
||||||
|
Labels.getLabel("editarPricingController.windowOcupacion.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
|
||||||
try{
|
return;
|
||||||
Collections.sort(argList, Collections.reverseOrder(new PricingOcupaAntecipaComparator()));
|
}
|
||||||
} catch (Exception e){
|
|
||||||
Messagebox.show(Labels.getLabel("editarPricingOcupaAntecipaAutomaticoController.MSG.FormatoDados"),
|
|
||||||
Labels.getLabel("editarPricingController.windowOcupacion.title"),
|
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
|
|
||||||
return;
|
int diaMin = -1;
|
||||||
}
|
|
||||||
|
|
||||||
int diaMin = -1;
|
for (PricingOcupaAntecipa p : argList) {
|
||||||
|
if (p.getCantdiasmin() != null) {
|
||||||
for (PricingOcupaAntecipa p : argList){
|
if (diaMin != p.getCantdiasmin()) {
|
||||||
if (diaMin != p.getCantdiasmin()){
|
|
||||||
lsPricingOcupaAntecipa.add(p);
|
lsPricingOcupaAntecipa.add(p);
|
||||||
diaMin = p.getCantdiasmin();
|
diaMin = p.getCantdiasmin();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// se TabelaMaior.size mod TabelaMenor.size = 0, então há possibilidade de transformar a maior na menor.
|
|
||||||
if ((lsPricingOcupaAntecipa.size() > 0) && (argList.size() % lsPricingOcupaAntecipa.size() == 0)){
|
|
||||||
|
|
||||||
for (int j = 0; j < lsPricingOcupaAntecipa.size(); j++){
|
|
||||||
lsPricingOcupaAntecipa.get(j).setOcupacionfinal(argList.get(j).getOcupacionfinal());
|
|
||||||
lsPricingOcupaAntecipa.get(j).setOcupacioninicial(argList.get(j).getOcupacioninicial());
|
|
||||||
lsPricingOcupaAntecipa.get(j).setCantasientosmax(argList.get(j).getCantasientosmax());
|
|
||||||
lsPricingOcupaAntecipa.get(j).setCantasientosmin(argList.get(j).getCantasientosmin());
|
|
||||||
}
|
|
||||||
|
|
||||||
pricingOcupaAntecipaList.setData(lsPricingOcupaAntecipa);
|
|
||||||
} else if (lsPricingOcupaAntecipa.size() > 0){
|
|
||||||
Messagebox.show(Labels.getLabel("editarPricingOcupaAntecipaAutomaticoController.MSG.FormatoDados"),
|
|
||||||
Labels.getLabel("editarPricingController.windowOcupacion.title"),
|
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void apagarRegistros() throws BusinessException{
|
|
||||||
for (PricingOcupaAntecipa poa : argList){
|
|
||||||
if ((poa.getOcupacioninicial() != null && poa.getOcupacioninicial().doubleValue() > 0) || (poa.getCantasientosmin() != null && poa.getCantasientosmin().intValue() > 0)){
|
|
||||||
pricingOcupaAntecipaService.borrar(poa);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onClick$btnAdicionarOcupaAntecipa(Event ev) throws Exception {
|
|
||||||
List<PricingOcupaAntecipa> parentList = new ArrayList<PricingOcupaAntecipa>();
|
|
||||||
calculaCantDiasMax();
|
|
||||||
try {
|
|
||||||
apagarRegistros();
|
|
||||||
for (int i = 0; i < lsPricingOcupaAntecipa.size(); i++){
|
|
||||||
lsPricingOcupaAntecipa.get(i).setOcupacioninicial(new BigDecimal(0));
|
|
||||||
if (lsPricingOcupaAntecipa.get(i).getPricingocupaantecipaId() == null){
|
|
||||||
pricingOcupaAntecipaService.suscribir(lsPricingOcupaAntecipa.get(i));
|
|
||||||
} else {
|
|
||||||
pricingOcupaAntecipaService.actualizacion(lsPricingOcupaAntecipa.get(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
parentList.add(lsPricingOcupaAntecipa.get(i));
|
|
||||||
|
|
||||||
for (int j=i+1; j < lsPricingOcupaAntecipa.size(); j++){
|
|
||||||
PricingOcupaAntecipa p = new PricingOcupaAntecipa();
|
|
||||||
p.setPricingocupaantecipaId(lsPricingOcupaAntecipa.get(j).getPricingocupaantecipaId());
|
|
||||||
p.setCantasientosmax(lsPricingOcupaAntecipa.get(j).getCantasientosmax());
|
|
||||||
p.setCantasientosmin(lsPricingOcupaAntecipa.get(j).getCantasientosmin());
|
|
||||||
p.setCantdiasmax(lsPricingOcupaAntecipa.get(i).getCantdiasmax());
|
|
||||||
p.setCantdiasmin(lsPricingOcupaAntecipa.get(i).getCantdiasmin());
|
|
||||||
p.setOcupacionfinal(lsPricingOcupaAntecipa.get(j).getOcupacionfinal());
|
|
||||||
p.setOcupacioninicial(lsPricingOcupaAntecipa.get(j).getOcupacioninicial());
|
|
||||||
p.setPorcentaje(lsPricingOcupaAntecipa.get(j).getPorcentaje());
|
|
||||||
p.setPricing(pricing);
|
|
||||||
pricingOcupaAntecipaService.suscribir(p);
|
|
||||||
parentList.add(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
parentPricingOcupaAntecipaList.setData(parentList);
|
|
||||||
closeWindow();
|
|
||||||
} catch (Exception e) {
|
|
||||||
Messagebox.show(e.getLocalizedMessage(),
|
|
||||||
Labels.getLabel("editarPricingController.windowOcupacion.title"),
|
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class PricingOcupaAntecipaComparator implements Comparator<PricingOcupaAntecipa> {
|
|
||||||
public int compare(PricingOcupaAntecipa pricing, PricingOcupaAntecipa outroPricing) {
|
|
||||||
return pricing.getCantdiasmin().
|
|
||||||
compareTo(outroPricing.getCantdiasmin());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void calculaCantDiasMax(){
|
|
||||||
Collections.sort(lsPricingOcupaAntecipa, Collections.reverseOrder(new PricingOcupaAntecipaComparator()));
|
|
||||||
PricingOcupaAntecipa poa;
|
|
||||||
int cantDiasMinAnterior = lsPricingOcupaAntecipa.get(0).getCantdiasmin();
|
|
||||||
for (int i = 0; i < lsPricingOcupaAntecipa.size(); i++){
|
|
||||||
poa = lsPricingOcupaAntecipa.get(i);
|
|
||||||
if (i == 0){
|
|
||||||
poa.setCantdiasmax(CANTDIASMAXDEFAULT);
|
|
||||||
} else {
|
|
||||||
poa.setCantdiasmax(cantDiasMinAnterior - 1);
|
|
||||||
cantDiasMinAnterior = poa.getCantdiasmin();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onClick$btnlancar(Event ev) throws Exception {
|
|
||||||
PricingOcupaAntecipa poa = new PricingOcupaAntecipa();
|
|
||||||
poa.setPricing(pricing);
|
|
||||||
poa.setCantdiasmin(cantdiasmin.getValue());
|
|
||||||
poa.setPorcentaje(porcentaje.getValueDecimal());
|
|
||||||
if (rdOcupacao.isChecked()){
|
|
||||||
poa.setOcupacioninicial(new BigDecimal(ocupacioninicial.getValue()));
|
|
||||||
poa.setOcupacionfinal(new BigDecimal(ocupacionfinal.getValue()));
|
|
||||||
} else {
|
} else {
|
||||||
poa.setCantasientosmin(ocupacioninicial.getValue());
|
lsPricingOcupaAntecipa.add(p);
|
||||||
poa.setCantasientosmax(ocupacionfinal.getValue());
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// se TabelaMaior.size mod TabelaMenor.size = 0, então há possibilidade de transformar a maior na menor.
|
||||||
|
if ((lsPricingOcupaAntecipa.size() > 0) && (argList.size() % lsPricingOcupaAntecipa.size() == 0)) {
|
||||||
|
|
||||||
|
for (int j = 0; j < lsPricingOcupaAntecipa.size(); j++) {
|
||||||
|
lsPricingOcupaAntecipa.get(j).setOcupacionfinal(argList.get(j).getOcupacionfinal());
|
||||||
|
lsPricingOcupaAntecipa.get(j).setOcupacioninicial(argList.get(j).getOcupacioninicial());
|
||||||
|
lsPricingOcupaAntecipa.get(j).setCantasientosmax(argList.get(j).getCantasientosmax());
|
||||||
|
lsPricingOcupaAntecipa.get(j).setCantasientosmin(argList.get(j).getCantasientosmin());
|
||||||
}
|
}
|
||||||
|
|
||||||
lsPricingOcupaAntecipa.add(poa);
|
|
||||||
pricingOcupaAntecipaList.setData(lsPricingOcupaAntecipa);
|
pricingOcupaAntecipaList.setData(lsPricingOcupaAntecipa);
|
||||||
|
} else if (lsPricingOcupaAntecipa.size() > 0) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarPricingOcupaAntecipaAutomaticoController.MSG.FormatoDados"),
|
||||||
|
Labels.getLabel("editarPricingController.windowOcupacion.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void onClick$btnRemoverOcupaAntecipa(Event ev) {
|
private void apagarRegistros() throws BusinessException {
|
||||||
|
for (PricingOcupaAntecipa poa : argList) {
|
||||||
|
if ((poa.getOcupacioninicial() != null && poa.getOcupacioninicial().doubleValue() > 0) || (poa.getCantasientosmin() != null && poa.getCantasientosmin().intValue() > 0)) {
|
||||||
|
pricingOcupaAntecipaService.borrar(poa);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
public void onClick$btnAdicionarOcupaAntecipa(Event ev) throws Exception {
|
||||||
PricingOcupaAntecipa pOcupacion = (PricingOcupaAntecipa) pricingOcupaAntecipaList.getSelected();
|
List<PricingOcupaAntecipa> parentList = new ArrayList<PricingOcupaAntecipa>();
|
||||||
if (pOcupacion != null) {
|
calculaCantDiasMax();
|
||||||
int resp = Messagebox.show(Labels.getLabel("editarPricingController.MSG.borrarPerguntaOcupacion"),
|
try {
|
||||||
Labels.getLabel("editarPricingController.windowOcupacion.title"),
|
apagarRegistros();
|
||||||
Messagebox.YES | Messagebox.NO,
|
for (int i = 0; i < lsPricingOcupaAntecipa.size(); i++) {
|
||||||
Messagebox.QUESTION);
|
lsPricingOcupaAntecipa.get(i).setOcupacioninicial(new BigDecimal(0));
|
||||||
|
if (lsPricingOcupaAntecipa.get(i).getPricingocupaantecipaId() == null) {
|
||||||
if (resp == Messagebox.YES) {
|
pricingOcupaAntecipaService.suscribir(lsPricingOcupaAntecipa.get(i));
|
||||||
pricingOcupaAntecipa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
pricingOcupaAntecipa.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
pricingOcupaAntecipa.setActivo(Pricing.INATIVO);
|
|
||||||
|
|
||||||
pricingOcupaAntecipaList.removeItem(pricingOcupaAntecipa);
|
|
||||||
pricingOcupaAntecipaService.borrar(pricingOcupaAntecipa);
|
|
||||||
closeWindow();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"),
|
pricingOcupaAntecipaService.actualizacion(lsPricingOcupaAntecipa.get(i));
|
||||||
Labels.getLabel("editarPricingController.windowOcupacion.title"),
|
}
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
|
parentList.add(lsPricingOcupaAntecipa.get(i));
|
||||||
|
|
||||||
|
for (int j = i + 1; j < lsPricingOcupaAntecipa.size(); j++) {
|
||||||
|
PricingOcupaAntecipa p = new PricingOcupaAntecipa();
|
||||||
|
p.setPricingocupaantecipaId(lsPricingOcupaAntecipa.get(j).getPricingocupaantecipaId());
|
||||||
|
p.setCantasientosmax(lsPricingOcupaAntecipa.get(j).getCantasientosmax());
|
||||||
|
p.setCantasientosmin(lsPricingOcupaAntecipa.get(j).getCantasientosmin());
|
||||||
|
p.setCantdiasmax(lsPricingOcupaAntecipa.get(i).getCantdiasmax());
|
||||||
|
p.setCantdiasmin(lsPricingOcupaAntecipa.get(i).getCantdiasmin());
|
||||||
|
p.setOcupacionfinal(lsPricingOcupaAntecipa.get(j).getOcupacionfinal());
|
||||||
|
p.setOcupacioninicial(lsPricingOcupaAntecipa.get(j).getOcupacioninicial());
|
||||||
|
p.setPorcentaje(lsPricingOcupaAntecipa.get(j).getPorcentaje());
|
||||||
|
p.setPricing(pricing);
|
||||||
|
pricingOcupaAntecipaService.suscribir(p);
|
||||||
|
parentList.add(p);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
|
||||||
log.error(ex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parentPricingOcupaAntecipaList.setData(parentList);
|
||||||
|
closeWindow();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Messagebox.show(e.getLocalizedMessage(),
|
||||||
|
Labels.getLabel("editarPricingController.windowOcupacion.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class PricingOcupaAntecipaComparator implements Comparator<PricingOcupaAntecipa> {
|
||||||
|
public int compare(PricingOcupaAntecipa pricing, PricingOcupaAntecipa outroPricing) {
|
||||||
|
if (pricing.getCantdiasmin() != null && outroPricing.getCantdiasmin() != null) {
|
||||||
|
return pricing.getCantdiasmin().compareTo(outroPricing.getCantdiasmin());
|
||||||
|
} else if (pricing.getOcupacioninicial() != null && outroPricing.getOcupacioninicial() != null) {
|
||||||
|
return pricing.getOcupacioninicial().compareTo(outroPricing.getOcupacioninicial());
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void calculaCantDiasMax() {
|
||||||
|
Collections.sort(lsPricingOcupaAntecipa, Collections.reverseOrder(new PricingOcupaAntecipaComparator()));
|
||||||
|
PricingOcupaAntecipa poa;
|
||||||
|
int cantDiasMinAnterior = lsPricingOcupaAntecipa.get(0).getCantdiasmin();
|
||||||
|
for (int i = 0; i < lsPricingOcupaAntecipa.size(); i++) {
|
||||||
|
poa = lsPricingOcupaAntecipa.get(i);
|
||||||
|
if (i == 0) {
|
||||||
|
poa.setCantdiasmax(CANTDIASMAXDEFAULT);
|
||||||
|
} else {
|
||||||
|
poa.setCantdiasmax(cantDiasMinAnterior - 1);
|
||||||
|
cantDiasMinAnterior = poa.getCantdiasmin();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnlancar(Event ev) throws Exception {
|
||||||
|
PricingOcupaAntecipa poa = new PricingOcupaAntecipa();
|
||||||
|
poa.setPricing(pricing);
|
||||||
|
poa.setCantdiasmin(cantdiasmin.getValue());
|
||||||
|
poa.setPorcentaje(porcentaje.getValueDecimal());
|
||||||
|
if (rdOcupacao.isChecked()) {
|
||||||
|
poa.setOcupacioninicial(new BigDecimal(ocupacioninicial.getValue()));
|
||||||
|
poa.setOcupacionfinal(new BigDecimal(ocupacionfinal.getValue()));
|
||||||
|
} else {
|
||||||
|
poa.setCantasientosmin(ocupacioninicial.getValue());
|
||||||
|
poa.setCantasientosmax(ocupacionfinal.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
public PricingOcupaAntecipa getPricingOcupaAntecipa() {
|
lsPricingOcupaAntecipa.add(poa);
|
||||||
return pricingOcupaAntecipa;
|
pricingOcupaAntecipaList.setData(lsPricingOcupaAntecipa);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPricingOcupacion(PricingOcupaAntecipa pricingOcupaAntecipa) {
|
public void onClick$btnRemoverOcupaAntecipa(Event ev) {
|
||||||
this.pricingOcupaAntecipa = pricingOcupaAntecipa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MyListbox getPricingOcupacionList() {
|
try {
|
||||||
return pricingOcupaAntecipaList;
|
PricingOcupaAntecipa pOcupacion = (PricingOcupaAntecipa) pricingOcupaAntecipaList.getSelected();
|
||||||
}
|
if (pOcupacion != null) {
|
||||||
|
int resp = Messagebox.show(Labels.getLabel("editarPricingController.MSG.borrarPerguntaOcupacion"),
|
||||||
|
Labels.getLabel("editarPricingController.windowOcupacion.title"),
|
||||||
|
Messagebox.YES | Messagebox.NO,
|
||||||
|
Messagebox.QUESTION);
|
||||||
|
|
||||||
public void setPricingOcupacionList(MyListbox pricingOcupacionList) {
|
if (resp == Messagebox.YES) {
|
||||||
this.pricingOcupaAntecipaList = pricingOcupacionList;
|
pricingOcupaAntecipa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
}
|
pricingOcupaAntecipa.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
pricingOcupaAntecipa.setActivo(Pricing.INATIVO);
|
||||||
|
|
||||||
public ConstraintPorcentagem getCt() {
|
pricingOcupaAntecipaList.removeItem(pricingOcupaAntecipa);
|
||||||
return ct;
|
pricingOcupaAntecipaService.borrar(pricingOcupaAntecipa);
|
||||||
}
|
closeWindow();
|
||||||
|
}
|
||||||
public void setCt(ConstraintPorcentagem ct) {
|
} else {
|
||||||
this.ct = ct;
|
Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"),
|
||||||
}
|
Labels.getLabel("editarPricingController.windowOcupacion.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
public Boolean getHasNoElements() {
|
}
|
||||||
return hasNoElements;
|
} catch (Exception ex) {
|
||||||
}
|
log.error(ex);
|
||||||
|
|
||||||
public void setHasNoElements(Boolean hasNoElements) {
|
|
||||||
this.hasNoElements = hasNoElements;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PricingOcupaAntecipa getPricingOcupaAntecipa() {
|
||||||
|
return pricingOcupaAntecipa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPricingOcupacion(PricingOcupaAntecipa pricingOcupaAntecipa) {
|
||||||
|
this.pricingOcupaAntecipa = pricingOcupaAntecipa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyListbox getPricingOcupacionList() {
|
||||||
|
return pricingOcupaAntecipaList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPricingOcupacionList(MyListbox pricingOcupacionList) {
|
||||||
|
this.pricingOcupaAntecipaList = pricingOcupacionList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConstraintPorcentagem getCt() {
|
||||||
|
return ct;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCt(ConstraintPorcentagem ct) {
|
||||||
|
this.ct = ct;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getHasNoElements() {
|
||||||
|
return hasNoElements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasNoElements(Boolean hasNoElements) {
|
||||||
|
this.hasNoElements = hasNoElements;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue