Browse Source

[fix]财务管理 销售管理

修改销售订单开票 新增填充国税发票历史数据
修改销售订单开票前页面:修改报价币种的展示组件;新增开票金额由开票额度比例动态输入和含税总价动态计算得到;调整开票历史前端列表展示
dev
liuxiaoxu 3 months ago
parent
commit
856f7d00d2
  1. 22
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java
  2. 71
      ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html

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

@ -7,7 +7,9 @@ import java.util.List;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory;
import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial; import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial;
import com.ruoyi.financial.mapper.FinancialTaxInvoiceHistoryMapper;
import com.ruoyi.financial.mapper.FinancialTaxInvoiceMaterialMapper; import com.ruoyi.financial.mapper.FinancialTaxInvoiceMaterialMapper;
import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService; import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService;
import com.ruoyi.system.domain.SysCustomerVo; import com.ruoyi.system.domain.SysCustomerVo;
@ -39,6 +41,9 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
@Autowired @Autowired
private IFinancialTaxInvoiceMaterialService invoiceMaterialService; private IFinancialTaxInvoiceMaterialService invoiceMaterialService;
@Autowired
private FinancialTaxInvoiceHistoryMapper invoiceHistoryMapper;
@Autowired @Autowired
private SysCustomerMapper sysCustomerMapper; private SysCustomerMapper sysCustomerMapper;
@ -201,6 +206,7 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
financialTaxInvoice.setApplyUser(loginName); financialTaxInvoice.setApplyUser(loginName);
financialTaxInvoice.setBusinessMembers(loginName); financialTaxInvoice.setBusinessMembers(loginName);
//填充国税发票物料数据
List<FinancialTaxInvoiceMaterial> invoiceMaterialList = financialTaxInvoice.getInvoiceMaterialList(); List<FinancialTaxInvoiceMaterial> invoiceMaterialList = financialTaxInvoice.getInvoiceMaterialList();
invoiceMaterialList.parallelStream().forEach(invoiceMaterial -> { invoiceMaterialList.parallelStream().forEach(invoiceMaterial -> {
invoiceMaterial.setTaxInvoiceCode(taxInvoiceCode); invoiceMaterial.setTaxInvoiceCode(taxInvoiceCode);
@ -209,6 +215,22 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
invoiceMaterial.setCreateTime(new Date()); invoiceMaterial.setCreateTime(new Date());
}); });
invoiceMaterialMapper.insertFinancialTaxInvoiceMaterialBatch(invoiceMaterialList); invoiceMaterialMapper.insertFinancialTaxInvoiceMaterialBatch(invoiceMaterialList);
//填充国税发票历史数据
FinancialTaxInvoiceHistory financialTaxInvoiceHistory = new FinancialTaxInvoiceHistory();
financialTaxInvoiceHistory.setTaxInvoiceCode(taxInvoiceCode);
financialTaxInvoiceHistory.setSalesOrderCode(financialTaxInvoice.getSalesOrderCode());
financialTaxInvoiceHistory.setInvoiceAmountRmb(financialTaxInvoice.getInvoiceAmountRmb());
//financialTaxInvoiceHistory.setInvoiceAmountUsd(financialTaxInvoice.getInvoiceAmountUsd());
financialTaxInvoiceHistory.setInvoicePurpose(financialTaxInvoice.getInvoicePurpose());
financialTaxInvoiceHistory.setInvoiceQuotaRatio(financialTaxInvoice.getInvoiceQuotaRatio());
financialTaxInvoiceHistory.setTaxInvoiceStatus("0");//待审核
financialTaxInvoiceHistory.setApplyTime(new Date());
financialTaxInvoiceHistory.setCreateBy(loginName);
financialTaxInvoiceHistory.setCreateTime(new Date());
invoiceHistoryMapper.insertFinancialTaxInvoiceHistory(financialTaxInvoiceHistory);
return financialTaxInvoiceMapper.insertFinancialTaxInvoice(financialTaxInvoice); return financialTaxInvoiceMapper.insertFinancialTaxInvoice(financialTaxInvoice);
} }
} }

71
ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html

@ -25,13 +25,15 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-5 control-label">报价币种:</label> <label class="col-sm-5 control-label">报价币种:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_common_currency')}"> <select name="commonCurrency" class="form-control m-b" th:with="type=${@dict.getType('sys_common_currency')}" readonly>
<input type="radio" th:id="${'commonCurrency_' + dict.dictCode}" name="commonCurrency" th:value="${dict.dictValue}" th:field="*{commonCurrency}" readonly> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{commonCurrency}"></option>
<label th:for="${'commonCurrency_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> </select>
</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-5 control-label">客户代码/ID:</label> <label class="col-sm-5 control-label">客户代码/ID:</label>
<div class="col-sm-7"> <div class="col-sm-7">
@ -174,7 +176,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-5 control-label">含税总价(RMB):</label> <label class="col-sm-5 control-label">含税总价(RMB):</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input name="rmbTaxSum" th:field="*{rmbTaxSum}" class="form-control" type="text" readonly> <input name="rmbTaxSum" th:field="*{rmbTaxSum}" class="form-control" type="text" id="rmbTaxSumInput" readonly>
</div> </div>
</div> </div>
@ -194,7 +196,7 @@
<label class="col-sm-5 control-label">开票额度比例:</label> <label class="col-sm-5 control-label">开票额度比例:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<div class="input-group"> <div class="input-group">
<input name="invoiceQuotaRatio" th:field="*{invoiceQuotaRatio}" class="form-control" type="text"> <input name="invoiceQuotaRatio" th:field="*{invoiceQuotaRatio}" class="form-control" type="text" id="invoiceQuotaRatioInput">
<span class="input-group-addon">%</span> <span class="input-group-addon">%</span>
</div> </div>
</div> </div>
@ -203,7 +205,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-5 control-label">开票金额(RMB):</label> <label class="col-sm-5 control-label">开票金额(RMB):</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input name="invoiceAmountUsd" th:field="*{invoiceAmountUsd}" class="form-control" type="text"> <input name="invoiceAmountRmb" th:field="*{invoiceAmountRmb}" class="form-control" type="text" id="invoiceAmountRmbInput" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -213,9 +215,6 @@
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
@ -389,24 +388,13 @@
field: 'invoiceHistoryId', field: 'invoiceHistoryId',
visible: false visible: false
}, },
{
title: '国税发票单号',
field: 'taxInvoiceCode',
},
{
title: '发票状态', //(0待审核、1待开具、2已开具、3审核拒绝)
field: 'taxInvoiceStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(taxInvoiceStatusDatas, value);
}
},
{ {
title: '申请时间', title: '申请时间',
field: 'applyTime', field: 'applyTime',
}, },
{ {
title: '财务员', title: '国税发票单号',
field: 'financeMembers', field: 'taxInvoiceCode',
}, },
{ {
title: '开票额度比例', title: '开票额度比例',
@ -416,16 +404,28 @@
title: '开票金额(RMB)', title: '开票金额(RMB)',
field: 'invoiceAmountRmb', field: 'invoiceAmountRmb',
}, },
{ {
title: '开票用途', title: '开票用途',
field: 'invoicePurpose', field: 'invoicePurpose',
}, },
{
title: '发票状态', //(0待审核、1待开具、2已开具、3审核拒绝)
field: 'taxInvoiceStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(taxInvoiceStatusDatas, value);
}
},
{
title: '财务员',
field: 'financeMembers',
},
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.invoiceHistoryId + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.edit(\'' + row.invoiceHistoryId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join(''); return actions.join('');
} }
}] }]
@ -528,6 +528,29 @@
} }
//通过监听额度比例输入框的值,动态计算开票金额
$(document).ready(function() {
var invoiceAmountRmbInput = $('#invoiceAmountRmbInput');
var invoiceQuotaRatioInput = $('#invoiceQuotaRatioInput');
var rmbTaxSumInput = $('#rmbTaxSumInput');
//监听开票额度比例输入框的变化
invoiceQuotaRatioInput.on('input', function() {
var rmbTaxSum = parseFloat(rmbTaxSumInput.val());
var invoiceQuotaRatio = parseFloat($(this).val());
if (!isNaN(rmbTaxSum) && !isNaN(invoiceQuotaRatio)) {
//计算开票金额 = 税前总额 * 开票比例
var invoiceAmountRmb = rmbTaxSum * (invoiceQuotaRatio / 100);
//更新开票金额输入框
invoiceAmountRmbInput.val(invoiceAmountRmb.toFixed(2));
} else {
invoiceAmountRmbInput.val('');
}
});
});
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save