会计分录处理方式(会计分录讲解)

时间:2023/4/17 16:43:50 编辑:福途教育 标签:会计师

榜单说明:福途教育网榜单是基于互联网大数据统计及人为根据市场和参数条件变化的分析而得出本站站内排序,排名不分先后,仅供参考。

2024年【会计师】申请条件/费用/专业咨询 >>

会计师申请条件是什么?会计师费用是多少?会计师专业都有哪些?

点击咨询

    本文解答了关于《会计分录处理方式》相关内容,同时关于1、会计分录处理方式有哪些,2、会计分录处理方式有哪几种,3、会计分录怎么处理,4、的会计分录,5、会计分录讲解,的相关问答本篇文章福途教育网小编也整理了进来,希望对您有帮助。

    会计分录处理方式(会计分录讲解)

    会计分录处理方式

    List tFinanceDocumentEntrieList = financeDocumentEntriesService.selectByExample(new FinanceDocumentEntriesExample());//根据公司id生成凭证

    if (tFinanceDocumentEntrieList.size()<1){

    log.error("没有找到该路径的会计分录处理方式!请先去设置会计分录处理!");

    //用自增长id代替会计分录id(Tommy,2018-8-31)

    //throw new BusinessException("没有找到该路径的会计分录处理方式!请先去设置会计分录处理!");

    }

    List tFinanceDocumentEntrieListNew = new ArrayList();

    int i = 0;

    for (FinanceDocumentEntries tFinanceDocumentEntries : tFinanceDocumentEntrieList){

    if (tFinanceDocumentEntries.getUnitId() == Long.parseLong(unitId)){

    if (i < 10){

    tFinanceDocumentEntrieListNew.add(tFinanceDocumentEntries);

    i++;

    }

    }

    }

    int sum = 0;

    BigDecimal tDebitMoneySum = new BigDecimal(0);

    BigDecimal tCreditMoneySum = new BigDecimal(0);

    for (int j=0;j

    //根据会计分录处理id找会计科目id(Tommy,2018-8-31)

    Optional financeSubject = financeSubjectIDMapper.selectByUnitIdAndFinanceSub(String.valueOf( unitId ), Long.parseLong(String.valueOf(tFinanceDocumentEntrieListNew.get(j).getId())));

    //会计分录处理映射表中的accountId

    FinanceSubjectIDMapperExample example = new FinanceSubjectIDMapperExample();

    FinanceSubjectIDMapperExample.Criteria criteria = example.createCriteria();

    if (financeSubject.toString() != "[]"){

    criteria.andFinanceSubIdEqualTo(String.valueOf(tFinanceDocumentEntrieListNew.get(j).getId()));

    criteria.andUnitIdEqualTo(String.valueOf(unitId));

    List financeSubjectIDMapperList = financeSubjectIDMapperService.selectByExample(example);

    if (financeSubjectIDMapperList.size()>0){

    FinanceVoucherSummary financeVoucherSummary = financeVoucherSummaryMapper.selectByDebitIdAndCreditId(financeSubjectIDMapperList.get(0).getAccountId(),tFinanceDocumentEntrieListNew.get(j).getDebitSubjectId(), financeSubjectIDMapperList.get(0).getAccountId(),tFinanceDocumentEntrieListNew.get(j).getCreditSubjectId());

    //根据科目id和公司id查balanceid

    if (financeVoucherSummary != null){

    tDebitMoneySum = tDebitMoneySum.add(financeVoucherSummary.getDebitMoney());

    tCreditMoneySum = tCreditMoneySum.add(financeVoucherSummary.getCreditMoney());

    }

    }

    }

    }

    //函数调用判断会计分录是否平衡

    BigDecimal a = Arith.compare(tDebitMoneySum, tCreditMoneySum);

    if (a.doubleValue() != 0.0){

    throw new BusinessException("科目余额为不平,请检查会计分录是否正确!");

    }

    }

    /**

    * 根据id获取并修改凭证

    * @param request

    * @return

    * @throws Exception

    */

    @RequestMapping(value = "/getFinanceVoucherById", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")

    public String getFinanceVoucherById(HttpServletRequest request) throws Exception {

    Map map = new HashMap();

    String message = "1";

    String id = request.getParameter("id");

    AuthPlatformUserInfo userInfo = userInfoUtils.getSimpleUserInfo(request);

    if (userInfo == null) {

    return "2";

    }

    String companyId = request.getParameter("companyId");

    String month = request.getParameter("month");

    if (StringUtils.isNotBlank(id)) {

    FinanceVoucherExample example = new FinanceVoucherExample();

    FinanceVoucherExample.Criteria criteria = example.createCriteria();

    criteria.andIdEqualTo(Long.parseLong(id));

    FinanceVoucher financeVoucher = financeVoucherMapper.selectByExample(example).get(0);

    month = financeVoucher.getVoucherYearAndMonth();

    companyId = String.valueOf(financeVoucher.getUnitId());

    financeVoucher.setUpdateUser(userInfo.getName());

    financeVoucherMapper.updateByPrimaryKey(financeVoucher);

    //根据凭证id查询凭证明细

    List financeVoucherDetailList = financeVoucherDetailMapper.selectByVoucherId(Long.parseLong(id));

    map.put("financeVoucherDetailList",financeVoucherDetailList);

    if (id.length() > 0){

    //根据凭证明细id查凭证摘要

    List financeVoucherSummaryList = financeVoucherSummaryMapper.selectByVoucherDetailId(Long.parseLong(id));

    map.put("financeVoucherSummaryList", financeVoucherSummaryList);

    }

    }

    //根据选择的月查询该月的所有凭证

    FinanceVoucherExample financeVoucherExample = new FinanceVoucherExample();

    FinanceVoucherExample.Criteria financeVoucherCriteria = financeVoucherExample.createCriteria();

    financeVoucherCriteria.andVoucherYearAndMonthEqualTo(String.valueOf(month)).andUnitIdEqualTo(Long.parseLong(companyId));

    List financeVoucherList = financeVoucherMapper.selectByExample(financeVoucherExample);

    //排序排到最后

    BookkeepingMode bookkeepingMode = new BookkeepingMode();

    List financeVoucherListNew = bookkeepingMode.getSortVoucherList(financeVoucherList);

    List financeVoucherListNew1 = new ArrayList();

    if (financeVoucherListNew.size() >0) {

    financeVoucherListNew1 = financeVoucherListNew.subList(0, financeVoucherListNew.size() - 1);

    } else {

    financeVoucherListNew1 = financeVoucherListNew;

    }

    map.put("financeVoucherList",financeVoucherListNew1);

    message = WebUtil.getContent(map);

    return message;

    }

    /**

    * 根据凭证id修改凭证状态

    * @param request

    * @return

    * @throws Exception

    */

    @RequestMapping(value = "/updateFinanceVoucherStatus", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")

    public String updateFinanceVoucherStatus(HttpServletRequest request) throws Exception {

    String message = "1";

    String id = request.getParameter("voucherId");

    if (id.length()>0){

    AuthPlatformUserInfo userInfo = userInfoUtils.getSimpleUserInfo(request);

    if (userInfo == null) {

    return "2";

    }

    FinanceVoucher financeVoucher = new FinanceVoucher();

    financeVoucher.setId(Long.parseLong(id));

    financeVoucher.setCheckStatus((byte) 1);

    financeVoucher.setCheckUser(userInfo.getName());

    financeVoucherMapper.updateByPrimaryKeySelective(financeVoucher);

    }

    return message;

    }

    }

    总结:以上是编辑:【麦穗】整理及AI智能原创关于《

    会计分录处理方式

    》优质内容解答希望能帮助到您。
了解 【会计师】更多资讯
以上手机版 会计分录处理方式(会计分录讲解) 小编为您整理会计分录处理方式(会计分录讲解)的全部内容,以上内容仅供参考。
上一篇:二建继续教育考几门考试难不难(二建继续教育考几门考试难不难呢)
下一篇:2023二级造价工程师需要几年考完(小白考二级造价工程师难度大吗)

热门推荐

最新文章