1、在【客户化】->【单据号管理】中,为指定单据配置单据号规则
2、在EventHandler类中,实现获取单据号方法
/**
* 获取单据号
*
* @param billType
* @param pk_corp
* @return
*/
private String getVBillCode(String billType, String pk_corp) {
try {
BillcodeGenerater gene = new BillcodeGenerater();
return gene.getBillCode(billType, pk_corp, null, null);
} catch (ValidationException e) {
e.printStackTrace();
} catch (BusinessException e) {
e.printStackTrace();
}
return null;
}
3、在EventHandler类中重写onBoAdd方法
@Override
public void onBoAdd(ButtonObject bo) throws Exception {
// TODO Auto-generated method stub
super.onBoAdd(bo);
//String code = getVBillCode(this.getBillCardPanelWrapper().getBillCardPanel().getBillType(), this.getBillCardPanelWrapper().getBillCardPanel().getCorp());
String code = getVBillCode("H104", this.getBillCardPanelWrapper().getBillCardPanel().getCorp());//此处H104是单据