Browse Source

[feat]财务管理

修改审核国税发票-国内 国税发票物料列表数据:去掉两个美元字段;
新增 审核国税发票-国外前端列表页面:按照prd进行创建;新增查询国税发票物料前端列表js方法
新增 根据发票编号查询发票历史记录后端接口
修改 审核国税发票 后端接口:多表操作新增事务,新增审核通过和拒绝关联到国税发票记录表,同时进行修改操作
dev
liuxiaoxu 3 months ago
parent
commit
4eda27ee7b
  1. 8
      ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java
  2. 35
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java
  3. 5
      ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml
  4. 8
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html
  5. 337
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSD.html

8
ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java

@ -82,4 +82,12 @@ public interface FinancialTaxInvoiceHistoryMapper
* @return 结果 * @return 结果
*/ */
List<FinancialTaxInvoiceHistory> selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode); List<FinancialTaxInvoiceHistory> selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode);
/**
* 根据发票编号查询发票历史记录
*
* @param taxInvoiceCode 发票编号
* @return 结果
*/
FinancialTaxInvoiceHistory selectInvoiceHistoryByInvoiceCode(String taxInvoiceCode);
} }

35
ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java

@ -53,6 +53,7 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
/** /**
* 查询国税发票 * 查询国税发票
* *
@ -263,15 +264,31 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
/** /**
* 审核国税发票 * 审核国税发票
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice,String taxInvoiceStatus) { public int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice, String taxInvoiceStatus) {
if ("1".equals(taxInvoiceStatus)){ String loginName = ShiroUtils.getLoginName();
//审核通过 String taxInvoiceCode = financialTaxInvoice.getTaxInvoiceCode();
financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus); FinancialTaxInvoiceHistory invoiceHistory = invoiceHistoryMapper.selectInvoiceHistoryByInvoiceCode(taxInvoiceCode);
return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice); invoiceHistory.setUpdateTime(new Date());
}else { invoiceHistory.setUpdateBy(loginName);
financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus);
return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice); financialTaxInvoice.setUpdateTime(new Date());
} financialTaxInvoice.setUpdateBy(loginName);
if ("1".equals(taxInvoiceStatus)) {
//审核通过
invoiceHistory.setTaxInvoiceStatus(taxInvoiceStatus);
invoiceHistoryMapper.updateFinancialTaxInvoiceHistory(invoiceHistory);
financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus);
return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice);
} else {
//审核拒绝
invoiceHistory.setTaxInvoiceStatus(taxInvoiceStatus);
invoiceHistoryMapper.updateFinancialTaxInvoiceHistory(invoiceHistory);
financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus);
return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice);
}
} }
} }

5
ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml

@ -44,6 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where sales_order_code = #{salesOrderCode} where sales_order_code = #{salesOrderCode}
</select> </select>
<select id="selectInvoiceHistoryByInvoiceCode" parameterType="String" resultMap="FinancialTaxInvoiceHistoryResult">
<include refid="selectFinancialTaxInvoiceHistoryVo"/>
where tax_invoice_code = #{taxInvoiceCode}
</select>
<insert id="insertFinancialTaxInvoiceHistory" parameterType="FinancialTaxInvoiceHistory" useGeneratedKeys="true" keyProperty="invoiceHistoryId"> <insert id="insertFinancialTaxInvoiceHistory" parameterType="FinancialTaxInvoiceHistory" useGeneratedKeys="true" keyProperty="invoiceHistoryId">
insert into financial_tax_invoice_history insert into financial_tax_invoice_history
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

8
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html

@ -314,14 +314,6 @@
title: '物料的不含税单价(RMB)', title: '物料的不含税单价(RMB)',
field: 'noTaxRmb', field: 'noTaxRmb',
}, },
{
title: '物料的含税单价(美元)',
field: 'taxUsd',
},
{
title: '物料的不含税单价(美元)',
field: 'noTaxUsd',
},
{ {
title: '已出库数量', title: '已出库数量',
field: 'outBoundQuantity', field: 'outBoundQuantity',

337
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSD.html

@ -0,0 +1,337 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('审核国税发票')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-taxInvoice-auditRmb" th:object="${taxInvoice}">
<input name="taxInvoiceId" th:field="*{taxInvoiceId}" type="hidden">
<div class="form-group">
<label class="col-sm-5 control-label">发票单号:</label>
<div class="col-sm-7">
<input name="taxInvoiceCode" th:field="*{taxInvoiceCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">销售订单编号:</label>
<div class="col-sm-7">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">订单类型:</label>
<div class="col-sm-7">
<select name="salesOrderType" class="form-control m-b" th:with="type=${@dict.getType('sys_order_type')}" readonly>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{salesOrderType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">报价币种:</label>
<div class="col-sm-7">
<select name="commonCurrency" class="form-control m-b" th:with="type=${@dict.getType('sys_common_currency')}" readonly>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{commonCurrency}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">客户代码/ID:</label>
<div class="col-sm-7">
<input name="enterpriseCode" th:field="*{enterpriseCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">客户名称:</label>
<div class="col-sm-7">
<input name="enterpriseName" th:field="*{enterpriseName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">联系电话:</label>
<div class="col-sm-7">
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">公司地址:</label>
<div class="col-sm-7">
<input name="enterpriseAddress" th:field="*{enterpriseAddress}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票公司名称:</label>
<div class="col-sm-7">
<input name="invoiceCompanyName" th:field="*{invoiceCompanyName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票公司税号:</label>
<div class="col-sm-7">
<input name="invoiceCompanyCode" th:field="*{invoiceCompanyCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">公司开户行:</label>
<div class="col-sm-7">
<input name="depositBank" th:field="*{depositBank}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">公司开户账号:</label>
<div class="col-sm-7">
<input name="bankAccount" th:field="*{bankAccount}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">税率:</label>
<div class="col-sm-7">
<div class="input-group">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text" readonly>
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required" >发票种类:</label>
<div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_class')}">
<input type="radio" th:id="${'taxInvoiceClass_' + dict.dictCode}" name="taxInvoiceClass" th:value="${dict.dictValue}" th:field="*{taxInvoiceClass}" disabled>
<label th:for="${'taxInvoiceClass_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">发票类型:</label>
<div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_type')}">
<input type="radio" th:id="${'taxInvoiceType_' + dict.dictCode}" name="taxInvoiceType" th:value="${dict.dictValue}" th:field="*{taxInvoiceType}" disabled>
<label th:for="${'taxInvoiceType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">发票抬头:</label>
<div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_title')}">
<input type="radio" th:id="${'taxInvoiceTitle_' + dict.dictCode}" name="taxInvoiceTitle" th:value="${dict.dictValue}" th:field="*{taxInvoiceTitle}" disabled>
<label th:for="${'taxInvoiceTitle_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">邮箱:</label>
<div class="col-sm-7">
<input name="invoiceEmail" th:field="*{invoiceEmail}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">业务备注:</label>
<div class="col-sm-7">
<input name="businessRemark" th:field="*{businessRemark}" class="form-control" type="text" readonly>
</div>
</div>
<div class="container">
<div class="row">
<h4 class="font-weight-bold">开票物料</h4>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-material"></table>
</div>
</div>
</div>
<div class="container">
<div class="row">
<h4 class="font-weight-bold">开票额度</h4>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">不含税总价(美元):</label>
<div class="col-sm-7">
<input name="noUsdSum" th:field="*{noUsdSum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">含税总价(美元):</label>
<div class="col-sm-7">
<input name="usdTaxSum" th:field="*{usdTaxSum}" class="form-control" type="text" id="usdTaxSumInput" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">物料数合计:</label>
<div class="col-sm-7">
<input name="materialSum" th:field="*{materialSum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">数量合计:</label>
<div class="col-sm-7">
<input name="enterpriseSum" th:field="*{enterpriseSum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票额度比例:</label>
<div class="col-sm-7">
<div class="input-group">
<input name="invoiceQuotaRatio" th:field="*{invoiceQuotaRatio}" class="form-control" type="text" id="invoiceQuotaRatioInput" readonly>
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票金额(美元):</label>
<div class="col-sm-7">
<input name="invoiceAmountUsd" th:field="*{invoiceAmountUsd}" class="form-control" type="text" id="invoiceAmountUsdInput" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票用途:</label>
<div class="col-sm-7">
<input name="invoicePurpose" th:field="*{invoicePurpose}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">备注:</label>
<div class="col-sm-7">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var materialProcessMethodDatas = [[${@dict.getType('processMethod')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var taxInvoiceStatusDatas = [[${@dict.getType('tax_invoice_status')}]];
var taxInvoice = [[${taxInvoice}]];
var prefix = ctx + "financial/taxInvoice";
$("#form-taxInvoice-auditRmb").validate({
focusCleanup: true
});
// function submitHandler() {
//
//
// $.operate.save(prefix + "/auditRmb", $('#form-taxInvoice-auditRmb').serialize());
// }
//开票物料
$(function() {
var options = {
id: 'bootstrap-table-material',
url: prefix + "/getInvoiceMaterialListByCode",
queryParams: function(params) {
return {
taxInvoiceCode: $("#taxInvoiceCode").val(),
}
},
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
modalName: "国税发票物料",
columns: [{
checkbox: true
},
{
title: '国税发票物料ID',
field: 'invoiceMaterialId',
visible: false
},
{
title: '物料编号',
field: 'materialCode',
},
{
title: '物料名称',
field: 'materialName',
},
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
title: '物料加工方式',
field: 'materialProcessMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(materialProcessMethodDatas, value);
}
},
{
title: '物料品牌',
field: 'materialBrand',
},
{
title: '物料图片',
field: 'materialPhotourl',
},
{
title: '物料单位',
field: 'materialUnit',
},
{
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料的数量',
field: 'materialNum',
},
{
title: '物料的含税单价(美元)',
field: 'taxUsd',
},
{
title: '物料的不含税单价(美元)',
field: 'noTaxUsd',
},
{
title: '已出库数量',
field: 'outBoundQuantity',
},
{
title: '已验收数',
field: 'hasCheckNum',
},
{
title: '退货数',
field: 'refundsNum',
}]
};
$.table.init(options);
});
</script>
</body>
</html>
Loading…
Cancel
Save