Browse Source

对外收款账单 PostReceivablesFeilDownload
汇款通知
价格更改

leiy 10 months ago
parent
commit
012c8edef1
1 changed files with 22 additions and 7 deletions
  1. 22 7
      OASystem/OASystem.Api/Controllers/FinancialController.cs

+ 22 - 7
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -923,12 +923,27 @@ namespace OASystem.API.Controllers
                 else if (dto.FileType == 3) //汇款通知
                 {
                     var _EnterExitCosts = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(it => it.IsDel == 0 && it.DiId == dto.DiId).First();
-                    var _DayAndCosts = _sqlSugar.Queryable<Grp_DayAndCost>().Where(it => it.IsDel == 0 && it.DiId == dto.DiId).ToList();
+                    var _DayAndCosts = _sqlSugar.Queryable<Grp_DayAndCost>().Where(it => it.IsDel == 0 && it.DiId == dto.DiId && it.NationalTravelFeeId > 0).ToList();
                     if (_EnterExitCosts == null)
                     {
                         return Ok(JsonView(false, "该团组未填写出入境费用;"));
                     }
 
+                    var _cityFee = _sqlSugar.Queryable<Grp_NationalTravelFee>().Where(it => it.IsDel == 0).ToList();
+
+                    foreach (var item in _DayAndCosts)
+                    {
+                        var cityInfo = _cityFee.Where(it => it.Id == item.NationalTravelFeeId).FirstOrDefault();
+                        if (cityInfo != null)
+                        {
+                            if (cityInfo.City.Contains("全部城市") || cityInfo.City.Contains("其他城市"))
+                            {
+                                item.Place = cityInfo.Country;
+                            }else item.Place = cityInfo.City;
+                        }
+                    }
+
+
                     //数据源
                     List<Grp_DayAndCost> dac1 = _DayAndCosts.Where(it => it.Type == 1).ToList(); //住宿费
                     List<Grp_DayAndCost> dac2 = _DayAndCosts.Where(it => it.Type == 2).ToList(); //伙食费
@@ -1047,10 +1062,10 @@ namespace OASystem.API.Controllers
                                     SetCells(ChildTable, doc, rowIndex, 0, item.Place);
                                     SetCells(ChildTable, doc, rowIndex, 1, days + "晚");
 
-                                    string currencyCode = currData.Find(it => it.Id == item.Currency)?.Name ?? "Unknown";
+                                    string currencyCode = currData.Find(it => it.Id == item.Currency)?.Remark ?? "Unknown";
                                     SetCells(ChildTable, doc, rowIndex, 2, item.Cost.ToString("#0.00") + currencyCode + "/晚");
                                     SetCells(ChildTable, doc, rowIndex, 3, " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00"));
-                                    SetCells(ChildTable, doc, rowIndex, 4, "CNY" + item.SubTotal * days + "\r\n");
+                                    SetCells(ChildTable, doc, rowIndex, 4, "CNY" + item.SubTotal + "\r\n");
                                     rowIndex++;
                                     zsinfo += item.Place + "  " + days + "晚 " + item.Cost.ToString("#0.00") + currencyCode + "/晚" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.0000") + "   CNY" + item.SubTotal * days + "\r\n";
                                 }
@@ -1084,10 +1099,10 @@ namespace OASystem.API.Controllers
                                     SetCells(ChildTable1, doc, rowIndex, 0, item.Place);
                                     SetCells(ChildTable1, doc, rowIndex, 1, days + "天");
 
-                                    string currencyCode = currData.Find(it => it.Id == item.Currency)?.Name ?? "Unknown";
+                                    string currencyCode = currData.Find(it => it.Id == item.Currency)?.Remark ?? "Unknown";
                                     SetCells(ChildTable1, doc, rowIndex, 2, item.Cost.ToString("#0.00") + currencyCode + "/天");
                                     SetCells(ChildTable1, doc, rowIndex, 3, " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00"));
-                                    SetCells(ChildTable1, doc, rowIndex, 4, "CNY" + item.SubTotal * days);
+                                    SetCells(ChildTable1, doc, rowIndex, 4, "CNY" + item.SubTotal);
                                     rowIndex++;
                                     hsinfo += item.Place + "  " + days + "天 " + item.Cost.ToString("#0.00") + currencyCode + "/天" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.0000") + "   CNY" + item.SubTotal * days + "\r\n";
                                 }
@@ -1121,10 +1136,10 @@ namespace OASystem.API.Controllers
                                     SetCells(ChildTable2, doc, rowIndex, 0, item.Place);
                                     SetCells(ChildTable2, doc, rowIndex, 1, days + "天");
 
-                                    string currencyCode = currData.Find(it => it.Id == item.Currency)?.Name ?? "Unknown";
+                                    string currencyCode = currData.Find(it => it.Id == item.Currency)?.Remark ?? "Unknown";
                                     SetCells(ChildTable2, doc, rowIndex, 2, item.Cost.ToString("#0.00") + currencyCode + "/天");
                                     SetCells(ChildTable2, doc, rowIndex, 3, " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00"));
-                                    SetCells(ChildTable2, doc, rowIndex, 4, "CNY" + item.SubTotal * days + "\r\n");
+                                    SetCells(ChildTable2, doc, rowIndex, 4, "CNY" + item.SubTotal + "\r\n");
                                     rowIndex++;
                                     gzinfo += item.Place + "  " + days + "天 " + item.Cost.ToString("#0.00") + currencyCode + "/天" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00") + "   CNY" + item.SubTotal * days + "\r\n";
                                 }