NC5单据号处理

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是单据类型号,在PUB_BILLCODE_RULE表的PK_BILLTYPECODE字段中
		//System.out.println("单据号是:"+code);
		// 设置单据号到单据的vbillno字段上
		getBillCardPanelWrapper().getBillCardPanel().getHeadItem("vbillno").setValue(code);
	}
4、在UI实现类中,重写createEventHandler方法

	@Override
	protected CardEventHandler createEventHandler() {
		// TODO Auto-generated method stub
		return new HbEventHandler(this,getUIControl());
	}




你可能感兴趣的:(处理)