|
@@ -1370,7 +1370,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #region 收款退还与其他款项
|
|
|
+ #region 收款退还与其他款项 --> 收款退还
|
|
|
|
|
|
/// <summary>
|
|
|
/// 收款退还与其他款项
|
|
@@ -1534,7 +1534,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 收款退还与其他款项
|
|
|
+ /// 收款退还与其他款项 --> 收款退还(只保留人名币)
|
|
|
/// 操作(Add Or Edit)
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
@@ -1667,8 +1667,8 @@ namespace OASystem.API.Controllers
|
|
|
decimal sum_fr = 0M;
|
|
|
decimal sum_pr = 0M;
|
|
|
string str_client = string.Empty;
|
|
|
- //decimal sum_other = 0M; //收款退还
|
|
|
- //decimal sum_extra = 0M; //超支费用
|
|
|
+ decimal sum_refund = 0M; //收款退还
|
|
|
+ decimal sum_extra = 0M; //超支费用
|
|
|
decimal balance = 0M;
|
|
|
string str_schedule = string.Empty;
|
|
|
|
|
@@ -1695,42 +1695,35 @@ namespace OASystem.API.Controllers
|
|
|
str_client = str_client.TrimEnd(';');
|
|
|
}
|
|
|
|
|
|
- // //3.
|
|
|
- // string sql_other = string.Format(@" Select * From Fin_OtherPrice where diid = {0} and isdel = 0 and RefundType = 1 and PayType=1 ", diId);
|
|
|
- // List<Fin_OtherPrice> list_other = _sqlSugar.SqlQueryable<Fin_OtherPrice>(sql_other).ToList();
|
|
|
- // sum_other = list_other.Sum(s => s.Price);
|
|
|
-
|
|
|
- // //4.
|
|
|
- // string sql_extra = string.Format(@" Select c.* From Fin_GroupExtraCost f
|
|
|
- //Inner join Grp_CreditCardPayment c On f.Id = c.CId
|
|
|
- //Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId = {0} ", diId);
|
|
|
- // List<Grp_CreditCardPayment> list_extra = _sqlSugar.SqlQueryable<Grp_CreditCardPayment>(sql_extra).ToList();
|
|
|
- // sum_extra = list_extra.Sum(s => s.RMBPrice);
|
|
|
-
|
|
|
- //item_rst.frPrice = (sum_fr + sum_extra).ToString("#0.00");
|
|
|
- //item_rst.prPrice = (sum_pr - sum_other).ToString("#0.00");
|
|
|
- //item_rst.balPrice = ((sum_fr + sum_extra) - (sum_pr - sum_other)).ToString("#0.00");
|
|
|
- //item_rst.prClient = str_client;
|
|
|
- //item_rst.schedule = str_schedule;
|
|
|
-
|
|
|
- //string tempVisitDate = Convert.ToDateTime(item_rst.visitDate).ToString("yyyy-MM-dd");
|
|
|
-
|
|
|
- //sumAll_fr += (sum_fr + sum_extra);
|
|
|
- //sumAll_pr += (sum_pr - sum_other);
|
|
|
- //sumAll_balance += ((sum_fr + sum_extra) - (sum_pr - sum_other));
|
|
|
+ //3.收款退还
|
|
|
+ string sql_other = string.Format(@"Select * From Fin_PaymentRefundAndOtherMoney prao
|
|
|
+ Inner Join Grp_CreditCardPayment ccp On prao.Id = ccp.CId
|
|
|
+ Where ccp.CTable = 285 And ccp.IsPay = 1 And prao.IsDel = 0 And ccp.IsDel = 0 And prao.DiId = {0}", diId);
|
|
|
+ List<Grp_CreditCardPayment> list_other = _sqlSugar.SqlQueryable<Grp_CreditCardPayment>(sql_other).ToList();
|
|
|
+ sum_refund = list_other.Sum(s => s.RMBPrice);
|
|
|
|
|
|
+ //4.超支
|
|
|
+ string sql_extra = string.Format(@" Select c.* From Fin_GroupExtraCost f
|
|
|
+ Inner join Grp_CreditCardPayment c On f.Id = c.CId
|
|
|
+ Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId = {0} ", diId);
|
|
|
+ List<Grp_CreditCardPayment> list_extra = _sqlSugar.SqlQueryable<Grp_CreditCardPayment>(sql_extra).ToList();
|
|
|
+ sum_extra = list_extra.Sum(s => s.RMBPrice);
|
|
|
|
|
|
item_rst.frPrice = sum_fr.ToString("#0.00");
|
|
|
- item_rst.prPrice = sum_pr.ToString("#0.00");
|
|
|
- item_rst.balPrice = (sum_fr - sum_pr).ToString("#0.00");
|
|
|
+ item_rst.extraPrice = sum_extra.ToString("#0.00");
|
|
|
+ item_rst.receivableTotal = (sum_fr + sum_extra).ToString("#0.00");
|
|
|
+ item_rst.prPrice = (sum_pr).ToString("#0.00");
|
|
|
+ item_rst.refundAmount = sum_refund.ToString("#0.00");
|
|
|
+ item_rst.receivedTotal = (sum_pr - sum_refund).ToString("#0.00");
|
|
|
+ item_rst.balPrice = ((sum_fr + sum_extra) - (sum_pr - sum_refund)).ToString("#0.00");
|
|
|
item_rst.prClient = str_client;
|
|
|
item_rst.schedule = str_schedule;
|
|
|
|
|
|
string tempVisitDate = Convert.ToDateTime(item_rst.visitDate).ToString("yyyy-MM-dd");
|
|
|
|
|
|
- sumAll_fr += sum_fr;
|
|
|
- sumAll_pr += sum_pr;
|
|
|
- sumAll_balance += sum_fr - sum_pr;
|
|
|
+ sumAll_fr += (sum_fr + sum_extra);
|
|
|
+ sumAll_pr += (sum_pr - sum_refund);
|
|
|
+ sumAll_balance += ((sum_fr + sum_extra) - (sum_pr - sum_refund));
|
|
|
|
|
|
}
|
|
|
|