Browse Source

成本报表 费用支出单 美元 人民币

liuchaohui 1 year ago
parent
commit
70d35b0b3d

+ 7 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/entity/SyCostAllocationCostpay.java

@@ -72,13 +72,16 @@ public class SyCostAllocationCostpay implements Serializable {
     @ApiModelProperty(value = "费用项目")
     private String expenseItem;
     /**支出本币金额*/
-    @Excel(name = "支出本币金额", width = 15)
-    @ApiModelProperty(value = "支出本币金额")
+    @Excel(name = "人民币(不含税)", width = 15)
+    @ApiModelProperty(value = "人民币(不含税)")
     private java.math.BigDecimal disbursedLocalmoney;
     /**支出原币金额*/
-    @Excel(name = "支出原币金额", width = 15)
-    @ApiModelProperty(value = "支出原币金额")
+    @Excel(name = "美元", width = 15)
+    @ApiModelProperty(value = "美元")
     private java.math.BigDecimal disbursedOriginalmoney;
+    @Excel(name = "人民币(税额)", width = 15)
+    @ApiModelProperty(value = "人民币(税额)")
+    private java.math.BigDecimal shuiemoney;
     /**发票号*/
     @Excel(name = "发票号", width = 15)
     @ApiModelProperty(value = "发票号")

+ 12 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationCostpayMapper.xml

@@ -22,9 +22,11 @@
 		sp.cDefine10 as invoicenum,
 		sp.cMaker as preparedBy,
 		ex.cExpName as expenseItem,
-		sps.INatMoney as disbursedLocalmoney,
 		v.cVenName as processUnit,
-		sps.iMoney as disbursedOriginalmoney
+		case when sps.cExpCode='00011' then sps.iMoney end as shuiemoney,
+		case when sps.cExpCode!='00011' and sp.Cexch_Name='美元' then sps.iMoney*sp.iexchrate
+				 when sps.cExpCode!='00011' and sp.Cexch_Name='人民币' then sps.iMoney end as disbursedLocalmoney,
+		case when sps.cExpCode!='00011' and sp.Cexch_Name='美元' then sps.iMoney end as disbursedOriginalmoney
 		FROM
 		UFDATA_101_2021.dbo.SalePayVouch sp
 		INNER JOIN UFDATA_101_2021.dbo.SalePayVouchs sps ON sp.id = sps.id
@@ -46,9 +48,11 @@
 				 sp.cDefine10 as invoicenum,
 				 sp.cMaker as preparedBy,
 				 ex.cExpName as expenseItem,
-				 sps.INatMoney as disbursedLocalmoney,
 				 v.cVenName as processUnit,
-				 sps.iMoney as disbursedOriginalmoney
+				 case when sps.cExpCode='00011' then sps.iMoney end as shuiemoney,
+				 case when sps.cExpCode!='00011' and sp.Cexch_Name='美元' then sps.iMoney*sp.iexchrate
+				 	  when sps.cExpCode!='00011' and sp.Cexch_Name='人民币' then sps.iMoney end as disbursedLocalmoney,
+				 case when sps.cExpCode!='00011' and sp.Cexch_Name='美元' then sps.iMoney end as disbursedOriginalmoney
 			 FROM
 				 UFDATA_102_2021.dbo.SalePayVouch sp
 				 INNER JOIN UFDATA_102_2021.dbo.SalePayVouchs sps ON sp.id = sps.id
@@ -70,9 +74,11 @@
 				 sp.cDefine10 as invoicenum,
 				 sp.cMaker as preparedBy,
 				 ex.cExpName as expenseItem,
-				 sps.INatMoney as disbursedLocalmoney,
 				 v.cVenName as processUnit,
-				 sps.iMoney as disbursedOriginalmoney
+				 case when sps.cExpCode='00011' then sps.iMoney end as shuiemoney,
+				 case when sps.cExpCode!='00011' and sp.Cexch_Name='美元' then sps.iMoney*sp.iexchrate
+				 	  when sps.cExpCode!='00011' and sp.Cexch_Name='人民币' then sps.iMoney end as disbursedLocalmoney,
+				 case when sps.cExpCode!='00011' and sp.Cexch_Name='美元' then sps.iMoney end as disbursedOriginalmoney
 			 FROM
 				 UFDATA_103_2021.dbo.SalePayVouch sp
 				 INNER JOIN UFDATA_103_2021.dbo.SalePayVouchs sps ON sp.id = sps.id

+ 6 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/service/impl/SyCostAllocationServiceImpl.java

@@ -373,7 +373,9 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
                 if(syCostAllocation.getUsdExpense()==null){
                     syCostAllocation.setUsdExpense(BigDecimal.ZERO);
                 }
-                syCostAllocation.setUsdExpense(syCostAllocation.getUsdExpense().add(syCostAllocationCostpay.getDisbursedOriginalmoney()));
+                if(syCostAllocationCostpay.getDisbursedOriginalmoney()!=null){
+                    syCostAllocation.setUsdExpense(syCostAllocation.getUsdExpense().add(syCostAllocationCostpay.getDisbursedOriginalmoney()));
+                }
             }
 
             if(syCostAllocation.getRmbExpense()==null){
@@ -382,7 +384,9 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
                 if(syCostAllocation.getRmbExpense()==null){
                     syCostAllocation.setRmbExpense(BigDecimal.ZERO);
                 }
-                syCostAllocation.setRmbExpense(syCostAllocation.getRmbExpense().add(syCostAllocationCostpay.getDisbursedLocalmoney()));
+                if(syCostAllocationCostpay.getDisbursedLocalmoney()!=null){
+                    syCostAllocation.setRmbExpense(syCostAllocation.getRmbExpense().add(syCostAllocationCostpay.getDisbursedLocalmoney()));
+                }
             }
         }
         syCostAllocation.setSyCostAllocationCostpayList(syCostAllocationCostpays);