public void addCMPBill(HYBillVO billvo, String tally_corp, String tallyman, UFDate tallydate) throws BusinessException { if (!isTogatherWithCMP(tally_corp)) { return; } RegisterVO headvo = (RegisterVO) billvo.getParentVO(); if (headvo.getSfflag().booleanValue()) { // 如果已付票则不记票据账 return; } SettlementBodyVO[] rvo = new SettlementBodyVO[1]; initSettlementBodyVO(rvo, headvo); CommonDAO commonDAO = new CommonDAO(); BaseinfoVO baseVO = commonDAO.queryBaseinfoByPK(headvo.getPk_baseinfo()); rvo[0].setPk_corp(tally_corp); rvo[0].setPk_currtype(baseVO.getPk_curr()); rvo[0].setTallydate(headvo.getInvoicedate()); rvo[0].setSigndate(headvo.getInvoicedate()); rvo[0].setFundformcode(CmpConst.BILL_DEPOSIT); rvo[0].setBilldate(headvo.getInvoicedate()); rvo[0].setReceive(baseVO.getMoneyy()); rvo[0].setFundsflag(CmpConst.CASH_FLOW_IN); rvo[0].setDirection(CmpConst.Direction_Receive); rvo[0].setPk_notetype(baseVO.getFbmbilltype()); // suzhzh 201106171021595038 回写票据号 rvo[0].setNotenumber(baseVO.getFbmbillno()); // add by ouyangzhb 2011-06-24 回写票据类型 rvo[0].setPk_notetype(baseVO.getFbmbilltype()); rvo[0].setTradertype(CmpConst.TradeObjType_Bank); rvo[0].setPk_trader(baseVO.getPaybank()); buildOppInfo(rvo[0]); rvo[0].setMemo(headvo.getNote()); rvo[0].setFracrate(headvo.getFrate()); // 辅币汇率 rvo[0].setLocalrate(headvo.getBrate()); // 本币汇率 fillCurrKeyValue(rvo[0]); getBankTallyService().writeBankacc(rvo); }
/** * 组装后台需要的RegisterVO * * @param param * @param oldVO * @return * @throws BusinessException */ private RegisterVO getNewVO(BusiActionParamVO<T> param) throws BusinessException { RegisterVO vo = new RegisterVO(); RegisterVO oldVO = param.getRegisterVO(); ReliefVO reliefVO = param.getSuperVO(); vo.setPk_baseinfo(param.getPk_baseinfo()); vo.setPk_billtypecode(FbmBusConstant.BILLTYPE_GATHER); vo.setGatherdate(param.getActiondate()); vo.setGathertype(FbmBusConstant.GATHER_TYPE_RELIEF); // 调剂来源 vo.setPk_source(param.getPk_bill()); // 来源单据:调剂出库单 vo.setPaybillunit( dao.queryCustByCorp(InvocationInfoProxy.getInstance().getCorpCode())); // 付票单位为当前登陆的公司 vo.setHoldunit(reliefVO.getReliefunit()); // 持票单位 vo.setMoneyy(oldVO.getMoneyy()); vo.setFrate(oldVO.getFrate()); vo.setBrate(oldVO.getBrate()); vo.setMoneyb(oldVO.getMoneyb()); vo.setMoneyf(oldVO.getMoneyf()); vo.setKeepunit( dao.queryCustByCorp(InvocationInfoProxy.getInstance().getCorpCode())); // 持票单位同付票单位,取中心 vo.setIsnewbill(UFBoolean.FALSE); vo.setSfflag(UFBoolean.FALSE); vo.setIsverify(UFBoolean.FALSE); vo.setNote(""); vo.setPk_corp(dao.queryCorpByCust(reliefVO.getReliefunit())); // 根据客商取公司 vo.setVbillno( new HYPubBO().getBillNo(FbmBusConstant.BILLTYPE_GATHER, vo.getPk_corp(), null, null)); /** ************************************************ */ vo.setSfflag(UFBoolean.TRUE); // 收付款标志,默认打上true /** ************************************************ */ vo.setVoperatorid(param.getActionperson()); vo.setDoperatedate(param.getActiondate()); vo.setVapproveid(param.getActionperson()); vo.setDapprovedate(param.getActiondate()); vo.setVapprovenote(""); return vo; }
/** * 核销减少票据账 * * @param billvo * @param tally_corp * @param tallyman * @param tallydate * @throws BusinessException */ public void addCMPBill4Destory( HYBillVO billvo, String tally_corp, String tallyman, UFDate tallydate) throws BusinessException { if (!isTogatherWithCMP(tally_corp)) { return; } RegisterVO headvo = (RegisterVO) billvo.getParentVO(); // 付票退票核销 ActionQueryDAO actionDAO = new ActionQueryDAO(); ActionVO newActionVO = actionDAO.queryNewestByPk_baseinfo(headvo.getPk_baseinfo(), headvo.getPk_corp()); if (newActionVO.getActioncode().equals(FbmActionConstant.AUDIT) && newActionVO.getBilltype().equals(FbmBusConstant.BILLTYPE_RETURN)) { // 如果没有在fbm_outer表里,说明付票没有走收付报,而是直接已付票打勾,返回 SuperVO[] outers = FBMProxy.getUifService() .queryByCondition( OuterVO.class, "isnull(dr,0)=0 and pk_billtypecode='36GL' and pk_busibill='" + headvo.getPrimaryKey() + "'"); if (outers == null || outers.length == 0) { return; } } else if (newActionVO.getActioncode().equals(FbmActionConstant.AUDIT) && newActionVO.getBilltype().equals(FbmBusConstant.BILLTYPE_GATHER)) { SuperVO[] outers = FBMProxy.getUifService() .queryByCondition( OuterVO.class, "isnull(dr,0)=0 and pk_billtypecode='36GA' and pk_busibill='" + newActionVO.getPk_source() + "'"); if (outers == null || outers.length == 0) { return; } } SettlementBodyVO[] rvo = new SettlementBodyVO[1]; initSettlementBodyVO(rvo, headvo); CommonDAO commonDAO = new CommonDAO(); BaseinfoVO baseVO = commonDAO.queryBaseinfoByPK(headvo.getPk_baseinfo()); rvo[0].setPk_corp(tally_corp); rvo[0].setPk_currtype(baseVO.getPk_curr()); rvo[0].setTallydate(tallydate); rvo[0].setSigndate(tallydate); rvo[0].setFundformcode(CmpConst.BILL_DEPOSIT); rvo[0].setBilldate(tallydate); rvo[0].setPay(baseVO.getMoneyy()); rvo[0].setFundsflag(CmpConst.CASH_FLOW_OUT); rvo[0].setDirection(CmpConst.Direction_Pay); rvo[0].setPk_notetype(baseVO.getFbmbilltype()); // suzhzh 201106171021595038 回写票据号 rvo[0].setNotenumber(baseVO.getFbmbillno()); // add by ouyangzhb 2011-06-24 回写票据类型 rvo[0].setPk_notetype(baseVO.getFbmbilltype()); rvo[0].setTradertype(CmpConst.TradeObjType_KeShang); // 对方为客商 rvo[0].setPk_trader(baseVO.getReceiveunit()); rvo[0].setPk_oppaccount(baseVO.getReceivebankacc()); buildOppInfo(rvo[0]); rvo[0].setMemo( nc.vo.ml.NCLangRes4VoTransl.getNCLangRes() .getStrByID("36201505", "UPP36201505-000006") /* @res"核销付票登记单开票业务"*/); rvo[0].setFracrate(headvo.getFrate()); // 辅币汇率 rvo[0].setLocalrate(headvo.getBrate()); // 本币汇率 fillCurrKeyValue(rvo[0]); getBankTallyService().writeBankacc(rvo); }
public void addCMPBank(HYBillVO billvo, String tally_corp, String tallyman, UFDate tallydate) throws BusinessException { if (!isTogatherWithCMP(tally_corp)) { return; } RegisterVO vo = (RegisterVO) billvo.getParentVO(); List<SettlementBodyVO> retList = new ArrayList<SettlementBodyVO>(); CommonDAO commonDAO = new CommonDAO(); BaseinfoVO baseVO = commonDAO.queryBaseinfoByPK(vo.getPk_baseinfo()); SettlementBodyVO rvo = new SettlementBodyVO(); rvo.setPk_corp(tally_corp); // 公司 rvo.setSystemcode(ProductInfo.pro_FBM); // 来源系统 rvo.setPk_bill(vo.getPrimaryKey()); // 业务单据主键 rvo.setBillcode(vo.getVbillno()); // 单据编号 rvo.setBilldate(vo.getInvoicedate()); // 业务日期取实际放款日期 rvo.setTallystatus(new Integer(CMPaccStatus.SUCCESSACCOUNT.getStatus())); // 记账状态,设置为结算成功日期 rvo.setTallydate(vo.getInvoicedate()); rvo.setSigndate(vo.getInvoicedate()); rvo.setFundformcode(CmpConst.BANK_DEPOSIT); // 银行存款 String selfAcc = baseVO.getPaybankacc(); UFDouble securitymoney = vo.getSecuritymoney() == null ? new UFDouble(0) : vo.getSecuritymoney(); rvo.setPay(vo.getPoundagemoney().add(securitymoney)); UFDouble securitymoneyf = vo.getSecuritymoneyf() == null ? new UFDouble(0) : vo.getSecuritymoneyf(); rvo.setPayfrac(vo.getPoundagemoneyf().add(securitymoneyf)); UFDouble securitymoneyb = vo.getSecuritymoneyb() == null ? new UFDouble(0) : vo.getSecuritymoneyb(); rvo.setPaylocal(vo.getPoundagemoneyb().add(securitymoneyb)); // rvo.setFundsflag(CmpConst.CASH_FLOW_OUT); // 资金流向(0 资金流入1 资金流出2 转账出) rvo.setDirection( CmpConst.Direction_Pay); // CmpConst.Direction_Receive=0收款;CmpConst.Direction_Receive=1付款; rvo.setPk_account(selfAcc); // 本方帐 rvo.setPk_currtype(baseVO.getPk_curr()); // 币种 rvo.setFracrate(vo.getFrate()); // 辅币汇率 rvo.setLocalrate(vo.getBrate()); // 本币汇率 rvo.setTradertype(CmpConst.TradeObjType_Bank); // 对方类型为银行 rvo.setPk_trader(baseVO.getPaybank()); // suzhzh 201106171021595038 回写票据号 rvo.setNotenumber(baseVO.getFbmbillno()); // add by ouyangzhb 2011-06-24 回写票据类型 rvo.setPk_notetype(baseVO.getFbmbilltype()); buildOppInfo(rvo); rvo.setPk_billtype(vo.getPk_billtypecode()); rvo.setMemo(vo.getNote()); retList.add(rvo); // 处理保证金 if (FbmBusConstant.ASSURETYPE_BAIL.equals(vo.getImpawnmode())) { BankaccbasVO bankaccvo = (BankaccbasVO) FBMProxy.getUAPQuery().retrieveByPK(BankaccbasVO.class, vo.getSecurityaccount()); SettlementBodyVO rvo1 = new SettlementBodyVO(); rvo1.setPk_corp(tally_corp); // 公司 rvo1.setSystemcode(ProductInfo.pro_FBM); // 来源系统 rvo1.setPk_bill(vo.getPrimaryKey()); // 业务单据主键 rvo1.setPk_account(bankaccvo.getPrimaryKey()); rvo1.setBillcode(vo.getVbillno()); // 单据编号 rvo1.setBilldate(vo.getInvoicedate()); // 业务日期取实际放款日期 rvo1.setTallydate(vo.getInvoicedate()); rvo1.setSigndate(vo.getInvoicedate()); rvo1.setTallystatus(new Integer(CMPaccStatus.SUCCESSACCOUNT.getStatus())); // 记账状态,设置为结算成功日期 rvo1.setFundformcode(1); // 银行存款 selfAcc = null; selfAcc = vo.getSecurityaccount(); rvo1.setReceive(vo.getSecuritymoney()); rvo1.setReceivefrac(vo.getSecuritymoneyf()); rvo1.setReceivelocal(vo.getSecuritymoneyb()); // rvo1.setFundsflag(CmpConst.CASH_FLOW_IN); // 资金流向(0 资金流入1 资金流出2 转账出) rvo1.setDirection( CmpConst .Direction_Receive); // CmpConst.Direction_Receive=0收款;CmpConst.Direction_Receive=1付款; rvo1.setPk_account(selfAcc); // 本方帐 rvo1.setPk_currtype(baseVO.getPk_curr()); // 币种 rvo1.setFracrate(vo.getFrate()); // 辅币汇率 rvo1.setLocalrate(vo.getBrate()); // 本币汇率 rvo1.setTradertype(CmpConst.TradeObjType_Bank); // 对方类型为银行 rvo1.setPk_trader(baseVO.getPaybank()); // suzhzh 201106171021595038 回写票据号 rvo1.setNotenumber(baseVO.getFbmbillno()); // add by ouyangzhb 2011-06-24 回写票据类型 rvo.setPk_notetype(baseVO.getFbmbilltype()); buildOppInfo(rvo1); rvo1.setPk_billtype(vo.getPk_billtypecode()); rvo1.setMemo(vo.getNote()); retList.add(rvo1); } getBankTallyService() .writeBankacc((SettlementBodyVO[]) retList.toArray(new SettlementBodyVO[0])); }