Exemplo n.º 1
0
  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);
  }
Exemplo n.º 2
0
  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]));
  }