amigotrip 7 months ago
parent
commit
f4448c3d11
1 changed files with 25 additions and 3 deletions
  1. 25 3
      OASystem/OASystem.Api/Controllers/StatisticsController.cs

+ 25 - 3
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -575,14 +575,36 @@ namespace OASystem.API.Controllers
 
                 List<GroupCTGGRFeeView> groupCTGGRFeeViews = new List<GroupCTGGRFeeView>();
 
+                //string CTGGRFeeSql = string.Format(@"Select ctggr.Id As CTGGRId,ctggr.DiId As CTGGRDiId,ctggr.PriceName As Area,ctggrc.*,ctggrc.Price As PayMoney,
+                //                                     sd2.name As PaymentCurrency,ccp.PayPercentage,
+                //                                     (ctggrc.Price / (ccp.PayPercentage / 100)) As AmountPaid,
+                //                                     (ctggrc.Price / (ccp.PayPercentage / 100) - ctggrc.Price) As BalancePayment,
+                //                                     ccp.DayRate,(ctggrc.Price * ccp.DayRate)  As CNYPrice,ccp.Payee,ccp.AuditGMDate,
+                //                                     ccp.OrbitalPrivateTransfer,sd1.Name As PayWay,ccp.IsPay,u.CnName As Applicant,ctggr.CreateTime
+                //                                     From Grp_CarTouristGuideGroundReservations ctggr
+                //                                     Left Join ( Select cggrc.CTGGRId,sd1.Name As PriceName,cggrc.Price,sd2.Name As PriceCurrency,
+                //                                                        cggrc.DatePrice,cggrc.PriceContent
+                //                                             From Grp_CarTouristGuideGroundReservationsContent cggrc
+                //                                             Left Join Sys_SetData sd1 On cggrc.SId = sd1.Id
+                //                                             Left Join Sys_SetData sd2 On cggrc.Currency = sd2.Id
+                //                                             Where cggrc.ISdel = 0 And cggrc.Price != 0.00 
+                //                                             ) ctggrc On ctggr.Id = ctggrc.CTGGRId 
+                //                                     Left Join Grp_CreditCardPayment ccp On ccp.IsDel = 0  And ccp.CTable = 79 And ctggr.Id = ccp.CId
+                //                                     Left Join Sys_SetData sd1 On ccp.PayDId = sd1.Id
+                //                                     Left Join Sys_SetData sd2 On ccp.PaymentCurrency = sd2.Id
+                //                                     Left Join Sys_Users u On ccp.CreateUserId = u.Id
+                //                                     Where ctggr.IsDel = 0 And ccp.IsAuditGM = 1 And ctggr.DiId = {0}
+                //                                     Order By CreateTime", _dto.DiId);
+
+
                 string CTGGRFeeSql = string.Format(@"Select ctggr.Id As CTGGRId,ctggr.DiId As CTGGRDiId,ctggr.PriceName As Area,ctggrc.*,ctggrc.Price As PayMoney,
                                                      sd2.name As PaymentCurrency,ccp.PayPercentage,
-                                                     (ctggrc.Price / (ccp.PayPercentage / 100)) As AmountPaid,
-                                                     (ctggrc.Price / (ccp.PayPercentage / 100) - ctggrc.Price) As BalancePayment,
+                                                     (ctggrc.Price * (ccp.PayPercentage / 100)) As AmountPaid,
+                                                     (ctggrc.Price - ctggrc.Price * (ccp.PayPercentage / 100)) As BalancePayment,
                                                      ccp.DayRate,(ctggrc.Price * ccp.DayRate)  As CNYPrice,ccp.Payee,ccp.AuditGMDate,
                                                      ccp.OrbitalPrivateTransfer,sd1.Name As PayWay,ccp.IsPay,u.CnName As Applicant,ctggr.CreateTime
                                                      From Grp_CarTouristGuideGroundReservations ctggr
-                                                     Left Join ( Select cggrc.CTGGRId,sd1.Name As PriceName,cggrc.Price,sd2.Name As PriceCurrency,
+                                                     Left Join ( Select cggrc.CTGGRId,sd1.Name As PriceName,cggrc.Price*cggrc.Count As Price,sd2.Name As PriceCurrency,
                                                                         cggrc.DatePrice,cggrc.PriceContent
                                                              From Grp_CarTouristGuideGroundReservationsContent cggrc
                                                              Left Join Sys_SetData sd1 On cggrc.SId = sd1.Id