From 856f7d00d29db842ce696b6bcee023a97c79240a Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 14 Aug 2024 10:40:15 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=BC=80=E7=A5=A8=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A1=AB=E5=85=85=E5=9B=BD=E7=A8=8E=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=BC=80=E7=A5=A8?= =?UTF-8?q?=E5=89=8D=E9=A1=B5=E9=9D=A2=EF=BC=9A=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E5=B8=81=E7=A7=8D=E7=9A=84=E5=B1=95=E7=A4=BA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=9B=E6=96=B0=E5=A2=9E=E5=BC=80=E7=A5=A8=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E7=94=B1=E5=BC=80=E7=A5=A8=E9=A2=9D=E5=BA=A6=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E5=8A=A8=E6=80=81=E8=BE=93=E5=85=A5=E5=92=8C=E5=90=AB?= =?UTF-8?q?=E7=A8=8E=E6=80=BB=E4=BB=B7=E5=8A=A8=E6=80=81=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=BE=97=E5=88=B0=EF=BC=9B=E8=B0=83=E6=95=B4=E5=BC=80=E7=A5=A8?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E5=89=8D=E7=AB=AF=E5=88=97=E8=A1=A8=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FinancialTaxInvoiceServiceImpl.java | 22 ++++++ .../system/salesOrder/makeInvoiceRMB.html | 71 ++++++++++++------- 2 files changed, 69 insertions(+), 24 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java index 12abd152..76a656bd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java +++ b/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.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial; +import com.ruoyi.financial.mapper.FinancialTaxInvoiceHistoryMapper; import com.ruoyi.financial.mapper.FinancialTaxInvoiceMaterialMapper; import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService; import com.ruoyi.system.domain.SysCustomerVo; @@ -39,6 +41,9 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi @Autowired private IFinancialTaxInvoiceMaterialService invoiceMaterialService; + @Autowired + private FinancialTaxInvoiceHistoryMapper invoiceHistoryMapper; + @Autowired private SysCustomerMapper sysCustomerMapper; @@ -201,6 +206,7 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi financialTaxInvoice.setApplyUser(loginName); financialTaxInvoice.setBusinessMembers(loginName); + //填充国税发票物料数据 List invoiceMaterialList = financialTaxInvoice.getInvoiceMaterialList(); invoiceMaterialList.parallelStream().forEach(invoiceMaterial -> { invoiceMaterial.setTaxInvoiceCode(taxInvoiceCode); @@ -209,6 +215,22 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi invoiceMaterial.setCreateTime(new Date()); }); 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); } } diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html index 34a57450..3115902b 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html @@ -25,13 +25,15 @@
-
- - -
+
+ + +
@@ -174,7 +176,7 @@
- +
@@ -194,7 +196,7 @@
- + %
@@ -203,7 +205,7 @@
- +
@@ -213,9 +215,6 @@
- - -
@@ -389,24 +388,13 @@ field: 'invoiceHistoryId', visible: false }, - { - title: '国税发票单号', - field: 'taxInvoiceCode', - }, - { - title: '发票状态', //(0待审核、1待开具、2已开具、3审核拒绝) - field: 'taxInvoiceStatus', - formatter: function(value, row, index) { - return $.table.selectDictLabel(taxInvoiceStatusDatas, value); - } - }, { title: '申请时间', field: 'applyTime', }, { - title: '财务员', - field: 'financeMembers', + title: '国税发票单号', + field: 'taxInvoiceCode', }, { title: '开票额度比例', @@ -416,16 +404,28 @@ title: '开票金额(RMB)', field: 'invoiceAmountRmb', }, + { title: '开票用途', field: 'invoicePurpose', }, + { + title: '发票状态', //(0待审核、1待开具、2已开具、3审核拒绝) + field: 'taxInvoiceStatus', + formatter: function(value, row, index) { + return $.table.selectDictLabel(taxInvoiceStatusDatas, value); + } + }, + { + title: '财务员', + field: 'financeMembers', + }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); + actions.push('详情 '); 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(''); + } + }); + }); + \ No newline at end of file