Exemple #1
0
        public static void GetFeeListByMonth(int monthnumber, RoomFeeAnalysis[] my_fee_list, ViewRoomFeeHistoryDetail[] my_fee_history_list, ViewRoomFeeHistoryDetail[] my_fee_history_list_chongdi, int Year, out decimal YingShouFee, out decimal YiShouFee, out decimal JianMianFee, out decimal WeiShouFee, out decimal ChongDiFee, out decimal Cycle_WeiShouFee)
        {
            YingShouFee = 0;
            YiShouFee   = 0;
            JianMianFee = 0;
            WeiShouFee  = 0;
            ChongDiFee  = 0;
            decimal Cycle_YiShouFee   = 0;
            decimal Cycle_JianMianFee = 0;

            Cycle_WeiShouFee = 0;
            decimal  Cycle_ChongDiFee = 0;
            DateTime StartTime        = DateTime.MinValue;
            DateTime EndTime          = DateTime.MinValue;

            WebUtil.GetTimeRangeByMonthNumber(monthnumber, Year, out StartTime, out EndTime);
            var     my_fee_history_list1          = ViewRoomFeeHistoryDetail.GetFinalViewRoomFeeHistoryDetailDictionary(my_fee_history_list, StartTime, EndTime).ToArray();
            var     my_fee_history_list_chongdi_1 = ViewRoomFeeHistoryDetail.GetFinalViewRoomFeeHistoryDetailDictionary(my_fee_history_list_chongdi, StartTime, EndTime).ToArray();
            decimal YingShouFee_1 = 0;
            decimal YingShouFee_2 = 0;

            if (my_fee_history_list1.Length > 0)
            {
                decimal RealCost = my_fee_history_list1.Sum(p => Convert.ToDecimal(p["MonthTotalCost"]));
                ChongDiFee  = my_fee_history_list_chongdi_1.Where(p => Convert.ToInt32(p["ChargeState"]) == 4).Sum(p => Convert.ToDecimal(p["MonthTotalCost"]));
                YiShouFee   = RealCost - ChongDiFee;
                JianMianFee = my_fee_history_list1.Sum(p => Convert.ToDecimal(p["MonthDiscountCost"]));
                var     my_fee_history_list2          = my_fee_history_list1.Where(p => (Convert.ToInt32(p["FeeType"]) == 4 && Convert.ToInt32(p["ImportFeeID"]) > 0) || Convert.ToInt32(p["FeeType"]) != 4).ToArray();
                var     my_fee_history_list_chongdi_2 = my_fee_history_list_chongdi_1.Where(p => (Convert.ToInt32(p["FeeType"]) == 4 && Convert.ToInt32(p["ImportFeeID"]) > 0) || Convert.ToInt32(p["FeeType"]) != 4).ToArray();
                decimal Cycle_RealCost = my_fee_history_list2.Sum(p => Convert.ToDecimal(p["MonthTotalCost"]));
                Cycle_ChongDiFee  = my_fee_history_list_chongdi_2.Where(p => Convert.ToInt32(p["ChargeState"]) == 4).Sum(p => Convert.ToDecimal(p["MonthTotalCost"]));
                Cycle_YiShouFee   = Cycle_RealCost - Cycle_ChongDiFee;
                Cycle_JianMianFee = my_fee_history_list2.Sum(p => Convert.ToDecimal(p["MonthDiscountCost"]));
                YingShouFee_1     = my_fee_history_list1.Sum(p => Convert.ToDecimal(p["TotalCost"]));
            }
            var my_fee_list1 = RoomFeeAnalysis.GetRoomFeeAnalysisDictionary(my_fee_list, StartTime, EndTime).ToArray();

            if (my_fee_list1.Length > 0)
            {
                WeiShouFee       = my_fee_list1.Sum(p => Convert.ToDecimal(p["TotalFinalCost"]));
                Cycle_WeiShouFee = my_fee_list1.Where(p => (Convert.ToInt32(p["FeeType"]) == 4 && Convert.ToInt32(p["ImportFeeID"]) <= 0) || Convert.ToInt32(p["FeeType"]) != 4).Sum(p => Convert.ToDecimal(p["TotalFinalCost"]));
                YingShouFee_2    = my_fee_list1.Sum(p => Convert.ToDecimal(p["TotalCost"]));
            }
            YingShouFee = YingShouFee_1 + YingShouFee_2;
        }