Exemplo n.º 1
0
  @Override
  protected String doCheck(BusiActionParamVO<T> param) throws BusinessException {
    String commonError = commonCheck(param);
    if (commonError != null) return commonError;

    ActionVO actionVO = param.getLastActionVO();
    // 校验票据动作
    if (!(actionVO.getActioncode().equals(FbmActionConstant.AUDIT)
        && actionVO.getBilltype().equals(FbmBusConstant.BILLTYPE_GATHER)
        && actionVO.getPk_bill().equals(param.getPk_bill()))) {
      return nc.vo.ml.NCLangRes4VoTransl.getNCLangRes()
              .getStrByID("fbmcomm", "UPPFBMComm-000239") /* @res"票据"*/
          + param.getBaseinfoVO().getFbmbillno()
          + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes()
              .getStrByID("fbmcomm", "UPPFBMComm-000263") /* @res"的前一操作必须是审核收票登记单。"*/
          + BusiMessageTranslator.translateAction(param);
    }
    return null;
  }
Exemplo n.º 2
0
  /**
   * 核销减少票据账
   *
   * @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);
  }