Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 3 months ago
parent
commit
fbac0fa873
  1. 14
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNotice.java
  2. 18
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNoticeDetail.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java
  5. 4
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java
  6. 102
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java
  7. 57
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java
  8. 57
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java
  9. 37
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java
  10. 197
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoiceHistory.java
  11. 93
      ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java
  12. 8
      ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceMaterialMapper.java
  13. 82
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java
  14. 7
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceMaterialService.java
  15. 5
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceService.java
  16. 140
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java
  17. 13
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceMaterialServiceImpl.java
  18. 90
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java
  19. 26
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java
  20. 13
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java
  21. 19
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/exportDto/SysCustomerDto.java
  22. 5
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java
  23. BIN
      ruoyi-admin/src/main/resources/FinancialReceiptVoucherTemplate.xlsx
  24. 1
      ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml
  25. 134
      ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml
  26. 14
      ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml
  27. 7
      ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMaterialMapper.xml
  28. 5
      ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml
  29. 39
      ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/add.html
  30. 12
      ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/edit.html
  31. 160
      ruoyi-admin/src/main/resources/templates/financial/receivables/receivables.html
  32. 342
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html
  33. 337
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSD.html
  34. 53
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html
  35. 132
      ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html
  36. 566
      ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceUSD.html
  37. 25
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html

14
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNotice.java

@ -51,11 +51,11 @@ public class AftersalesComplaintNotice extends BaseEntity
/** 物料合计 */
@Excel(name = "物料合计")
private String materialSum;
private Integer materialSum;
/** 数量合计 */
@Excel(name = "数量合计")
private String enterpriseSum;
private Integer enterpriseSum;
/** 交货数量 */
private String deliveryGoodsNum;
@ -146,25 +146,25 @@ public class AftersalesComplaintNotice extends BaseEntity
this.materialName = materialName;
}
public String getMaterialName()
public String getMaterialName()
{
return materialName;
}
public void setMaterialSum(String materialSum)
public void setMaterialSum(Integer materialSum)
{
this.materialSum = materialSum;
}
public String getMaterialSum()
public Integer getMaterialSum()
{
return materialSum;
}
public void setEnterpriseSum(String enterpriseSum)
public void setEnterpriseSum(Integer enterpriseSum)
{
this.enterpriseSum = enterpriseSum;
}
public String getEnterpriseSum()
public Integer getEnterpriseSum()
{
return enterpriseSum;
}

18
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNoticeDetail.java

@ -102,14 +102,14 @@ public class AftersalesComplaintNoticeDetail extends BaseEntity
/** 已出库数量 */
@Excel(name = "交货数量",sort = 8)
private String shippedGoodsSum;
private Integer shippedGoodsSum;
/** 物料数合计 */
private String materialSum;
private Integer materialSum;
/** 数量合计 */
@Excel(name = "客诉数量",sort = 9)
private String enterpriseSum;
private Integer enterpriseSum;
/** 备注 */
@Excel(name = "备注", sort = 14)
@ -324,30 +324,30 @@ public class AftersalesComplaintNoticeDetail extends BaseEntity
{
return materialProcessMethod;
}
public void setShippedGoodsSum(String shippedGoodsSum)
public void setShippedGoodsSum(Integer shippedGoodsSum)
{
this.shippedGoodsSum = shippedGoodsSum;
}
public String getShippedGoodsSum()
public Integer getShippedGoodsSum()
{
return shippedGoodsSum;
}
public void setMaterialSum(String materialSum)
public void setMaterialSum(Integer materialSum)
{
this.materialSum = materialSum;
}
public String getMaterialSum()
public Integer getMaterialSum()
{
return materialSum;
}
public void setEnterpriseSum(String enterpriseSum)
public void setEnterpriseSum(Integer enterpriseSum)
{
this.enterpriseSum = enterpriseSum;
}
public String getEnterpriseSum()
public Integer getEnterpriseSum()
{
return enterpriseSum;
}

2
ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java

@ -119,5 +119,5 @@ public interface AfterSalesShippingDeviceMapper
/*
* 根据sn号查询出货设备信息列表
* */
List<AfterSalesShippingDevice> selectShippingDeviceListBySnCodeAndMaterialNo(String[] snCode,String materialNo);
List<AfterSalesShippingDevice> selectShippingDeviceListBySnCodeAndMaterialNo(String[] snCode);
}

2
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java

@ -111,5 +111,5 @@ public interface IAfterSalesShippingDeviceService
/*
* 根据sn号查询出货设备信息列表
* */
List<AfterSalesShippingDevice> selectShippingDeviceListBySnCode(String[] snCode,String materialNo);
List<AfterSalesShippingDevice> selectShippingDeviceListBySnCode(String[] snCode);
}

4
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java

@ -251,7 +251,7 @@ public class AfterSalesShippingDeviceServiceImpl implements IAfterSalesShippingD
}
@Override
public List<AfterSalesShippingDevice> selectShippingDeviceListBySnCode(String[] snCode,String materialNo) {
return afterSalesShippingDeviceMapper.selectShippingDeviceListBySnCodeAndMaterialNo(snCode,materialNo);
public List<AfterSalesShippingDevice> selectShippingDeviceListBySnCode(String[] snCode) {
return afterSalesShippingDeviceMapper.selectShippingDeviceListBySnCodeAndMaterialNo(snCode);
}
}

102
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java

@ -5,14 +5,21 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.domain.AftersalesComplaintNotice;
import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO;
import com.ruoyi.aftersales.mapper.AftersalesComplaintNoticeMapper;
import com.ruoyi.aftersales.service.IAfterSalesShippingDeviceService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -38,6 +45,12 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
@Autowired
private AftersalesComplaintNoticeMapper complaintNoticeMapper;
@Autowired
private IAfterSalesShippingDeviceService afterSalesShippingDeviceService;
@Autowired
private WarehouseOutOrderMapper warehouseOutOrderMapper;
/**
* 查询售后客诉通知单详情
*
@ -61,10 +74,41 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
{
return aftersalesComplaintNoticeDetailMapper.selectAftersalesComplaintNoticeDetailList(aftersalesComplaintNoticeDetail);
}
@Override
/**
* 导出售后客诉通知单详情列表
*/
@Override
public List<AftersalesComplaintNoticeDetail> selectDetailListByNoticeCodes(String[] complaintNoticeCodes) {
return aftersalesComplaintNoticeDetailMapper.selectDetailListByNoticeCodes(complaintNoticeCodes);
List<AftersalesComplaintNoticeDetail> complaintNoticeDetailList = aftersalesComplaintNoticeDetailMapper.selectDetailListByNoticeCodes(complaintNoticeCodes);
List<AftersalesComplaintNoticeDetail> exportDetailList = new ArrayList<>();
for (AftersalesComplaintNoticeDetail noticeDetail:complaintNoticeDetailList) {
String snCodes = noticeDetail.getSnCode();
String[] snCodeArray = snCodes.split(",");
List<AfterSalesShippingDevice> salesShippingDeviceList = afterSalesShippingDeviceService.selectShippingDeviceListBySnCode(snCodeArray);
for (String snCode:snCodeArray) {
AftersalesComplaintNoticeDetail exportDetail = new AftersalesComplaintNoticeDetail();
Optional<AfterSalesShippingDevice> matchingDevice = salesShippingDeviceList.stream()
.filter(detail -> detail.getSnCode().equals(snCode))
.findFirst();
matchingDevice.ifPresent(detail -> {
exportDetail.setCustomerId(noticeDetail.getCustomerId());
exportDetail.setCustomerName(noticeDetail.getCustomerName());
exportDetail.setDeviceModelCode(detail.getDeviceModelCode());
exportDetail.setDeviceModelName(detail.getMaterialName());
exportDetail.setMakeNo(detail.getSalesOrderCode());
exportDetail.setDeviceRunningNumber(detail.getDeviceRunningNumber());
exportDetail.setShippedGoodsSum(noticeDetail.getShippedGoodsSum());
exportDetail.setEnterpriseSum(1);
exportDetail.setComplaintProblem(noticeDetail.getComplaintProblem());
exportDetail.setAdverseReportUrl(noticeDetail.getAdverseReportUrl());
exportDetail.setEmergencyDegree(noticeDetail.getEmergencyDegree());
exportDetail.setClosingProcedures(noticeDetail.getClosingProcedures());
exportDetail.setRemark(noticeDetail.getRemark());
});
exportDetailList.add(exportDetail);
}
}
return exportDetailList;
}
/**
@ -95,35 +139,43 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
String loginName = ShiroUtils.getLoginName();
complaintNoticeDetail.setCreateBy(loginName);
complaintNoticeDetail.setCreateTime(DateUtils.getNowDate());
String makeNo = complaintNoticeDetail.getMakeNo();
//保存信息到AftersalesComplaintNotice数据表中
complaintNotice.setComplaintNoticeCode(newCode);
complaintNotice.setCreateBy(loginName);
complaintNotice.setCreateTime(new Date());
complaintNotice.setCreateTime(DateUtils.getNowDate());
complaintNotice.setMakeNo(complaintNoticeDetail.getMakeNo());
complaintNotice.setCustomerId(complaintNoticeDetail.getCustomerId());
complaintNotice.setCustomerName(complaintNoticeDetail.getCustomerName());
complaintNotice.setClosingProcedures("1");
complaintNotice.setEmergencyDegree(complaintNoticeDetail.getEmergencyDegree());
complaintNoticeMapper.insertAftersalesComplaintNotice(complaintNotice);
if(complaintNoticeDetail.getAftersalesMaterialVOs()!=null){
complaintNotice.setMaterialSum(complaintNoticeDetail.getAftersalesMaterialVOs().size());
}
List<AftersalesMaterialVO> aftersalesMaterialVOs = complaintNoticeDetail.getAftersalesMaterialVOs();
if (StringUtils.isEmpty(aftersalesMaterialVOs)){
return aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) {
complaintNoticeDetail.setMaterialType(aftersalesMaterialVO.getMaterialType());
complaintNoticeDetail.setMaterialUnit(aftersalesMaterialVO.getMaterialUnit());
complaintNoticeDetail.setMaterialProcessMethod(aftersalesMaterialVO.getMaterialProcessMethod());
complaintNoticeDetail.setMaterialName(aftersalesMaterialVO.getMaterialName());
complaintNoticeDetail.setMaterialDescribe(aftersalesMaterialVO.getMaterialDescribe());
complaintNoticeDetail.setMaterialNo(aftersalesMaterialVO.getMaterialNo());
complaintNoticeDetail.setMaterialPhotourl(aftersalesMaterialVO.getMaterialPhotourl());
complaintNoticeDetail.setMaterialBrand(aftersalesMaterialVO.getMaterialBrand());
complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem());
complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode());
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
}else{
for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) {
complaintNoticeDetail.setMaterialNo(aftersalesMaterialVO.getMaterialNo());
complaintNoticeDetail.setMaterialName(aftersalesMaterialVO.getMaterialName());
complaintNoticeDetail.setMaterialType(aftersalesMaterialVO.getMaterialType());
complaintNoticeDetail.setMaterialUnit(aftersalesMaterialVO.getMaterialUnit());
complaintNoticeDetail.setMaterialDescribe(aftersalesMaterialVO.getMaterialDescribe());
complaintNoticeDetail.setMaterialPhotourl(aftersalesMaterialVO.getMaterialPhotourl());
complaintNoticeDetail.setMaterialBrand(aftersalesMaterialVO.getMaterialBrand());
complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode());
complaintNoticeDetail.setClosingProcedures("1");
complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem());
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
// int totalQuantity = warehouseOutOrderMapper.sumOutOrderQuantityByMakeNo(makeNo);
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNotice.setEnterpriseSum(aftersalesMaterialVO.getShippedGoodsSum());
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
}
complaintNoticeMapper.insertAftersalesComplaintNotice(complaintNotice);
return 1;
}
@ -142,7 +194,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
//更新主表内容
aftersalesComplaintNotice.setComplaintNoticeCode(aftersalesComplaintNoticeDetail.getComplaintNoticeCode());
aftersalesComplaintNotice.setUpdateBy(loginName);
aftersalesComplaintNotice.setUpdateTime(new Date());
aftersalesComplaintNotice.setUpdateTime(DateUtils.getNowDate());
aftersalesComplaintNotice.setMakeNo(aftersalesComplaintNoticeDetail.getMakeNo());
aftersalesComplaintNotice.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree());
aftersalesComplaintNotice.setRemark(aftersalesComplaintNoticeDetail.getRemark());
@ -166,7 +218,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setCreateBy(aftersalesComplaintNoticeDetail.getCreateBy());
complaintNoticeDetail.setCreateTime(aftersalesComplaintNoticeDetail.getCreateTime());
complaintNoticeDetail.setUpdateBy(loginName);
complaintNoticeDetail.setUpdateTime(new Date());
complaintNoticeDetail.setUpdateTime(DateUtils.getNowDate());
complaintNoticeDetail.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId());
complaintNoticeDetail.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName());
complaintNoticeDetail.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree());
@ -183,6 +235,8 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem());
complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode());
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNoticeDetail.setClosingProcedures("1");
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
return 1;
@ -261,6 +315,8 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
aftersalesMaterialVO.setMaterialUnit(complaintNoticeDetail.getMaterialUnit());
aftersalesMaterialVO.setMaterialType(complaintNoticeDetail.getMaterialType());
aftersalesMaterialVO.setComplaintProblem(complaintNoticeDetail.getComplaintProblem());
aftersalesMaterialVO.setShippedGoodsSum(complaintNoticeDetail.getShippedGoodsSum());
aftersalesMaterialVO.setEmergencyDegree(complaintNoticeDetail.getEmergencyDegree());
aftersalesMaterialVO.setSnCode(complaintNoticeDetail.getSnCode());
aftersalesMaterialVO.setAdverseReportUrl(complaintNoticeDetail.getAdverseReportUrl());
aftersalesMaterialVOs.add(aftersalesMaterialVO);

57
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java

@ -16,10 +16,13 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.mapper.SysMakeorderBomMapper;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -49,7 +52,10 @@ public class AftersalesComplaintNoticeServiceImpl implements IAftersalesComplain
private SysMakeorderBomMapper sysMakeorderBomMapper;
@Autowired
private WarehouseOutOrderDetailMapper warehouseOutOrderDetailMapper;
private WarehouseOutOrderMapper warehouseOutOrderMapper;
@Autowired
private SysSalesOrderChildMapper sysSalesOrderChildMapper;
/**
* 查询售后客诉通知单
@ -191,34 +197,33 @@ public class AftersalesComplaintNoticeServiceImpl implements IAftersalesComplain
public List<AftersalesMaterialVO> selectMaterialInfoByMakeNo(String makeNo) {
ArrayList<AftersalesMaterialVO> aftersalesMaterialVOs = new ArrayList<>();
List<SysMakeorderBom> sysMakeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomByMakeNo(makeNo);
if (StringUtils.isEmpty(sysMakeorderBoms)){
// List<SysMakeorderBom> sysMakeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomByMakeNo(makeNo);
// if (StringUtils.isEmpty(sysMakeorderBoms)){
// // 记录日志
// log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo);
// }
SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectSaleNoByMakeNo(makeNo);
if (StringUtils.isEmpty(sysMakeOrder.getSaleNo())){
log.warn("未查找到与生产订单关联的销售订单, 生产订单号: {}", makeNo);
}
List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrderChildMapper.selectSysSalesOrderChildByQuoteId(sysMakeOrder.getSaleNo());
if (StringUtils.isEmpty(sysSalesOrderChildList)){
// 记录日志
log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo);
log.warn("未查找到与销售订单关联的物料相关数据, 销售订单号: {}", sysMakeOrder.getSaleNo());
}
List<WarehouseOutOrderDetail> outOrderDetails = warehouseOutOrderDetailMapper.selectOutOrderDetailListByMakeNo(makeNo);
for (SysMakeorderBom sysMakeorderBom : sysMakeorderBoms) {
int totalQuantity = warehouseOutOrderMapper.sumOutOrderQuantityByMakeNo(makeNo);
for (SysSalesOrderChild salesOrderChild : sysSalesOrderChildList) {
AftersalesMaterialVO aftersalesMaterialVO = new AftersalesMaterialVO();
aftersalesMaterialVO.setMaterialNo(sysMakeorderBom.getMaterialNo());
if (StringUtils.isEmpty(outOrderDetails)){
aftersalesMaterialVO.setShippedGoodsSum(0);
}else {
Optional<WarehouseOutOrderDetail> matchingDetail = outOrderDetails.stream()
.filter(detail -> detail.getMaterialNo().equals(sysMakeorderBom.getMaterialNo()))
.findFirst();
matchingDetail.ifPresent(detail -> {
int sum = detail.getHasOutOrderSum();
aftersalesMaterialVO.setShippedGoodsSum(detail.getHasOutOrderSum()==null?0:detail.getHasOutOrderSum());
});
}
aftersalesMaterialVO.setMaterialBrand(sysMakeorderBom.getBrand());
aftersalesMaterialVO.setMaterialDescribe(sysMakeorderBom.getDescribe());
aftersalesMaterialVO.setMaterialName(sysMakeorderBom.getMaterialName());
aftersalesMaterialVO.setMaterialProcessMethod(sysMakeorderBom.getProcessMethod());
aftersalesMaterialVO.setMaterialPhotourl(sysMakeorderBom.getPhotoUrl());
aftersalesMaterialVO.setMaterialUnit(sysMakeorderBom.getUnit());
aftersalesMaterialVO.setMaterialType(sysMakeorderBom.getMaterialType());
aftersalesMaterialVO.setMaterialNo(salesOrderChild.getMaterialCode());
aftersalesMaterialVO.setShippedGoodsSum(totalQuantity);
aftersalesMaterialVO.setMaterialBrand(salesOrderChild.getBrand());
aftersalesMaterialVO.setMaterialDescribe(salesOrderChild.getDescribe());
aftersalesMaterialVO.setMaterialName(salesOrderChild.getMaterialName());
aftersalesMaterialVO.setMaterialProcessMethod(salesOrderChild.getProcessMethod());
aftersalesMaterialVO.setMaterialPhotourl(salesOrderChild.getPhotoUrl());
aftersalesMaterialVO.setMaterialUnit(salesOrderChild.getUnit());
aftersalesMaterialVO.setMaterialType(salesOrderChild.getMaterialType());
aftersalesMaterialVOs.add(aftersalesMaterialVO);
}
return aftersalesMaterialVOs;

57
ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java

@ -1,15 +1,14 @@
package com.ruoyi.financial.controller;
import java.util.List;
import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial;
import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.financial.domain.FinancialTaxInvoice;
@ -34,6 +33,10 @@ public class FinancialTaxInvoiceController extends BaseController
@Autowired
private IFinancialTaxInvoiceService financialTaxInvoiceService;
@Autowired
private IFinancialTaxInvoiceMaterialService taxInvoiceMaterialService;
@RequiresPermissions("financial:taxInvoice:view")
@GetMapping()
public String taxInvoice()
@ -89,6 +92,50 @@ public class FinancialTaxInvoiceController extends BaseController
return toAjax(financialTaxInvoiceService.insertFinancialTaxInvoice(financialTaxInvoice));
}
/**
* 审核国税发票弹窗页面
*/
@GetMapping("/auditInvoice/{taxInvoiceId}")
public String auditInvoice(@PathVariable("taxInvoiceId") Long taxInvoiceId, ModelMap mmap)
{
FinancialTaxInvoice taxInvoice = financialTaxInvoiceService.selectFinancialTaxInvoiceById(taxInvoiceId);
String commonCurrency = taxInvoice.getCommonCurrency();
mmap.put("taxInvoice", taxInvoice);
if ("1".equals(commonCurrency)){
return prefix + "/auditInvoiceRMB";
}else {
return prefix + "/auditInvoiceUSD";
}
}
/**
* 审核国税发票
*/
@RequiresPermissions("financial:taxInvoice:auditInvoice")
@Log(title = "国税发票", businessType = BusinessType.INSERT)
@PostMapping("/auditInvoice")
@ResponseBody
public AjaxResult auditInvoiceSave(FinancialTaxInvoice financialTaxInvoice,@RequestParam("taxInvoiceStatus") String taxInvoiceStatus)
{
return toAjax(financialTaxInvoiceService.auditInvoiceFinancialTaxInvoice(financialTaxInvoice,taxInvoiceStatus));
}
/**
* 国税发票物料列表展示
*/
@ResponseBody
@PostMapping("/getInvoiceMaterialListByCode")
public TableDataInfo getInvoiceMaterialListByCode(@RequestParam("taxInvoiceCode") String taxInvoiceCode){
startPage();
List<FinancialTaxInvoiceMaterial> list = taxInvoiceMaterialService.getInvoiceMaterialListByCode(taxInvoiceCode);
return getDataTable(list);
}
/**
* 修改国税发票
*/

37
ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java

@ -130,8 +130,12 @@ public class FinancialTaxInvoice extends BaseEntity
@Excel(name = "开票额度比例")
private BigDecimal invoiceQuotaRatio;
/** 开票金额 */
private BigDecimal invoiceAmount;
/** 开票金额(RMB) */
private BigDecimal invoiceAmountRmb;
/** 开票金额(美元) */
private BigDecimal invoiceAmountUsd;
/** 实际开票金额 */
@Excel(name = "实际开票金额")
@ -455,16 +459,16 @@ public class FinancialTaxInvoice extends BaseEntity
{
return invoiceQuotaRatio;
}
public void setInvoiceAmount(BigDecimal invoiceAmount)
{
this.invoiceAmount = invoiceAmount;
public BigDecimal getInvoiceAmountRmb() {
return invoiceAmountRmb;
}
public BigDecimal getInvoiceAmount()
{
return invoiceAmount;
public void setInvoiceAmountRmb(BigDecimal invoiceAmountRmb) {
this.invoiceAmountRmb = invoiceAmountRmb;
}
public void setActualInvoiceAmount(BigDecimal actualInvoiceAmount)
public void setActualInvoiceAmount(BigDecimal actualInvoiceAmount)
{
this.actualInvoiceAmount = actualInvoiceAmount;
}
@ -473,7 +477,17 @@ public class FinancialTaxInvoice extends BaseEntity
{
return actualInvoiceAmount;
}
public void setActualInvoiceAmountRmb(BigDecimal actualInvoiceAmountRmb)
public BigDecimal getInvoiceAmountUsd() {
return invoiceAmountUsd;
}
public void setInvoiceAmountUsd(BigDecimal invoiceAmountUsd) {
this.invoiceAmountUsd = invoiceAmountUsd;
}
public void setActualInvoiceAmountRmb(BigDecimal actualInvoiceAmountRmb)
{
this.actualInvoiceAmountRmb = actualInvoiceAmountRmb;
}
@ -597,7 +611,8 @@ public class FinancialTaxInvoice extends BaseEntity
.append("usdTaxSum", getUsdTaxSum())
.append("invoiceEmail", getInvoiceEmail())
.append("invoiceQuotaRatio", getInvoiceQuotaRatio())
.append("invoiceAmount", getInvoiceAmount())
.append("invoiceAmountRmb", getInvoiceAmountRmb())
.append("invoiceAmountUsd", getInvoiceAmountUsd())
.append("actualInvoiceAmount", getActualInvoiceAmount())
.append("actualInvoiceAmountRmb", getActualInvoiceAmountRmb())
.append("actualInvoiceAmountUsd", getActualInvoiceAmountUsd())

197
ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoiceHistory.java

@ -0,0 +1,197 @@
package com.ruoyi.financial.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 国税发票历史记录对象 financial_tax_invoice_history
*
* @author 刘晓旭
* @date 2024-08-14
*/
public class FinancialTaxInvoiceHistory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 国税发票历史id */
private Long invoiceHistoryId;
/** 国税发票单号 */
@Excel(name = "国税发票单号")
private String taxInvoiceCode;
/** 销售订单编号 */
private String salesOrderCode;
/** 发票状态(0待审核、1待开具、2已开具、3审核拒绝) */
@Excel(name = "发票状态(0待审核、1待开具、2已开具、3审核拒绝)")
private String taxInvoiceStatus;
/** 申请时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyTime;
/** 财务员 */
@Excel(name = "财务员")
private String financeMembers;
/** 开票额度比例 */
@Excel(name = "开票额度比例")
private BigDecimal invoiceQuotaRatio;
/** 开票金额(RMB) */
@Excel(name = "开票金额(RMB)")
private BigDecimal invoiceAmountRmb;
/** 开票金额(美元) */
@Excel(name = "开票金额(美元)")
private BigDecimal invoiceAmountUsd;
/** 开票用途 */
@Excel(name = "开票用途")
private String invoicePurpose;
/** 使用状态(1是、0否、2已作废) */
private String useStatus;
/** 删除标志 0正常 1删除 */
private String delFlag;
public void setInvoiceHistoryId(Long invoiceHistoryId)
{
this.invoiceHistoryId = invoiceHistoryId;
}
public Long getInvoiceHistoryId()
{
return invoiceHistoryId;
}
public void setTaxInvoiceCode(String taxInvoiceCode)
{
this.taxInvoiceCode = taxInvoiceCode;
}
public String getTaxInvoiceCode()
{
return taxInvoiceCode;
}
public void setSalesOrderCode(String salesOrderCode)
{
this.salesOrderCode = salesOrderCode;
}
public String getSalesOrderCode()
{
return salesOrderCode;
}
public void setTaxInvoiceStatus(String taxInvoiceStatus)
{
this.taxInvoiceStatus = taxInvoiceStatus;
}
public String getTaxInvoiceStatus()
{
return taxInvoiceStatus;
}
public void setApplyTime(Date applyTime)
{
this.applyTime = applyTime;
}
public Date getApplyTime()
{
return applyTime;
}
public void setFinanceMembers(String financeMembers)
{
this.financeMembers = financeMembers;
}
public String getFinanceMembers()
{
return financeMembers;
}
public void setInvoiceQuotaRatio(BigDecimal invoiceQuotaRatio)
{
this.invoiceQuotaRatio = invoiceQuotaRatio;
}
public BigDecimal getInvoiceQuotaRatio()
{
return invoiceQuotaRatio;
}
public void setInvoiceAmountRmb(BigDecimal invoiceAmountRmb)
{
this.invoiceAmountRmb = invoiceAmountRmb;
}
public BigDecimal getInvoiceAmountRmb()
{
return invoiceAmountRmb;
}
public void setInvoiceAmountUsd(BigDecimal invoiceAmountUsd)
{
this.invoiceAmountUsd = invoiceAmountUsd;
}
public BigDecimal getInvoiceAmountUsd()
{
return invoiceAmountUsd;
}
public void setInvoicePurpose(String invoicePurpose)
{
this.invoicePurpose = invoicePurpose;
}
public String getInvoicePurpose()
{
return invoicePurpose;
}
public void setUseStatus(String useStatus)
{
this.useStatus = useStatus;
}
public String getUseStatus()
{
return useStatus;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("invoiceHistoryId", getInvoiceHistoryId())
.append("taxInvoiceCode", getTaxInvoiceCode())
.append("salesOrderCode", getSalesOrderCode())
.append("taxInvoiceStatus", getTaxInvoiceStatus())
.append("applyTime", getApplyTime())
.append("financeMembers", getFinanceMembers())
.append("invoiceQuotaRatio", getInvoiceQuotaRatio())
.append("invoiceAmountRmb", getInvoiceAmountRmb())
.append("invoiceAmountUsd", getInvoiceAmountUsd())
.append("invoicePurpose", getInvoicePurpose())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("useStatus", getUseStatus())
.append("delFlag", getDelFlag())
.toString();
}
}

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

@ -0,0 +1,93 @@
package com.ruoyi.financial.mapper;
import java.util.List;
import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory;
/**
* 国税发票历史记录Mapper接口
*
* @author 刘晓旭
* @date 2024-08-14
*/
public interface FinancialTaxInvoiceHistoryMapper
{
/**
* 查询国税发票历史记录
*
* @param invoiceHistoryId 国税发票历史记录ID
* @return 国税发票历史记录
*/
public FinancialTaxInvoiceHistory selectFinancialTaxInvoiceHistoryById(Long invoiceHistoryId);
/**
* 查询国税发票历史记录列表
*
* @param financialTaxInvoiceHistory 国税发票历史记录
* @return 国税发票历史记录集合
*/
public List<FinancialTaxInvoiceHistory> selectFinancialTaxInvoiceHistoryList(FinancialTaxInvoiceHistory financialTaxInvoiceHistory);
/**
* 新增国税发票历史记录
*
* @param financialTaxInvoiceHistory 国税发票历史记录
* @return 结果
*/
public int insertFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory);
/**
* 修改国税发票历史记录
*
* @param financialTaxInvoiceHistory 国税发票历史记录
* @return 结果
*/
public int updateFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory);
/**
* 删除国税发票历史记录
*
* @param invoiceHistoryId 国税发票历史记录ID
* @return 结果
*/
public int deleteFinancialTaxInvoiceHistoryById(Long invoiceHistoryId);
/**
* 批量删除国税发票历史记录
*
* @param invoiceHistoryIds 需要删除的数据ID
* @return 结果
*/
public int deleteFinancialTaxInvoiceHistoryByIds(String[] invoiceHistoryIds);
/**
* 作废国税发票历史记录
*
* @param invoiceHistoryId 国税发票历史记录ID
* @return 结果
*/
public int cancelFinancialTaxInvoiceHistoryById(Long invoiceHistoryId);
/**
* 恢复国税发票历史记录
*
* @param invoiceHistoryId 国税发票历史记录ID
* @return 结果
*/
public int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId);
/**
* 根据销售订单编号查询发票历史记录集合
*
* @param salesOrderCode 销售订单编号
* @return 结果
*/
List<FinancialTaxInvoiceHistory> selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode);
/**
* 根据发票编号查询发票历史记录
*
* @param taxInvoiceCode 发票编号
* @return 结果
*/
FinancialTaxInvoiceHistory selectInvoiceHistoryByInvoiceCode(String taxInvoiceCode);
}

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

@ -84,4 +84,12 @@ public interface FinancialTaxInvoiceMaterialMapper
* @return 结果
*/
public int restoreFinancialTaxInvoiceMaterialById(Long invoiceMaterialId);
/**
* 根据发票单号获取发票物料信息集合
*
* @param taxInvoiceCode 发票单号
* @return 结果
*/
List<FinancialTaxInvoiceMaterial> selectFinancialTaxInvoiceMaterialByCode(String taxInvoiceCode);
}

82
ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java

@ -0,0 +1,82 @@
package com.ruoyi.financial.service;
import java.util.List;
import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory;
/**
* 国税发票历史记录Service接口
*
* @author 刘晓旭
* @date 2024-08-14
*/
public interface IFinancialTaxInvoiceHistoryService
{
/**
* 查询国税发票历史记录
*
* @param invoiceHistoryId 国税发票历史记录ID
* @return 国税发票历史记录
*/
public FinancialTaxInvoiceHistory selectFinancialTaxInvoiceHistoryById(Long invoiceHistoryId);
/**
* 查询国税发票历史记录列表
*
* @param financialTaxInvoiceHistory 国税发票历史记录
* @return 国税发票历史记录集合
*/
public List<FinancialTaxInvoiceHistory> selectFinancialTaxInvoiceHistoryList(FinancialTaxInvoiceHistory financialTaxInvoiceHistory);
/**
* 新增国税发票历史记录
*
* @param financialTaxInvoiceHistory 国税发票历史记录
* @return 结果
*/
public int insertFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory);
/**
* 修改国税发票历史记录
*
* @param financialTaxInvoiceHistory 国税发票历史记录
* @return 结果
*/
public int updateFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory);
/**
* 批量删除国税发票历史记录
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteFinancialTaxInvoiceHistoryByIds(String ids);
/**
* 删除国税发票历史记录信息
*
* @param invoiceHistoryId 国税发票历史记录ID
* @return 结果
*/
public int deleteFinancialTaxInvoiceHistoryById(Long invoiceHistoryId);
/**
* 作废国税发票历史记录
* @param invoiceHistoryId 国税发票历史记录ID
* @return
*/
int cancelFinancialTaxInvoiceHistoryById(Long invoiceHistoryId);
/**
* 恢复国税发票历史记录
* @param invoiceHistoryId 国税发票历史记录ID
* @return
*/
int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId);
/**
* 根据销售订单编号查询发票历史记录集合
* @param salesOrderCode 销售订单编号
* @return
*/
List<FinancialTaxInvoiceHistory> selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode);
}

7
ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceMaterialService.java

@ -81,4 +81,11 @@ public interface IFinancialTaxInvoiceMaterialService
* @return
*/
int restoreFinancialTaxInvoiceMaterialById(Long invoiceMaterialId);
/**
* 根据发票单号获取发票物料集合
* @param taxInvoiceCode 发票单号
* @return
*/
List<FinancialTaxInvoiceMaterial> getInvoiceMaterialListByCode(String taxInvoiceCode);
}

5
ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceService.java

@ -87,4 +87,9 @@ public interface IFinancialTaxInvoiceService
* @return
*/
int makeInvoiceSave(FinancialTaxInvoice financialTaxInvoice);
/**
* 审核国税发票
*/
int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice,String taxInvoiceStatus);
}

140
ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java

@ -0,0 +1,140 @@
package com.ruoyi.financial.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.financial.mapper.FinancialTaxInvoiceHistoryMapper;
import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory;
import com.ruoyi.financial.service.IFinancialTaxInvoiceHistoryService;
import com.ruoyi.common.core.text.Convert;
/**
* 国税发票历史记录Service业务层处理
*
* @author 刘晓旭
* @date 2024-08-14
*/
@Service
public class FinancialTaxInvoiceHistoryServiceImpl implements IFinancialTaxInvoiceHistoryService
{
@Autowired
private FinancialTaxInvoiceHistoryMapper financialTaxInvoiceHistoryMapper;
/**
* 查询国税发票历史记录
*
* @param invoiceHistoryId 国税发票历史记录ID
* @return 国税发票历史记录
*/
@Override
public FinancialTaxInvoiceHistory selectFinancialTaxInvoiceHistoryById(Long invoiceHistoryId)
{
return financialTaxInvoiceHistoryMapper.selectFinancialTaxInvoiceHistoryById(invoiceHistoryId);
}
/**
* 查询国税发票历史记录列表
*
* @param financialTaxInvoiceHistory 国税发票历史记录
* @return 国税发票历史记录
*/
@Override
public List<FinancialTaxInvoiceHistory> selectFinancialTaxInvoiceHistoryList(FinancialTaxInvoiceHistory financialTaxInvoiceHistory)
{
return financialTaxInvoiceHistoryMapper.selectFinancialTaxInvoiceHistoryList(financialTaxInvoiceHistory);
}
/**
* 新增国税发票历史记录
*
* @param financialTaxInvoiceHistory 国税发票历史记录
* @return 结果
*/
@Override
public int insertFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory)
{
String loginName = ShiroUtils.getLoginName();
financialTaxInvoiceHistory.setCreateBy(loginName);
financialTaxInvoiceHistory.setCreateTime(DateUtils.getNowDate());
return financialTaxInvoiceHistoryMapper.insertFinancialTaxInvoiceHistory(financialTaxInvoiceHistory);
}
/**
* 修改国税发票历史记录
*
* @param financialTaxInvoiceHistory 国税发票历史记录
* @return 结果
*/
@Override
public int updateFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory)
{
String loginName = ShiroUtils.getLoginName();
financialTaxInvoiceHistory.setUpdateBy(loginName);
financialTaxInvoiceHistory.setUpdateTime(DateUtils.getNowDate());
return financialTaxInvoiceHistoryMapper.updateFinancialTaxInvoiceHistory(financialTaxInvoiceHistory);
}
/**
* 删除国税发票历史记录对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteFinancialTaxInvoiceHistoryByIds(String ids)
{
return financialTaxInvoiceHistoryMapper.deleteFinancialTaxInvoiceHistoryByIds(Convert.toStrArray(ids));
}
/**
* 删除国税发票历史记录信息
*
* @param invoiceHistoryId 国税发票历史记录ID
* @return 结果
*/
@Override
public int deleteFinancialTaxInvoiceHistoryById(Long invoiceHistoryId)
{
return financialTaxInvoiceHistoryMapper.deleteFinancialTaxInvoiceHistoryById(invoiceHistoryId);
}
/**
* 作废国税发票历史记录
*
* @param invoiceHistoryId 国税发票历史记录ID
* @return 结果
*/
@Override
public int cancelFinancialTaxInvoiceHistoryById(Long invoiceHistoryId)
{
return financialTaxInvoiceHistoryMapper.cancelFinancialTaxInvoiceHistoryById(invoiceHistoryId);
}
/**
* 恢复国税发票历史记录信息
*
* @param invoiceHistoryId 国税发票历史记录ID
* @return 结果
*/
@Override
public int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId)
{
return financialTaxInvoiceHistoryMapper.restoreFinancialTaxInvoiceHistoryById(invoiceHistoryId);
}
/**
* 根据销售订单编号查询历史记录集合
*
* @param salesOrderCode 销售订单编号
* @return 结果
*/
@Override
public List<FinancialTaxInvoiceHistory> selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode) {
List<FinancialTaxInvoiceHistory> list = financialTaxInvoiceHistoryMapper.selectInvoiceHistoryListBySalesOrderCode(salesOrderCode);
return list;
}
}

13
ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceMaterialServiceImpl.java

@ -143,4 +143,17 @@ public class FinancialTaxInvoiceMaterialServiceImpl implements IFinancialTaxInvo
{
return financialTaxInvoiceMaterialMapper.restoreFinancialTaxInvoiceMaterialById(invoiceMaterialId);
}
/**
* 根据发票单号获取发票物料信息集合
*
* @param taxInvoiceCode 发票单号
* @return 结果
*/
@Override
public List<FinancialTaxInvoiceMaterial> getInvoiceMaterialListByCode(String taxInvoiceCode) {
return financialTaxInvoiceMaterialMapper.selectFinancialTaxInvoiceMaterialByCode(taxInvoiceCode);
}
}

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

@ -3,11 +3,15 @@ package com.ruoyi.financial.service.impl;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.BusinessException;
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;
@ -20,6 +24,7 @@ import com.ruoyi.financial.domain.FinancialTaxInvoice;
import com.ruoyi.financial.service.IFinancialTaxInvoiceService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
/**
* 国税发票Service业务层处理
@ -39,12 +44,16 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
@Autowired
private IFinancialTaxInvoiceMaterialService invoiceMaterialService;
@Autowired
private FinancialTaxInvoiceHistoryMapper invoiceHistoryMapper;
@Autowired
private SysCustomerMapper sysCustomerMapper;
@Autowired
private RedisCache redisCache;
/**
* 查询国税发票
*
@ -165,6 +174,7 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
financialTaxInvoice.setContactNumber(sysSalesOrder.getContactNumber());
financialTaxInvoice.setEnterpriseSum(sysSalesOrder.getEnterpriseSum());
financialTaxInvoice.setMaterialSum(sysSalesOrder.getMaterialSum());
// financialTaxInvoice.setTaxRate(BigDecimal.valueOf(sysSalesOrder.getTaxRate()));
financialTaxInvoice.setRmbTaxSum(BigDecimal.valueOf(sysSalesOrder.getRmbTaxSum()));
financialTaxInvoice.setNoRmbSum(BigDecimal.valueOf(sysSalesOrder.getNoRmbSum()));
financialTaxInvoice.setUsdTaxSum(BigDecimal.valueOf(sysSalesOrder.getUsdTaxSum()));
@ -174,10 +184,7 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
financialTaxInvoice.setInvoiceCompanyName(sysCustomerVo.getInvoicingCompanyName());
financialTaxInvoice.setBankAccount(sysCustomerVo.getBankAccount());
financialTaxInvoice.setDepositBank(sysCustomerVo.getDepositBank());
financialTaxInvoice.setTaxRate(BigDecimal.valueOf(sysCustomerVo.getTaxRate()));
return financialTaxInvoice;
}
@ -193,6 +200,8 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
public int makeInvoiceSave(FinancialTaxInvoice financialTaxInvoice) {
String loginName = ShiroUtils.getLoginName();
String salesOrderCode = financialTaxInvoice.getSalesOrderCode();
financialTaxInvoice.setCreateBy(loginName);
financialTaxInvoice.setCreateTime(new Date());
String taxInvoiceCode = redisCache.generateBillNo("FP");
@ -201,14 +210,85 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
financialTaxInvoice.setApplyUser(loginName);
financialTaxInvoice.setBusinessMembers(loginName);
//填充国税发票物料数据
List<FinancialTaxInvoiceMaterial> invoiceMaterialList = financialTaxInvoice.getInvoiceMaterialList();
invoiceMaterialList.parallelStream().forEach(invoiceMaterial -> {
invoiceMaterial.setTaxInvoiceCode(taxInvoiceCode);
invoiceMaterial.setSalesOrderCode(financialTaxInvoice.getSalesOrderCode());
invoiceMaterial.setSalesOrderCode(salesOrderCode);
invoiceMaterial.setCreateBy(loginName);
invoiceMaterial.setCreateTime(new Date());
});
invoiceMaterialMapper.insertFinancialTaxInvoiceMaterialBatch(invoiceMaterialList);
//获取历史开票信息
List<FinancialTaxInvoiceHistory> financialTaxInvoiceHistories = invoiceHistoryMapper.selectInvoiceHistoryListBySalesOrderCode(salesOrderCode);
//获取除了被审核拒接的历史开票信息
List<FinancialTaxInvoiceHistory> filterInvoiceHistories = financialTaxInvoiceHistories.stream().filter(item -> !item.getTaxInvoiceStatus().equals("3")).collect(Collectors.toList());
//判断历史开票信息是否超出开票限额
if (!CollectionUtils.isEmpty(filterInvoiceHistories)){
BigDecimal totalInvoiceQuotaRatio = filterInvoiceHistories.stream().map(FinancialTaxInvoiceHistory::getInvoiceQuotaRatio)
.reduce(BigDecimal.ZERO, BigDecimal::add);
//判断累计开票比例是否超出开票限额
if (totalInvoiceQuotaRatio.add(financialTaxInvoice.getInvoiceQuotaRatio()).compareTo(new BigDecimal("100")) > 0 ){
throw new BusinessException("累计开票比例超出开票限额100%");
}
}
//填充国税发票历史数据
FinancialTaxInvoiceHistory financialTaxInvoiceHistory = new FinancialTaxInvoiceHistory();
financialTaxInvoiceHistory.setTaxInvoiceCode(taxInvoiceCode);
financialTaxInvoiceHistory.setSalesOrderCode(salesOrderCode);
if ("1".equals(financialTaxInvoice.getCommonCurrency())){
financialTaxInvoiceHistory.setInvoiceAmountRmb(financialTaxInvoice.getInvoiceAmountRmb());
}else {
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);
}
/**
* 审核国税发票
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice, String taxInvoiceStatus) {
String loginName = ShiroUtils.getLoginName();
String taxInvoiceCode = financialTaxInvoice.getTaxInvoiceCode();
FinancialTaxInvoiceHistory invoiceHistory = invoiceHistoryMapper.selectInvoiceHistoryByInvoiceCode(taxInvoiceCode);
invoiceHistory.setUpdateTime(new Date());
invoiceHistory.setUpdateBy(loginName);
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);
}
}
}

26
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java

@ -22,7 +22,9 @@ import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.financial.domain.FinancialTaxInvoice;
import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory;
import com.ruoyi.financial.service.IFinancialReceivablesService;
import com.ruoyi.financial.service.IFinancialTaxInvoiceHistoryService;
import com.ruoyi.financial.service.IFinancialTaxInvoiceService;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.*;
@ -101,6 +103,10 @@ public class SysSalesOrderController extends BaseController
@Autowired
private IFinancialTaxInvoiceService taxInvoiceService;
@Autowired
private IFinancialTaxInvoiceHistoryService invoiceHistoryService;
@RequiresPermissions("system:salesOrder:view")
@GetMapping()
public String salesOrder(ModelMap mmap)
@ -623,11 +629,27 @@ public class SysSalesOrderController extends BaseController
*/
@ResponseBody
@PostMapping("/getSalesOrderCodeChildListByCode")
public TableDataInfo getSalesOrderCodeChildListByCode(@RequestParam("salesOrderCode") String salesOrderCode)
@PostMapping("/getSalesOrderChildListByCode")
public TableDataInfo getSalesOrderChildListByCode(@RequestParam("salesOrderCode") String salesOrderCode)
{
startPage();
List<SysSalesOrderChild> list = sysSalesOrderChildService.selectOrderChildListBySalesOrderCode(salesOrderCode);
return getDataTable(list);
}
/**
* 查询开票历史记录列表
*/
@ResponseBody
@PostMapping("/getInvoiceHistoryListBySalesOrderCode")
public TableDataInfo getInvoiceHistoryListBySalesOrderCode(@RequestParam("salesOrderCode") String salesOrderCode)
{
startPage();
List<FinancialTaxInvoiceHistory> list = invoiceHistoryService.selectInvoiceHistoryListBySalesOrderCode(salesOrderCode);
return getDataTable(list);
}
}

13
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java

@ -88,7 +88,7 @@ public class SysCustomer extends BaseEntity
/** 税率 */
@Excel(name = "税率")
private String taxRate;
private Double taxRate;
/** 诚信评级 */
@Excel(name = "诚信评级")
@ -556,16 +556,15 @@ public class SysCustomer extends BaseEntity
{
return confirmTax;
}
public void setTaxRate(String taxRate)
{
this.taxRate = taxRate;
}
public String getTaxRate()
{
public Double getTaxRate() {
return taxRate;
}
public void setTaxRate(Double taxRate) {
this.taxRate = taxRate;
}
public Long getDeliveryAddressId() {
return deliveryAddressId;
}

19
ruoyi-admin/src/main/java/com/ruoyi/system/domain/exportDto/SysCustomerDto.java

@ -190,7 +190,7 @@ public class SysCustomerDto extends SysCustomer
/** 税率 */
@ExcelProperty("税率")
private String taxRate;
private Double taxRate;
/** 国家/地区编号 */
@ExcelProperty("国家/地区编号")
@ -574,16 +574,19 @@ public class SysCustomerDto extends SysCustomer
{
return confirmTax;
}
public void setTaxRate(String taxRate)
{
this.taxRate = taxRate;
}
public String getTaxRate()
{
@Override
public Double getTaxRate() {
return taxRate;
}
public void setCountryNumber(String countryNumber)
@Override
public void setTaxRate(Double taxRate) {
this.taxRate = taxRate;
}
public void setCountryNumber(String countryNumber)
{
this.countryNumber = countryNumber;
}

5
ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java

@ -104,4 +104,9 @@ public interface WarehouseOutOrderMapper
* */
WarehouseOutOrder selectWarehouseOutOrderByShippingDeviceId(String shippingDeviceId);
/*
* 根据生产单号查询出库单数据
* */
public int sumOutOrderQuantityByMakeNo(String makeNo);
}

BIN
ruoyi-admin/src/main/resources/FinancialReceiptVoucherTemplate.xlsx

Binary file not shown.

1
ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml

@ -124,7 +124,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<foreach item="snCode" collection="array" open="(" separator="," close=")">
#{snCode}
</foreach>
and material_no = #{materialNo}
</select>

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

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.financial.mapper.FinancialTaxInvoiceHistoryMapper">
<resultMap type="FinancialTaxInvoiceHistory" id="FinancialTaxInvoiceHistoryResult">
<result property="invoiceHistoryId" column="invoice_history_id" />
<result property="taxInvoiceCode" column="tax_invoice_code" />
<result property="salesOrderCode" column="sales_order_code" />
<result property="taxInvoiceStatus" column="tax_invoice_status" />
<result property="applyTime" column="apply_time" />
<result property="financeMembers" column="finance_members" />
<result property="invoiceQuotaRatio" column="invoice_quota_ratio" />
<result property="invoiceAmountRmb" column="invoice_amount_rmb" />
<result property="invoiceAmountUsd" column="invoice_amount_usd" />
<result property="invoicePurpose" column="invoice_purpose" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="useStatus" column="use_status" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectFinancialTaxInvoiceHistoryVo">
select invoice_history_id, tax_invoice_code, sales_order_code, tax_invoice_status, apply_time, finance_members, invoice_quota_ratio, invoice_amount_rmb, invoice_amount_usd, invoice_purpose, create_by, create_time, update_by, update_time, remark, use_status, del_flag from financial_tax_invoice_history
</sql>
<select id="selectFinancialTaxInvoiceHistoryList" parameterType="FinancialTaxInvoiceHistory" resultMap="FinancialTaxInvoiceHistoryResult">
<include refid="selectFinancialTaxInvoiceHistoryVo"/>
<where>
</where>
</select>
<select id="selectFinancialTaxInvoiceHistoryById" parameterType="Long" resultMap="FinancialTaxInvoiceHistoryResult">
<include refid="selectFinancialTaxInvoiceHistoryVo"/>
where invoice_history_id = #{invoiceHistoryId}
</select>
<select id="selectInvoiceHistoryListBySalesOrderCode" parameterType="String" resultMap="FinancialTaxInvoiceHistoryResult">
<include refid="selectFinancialTaxInvoiceHistoryVo"/>
where sales_order_code = #{salesOrderCode}
</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 into financial_tax_invoice_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taxInvoiceCode != null">tax_invoice_code,</if>
<if test="salesOrderCode != null">sales_order_code,</if>
<if test="taxInvoiceStatus != null">tax_invoice_status,</if>
<if test="applyTime != null">apply_time,</if>
<if test="financeMembers != null">finance_members,</if>
<if test="invoiceQuotaRatio != null">invoice_quota_ratio,</if>
<if test="invoiceAmountRmb != null">invoice_amount_rmb,</if>
<if test="invoiceAmountUsd != null">invoice_amount_usd,</if>
<if test="invoicePurpose != null">invoice_purpose,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="useStatus != null">use_status,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taxInvoiceCode != null">#{taxInvoiceCode},</if>
<if test="salesOrderCode != null">#{salesOrderCode},</if>
<if test="taxInvoiceStatus != null">#{taxInvoiceStatus},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="financeMembers != null">#{financeMembers},</if>
<if test="invoiceQuotaRatio != null">#{invoiceQuotaRatio},</if>
<if test="invoiceAmountRmb != null">#{invoiceAmountRmb},</if>
<if test="invoiceAmountUsd != null">#{invoiceAmountUsd},</if>
<if test="invoicePurpose != null">#{invoicePurpose},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="useStatus != null">#{useStatus},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateFinancialTaxInvoiceHistory" parameterType="FinancialTaxInvoiceHistory">
update financial_tax_invoice_history
<trim prefix="SET" suffixOverrides=",">
<if test="taxInvoiceCode != null">tax_invoice_code = #{taxInvoiceCode},</if>
<if test="salesOrderCode != null">sales_order_code = #{salesOrderCode},</if>
<if test="taxInvoiceStatus != null">tax_invoice_status = #{taxInvoiceStatus},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="financeMembers != null">finance_members = #{financeMembers},</if>
<if test="invoiceQuotaRatio != null">invoice_quota_ratio = #{invoiceQuotaRatio},</if>
<if test="invoiceAmountRmb != null">invoice_amount_rmb = #{invoiceAmountRmb},</if>
<if test="invoiceAmountUsd != null">invoice_amount_usd = #{invoiceAmountUsd},</if>
<if test="invoicePurpose != null">invoice_purpose = #{invoicePurpose},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where invoice_history_id = #{invoiceHistoryId}
</update>
<delete id="deleteFinancialTaxInvoiceHistoryById" parameterType="Long">
delete from financial_tax_invoice_history where invoice_history_id = #{invoiceHistoryId}
</delete>
<delete id="deleteFinancialTaxInvoiceHistoryByIds" parameterType="String">
delete from financial_tax_invoice_history where invoice_history_id in
<foreach item="invoiceHistoryId" collection="array" open="(" separator="," close=")">
#{invoiceHistoryId}
</foreach>
</delete>
<update id="cancelFinancialTaxInvoiceHistoryById" parameterType="Long">
update financial_tax_invoice_history set del_flag = '1' where invoice_history_id = #{invoiceHistoryId}
</update>
<update id="restoreFinancialTaxInvoiceHistoryById" parameterType="Long">
update financial_tax_invoice_history set del_flag = '0' where invoice_history_id = #{invoiceHistoryId}
</update>
</mapper>

14
ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml

@ -36,7 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="usdTaxSum" column="usdTaxSum" />
<result property="invoiceEmail" column="invoice_email" />
<result property="invoiceQuotaRatio" column="invoice_quota_ratio" />
<result property="invoiceAmount" column="invoice_amount" />
<result property="invoiceAmountRmb" column="invoice_amount_rmb" />
<result property="invoiceAmountUsd" column="invoice_amount_usd" />
<result property="actualInvoiceAmount" column="actual_invoice_amount" />
<result property="actualInvoiceAmountRmb" column="actual_invoice_amount_rmb" />
<result property="actualInvoiceAmountUsd" column="actual_invoice_amount_usd" />
@ -55,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectFinancialTaxInvoiceVo">
select tax_invoice_id, tax_invoice_code, tax_invoice_status, use_status, sales_order_code, sales_order_number, sales_order_type, tax_invoice_type, tax_invoice_class, tax_invoice_title, business_members, apply_user, enterprise_code, enterprise_name, contact_number, enterprise_address, common_currency, invoice_company_name, invoice_company_code, deposit_bank, bank_account, tax_rate, usd_tax, material_sum, enterprise_sum, noRmbSum, rmbTaxSum, noUsdSum, usdTaxSum, invoice_email, invoice_quota_ratio, invoice_amount, actual_invoice_amount, actual_invoice_amount_rmb, actual_invoice_amount_usd, invoice_purpose, business_remark, invoice_remark, invoice_data, invoice_code, invoice_phone, create_by, create_time, update_by, update_time, remark, del_flag from financial_tax_invoice
select tax_invoice_id, tax_invoice_code, tax_invoice_status, use_status, sales_order_code, sales_order_number, sales_order_type, tax_invoice_type, tax_invoice_class, tax_invoice_title, business_members, apply_user, enterprise_code, enterprise_name, contact_number, enterprise_address, common_currency, invoice_company_name, invoice_company_code, deposit_bank, bank_account, tax_rate, usd_tax, material_sum, enterprise_sum, noRmbSum, rmbTaxSum, noUsdSum, usdTaxSum, invoice_email, invoice_quota_ratio, invoice_amount_rmb, invoice_amount_usd, actual_invoice_amount, actual_invoice_amount_rmb, actual_invoice_amount_usd, invoice_purpose, business_remark, invoice_remark, invoice_data, invoice_code, invoice_phone, create_by, create_time, update_by, update_time, remark, del_flag from financial_tax_invoice
</sql>
<select id="selectFinancialTaxInvoiceList" parameterType="FinancialTaxInvoice" resultMap="FinancialTaxInvoiceResult">
@ -113,7 +114,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="usdTaxSum != null">usdTaxSum,</if>
<if test="invoiceEmail != null">invoice_email,</if>
<if test="invoiceQuotaRatio != null">invoice_quota_ratio,</if>
<if test="invoiceAmount != null">invoice_amount,</if>
<if test="invoiceAmountRmb != null">invoice_amount_rmb,</if>
<if test="invoiceAmountUsd != null">invoice_amount_usd,</if>
<if test="actualInvoiceAmount != null">actual_invoice_amount,</if>
<if test="actualInvoiceAmountRmb != null">actual_invoice_amount_rmb,</if>
<if test="actualInvoiceAmountUsd != null">actual_invoice_amount_usd,</if>
@ -161,7 +163,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="usdTaxSum != null">#{usdTaxSum},</if>
<if test="invoiceEmail != null">#{invoiceEmail},</if>
<if test="invoiceQuotaRatio != null">#{invoiceQuotaRatio},</if>
<if test="invoiceAmount != null">#{invoiceAmount},</if>
<if test="invoiceAmountRmb != null">#{invoiceAmountRmb},</if>
<if test="invoiceAmountUsd != null">#{invoiceAmountUsd},</if>
<if test="actualInvoiceAmount != null">#{actualInvoiceAmount},</if>
<if test="actualInvoiceAmountRmb != null">#{actualInvoiceAmountRmb},</if>
<if test="actualInvoiceAmountUsd != null">#{actualInvoiceAmountUsd},</if>
@ -213,7 +216,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="usdTaxSum != null">usdTaxSum = #{usdTaxSum},</if>
<if test="invoiceEmail != null">invoice_email = #{invoiceEmail},</if>
<if test="invoiceQuotaRatio != null">invoice_quota_ratio = #{invoiceQuotaRatio},</if>
<if test="invoiceAmount != null">invoice_amount = #{invoiceAmount},</if>
<if test="invoiceAmountRmb != null">invoice_amount_rmb = #{invoiceAmountRmb},</if>
<if test="invoiceAmountUsd != null">invoice_amount_usd = #{invoiceAmountUsd},</if>
<if test="actualInvoiceAmount != null">actual_invoice_amount = #{actualInvoiceAmount},</if>
<if test="actualInvoiceAmountRmb != null">actual_invoice_amount_rmb = #{actualInvoiceAmountRmb},</if>
<if test="actualInvoiceAmountUsd != null">actual_invoice_amount_usd = #{actualInvoiceAmountUsd},</if>

7
ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMaterialMapper.xml

@ -48,7 +48,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectFinancialTaxInvoiceMaterialVo"/>
where invoice_material_id = #{invoiceMaterialId}
</select>
<select id="selectFinancialTaxInvoiceMaterialByCode" parameterType="String" resultMap="FinancialTaxInvoiceMaterialResult">
<include refid="selectFinancialTaxInvoiceMaterialVo"/>
where tax_invoice_code = #{taxInvoiceCode}
</select>
<insert id="insertFinancialTaxInvoiceMaterial" parameterType="FinancialTaxInvoiceMaterial" useGeneratedKeys="true" keyProperty="invoiceMaterialId">
insert into financial_tax_invoice_material
<trim prefix="(" suffix=")" suffixOverrides=",">

5
ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml

@ -102,6 +102,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where shipping_device_id = #{shippingDeviceId}
</select>
<select id="sumOutOrderQuantityByMakeNo" parameterType="String" resultType="int">
select sum(out_order_sum) as totalQuantity
from warehouse_out_order
where make_no = #{makeNo} and warehouse_out_status = '7'
</select>
<insert id="insertWarehouseOutOrder" parameterType="WarehouseOutOrder" useGeneratedKeys="true" keyProperty="outOrderId">
insert into warehouse_out_order

39
ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/add.html

@ -331,6 +331,16 @@
field: 'snCode',
editable: {
type: 'text', // 表示该列可以被编辑为文本
validate: function(value, row) {
// 检查 SN 号是否已存在
// var materialNo = row.materialNo;
// checkSnCodeExists(materialNo, value, function(exists) {
// if (!exists) {
// // 如果 SN 号不存在,则返回错误信息
// return '该SN号不存在!';
// }
// });
}
},
},
@ -342,13 +352,13 @@
},
},
{
title: '售后问题',
field: 'adverseReportUrl',
editable: {
type: 'text', // 表示该列可以被编辑为文本
// 可以在这里定义更多编辑行为,比如验证、提交等
},
// title: '售后问题',
// field: 'adverseReportUrl',
// editable: {
// type: 'text', // 表示该列可以被编辑为文本
//
// // 可以在这里定义更多编辑行为,比如验证、提交等
// },
},
{
title: '不良报告',
@ -385,7 +395,20 @@
};
$.table.init(options);
})
function checkSnCodeExists(materialNo,snCode, callback) {
$.ajax({
url: ctx + 'aftersales/complaintNotice/checkSnCode',
method: 'POST',
data: { materialNo: materialNo,snCode: snCode },
success: function(response) {
callback(response.exists); // 假设响应中有一个布尔值表示是否存在
},
error: function(xhr, status, error) {
console.error(error);
callback(false); // 如果出现错误,默认认为不存在
}
});
}
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);

12
ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/edit.html

@ -100,6 +100,7 @@
"materialUnit": item.materialUnit,
"materialBrand": item.materialBrand,
"materialDescribe": item.materialDescribe,
"shippedGoodsSum": item.shippedGoodsSum,
"snCode": item.snCode,
"complaintProblem": item.complaintProblem,
// "emergencyDegree": item.emergencyDegree,
@ -283,6 +284,10 @@
title: '描述',
field: 'materialDescribe',
},
{
title: '已出库数',
field: 'shippedGoodsSum',
},
{
title: 'SN号',
field: 'snCode',
@ -299,13 +304,18 @@
},
},
{
title: '售后问题',
title: '不良报告',
field: 'adverseReportUrl',
editable: {
type: 'text', // 表示该列可以被编辑为文本
// 可以在这里定义更多编辑行为,比如验证、提交等
},
},
{
title: '是否结案',
field: 'closingProcedures',
visible: false,
},
{
title: '操作',
align: 'center',

160
ruoyi-admin/src/main/resources/templates/financial/receivables/receivables.html

@ -72,9 +72,9 @@
</li>
<li class="select-time">
<label>上次更新时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginUpdateTime]"/>
<input type="text" class="time-input" id="startTime1" placeholder="开始时间" name="params[beginUpdateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endUpdateTime]"/>
<input type="text" class="time-input" id="endTime1" placeholder="结束时间" name="params[endUpdateTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -89,6 +89,9 @@
<a class="btn btn-success" onclick="addFinancialReceivables()" shiro:hasPermission="financial:receivables:add">
<i class="fa fa-plus"></i> 添加应收账款
</a>
<a class="btn btn-warning" onclick="exportReceivablesVoucher()" shiro:hasPermission="financial:receivables:export">
<i class="fa fa-download"></i> 导出收款凭证
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="financial:receivables:export">
<i class="fa fa-download"></i> 导出应收账单
</a>
@ -108,7 +111,6 @@
var currencyTypeDatas = [[${@dict.getType('sys_common_currency')}]];
var financialDeliverStatusDatas = [[${@dict.getType('financial_deliver_status')}]];
var prefix = ctx + "financial/receivables";
$(function() {
var options = {
url: prefix + "/list",
@ -119,116 +121,41 @@
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
modalName: "财务应收账款",
columns: [{
checkbox: true
},
{
title: '财务应收账款id',
field: 'financialReceivablesId',
visible: false
},
{
title: '应收单号',
field: 'financialReceivablesCode',
},
{
title: '收款结案状态',
field: 'receivablesClosingStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(receivablesClosingStatusDatas, value);
}
},
{
title: '关联单号',
field: 'salesOrderCode',
},
{
title: '贷方科目',
field: 'creditAccount',
},
{
title: '贷方明细',
field: 'creditDetail',
},
{
title: '开户银行',
field: 'openBank',
},
{
title: '开户账号',
field: 'openAccount',
},
{
title: '客户ID',
field: 'customerId',
},
{
title: '合同编号',
field: 'contractNumber',
},
{
title: '币种',
field: 'currencyType',
formatter: function(value, row, index) {
return $.table.selectDictLabel(currencyTypeDatas, value);
}
},
{
title: '不含税金额',
field: 'priceExcludingTax',
},
{
title: '含税金额',
field: 'priceIncludesTax',
},
{
title: '付款条件',
field: 'paymentCondition',
},
{
title: '实收含税金额',
field: 'receivedIncludesTax',
},
{
title: '未收含税金额',
field: 'notReceivedIncludesTax',
},
{
title: '业务员',
field: 'businessMembers',
},
{
title: '发货状态',
field: 'financialDeliverStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(financialDeliverStatusDatas, value);
}
},
{
title: '录入时间',
field: 'createTime',
},
{
title: '更新人',
field: 'updateBy',
},
{
title: '上次更新时间',
field: 'updateTime',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + addReceivablesVoucherFlag + '" href="javascript:void(0)" onclick="addReceivablesVoucher(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>创建收款凭证</a> ');
if (row.receivablesClosingStatus !== '2') {
actions.push('<a class="btn btn-success btn-xs ' + closingFlag + '" href="javascript:void(0)" onclick="confirmAndClose(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>结案</a> ');
columns: [
{checkbox: true},
{title: '财务应收账款id', field: 'financialReceivablesId', visible: false},
{title: '应收单号', field: 'financialReceivablesCode',},
{title: '收款结案状态', field: 'receivablesClosingStatus', formatter: function(value, row, index) {return $.table.selectDictLabel(receivablesClosingStatusDatas, value);}},
{title: '关联单号', field: 'salesOrderCode',},
{title: '贷方科目', field: 'creditAccount',},
{title: '贷方明细', field: 'creditDetail',},
{title: '开户银行', field: 'openBank',},
{title: '开户账号', field: 'openAccount',},
{title: '客户ID', field: 'customerId',},
{title: '合同编号', field: 'contractNumber',},
{title: '币种', field: 'currencyType', formatter: function(value, row, index) {return $.table.selectDictLabel(currencyTypeDatas, value);}},
{title: '不含税金额', field: 'priceExcludingTax',},
{title: '含税金额', field: 'priceIncludesTax',},
{title: '付款条件', field: 'paymentCondition',},
{title: '实收含税金额', field: 'receivedIncludesTax',},
{title: '未收含税金额', field: 'notReceivedIncludesTax',},
{title: '业务员', field: 'businessMembers',},
{title: '发货状态', field: 'financialDeliverStatus', formatter: function(value, row, index) {return $.table.selectDictLabel(financialDeliverStatusDatas, value);}},
{title: '录入时间', field: 'createTime',},
{title: '更新人', field: 'updateBy',},
{title: '上次更新时间', field: 'updateTime',},
{title: '操作', align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + addReceivablesVoucherFlag + '" href="javascript:void(0)" onclick="addReceivablesVoucher(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>创建收款凭证</a> ');
if (row.receivablesClosingStatus !== '2') {
actions.push('<a class="btn btn-success btn-xs ' + closingFlag + '" href="javascript:void(0)" onclick="confirmAndClose(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>结案</a> ');
}
actions.push('<a class="btn btn-success btn-xs ' + receivablesVoucherDetailFlag + '" href="javascript:void(0)" onclick="receivablesVoucherDetail(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
actions.push('<a class="btn btn-success btn-xs ' + receivablesVoucherDetailFlag + '" href="javascript:void(0)" onclick="receivablesVoucherDetail(\'' + row.financialReceivablesId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
}]
]
};
$.table.init(options);
});
@ -286,6 +213,17 @@
}
});
}
//导出应收款账单收款凭证,单个导出
function exportReceivablesVoucher() {
var bootstrpa = $("#bootstrap-table").bootstrapTable('getSelections');
var financialReceivablesId = bootstrpa[0].financialReceivablesId;
if (bootstrpa.length !== 1) {
$.modal.alertWarning("请选择一条数据");
return;
}
window.location.href = ctx + "financial/receivables/excelReceivablesVoucher/" + financialReceivablesId;
}
</script>
</body>
</html>

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

@ -0,0 +1,342 @@
<!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">不含税总价(RMB):</label>
<div class="col-sm-7">
<input name="noRmbSum" th:field="*{noRmbSum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">含税总价(RMB):</label>
<div class="col-sm-7">
<input name="rmbTaxSum" th:field="*{rmbTaxSum}" class="form-control" type="text" id="rmbTaxSumInput" 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">开票金额(RMB):</label>
<div class="col-sm-7">
<input name="invoiceAmountRmb" th:field="*{invoiceAmountRmb}" class="form-control" type="text" id="invoiceAmountRmbInput" 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: '物料的含税单价(RMB)',
field: 'taxRmb',
},
{
title: '物料的不含税单价(RMB)',
field: 'noTaxRmb',
},
{
title: '已出库数量',
field: 'outBoundQuantity',
},
{
title: '已验收数',
field: 'hasCheckNum',
},
{
title: '退货数',
field: 'refundsNum',
}]
};
$.table.init(options);
});
</script>
</body>
</html>

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>

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

@ -99,25 +99,22 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('financial:taxInvoice:edit')}]];
var removeFlag = [[${@permission.hasPermi('financial:taxInvoice:remove')}]];
var cancelFlag = [[${@permission.hasPermi('financial:taxInvoice:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('financial:taxInvoice:restore')}]];
var auditInvoiceFlag = [[${@permission.hasPermi('financial:taxInvoice:auditInvoice')}]];
var taxInvoiceStatusDatas = [[${@dict.getType('tax_invoice_status')}]];
var salesOrderTypeDatas = [[${@dict.getType('sys_order_type')}]];
var taxInvoiceTypeDatas = [[${@dict.getType('tax_invoice_type')}]];
var taxInvoiceClassDatas = [[${@dict.getType('tax_invoice_class')}]];
var taxInvoiceTitleDatas = [[${@dict.getType('tax_invoice_title')}]];
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]];
var prefix = ctx + "financial/taxInvoice";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
modalName: "国税发票",
columns: [{
@ -265,11 +262,8 @@
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.taxInvoiceId + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
if (row.taxInvoiceStatus=="0"){
actions.push('<a class="btn btn-success btn-xs ' + auditInvoiceFlag + '" href="javascript:void(0)" onclick="auditInvoice(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>审核</a>');
}
return actions.join('');
}
@ -277,6 +271,41 @@
};
$.table.init(options);
});
//审核页面
function auditInvoice(taxInvoiceId) {
var btn = ['<i class="fa fa-check"></i> 审核通过', '<i class="fa fa-remove"></i> 审核拒绝', '<i class="fa fa-close"></i> 关闭'];
var options = {
title: '审核发票',
url: prefix + "/auditInvoice/" + taxInvoiceId,
btn: btn,
yes: function (index, layero) { // 审核通过按钮
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-auditRmb').serialize();
var taxInvoiceStatus = "1";
var url= prefix + "/auditInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 true 表示审核通过
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
return false
},
btn2: function (index, layero) { // 审核拒绝按钮
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-auditRmb').serialize();
var taxInvoiceStatus = "3";
var url= prefix + "/auditInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 false 表示审核拒绝
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
return false;
}
};
$.modal.openOptions(options);
}
</script>
</body>
</html>

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

@ -25,13 +25,15 @@
<div class="form-group">
<label class="col-sm-5 control-label">报价币种:</label>
<div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_common_currency')}">
<input type="radio" th:id="${'commonCurrency_' + dict.dictCode}" name="commonCurrency" th:value="${dict.dictValue}" th:field="*{commonCurrency}" readonly>
<label th:for="${'commonCurrency_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
<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">
@ -89,7 +91,10 @@
<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>
@ -174,7 +179,7 @@
<div class="form-group">
<label class="col-sm-5 control-label">含税总价(RMB):</label>
<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>
@ -194,16 +199,16 @@
<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">
<input name="invoiceQuotaRatio" th:field="*{invoiceQuotaRatio}" class="form-control" type="text" id="invoiceQuotaRatioInput">
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票金额:</label>
<label class="col-sm-5 control-label">开票金额(RMB)</label>
<div class="col-sm-7">
<input name="invoiceAmount" th:field="*{invoiceAmount}" class="form-control" type="text">
<input name="invoiceAmountRmb" th:field="*{invoiceAmountRmb}" class="form-control" type="text" id="invoiceAmountRmbInput" readonly>
</div>
</div>
<div class="form-group">
@ -213,9 +218,6 @@
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
@ -224,6 +226,7 @@
var materialProcessMethodDatas = [[${@dict.getType('processMethod')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var taxInvoiceStatusDatas = [[${@dict.getType('tax_invoice_status')}]];
var taxInvoice = [[${taxInvoice}]];
@ -273,11 +276,11 @@
}
//开票物料
$(function() {
var options = {
id: 'bootstrap-table-material',
url: prefix + "/getSalesOrderCodeChildListByCode",
url: prefix + "/getSalesOrderChildListByCode",
queryParams: function(params) {
return {
salesOrderCode: $("#salesOrderCode").val(),
@ -364,6 +367,84 @@
});
//开票历史
$(function() {
var options = {
id: 'bootstrap-table-history',
url: prefix + "/getInvoiceHistoryListBySalesOrderCode",
queryParams: function(params) {
return {
salesOrderCode: $("#salesOrderCode").val(),
}
},
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
modalName: "国税发票历史记录",
columns: [{
checkbox: true
},
{
title: '国税发票历史id',
field: 'invoiceHistoryId',
visible: false
},
{
title: '申请时间',
field: 'applyTime',
},
{
title: '国税发票单号',
field: 'taxInvoiceCode',
},
{
title: '开票额度比例',
field: 'invoiceQuotaRatio',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value + "%";
}
}
},
{
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('<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('');
}
}]
};
$.table.init(options);
});
//获取客户发票信息
$(document).ready(function() {
@ -407,6 +488,7 @@
$('input[name="invoiceCompanyCode"]').val(details.invoiceCompanyCode);
$('input[name="depositBank"]').val(details.depositBank);
$('input[name="bankAccount"]').val(details.bankAccount);
$('input[name="taxRate"]').val(details.taxRate);
}
// 封装清空发票详情的函数
@ -414,6 +496,7 @@
$('input[name="invoiceCompanyCode"]').val('');
$('input[name="depositBank"]').val('');
$('input[name="bankAccount"]').val('');
$('input[name="taxRate"]').val('');
}
@ -457,6 +540,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>
</body>
</html>

566
ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceUSD.html

@ -0,0 +1,566 @@
<!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-USDAdd" 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="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">
<select class="form-control" id="invoiceCompanyName" name="invoiceCompanyName" th:field="*{invoiceCompanyName}">
<!-- 这里动态生成开票公司名称选项 -->
</select>
</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}" required>
<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}" required>
<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}" required>
<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">
</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">
</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 class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-history"></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">
<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">
</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 + "system/salesOrder"
$("#form-taxInvoice-USDAdd").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
//获取表单的数据
const makeInvoiceRMBData = $('#form-taxInvoice-USDAdd').serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
var makeInvoiceMaterialTable = $("#bootstrap-table-material").bootstrapTable('getData');
//将makeInvoiceMaterialTable转换成和makeInvoiceRMBData一样的形式
var makeInvoiceMaterialList = makeInvoiceMaterialTable.map(function (item) {
return {
invoiceMaterialId: item.invoiceMaterialId,
materialCode: item.materialCode,
materialName: item.materialName,
materialType: item.materialType,
materialProcessMethod: item.processMethod,
materialBrand:item.brand,
materialUnit: item.unit,
noTaxUsd: item.materialNoUsd,
taxUsd: item.materialUsd,
materialNum: item.materialNum,
outBoundQuantity: item.outBoundQuantity,
hasCheckNum: item.hasCheckNum,
refundsNum: item.refundsNum
}
});
const combinedData = Object.assign(makeInvoiceRMBData, {
invoiceMaterialList: makeInvoiceMaterialList
});
const jsonData = JSON.stringify(combinedData);
$.operate.saveJson(prefix + "/makeInvoice",jsonData);
}
}
//开票物料
$(function() {
var options = {
id: 'bootstrap-table-material',
url: prefix + "/getSalesOrderChildListByCode",
queryParams: function(params) {
return {
salesOrderCode: $("#salesOrderCode").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: 'processMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(materialProcessMethodDatas, value);
}
},
{
title: '物料品牌',
field: 'brand',
},
{
title: '物料图片',
field: 'photourl',
},
{
title: '物料单位',
field: 'unit',
},
{
title: '物料描述',
field: 'describe',
},
{
title: '物料的数量',
field: 'materialNum',
},
{
title: '物料的含税单价(美元)',
field: 'materialUsd',
},
{
title: '物料的不含税单价(美元)',
field: 'materialNoUsd',
},
{
title: '已出库数量',
field: 'outBoundQuantity',
},
{
title: '已验收数',
field: 'hasCheckNum',
},
{
title: '退货数',
field: 'refundsNum',
}]
};
$.table.init(options);
});
//开票历史
$(function() {
var options = {
id: 'bootstrap-table-history',
url: prefix + "/getInvoiceHistoryListBySalesOrderCode",
queryParams: function(params) {
return {
salesOrderCode: $("#salesOrderCode").val(),
}
},
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
modalName: "国税发票历史记录",
columns: [{
checkbox: true
},
{
title: '国税发票历史id',
field: 'invoiceHistoryId',
visible: false
},
{
title: '申请时间',
field: 'applyTime',
},
{
title: '国税发票单号',
field: 'taxInvoiceCode',
},
{
title: '开票额度比例',
field: 'invoiceQuotaRatio',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value + "%";
}
}
},
{
title: '开票金额(美元)',
field: 'invoiceAmountUsd',
},
{
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('<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('');
}
}]
};
$.table.init(options);
});
//获取客户发票信息
$(document).ready(function() {
// 初始化时默认加载客户编号列表
loadInvoiceCompanyNames();
// 监听开票公司名称下拉框的变化
$('#invoiceCompanyName').on('change', function() {
var selectedInvoiceCompanyName = $(this).val(); // 获取选中的开票公司名称
if (selectedInvoiceCompanyName) {
// 发起Ajax请求获取客户名称
$.ajax({
type: 'POST',
url: ctx + 'system/customer/getSysInvoiceInfoByName',
dataType: 'json', // 假设返回的数据格式是JSON
data: { invoiceCompanyName: selectedInvoiceCompanyName }, // 数据放在这里
success: function(data) {
console.log(data);
// 将获取到的客户名称填充到输入框
if (!data || !data.data) {
// 如果返回的数据有问题,可以给出提示或处理
$.modal.alertWarning('未能获取到开票公司信息!');
} else {
fillInvoiceDetails(data.data);
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.error('Error:', textStatus, errorThrown);
$.modal.alertWarning('查询开票公司名称时发生错误!');
}
});
} else {
// 如果没有选择开票公司名称,清开票信息输入框
clearInvoiceDetails();
}
});
});
// 封装填充发票详情的函数
function fillInvoiceDetails(details) {
$('input[name="invoiceCompanyCode"]').val(details.invoiceCompanyCode);
$('input[name="depositBank"]').val(details.depositBank);
$('input[name="bankAccount"]').val(details.bankAccount);
}
// 封装清空发票详情的函数
function clearInvoiceDetails() {
$('input[name="invoiceCompanyCode"]').val('');
$('input[name="depositBank"]').val('');
$('input[name="bankAccount"]').val('');
}
// 假设的加载客户编号列表函数
function loadInvoiceCompanyNames() {
var enterpriseCode = $("#enterpriseCode").val();
var url = ctx + 'system/customer/getAllInvoiceCompanyNameByCode' + '?enterpriseCode=' + enterpriseCode;
var tempInvoiceCompanyName = taxInvoice.invoiceCompanyName;
$.ajax({
type: 'GET', // 请求类型
url: url, // 后端接口URL
dataType: 'json', // 预期服务器返回的数据类型
success: function(data) {
if (data && Array.isArray(data)) {
var selectElement = $('#invoiceCompanyName'); // 获取开票公司名称下拉框元素
// 清空下拉框现有选项
selectElement.empty();
// 添加默认选项
if (tempInvoiceCompanyName) {
selectElement.append('<option value="' + tempInvoiceCompanyName + '">' + tempInvoiceCompanyName + '</option>');
}
// 遍历返回的数据,添加为下拉框的选项
$.each(data, function(index, item) {
// 假设item有invoiceCompanyName属性,代表客户名称
selectElement.append('<option value="' + item.invoiceCompanyName + '">' + item.invoiceCompanyName + '</option>');
});
// 设置默认值
if (tempInvoiceCompanyName) {
selectElement.val(tempInvoiceCompanyName);
}
} else {
$.modal.errMsg("开票公司信息为空");
}
},
});
}
//通过监听额度比例输入框的值,动态计算开票金额
$(document).ready(function() {
var invoiceAmountUsdInput = $('#invoiceAmountUsdInput');
var invoiceQuotaRatioInput = $('#invoiceQuotaRatioInput');
var usdTaxSumInput = $('#usdTaxSumInput');
//监听开票额度比例输入框的变化
invoiceQuotaRatioInput.on('input', function() {
var usdTaxSum = parseFloat(usdTaxSumInput.val());
var invoiceQuotaRatio = parseFloat($(this).val());
if (!isNaN(usdTaxSum) && !isNaN(invoiceQuotaRatio)) {
//计算开票金额 = 税前总额 * 开票比例
var invoiceAmountUsd = usdTaxSum * (invoiceQuotaRatio / 100);
//更新开票金额输入框
invoiceAmountUsdInput.val(invoiceAmountUsd.toFixed(2));
} else {
invoiceAmountUsdInput.val('');
}
});
});
</script>
</body>
</html>

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

@ -419,22 +419,29 @@
// 定义状态码常量
const AUDIT_STATUS_APPROVED = "1";//审核通过
const INVOICE_ALLOWED = "1";//允许开票
const DELETE_FLAG = "2"; //作废
// 检查是否选择了恰好一行数据
if (selectedRows.length === 1) {
const row = selectedRows[0];
// 检查是否已审核
if (row.auditStatus === AUDIT_STATUS_APPROVED) {
// 检查是否允许开票
if (row.invoice === INVOICE_ALLOWED) {
const invoiceUrl = prefix + "/makeInvoice/" + row.salesOrderId;
$.modal.open("开票", invoiceUrl);
// 检查是否已作废
if (row.useStatus === DELETE_FLAG) {
showWarning("该订单已作废");
}else {
// 检查是否已审核
if (row.auditStatus === AUDIT_STATUS_APPROVED) {
// 检查是否允许开票
if (row.invoice === INVOICE_ALLOWED) {
const invoiceUrl = prefix + "/makeInvoice/" + row.salesOrderId;
$.modal.open("开票", invoiceUrl);
} else {
showWarning("该订单不允许开票");
}
} else {
showWarning("该订单不允许开票");
showWarning("请先审核");
}
} else {
showWarning("请先审核");
}
} else {
showWarning("请先选择一条销售订单");

Loading…
Cancel
Save