Bladeren bron

零用金 ++ OP

yuanrf 3 dagen geleden
bovenliggende
commit
318de824e2

+ 20 - 13
OASystem/OASystem.Domain/ViewModels/Groups/FeeAuditView.cs

@@ -14,7 +14,7 @@ namespace OASystem.Domain.ViewModels.Groups
     /// <summary>
     /// GroupCostView
     /// </summary>
-    public class GroupCostAuditView: Grp_GroupCost
+    public class GroupCostAuditView : Grp_GroupCost
     {
         #region OP 自动审核相关
 
@@ -46,32 +46,34 @@ namespace OASystem.Domain.ViewModels.Groups
         /// <summary>
         /// 自动审核 - 导游景点费用
         /// </summary>
-        public decimal GuideScenicFee { 
-            get { return TGEF; } 
-            set { TGEF = value; } 
+        public decimal GuideScenicFee
+        {
+            get { return TGEF; }
+            set { TGEF = value; }
         }
 
         /// <summary>
         /// 自动审核  - 导游小费
         /// </summary>
-        public decimal GuideTipFee 
-        { 
-            get { return TGTips; } 
-            set { TGTips = value; } 
+        public decimal GuideTipFee
+        {
+            get { return TGTips; }
+            set { TGTips = value; }
         }
 
         /// <summary>
         /// 自动审核 - 导游餐费
         /// </summary>
-        public decimal GuideMealFee { 
-            get { return TGM; } 
-            set { TGM = value; } 
+        public decimal GuideMealFee
+        {
+            get { return TGM; }
+            set { TGM = value; }
         }
 
         /// <summary>
         /// 自动审核 - 导游住宿费
         /// </summary>
-        public decimal GuideRoomFee { get { return TGA; } set { TGA = value;} }
+        public decimal GuideRoomFee { get { return TGA; } set { TGA = value; } }
 
         /// <summary>
         /// 自动审核 - 导游交通费
@@ -122,7 +124,7 @@ namespace OASystem.Domain.ViewModels.Groups
         /// TODO:(没有具体匹配项)自动审核 - 客户午餐超支费用
         /// </summary>
         public decimal ClientLunchOverFee { get; set; }
-        
+
         /// <summary>
         /// 自动审核 - 客户晚餐
         /// </summary>
@@ -153,6 +155,11 @@ namespace OASystem.Domain.ViewModels.Groups
         /// </summary>
         public decimal TranslatorOverTimeFee { get; set; }
 
+        /// <summary>
+        /// 自动审核 - 零用金
+        /// </summary>
+        public decimal CashFee { get { return PC; } set { PC = value; } }
+
         #endregion
 
         #region 自动审核 - 酒店相关字段

+ 18 - 11
OASystem/OASystem.Infrastructure/Repositories/Groups/FeeAuditRepository.cs

@@ -9,11 +9,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
     /// <summary>
     /// 费用审核仓储
     /// </summary>
-    public class FeeAuditRepository:BaseRepository<EntityBase,ViewBase>
+    public class FeeAuditRepository : BaseRepository<EntityBase, ViewBase>
     {
         public FeeAuditRepository(SqlSugarClient sqlSugar) : base(sqlSugar)
-        { 
-            
+        {
+
         }
 
         /// <summary>
@@ -48,9 +48,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
             var groupInfo = new Grp_GroupCostParameter();
             string _teamCurrency = string.Empty;
             decimal _teamRate = 1.0000M;
-            
+
             var costContents = new List<GroupCostAuditView>();
-            var subFeeTypeIds = new int[] { 
+            var subFeeTypeIds = new int[] {
                 4, // 保险 82
                 5, // 机票 85
             };
@@ -389,6 +389,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     //1074    早餐超支费用 -- 暂无
                     //1075    午餐超支费用 -- 暂无
                     //1076    晚餐超支费用 -- 暂无
+
+                    //1556	零用金
+                    var opCashCost = item.FirstOrDefault(x => x.SId == 1556);
+                    if (opCashCost != null)
+                        if (opCashCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.CashFee) * _opPayPercentage) isAutoAudit = false;
+
                 }
 
                 //更改审核状态
@@ -424,7 +430,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 var isAutoAudit = false;
                 var currModule = 98; //其他款项
-                int groupSize =  groupDetails.VisitPNumber;
+                int groupSize = groupDetails.VisitPNumber;
 
                 decimal otherSubTotal = costContents.Sum(x => x.TeFee);
                 decimal groupCostCNYTotal = costContents.Sum(x => x.TeFee) * _teamRate * groupSize; //团组成本出行物资总金额
@@ -651,7 +657,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 var airInfo = await _sqlSugar.Queryable<Grp_AirTicketReservations>()
                     .InnerJoin<Grp_CreditCardPayment>((x, y) => x.Id == y.CId && y.CTable == currModule && y.IsDel == 0)
                     .Where((x, y) => x.Id == dataId && x.IsDel == 0 && auditFeeTypeIds.Contains(x.CType))
-                    .Select((x,y) => new { 
+                    .Select((x, y) => new
+                    {
                         x.Id,
                         CcpId = y.Id,
                         x.Price,
@@ -862,8 +869,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
         public string IsOverBudget(int feeType, int diId, int dataId)
         {
 
-            string _view ="-";
-            if (diId < 1) {  return _view; }
+            string _view = "-";
+            if (diId < 1) { return _view; }
             if (dataId < 1) { return _view; }
 
             List<int> stids = new() { 17, 66 };
@@ -879,7 +886,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             string costContentSql = $"Select * From Grp_GroupCost";
             var costContents = _sqlSugar.SqlQueryable<GroupCostAuditView>(costContentSql).Where(x => x.IsDel == 0 && x.Diid == diId).ToList();
-            if (costContents.Count < 1) {  return _view; }
+            if (costContents.Count < 1) { return _view; }
 
             //处理 成本详细信息 日期为空
             for (int i = 0; i < costContents.Count; i++)
@@ -1076,7 +1083,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 //更改审核状态
                 if (isAutoAudit) return _view;
             }
-            else return _view; 
+            else return _view;
 
             return _view;
         }