/*
 * 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.FormaPago;
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;

/**
 *
 * @author Administrador
 */
public class RenderFormaPago implements ListitemRenderer {

    public void render(Listitem lstm, Object o) throws Exception {
        FormaPago formaPago = (FormaPago) o;

        Listcell lc = new Listcell(formaPago.getFormapagoId().toString());
        lc.setParent(lstm);

        lc = new Listcell(formaPago.getDescpago());
        lc.setParent(lstm);
        
        lc = new Listcell(formaPago.getCvePago());
        lc.setParent(lstm);

        if (ApplicationProperties.getInstance().mostrarEquivalencia()) {
            lc = new Listcell(formaPago.getEquivalenciaId());
            lc.setParent(lstm);
        }

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