|
@@ -97,63 +97,71 @@ namespace OA2021.finance
|
|
|
|
|
|
void bindDetail()
|
|
|
{
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ if (Request.QueryString["startDate"] != null && !string.IsNullOrEmpty(Request.QueryString["startDate"].ToString()))
|
|
|
+ txtStartTime.Text = Request.QueryString["startDate"].ToString();
|
|
|
|
|
|
-
|
|
|
- if (Request.QueryString["startDate"] != null && !string.IsNullOrEmpty(Request.QueryString["startDate"].ToString()))
|
|
|
- txtStartTime.Text = Request.QueryString["startDate"].ToString();
|
|
|
+
|
|
|
+ if (Request.QueryString["endDate"] != null && !string.IsNullOrEmpty(Request.QueryString["endDate"].ToString()))
|
|
|
+ txtEndTime.Text = Request.QueryString["endDate"].ToString();
|
|
|
|
|
|
-
|
|
|
- if (Request.QueryString["endDate"] != null && !string.IsNullOrEmpty(Request.QueryString["endDate"].ToString()))
|
|
|
- txtEndTime.Text = Request.QueryString["endDate"].ToString();
|
|
|
|
|
|
+
|
|
|
+ pageControl.Params = "&company=" + ddlCompany.SelectedValue + "&department=" + ddlDepartment.SelectedValue + "&personnel=" + ddlPersonnel.SelectedValue
|
|
|
+ + "&startDate=" + txtStartTime.Text + "&endDate=" + txtEndTime.Text
|
|
|
+ + "&yearmonth2=" + ddlYearMonth2.SelectedValue;
|
|
|
|
|
|
-
|
|
|
- pageControl.Params = "&company=" + ddlCompany.SelectedValue + "&department=" + ddlDepartment.SelectedValue + "&personnel=" + ddlPersonnel.SelectedValue
|
|
|
- + "&startDate=" + txtStartTime.Text + "&endDate=" + txtEndTime.Text
|
|
|
- + "&yearmonth2=" + ddlYearMonth2.SelectedValue;
|
|
|
+
|
|
|
+ int pageIndex = pageControl.getPageIndex();
|
|
|
|
|
|
-
|
|
|
- int pageIndex = pageControl.getPageIndex();
|
|
|
+
|
|
|
+ DataTable listTable = new Fin_CommissionService().GetAll(Convert.ToInt32(ddlPersonnel.SelectedValue), txtStartTime.Text, txtEndTime.Text);
|
|
|
+ List<Fin_Commission> listCom = new List<Fin_Commission>();
|
|
|
+ if (listTable != null)
|
|
|
+ {
|
|
|
+ listCom = listTable.ToList<Fin_Commission>();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- DataTable listTable = new Fin_CommissionService().GetAll(Convert.ToInt32(ddlPersonnel.SelectedValue), txtStartTime.Text, txtEndTime.Text);
|
|
|
- List<Fin_Commission> listCom = new List<Fin_Commission>();
|
|
|
- if (listTable != null)
|
|
|
- {
|
|
|
- listCom = listTable.ToList<Fin_Commission>();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- totalRecord = listCom.Count;
|
|
|
- sumPage=(int)Math.Ceiling((double)listCom.Count / 10);
|
|
|
- float totalPage = (float)totalRecord / 10;
|
|
|
- if (totalPage == 0) totalPage = 1;
|
|
|
- else totalPage = (int)Math.Ceiling((double)totalPage);
|
|
|
+ totalRecord = listCom.Count;
|
|
|
+ sumPage = (int)Math.Ceiling((double)listCom.Count / 10);
|
|
|
+ float totalPage = (float)totalRecord / 10;
|
|
|
+ if (totalPage == 0) totalPage = 1;
|
|
|
+ else totalPage = (int)Math.Ceiling((double)totalPage);
|
|
|
|
|
|
- List<Fin_Commission> Fin_Commission = new List<Fin_Commission>();
|
|
|
- for (int i = 0; i < 10; i++)
|
|
|
- {
|
|
|
- var RowIndex = i + (pageIndex - 1) * 10;
|
|
|
- if (RowIndex < listCom.Count)
|
|
|
- {
|
|
|
- Fin_Commission.Add(listCom[RowIndex]);
|
|
|
- }
|
|
|
- else
|
|
|
+ List<Fin_Commission> Fin_Commission = new List<Fin_Commission>();
|
|
|
+ for (int i = 0; i < 10; i++)
|
|
|
{
|
|
|
- break;
|
|
|
+ var RowIndex = i + (pageIndex - 1) * 10;
|
|
|
+ if (RowIndex < listCom.Count)
|
|
|
+ {
|
|
|
+ Fin_Commission.Add(listCom[RowIndex]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- rpData.DataSource = Fin_Commission;
|
|
|
- rpData.DataBind();
|
|
|
+ rpData.DataSource = Fin_Commission;
|
|
|
+ rpData.DataBind();
|
|
|
|
|
|
-
|
|
|
- pageControl.bind(pageIndex, sumPage, totalRecord, url);
|
|
|
+
|
|
|
+ pageControl.bind(pageIndex, sumPage, totalRecord, url);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -371,7 +379,11 @@ namespace OA2021.finance
|
|
|
cTemp.DeleteTime = "";
|
|
|
cTemp.Remark = "";
|
|
|
cTemp.IsDel = 0;
|
|
|
- new Fin_CommissionService().add(cTemp);
|
|
|
+
|
|
|
+ {
|
|
|
+ new Fin_CommissionService().add(cTemp);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -394,39 +406,47 @@ namespace OA2021.finance
|
|
|
float sumPr = 0;
|
|
|
float reimburse = 0;
|
|
|
float TeamMoney = 0;
|
|
|
-
|
|
|
-
|
|
|
- ForeignReceivablesService frs = new ForeignReceivablesService();
|
|
|
- List<ForeignReceivables> frList = frs.GetAllByDIId(dele.Id);
|
|
|
- foreach (ForeignReceivables fr in frList)
|
|
|
+ try
|
|
|
{
|
|
|
- sumFr += fr.Price;
|
|
|
- }
|
|
|
+
|
|
|
+ ForeignReceivablesService frs = new ForeignReceivablesService();
|
|
|
+ List<ForeignReceivables> frList = frs.GetAllByDIId(dele.Id);
|
|
|
+ foreach (ForeignReceivables fr in frList)
|
|
|
+ {
|
|
|
+ sumFr += fr.Price;
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- ProceedsReceivedService prs = new ProceedsReceivedService();
|
|
|
- List<ProceedsReceived> prList = prs.GetAllByDIId(dele.Id);
|
|
|
- if (prList.Count != 0)
|
|
|
- {
|
|
|
- foreach (ProceedsReceived fr in prList)
|
|
|
+
|
|
|
+ ProceedsReceivedService prs = new ProceedsReceivedService();
|
|
|
+ List<ProceedsReceived> prList = prs.GetAllByDIId(dele.Id);
|
|
|
+ if (prList.Count != 0)
|
|
|
{
|
|
|
- sumPr += (float)fr.Price;
|
|
|
+ foreach (ProceedsReceived fr in prList)
|
|
|
+ {
|
|
|
+ sumPr += (float)fr.Price;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
-
|
|
|
- ViewOhterPriceOPService vopp = new ViewOhterPriceOPService();
|
|
|
- List<ViewOtherPriceOP> opplist = vopp.GetByDIId(dele.Id);
|
|
|
- foreach (ViewOtherPriceOP opp in opplist)
|
|
|
- {
|
|
|
-
|
|
|
- reimburse += opp.Price;
|
|
|
- }
|
|
|
+
|
|
|
+ ViewOhterPriceOPService vopp = new ViewOhterPriceOPService();
|
|
|
+ List<ViewOtherPriceOP> opplist = vopp.GetByDIId(dele.Id);
|
|
|
+ foreach (ViewOtherPriceOP opp in opplist)
|
|
|
+ {
|
|
|
+
|
|
|
+ reimburse += opp.Price;
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- sumPr = sumPr - reimburse;
|
|
|
+
|
|
|
+ sumPr = sumPr - reimburse;
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
CreditCardPaymentService ccps = new CreditCardPaymentService();
|
|
|
List<CreditCardPayment> creditCardPayments = ccps.GetByDIIDNotIsPay(dele.Id);
|
|
@@ -436,9 +456,7 @@ namespace OA2021.finance
|
|
|
foreach (CreditCardPayment item in creditCardPayments)
|
|
|
{
|
|
|
|
|
|
- if (item.PayThenMoney != null && item.PayThenMoney != "" && item.PayThenMoney != "0")
|
|
|
- TeamMoney += float.Parse(item.PayThenMoney) * float.Parse(item.DayRate);
|
|
|
- else if (item.PayPercentage != null && item.PayPercentage != "" && item.PayPercentage != "0")
|
|
|
+
|
|
|
{
|
|
|
TeamMoney += item.PayMoney * float.Parse(item.PayPercentage) / 100 * float.Parse(item.DayRate);
|
|
|
}
|
|
@@ -476,7 +494,7 @@ namespace OA2021.finance
|
|
|
List<CarTouristGuideGroundReservations> listOP = new CarTouristGuideGroundReservationsService().GetCarTouristGuideGroundReservationsByDIID(dele.Id);
|
|
|
|
|
|
List<Visa> listVisa = new VisaService().GetVisaByDIIDAndUserId(dele.Id, cTemp.Personnel);
|
|
|
- if (Profitstr > 0)
|
|
|
+
|
|
|
{
|
|
|
cTemp.IsMakeLoss = 0;
|
|
|
cTemp.IsLoss = 0;
|
|
@@ -518,10 +536,17 @@ namespace OA2021.finance
|
|
|
{
|
|
|
|
|
|
|
|
|
+
|
|
|
float SunPrice = 0;
|
|
|
int AirSegment = 0;
|
|
|
foreach (var item in listAir)
|
|
|
{
|
|
|
+ CreditCardPayment c = new CreditCardPaymentService().GetCreditCardPaymentByCid(item.Id, 85);
|
|
|
+ if (c!=null)
|
|
|
+ {
|
|
|
+ if (c.IsAuditGM!=0 && c.IsAuditGM!=2)
|
|
|
+ {
|
|
|
+
|
|
|
if (item.PassengerType == "客户")
|
|
|
{
|
|
|
if (item.Price > 0)
|
|
@@ -801,6 +826,8 @@ namespace OA2021.finance
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
SunPrice = AirSegment * 10;
|
|
|
comMoney = SunPrice;
|
|
|
cTemp.Detail = "本团人数" + Convert.ToInt32(dele.VisitPNumber) + ",该人员" + OpUserName + "共订航段数" + AirSegment.ToString() + ",每程航班提成为10元," + OpUserName + "提成共" + SunPrice.ToString("#0.00");
|
|
@@ -811,87 +838,62 @@ namespace OA2021.finance
|
|
|
{
|
|
|
string OpUserName = new UsersService().GetUsersByID(Convert.ToInt32(personId)).CnName;
|
|
|
|
|
|
- int days = 0, rooms = 0;
|
|
|
+
|
|
|
if (listHotel != null)
|
|
|
{
|
|
|
foreach (HotelReservations hotel in listHotel)
|
|
|
{
|
|
|
- if (hotel.GTId == 41 || hotel.GTId == 718)
|
|
|
+ CreditCardPayment c = new CreditCardPaymentService().GetCreditCardPaymentByCid(hotel.Id, 76);
|
|
|
+ if (c.IsAuditGM!=0 && c.IsAuditGM!=2)
|
|
|
{
|
|
|
-
|
|
|
- int s = 0;
|
|
|
- int d = 0;
|
|
|
- TimeSpan Tdays = Convert.ToDateTime(hotel.CheckOutDate) - Convert.ToDateTime(hotel.CheckInDate);
|
|
|
- if (hotel.SingleRoomPrice < 0)
|
|
|
- {
|
|
|
- rooms = rooms - hotel.SingleRoomCount;
|
|
|
- s = -1;
|
|
|
- }
|
|
|
- else if (hotel.SingleRoomPrice != 0)
|
|
|
+ if (hotel.GTId == 41 || hotel.GTId == 718)
|
|
|
{
|
|
|
- d = 1;
|
|
|
- rooms = rooms + hotel.SingleRoomCount;
|
|
|
- }
|
|
|
|
|
|
- if (hotel.DoubleRoomPrice < 0)
|
|
|
- {
|
|
|
- s = -1;
|
|
|
- rooms = rooms - hotel.DoubleRoomCount;
|
|
|
- }
|
|
|
- else if (hotel.DoubleRoomPrice != 0)
|
|
|
- {
|
|
|
- d = 1;
|
|
|
- rooms = rooms + hotel.DoubleRoomCount;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+ TimeSpan Tdays = Convert.ToDateTime(hotel.CheckOutDate) - Convert.ToDateTime(hotel.CheckInDate);
|
|
|
+ int days = Tdays.Days;
|
|
|
+ if (hotel.SingleRoomPrice < 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ comMoney = comMoney - 10 * hotel.SingleRoomCount * days;
|
|
|
+ }
|
|
|
+ else if (hotel.SingleRoomPrice != 0)
|
|
|
+ {
|
|
|
+ comMoney = comMoney + 10 * hotel.SingleRoomCount * days;
|
|
|
+ }
|
|
|
|
|
|
- if (hotel.SuiteRoomPrice < 0)
|
|
|
- {
|
|
|
- s = -1;
|
|
|
- rooms = rooms - hotel.SuiteRoomCount;
|
|
|
- }
|
|
|
- else if (hotel.SuiteRoomPrice != 0)
|
|
|
- {
|
|
|
- d = 1;
|
|
|
- rooms = rooms + hotel.SuiteRoomCount;
|
|
|
- }
|
|
|
+ if (hotel.DoubleRoomPrice < 0)
|
|
|
+ {
|
|
|
+ comMoney = comMoney - 10 * hotel.DoubleRoomCount * days;
|
|
|
+ }
|
|
|
+ else if (hotel.DoubleRoomPrice != 0)
|
|
|
+ {
|
|
|
+ comMoney = comMoney + 10 * hotel.DoubleRoomCount * days;
|
|
|
+ }
|
|
|
|
|
|
- if (hotel.OtherRoomPrice < 0)
|
|
|
- {
|
|
|
- s = -1;
|
|
|
- rooms = rooms - hotel.OtherRoomCount;
|
|
|
- }
|
|
|
- else if (hotel.OtherRoomPrice != 0)
|
|
|
- {
|
|
|
- d = 1;
|
|
|
- rooms = rooms + hotel.OtherRoomCount;
|
|
|
- }
|
|
|
+ if (hotel.SuiteRoomPrice < 0)
|
|
|
+ {
|
|
|
+ comMoney = comMoney - 10 * hotel.SuiteRoomCount * days;
|
|
|
+ }
|
|
|
+ else if (hotel.SuiteRoomPrice != 0)
|
|
|
+ {
|
|
|
+ comMoney = comMoney + 10 * hotel.SuiteRoomCount * days;
|
|
|
+ }
|
|
|
|
|
|
- if (s == -1)
|
|
|
- {
|
|
|
- if (rooms == 1)
|
|
|
+ if (hotel.OtherRoomPrice < 0)
|
|
|
{
|
|
|
- days = days - Tdays.Days;
|
|
|
+ comMoney = comMoney - 10 * hotel.OtherRoomCount * days;
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (d == 1)
|
|
|
+ else if (hotel.OtherRoomPrice != 0)
|
|
|
{
|
|
|
- days = days + Tdays.Days;
|
|
|
+ comMoney = comMoney + 10 * hotel.OtherRoomCount * days;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
- comMoney = 10 * rooms * days;
|
|
|
- if (rooms != 0 && days != 0)
|
|
|
- {
|
|
|
- cTemp.Detail = "本团人数" + Convert.ToInt32(dele.VisitPNumber) + ",该人员" + OpUserName + "共订总房间数" + rooms + ",总住宿天数" + days + ",每间每晚提成10元," + OpUserName + "提成共" + comMoney.ToString("#0.00") + "元";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- cTemp.Detail = "本团人数" + Convert.ToInt32(dele.VisitPNumber) + ",该人员" + OpUserName + "共订总房间数" + rooms + ",总住宿天数" + days + ",每间每晚提成10元," + OpUserName + "提成共" + comMoney.ToString("#0.00") + "元";
|
|
|
- }
|
|
|
+ cTemp.Detail = "本团人数" + Convert.ToInt32(dele.VisitPNumber) + ",该人员" + OpUserName + "共操作酒店晚数" + comMoney / 10 + ",每间每晚提成10元," + OpUserName + "提成共" + comMoney.ToString("#0.00") + "元";
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1020,6 +1022,9 @@ namespace OA2021.finance
|
|
|
}
|
|
|
if (!String.IsNullOrWhiteSpace(UserName))
|
|
|
{
|
|
|
+ comMoney += 100;
|
|
|
+
|
|
|
+ comMoney += 100;
|
|
|
UserName = UserName.Substring(0, UserName.Length - 1);
|
|
|
string name = new UsersService().GetUsersByID(Convert.ToInt32(personId)).CnName;
|
|
|
cTemp.Detail += "本团为只发邀请的团组," + UserName + "操作了该邀请数据,提成共100,均分后" + name + "得提成" + 100 / UserId.Count;
|
|
@@ -1039,39 +1044,47 @@ namespace OA2021.finance
|
|
|
int count2 = 0;
|
|
|
foreach (Visa visa in listVisa)
|
|
|
{
|
|
|
- if (visa.IsThird == 0)
|
|
|
+ CreditCardPayment c = new CreditCardPaymentService().GetCreditCardPaymentByCid(visa.Id, 80);
|
|
|
+ if (c!=null)
|
|
|
{
|
|
|
- if (visa.PassengerType == "客人")
|
|
|
+ if (c.IsAuditGM!=0 && c.IsAuditGM!=2)
|
|
|
{
|
|
|
- if (dele.VisitCountry.Contains("英国") || dele.VisitCountry.Contains("加拿大") || dele.VisitCountry.Contains("美国"))
|
|
|
+ if (visa.IsThird == 0)
|
|
|
{
|
|
|
- if (visa.VisaPrice > 0)
|
|
|
+ if (visa.PassengerType == "客人")
|
|
|
{
|
|
|
- count1 += visa.VisaFreeNumber + visa.VisaNumber;
|
|
|
- comMoney += 50 * (visa.VisaFreeNumber + visa.VisaNumber);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- comMoney = comMoney - (visa.VisaNumber + visa.VisaFreeNumber) * 50;
|
|
|
- count1 = count1 - visa.VisaFreeNumber - visa.VisaNumber;
|
|
|
- }
|
|
|
+ if (dele.VisitCountry.Contains("英国") || dele.VisitCountry.Contains("加拿大") || dele.VisitCountry.Contains("美国"))
|
|
|
+ {
|
|
|
+ if (visa.VisaPrice > 0)
|
|
|
+ {
|
|
|
+ count1 += visa.VisaFreeNumber + visa.VisaNumber;
|
|
|
+ comMoney += 50 * (visa.VisaFreeNumber + visa.VisaNumber);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ comMoney = comMoney - (visa.VisaNumber + visa.VisaFreeNumber) * 50;
|
|
|
+ count1 = count1 - visa.VisaFreeNumber - visa.VisaNumber;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (visa.VisaPrice > 0)
|
|
|
- {
|
|
|
- count2 += visa.VisaFreeNumber + visa.VisaNumber;
|
|
|
- comMoney += 30 * (visa.VisaFreeNumber + visa.VisaNumber);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- comMoney = comMoney - (visa.VisaNumber + visa.VisaFreeNumber) * 30;
|
|
|
- count2 = count2 - visa.VisaFreeNumber - visa.VisaNumber;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (visa.VisaPrice > 0)
|
|
|
+ {
|
|
|
+ count2 += visa.VisaFreeNumber + visa.VisaNumber;
|
|
|
+ comMoney += 30 * (visa.VisaFreeNumber + visa.VisaNumber);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ comMoney = comMoney - (visa.VisaNumber + visa.VisaFreeNumber) * 30;
|
|
|
+ count2 = count2 - visa.VisaFreeNumber - visa.VisaNumber;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
string UserName = new UsersService().GetUsersByID(Convert.ToInt32(personId)).CnName;
|
|
|
cTemp.Detail = "本团人数" + Convert.ToInt32(dele.VisitPNumber) + ",该人员" + UserName + "共办理英国、加拿大、美国签证" + count1 + "本护照(包含免签人员),申根国家及其他所有国家" + count2 + "本。" + UserName + "提成共" + comMoney.ToString("#0.00") + "元";
|
|
@@ -1140,13 +1153,13 @@ namespace OA2021.finance
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- cTemp.IsLoss = 0;
|
|
|
- cTemp.IsMakeLoss = 1;
|
|
|
- comMoney = 0;
|
|
|
- cTemp.Detail = "该团无利润,所以无提成";
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
cTemp.Money = Convert.ToDecimal(comMoney);
|