package com.tenwa.customer.handler.invoice; import jbo.app.tenwa.customer.CUSTOMER_INFO; import com.amarsoft.are.jbo.BizObject; import com.amarsoft.are.jbo.BizObjectManager; import com.amarsoft.are.jbo.JBOFactory; import com.amarsoft.awe.dw.handler.impl.CommonHandler; public class CustomerInvoiceHandler extends CommonHandler{ @Override protected void initDisplayForAdd(BizObject bo) throws Exception { //获取当前客户ID String customer_id=this.asPage.getAttribute("customer_id").toString(); //去客户表中查询关联customer_id的客户 BizObjectManager manager = JBOFactory.getFactory().getManager(CUSTOMER_INFO.CLASS_NAME); BizObject CUSTOMER_INFO = manager.createQuery("customerid=:customerid").setParameter("customerid",customer_id).getSingleResult(false); //初始化开票信息的开票人 if(CUSTOMER_INFO != null) { bo.setAttributeValue("tax_object", CUSTOMER_INFO.getAttribute("customername").getString()); bo.setAttributeValue("tax_no", CUSTOMER_INFO.getAttribute("certid").getString()); } //初始化customer_id bo.setAttributeValue("customer_id", customer_id); super.initDisplayForAdd(bo); } }