| | |
| | | if (ObjUtil.isNotNull(subjectMatter)) { |
| | | advanceAmount = advanceAmount.add(contractOutBoundInvoiceVo.getInvoiceNum().multiply(subjectMatter.getUnitPrice())); |
| | | } |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || |
| | | ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { |
| | | return R.failed("请在产品信息中补充税收分类信息"); |
| | | } |
| | | } else { |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode()) |
| | | .eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1")); |
| | | if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { |
| | | return R.failed("请在产品信息中补充税收分类信息"); |
| | | } |
| | | } |
| | | } |
| | | log.info("advanceAmount:{}", advanceAmount); |
| | | log.info("schedule.getPlannedAmount:{}", schedule.getPlannedAmount()); |
| | |
| | | BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId()); |
| | | if (ObjUtil.isNull(customer)) { |
| | | return R.failed("获取购方单位异常"); |
| | | } |
| | | for (ContractOutBoundInvoiceVo contractOutBoundInvoiceVo : genInvoiceInfoDTO.getOutBoundInvoiceList()) { |
| | | ContractOutBound contractOutBound = contractOutBoundMapper.selectById(contractOutBoundInvoiceVo.getContractOutBoundId()); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || |
| | | ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { |
| | | return R.failed("请在产品信息中补充税收分类信息"); |
| | | } |
| | | } else { |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) |
| | | .eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1")); |
| | | if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { |
| | | return R.failed("请在产品信息中补充税收分类信息"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | //机动车开票 |
| | | if (StrUtil.equals(genInvoiceInfoDTO.getInvoiceType(), "4")) { |
| | |
| | | if (ObjUtil.isNull(customer)) { |
| | | return R.failed("获取购方单位异常"); |
| | | } |
| | | for (ContractOutBoundInvoiceVo contractOutBoundInvoiceVo : mergeInvoiceDTO.getOutBoundInvoiceList()) { |
| | | ContractOutBound contractOutBound = contractOutBoundMapper.selectById(contractOutBoundInvoiceVo.getContractOutBoundId()); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjsc); |
| | | smjList.add(smjzt); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || |
| | | ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) |
| | | .in(Product::getCompId, smjList).last("limit 1")); |
| | | if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { |
| | | return R.failed("请在产品信息中补充税收分类信息"); |
| | | } |
| | | } else { |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) |
| | | .eq(Product::getCompId, SecurityUtils.getUser().getCompId()).last("limit 1")); |
| | | if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { |
| | | return R.failed("请在产品信息中补充税收分类信息"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | GenInvoiceInfoVo vo = genMergeInvoiceVo(mergeInvoiceDTO, customer, b); |
| | | vo = transBipVo(vo, b, customer); |
| | | return R.ok(vo); |
| | |
| | | item.put("taxRate", invoiceItemVo.getTaxRate()); |
| | | item.put("oriTaxAmount", invoiceItemVo.getPriceTax()); |
| | | item.put("oriTaxIncludedAmount", invoiceItemVo.getPriceAndTax()); |
| | | item.put("remarks", invoiceItemVo.getZy());//摘要 |
| | | item.put("_status", "Insert"); |
| | | JSONObject freeChId = new JSONObject(); |
| | | freeChId.put("GX08", invoiceItemVo.getHsdy());//核算单元 |
| | | freeChId.put("YSYF14", "2");//款项类型 1 预收款 2 应收款 |
| | | freeChId.put("YSYF31", invoiceItemVo.getSfjs());//是否计税 |
| | | freeChId.put("JT04", invoiceItemVo.getHsjylx());//核算交易类型 0101 集团外部 01020301 三级分子公司间 01020302 三级分公司与子子公司之间 |
| | | freeChId.put("JT06", invoiceItemVo.getKxmx());//款项明细 |
| | | freeChId.put("JT32", invoiceItemVo.getZyys());//作业要素 |
| | | freeChId.put("zzbkfl", invoiceItemVo.getBkfl());//板块分类 |
| | | freeChId.put("JT12", invoiceItemVo.getCpwlfl());//产品物料分类 |
| | | |
| | | item.put("freeChId", freeChId); |
| | | bodyItem.add(item); |
| | | } |
| | |
| | | baseMapper.updateById(contractInvoice); |
| | | return R.ok(); |
| | | } |
| | | return R.failed(resultJson, "应收发票集成失败"); |
| | | return R.failed(result); |
| | | } |
| | | //红票 |
| | | if (StrUtil.equals(contractInvoice.getInvoiceCategory(), "2")) { |
| | |
| | | baseMapper.updateById(contractInvoice); |
| | | return R.ok(); |
| | | } |
| | | return R.failed(resultJson, "应收发票删除失败"); |
| | | return R.failed(result); |
| | | } |
| | | return R.ok(); |
| | | } |