/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rjconsultores.ventaboletos.web.utilerias.render;

import com.rjconsultores.ventaboletos.entidad.CancelacionCargo;
import java.math.RoundingMode;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;

/**
 * 
 * @author Rafius
 */
public class RenderCancelacionCargo implements ListitemRenderer {

	public void render(Listitem lstm, Object o) throws Exception {
		CancelacionCargo cc = (CancelacionCargo) o;

		Listcell lc = new Listcell((cc.getTiempominimo() == null) ? "" : cc.getTiempominimo().setScale(2, RoundingMode.HALF_UP).toString());
		lc.setParent(lstm);

		lc = new Listcell((cc.getTiempomaximo() == null) ? "" : cc.getTiempomaximo().setScale(2, RoundingMode.HALF_UP).toString());
		lc.setParent(lstm);

		lc = new Listcell((cc.getPorccargo() == null) ? "" : cc.getPorccargo().setScale(2, RoundingMode.HALF_UP).toString());
		lc.setParent(lstm);

		lc = new Listcell((cc.getImportecargo() == null) ? "" : cc.getImportecargo().setScale(2, RoundingMode.HALF_UP).toString());
		lc.setParent(lstm);

		lstm.setAttribute("data", cc);
	}
}
