|
@@ -184,10 +184,10 @@ namespace OASystem.API.Controllers
|
|
|
*/
|
|
|
decimal frTotalAmount = 0.00M;//应收总金额
|
|
|
string _frSql = string.Format(@"Select fr.Id,fr.Diid,fr.PriceName,fr.Price,fr.Count,fr.Unit,fr.Currency,
|
|
|
- sd.Name As CurrencyCode,sd.Remark As CurrencyName,fr.Rate,fr.ItemSumPrice
|
|
|
+ sd.Name As CurrencyCode,sd.Remark As CurrencyName,fr.Rate,fr.ItemSumPrice,fr.CreateTime
|
|
|
From Fin_ForeignReceivables fr
|
|
|
Left Join Sys_SetData sd On fr.Currency = sd.Id
|
|
|
- Where fr.IsDel = 0 And fr.Diid = {0}",_dto.DiId);
|
|
|
+ Where fr.IsDel = 0 And fr.Diid = {0} Order By CreateTime", _dto.DiId);
|
|
|
List<Gsd_ForeignReceivablesView> _frViews = await _sqlSugar.SqlQueryable<Gsd_ForeignReceivablesView>(_frSql).ToListAsync();
|
|
|
frTotalAmount = _frViews.Sum(it => it.ItemSumPrice);
|
|
|
_giView.Receivables = _frViews;
|
|
@@ -199,15 +199,15 @@ namespace OASystem.API.Controllers
|
|
|
decimal prTotalAmount = 0.00M;//已收总金额
|
|
|
string _prSql = string.Format(@"Select pr.Id,pr.Diid,pr.SectionTime As SectionTimeDt,pr.Price,pr.Currency,
|
|
|
sd1.Name As CurrencyCode,sd1.Remark As CurrencyName,pr.Client,
|
|
|
- pr.ReceivablesType,sd2.Name As ReceivablesTypeName,pr.Remark
|
|
|
+ pr.ReceivablesType,sd2.Name As ReceivablesTypeName,pr.Remark,pr.CreateTime
|
|
|
From Fin_ProceedsReceived pr
|
|
|
Left Join Sys_SetData sd1 On pr.Currency = sd1.Id
|
|
|
Left Join Sys_SetData sd2 On pr.ReceivablesType = sd2.Id
|
|
|
- Where pr.IsDel = 0 and pr.Diid = {0}", _dto.DiId);
|
|
|
+ Where pr.IsDel = 0 and pr.Diid = {0} Order By CreateTime", _dto.DiId);
|
|
|
List<Gsd_ProceedsReceivedView> _prViews = await _sqlSugar.SqlQueryable<Gsd_ProceedsReceivedView>(_prSql).ToListAsync();
|
|
|
prTotalAmount = _prViews.Sum(it => it.Price);
|
|
|
_giView.ProceedsReceivedViews = _prViews;
|
|
|
- _giView.ProceedsReceivedStr = string.Format(@"已收款合计:{0} CNY(人民币)", prTotalAmount.ConvertToDecimal1().ToString("#0.00"));
|
|
|
+ _giView.ProceedsReceivedStr = string.Format(@$"应收合计:{frTotalAmount.ToString("#0.00")} CNY 已收款合计:{prTotalAmount.ConvertToDecimal1().ToString("#0.00")} CNY" );
|
|
|
|
|
|
|
|
|
/*
|
|
@@ -216,14 +216,14 @@ namespace OASystem.API.Controllers
|
|
|
decimal exTotalAmount = 0.00M;
|
|
|
string _ecSql = string.Format(@"Select gec.Id As GECId,gec.DiId As GECDiId,gec.PriceName,ccp.PayMoney,sd1.Name As PaymentCurrency,
|
|
|
ccp.RMBPrice As CNYPrice,ccp.DayRate,ccp.Payee,ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,
|
|
|
- sd3.Name As CardType,ccp.IsPay,u.CnName As Applicant
|
|
|
+ sd3.Name As CardType,ccp.IsPay,u.CnName As Applicant,gec.CreateTime
|
|
|
From OA2023DB.dbo.Fin_GroupExtraCost gec
|
|
|
Left Join Grp_CreditCardPayment ccp On gec.Id = ccp.CId
|
|
|
Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
|
|
|
Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
|
|
|
Left Join Sys_SetData sd3 On ccp.CTDId = sd3.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
- Where ccp.IsDel = 0 And ccp.CTable = 1015 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And ccp.DiId = {0}", _dto.DiId);
|
|
|
+ Where ccp.IsDel = 0 And ccp.CTable = 1015 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And ccp.DiId = {0} Order By CreateTime", _dto.DiId);
|
|
|
|
|
|
List<Gsd_ExtraCostsView> _ExtraCostsViews = await _sqlSugar.SqlQueryable<Gsd_ExtraCostsView>(_ecSql).ToListAsync();
|
|
|
|
|
@@ -281,13 +281,13 @@ namespace OASystem.API.Controllers
|
|
|
//删除了 And prom.PriceType = 1
|
|
|
string _ropSql = string.Format(@"Select u.CnName As Appliction,prom.Id As PrId,prom.DiId As PrDiId,prom.Price As PrPrice,
|
|
|
prom.PriceName AS PrPriceName,prom.CurrencyId As PrCurrencyId,
|
|
|
- prom.PayType As PrPayType,prom.PriceType As PrPriceType,ccp.*
|
|
|
+ prom.PayType As PrPayType,prom.PriceType As PrPriceType,ccp.*,prom.CreateTime As PrCreateTime
|
|
|
From Fin_PaymentRefundAndOtherMoney prom
|
|
|
Left Join Grp_CreditCardPayment ccp On prom.DiId = ccp.DIId And prom.Id = ccp.CId
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
Where prom.IsDel = 0 And prom.PayType = 1 And ccp.CTable = 285
|
|
|
And ccp.IsAuditGM = 1 And ccp.IsPay = 1
|
|
|
- And prom.DiId = {0}", _dto.DiId);
|
|
|
+ And prom.DiId = {0} Order By PrCreateTime", _dto.DiId);
|
|
|
var _promDatas = await _sqlSugar.SqlQueryable<Gsd_PaymentRefundAndOtherMoneyDataSource1View>(_ropSql).ToListAsync();
|
|
|
|
|
|
foreach (var ropItem in _promDatas)
|
|
@@ -449,7 +449,7 @@ namespace OASystem.API.Controllers
|
|
|
sd2.name As PaymentCurrency,ccp.PayPercentage,(ccp.PayMoney * ccp.PayPercentage / 100) As AmountPaid,
|
|
|
(ccp.PayMoney -(ccp.PayMoney * ccp.PayPercentage / 100)) As BalancePayment,ccp.DayRate,
|
|
|
ccp.RMBPrice As CNYPrice,ccp.Payee,ccp.AuditGMDate,
|
|
|
- ccp.OrbitalPrivateTransfer,sd1.Name As PayWay,ccp.IsPay,u.CnName As Applicant
|
|
|
+ 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.PriceContent
|
|
@@ -462,7 +462,7 @@ namespace OASystem.API.Controllers
|
|
|
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 ccp.IsPay = 1 And ctggr.DiId = {0} ",_dto.DiId);
|
|
|
+ Where ctggr.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And ctggr.DiId = {0} Order By CreateTime", _dto.DiId);
|
|
|
|
|
|
groupCTGGRFeeViews = await _sqlSugar.SqlQueryable<GroupCTGGRFeeView>(CTGGRFeeSql).ToListAsync();
|
|
|
|
|
@@ -490,7 +490,7 @@ namespace OASystem.API.Controllers
|
|
|
string groupAirFeeSql = string.Format(@"Select atr.Id As AirId,atr.DIId As AirDiId,atr.FlightsCode,atr.FlightsCity,sd4.Name As AirTypeName,
|
|
|
atr.FlightsDate,atr.FlightsTime,atr.ClientName,atr.ClientNum,ccp.PayMoney,
|
|
|
sd1.Name As PayMoneyCurrency,ccp.RMBPrice As CNYPrice,ccp.DayRate,ccp.Payee,ccp.AuditGMDate,
|
|
|
- ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,sd3.Name As CardType,ccp.IsPay,u.CnName As Applicant
|
|
|
+ ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,sd3.Name As CardType,ccp.IsPay,u.CnName As Applicant,atr.CreateTime
|
|
|
From Grp_AirTicketReservations atr
|
|
|
Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 85 And atr.Id = ccp.CId
|
|
|
Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
|
|
@@ -498,7 +498,7 @@ namespace OASystem.API.Controllers
|
|
|
Left Join Sys_SetData sd3 On ccp.CTDId = sd3.Id
|
|
|
Left Join Sys_SetData sd4 On atr.CType = sd4.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
- Where atr.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And atr.DiId = {0} ", _dto.DiId);
|
|
|
+ Where atr.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And atr.DiId = {0} Order By CreateTime", _dto.DiId);
|
|
|
groupAirFeeViews = await _sqlSugar.SqlQueryable<GroupAirFeeView>(groupAirFeeSql).ToListAsync();
|
|
|
|
|
|
string str = "";
|
|
@@ -663,14 +663,14 @@ namespace OASystem.API.Controllers
|
|
|
List<GroupVisaFeeView> groupVisaFeeViews = new List<GroupVisaFeeView>();
|
|
|
string groupVisaFeeSql = string.Format(@"Select vi.Id As VisaId,vi.DIId As VisaDiId,vi.VisaClient,ccp.PayMoney,sd1.Name As PayMoneyCurrency,
|
|
|
ccp.DayRate,ccp.Payee,ccp.AuditGMDate,ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,
|
|
|
- sd3.Name As CardTypeName,ccp.IsPay,u.CnName As Applicant
|
|
|
+ sd3.Name As CardTypeName,ccp.IsPay,u.CnName As Applicant,vi.CreateTime
|
|
|
From Grp_VisaInfo vi
|
|
|
Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 80 And vi.Id = ccp.CId
|
|
|
Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
|
|
|
Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
|
|
|
Left Join Sys_SetData sd3 On ccp.CTDId = sd3.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
- Where vi.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And vi.DIId = {0}",_dto.DiId);
|
|
|
+ Where vi.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And vi.DIId = {0} Order By CreateTime", _dto.DiId);
|
|
|
|
|
|
groupVisaFeeViews = await _sqlSugar.SqlQueryable<GroupVisaFeeView>(groupVisaFeeSql).ToListAsync();
|
|
|
|
|
@@ -738,7 +738,7 @@ namespace OASystem.API.Controllers
|
|
|
ioa.InviteCost,sd3.Name As InviteCurrency,ioa.SendCost,sd4.Name As SendCurrency,ioa.EventsCost,
|
|
|
sd5.Name As EventsCurrency,ioa.TranslateCost,sd6.Name As TranslateCurrency,ccp.PayMoney,
|
|
|
sd7.Name As PaymentCurrency,ccp.RMBPrice As CNYPrice,ccp.Payee,ccp.AuditGMDate,
|
|
|
- ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant
|
|
|
+ ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant,ioa.CreateTime
|
|
|
From Grp_InvitationOfficialActivities ioa
|
|
|
Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 81 And ioa.Id = ccp.CId
|
|
|
Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
|
|
@@ -749,7 +749,7 @@ namespace OASystem.API.Controllers
|
|
|
Left Join Sys_SetData sd6 On ioa.TranslateCurrency = sd6.Id
|
|
|
Left Join Sys_SetData sd7 On ccp.PaymentCurrency = sd7.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
- Where ioa.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And ioa.Diid = {0}",_dto.DiId);
|
|
|
+ Where ioa.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And ioa.Diid = {0} Order By CreateTime", _dto.DiId);
|
|
|
|
|
|
groupInvitationalFeeViews = await _sqlSugar.SqlQueryable<GroupInvitationalFeeView>(groupInvitationalFeeSql).ToListAsync();
|
|
|
|
|
@@ -841,13 +841,13 @@ namespace OASystem.API.Controllers
|
|
|
List<GroupInsuranceFeeView> groupInsuranceFeeViews = new List<GroupInsuranceFeeView>();
|
|
|
string groupInsuranceFeeSql = string.Format(@"Select ic.Id As InsuranceId,ic.Diid As InsuranceDiId,ClientName,ccp.PayMoney,ccp.RMBPrice As CNYPrice,
|
|
|
sd1.Name As PayMoneyCurrency,ccp.Payee,ccp.AuditGMDate,ccp.OrbitalPrivateTransfer,
|
|
|
- sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant
|
|
|
+ sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant,ic.CreateTime
|
|
|
From Grp_Customers ic
|
|
|
Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 82 And ic.Id = ccp.CId
|
|
|
Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
|
|
|
Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
- Where ic.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And ic.DiId = {0}", _dto.DiId);
|
|
|
+ Where ic.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And ic.DiId = {0} Order By CreateTime", _dto.DiId);
|
|
|
groupInsuranceFeeViews = await _sqlSugar.SqlQueryable<GroupInsuranceFeeView>(groupInsuranceFeeSql).ToListAsync();
|
|
|
|
|
|
decimal InsuranceCNYTotalPrice = 0.00M;
|
|
@@ -912,17 +912,19 @@ namespace OASystem.API.Controllers
|
|
|
_geView.GroupInsuranceFeeStr = string.Format(@"人民币总费用:{0} CNY", InsuranceCNYTotalPrice.ToString("#0.00"));
|
|
|
#endregion
|
|
|
|
|
|
- #region 其他款项费用
|
|
|
+ #region 其他款项费用 98
|
|
|
List<GroupDecreaseFeeView> groupDecreaseFeeViews = new List<GroupDecreaseFeeView>();
|
|
|
string groupDecreaseFeeSql = string.Format(@"Select dp.Id As DPId,dp.DiId As DPDiId,dp.PriceName,ccp.PayMoney,sd1.Name As PayMoneyCurrency,
|
|
|
- ccp.RMBPrice As CNYPrice,ccp.DayRate,ccp.Payee,ccp.AuditGMDate,ccp.OrbitalPrivateTransfer,
|
|
|
- sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant
|
|
|
+ (((ccp.PayMoney * ccp.DayRate) / ccp.PayPercentage) * 100) As CNYPrice,
|
|
|
+ ccp.DayRate,ccp.Payee,ccp.AuditGMDate,ccp.OrbitalPrivateTransfer,
|
|
|
+ sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant,dp.CreateTime
|
|
|
From Grp_DecreasePayments dp
|
|
|
Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 98 And dp.Id = ccp.CId
|
|
|
Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
|
|
|
Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
|
|
|
Left Join Sys_Users u On ccp.CreateUserId = u.Id
|
|
|
- Where dp.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And dp.Diid = {0}",_dto.DiId);
|
|
|
+ Where dp.IsDel = 0 And ccp.Ctable = 98 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And dp.Diid = {0}
|
|
|
+ Order By CreateTime", _dto.DiId);
|
|
|
groupDecreaseFeeViews = await _sqlSugar.SqlQueryable<GroupDecreaseFeeView>(groupDecreaseFeeSql).ToListAsync();
|
|
|
|
|
|
#region 保险费用 - 模拟数据
|
|
@@ -968,8 +970,10 @@ namespace OASystem.API.Controllers
|
|
|
decimal DecreaseCNYTotalPrice = 0.00M;
|
|
|
foreach (var item in groupDecreaseFeeViews)
|
|
|
{
|
|
|
+ item.CNYPrice = Convert.ToDecimal(item.CNYPrice.ToString("#0.00"));
|
|
|
DecreaseCNYTotalPrice += item.CNYPrice;
|
|
|
|
|
|
+
|
|
|
if (!string.IsNullOrEmpty(item.AuditGMDate))
|
|
|
{
|
|
|
item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
|