@Override
protected void _reverseSave(Context ctx, IObjectPK srcBillPK,
IObjectValue srcBillVO, BOTBillOperStateEnum billOperStateEnum,
IObjectValue relationInfo) throws BOSException, EASBizException {
reverseSave(ctx, srcBillPK, srcBillVO, billOperStateEnum, relationInfo);
//super._reverseSave(ctx, srcBillPK, srcBillVO, billOperStateEnum, relationInfo);
}
public static void reverseSave(Context ctx, IObjectPK srcBillPK, IObjectValue srcBillVO, BOTBillOperStateEnum bOTBillOperStateEnum, IObjectValue bOTRelationInfo) throws BOSException, EASBizException {
BOTRelationInfo relation = (BOTRelationInfo) bOTRelationInfo;
BOSObjectType bosType = BOSUuid.read(relation.getDestObjectID()).getType();
if (bosType.equals((new VoucherInfo()).getBOSType())) {
CoreBillBaseInfo model = (CoreBillBaseInfo) srcBillVO;
// 删除凭证
if (bOTBillOperStateEnum.equals(BOTBillOperStateEnum.DELETE)) {
//model.put(FLD_FIVOUCHERED, new Integer(0));
// 以下设置单据的凭证信息
model.put("VOUCHERNUMBER", null);
//model.put(FLD_VOUCHERDATE, null);
}
// 生成凭证
else {
String voucherID = relation.getDestObjectID();
VoucherInfo voucherInfo = (VoucherInfo) VoucherFactory.getLocalInstance(ctx).getValue(new ObjectStringPK(voucherID));
//model.put(FLD_FIVOUCHERED, voucherInfo.getNumber() );
// 以下设置单据的凭证信息
model.put("VOUCHERNUMBER", voucherInfo.getNumber());
// model.put(FLD_VOUCHERDATE, voucherInfo.getBookedDate());
}
BOSObjectType bosObjectType = srcBillVO.getBOSType();
ICoreBillBase iCoreBillBase = (ICoreBillBase) BOSObjectFactory.createBOSObject(ctx, bosObjectType);
iCoreBillBase.reverseSave(srcBillPK, (CoreBillBaseInfo) srcBillVO);
}
}