public static void set_so_lieu_by_row(
     List<GD_CHI_TIET_GIAO_KH> ip_lst_giao_kh
     , List<GD_CHI_TIET_GIAO_VON> ip_lst_giao_von
     , List<GD_CHI_TIET_GIAI_NGAN> ip_lst_giai_ngan
     , List<GD_KHOI_LUONG> ip_lst_khoi_luong
     , DateTime ip_dat_dau_nam
     , DateTime ip_dat_tu_ngay
     , DateTime ip_dat_den_ngay
     , decimal ip_dc_id_loai_nhiem_vu
     , decimal? ip_dc_id_cong_trinh_khoan
     , decimal? ip_dc_id_du_an_muc_tieu_muc
     , para_Level ip_para
     , out double ip_dc_so_km
     , out double ip_dc_tong_muc_dau_tu
     , out double ip_dc_ke_hoach_qbt_ntcs
     , out double ip_dc_ke_hoach_qbt_giao
     , out double ip_dc_ke_hoach_ns_ntcs
     , out double ip_dc_ke_hoach_ns_giao
     , out double ip_dc_da_nhan_qbt_trong_thang
     , out double ip_dc_da_nhan_qbt_luy_ke
     , out double ip_dc_da_nhan_ns_trong_thang
     , out double ip_dc_da_nhan_ns_luy_ke
     , out double ip_dc_da_thanh_toan_qbt_trong_thang
     , out double ip_dc_da_thanh_toan_qbt_luy_ke
     , out double ip_dc_da_thanh_toan_ns_trong_thang
     , out double ip_dc_da_thanh_toan_ns_luy_ke
     , out double ip_dc_gia_tri_thuc_hien_da_nghiem_thu_ab_qbt
     , out double ip_dc_gia_tri_thuc_hien_da_nghiem_thu_ab_ns
     , out double ip_dc_nhu_cau_von_ky_tiep_theo)
 {
     ip_dc_so_km = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.SoKM
                         , ip_para);
     ip_dc_tong_muc_dau_tu = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.TongMucDauTu
                         , ip_para);
     ip_dc_ke_hoach_qbt_ntcs = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KeHoachNamTruocChuyenSang_QuyBaoTri
                         , ip_para);
     ip_dc_ke_hoach_qbt_giao = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KeHoachGiao_QuyBaoTri
                         , ip_para);
     ip_dc_ke_hoach_ns_ntcs = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KeHoachNamTruocChuyenSang_NganSach
                         , ip_para);
     ip_dc_ke_hoach_ns_giao = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KeHoachGiao_NganSach
                         , ip_para);
     ip_dc_da_nhan_qbt_trong_thang = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KinhPhiDaNhan_TrongThang_QuyBaoTri
                         , ip_para);
     ip_dc_da_nhan_qbt_luy_ke = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KinhPhiDaNhan_LuyKe_QuyBaoTri
                         , ip_para);
     ip_dc_da_nhan_ns_trong_thang = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KinhPhiDaNhan_TrongThang_NganSach
                         , ip_para);
     ip_dc_da_nhan_ns_luy_ke = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KinhPhiDaNhan_LuyKe_NganSach
                         , ip_para);
     ip_dc_da_thanh_toan_qbt_trong_thang = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KinhPhiDaThanhToan_TrongThang_QuyBaoTri
                         , ip_para);
     ip_dc_da_thanh_toan_qbt_luy_ke = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KinhPhiDaThanhToan_LuyKe_QuyBaoTri
                         , ip_para);
     ip_dc_da_thanh_toan_ns_trong_thang = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KinhPhiDaThanhToan_TrongThang_NganSach
                         , ip_para);
     ip_dc_da_thanh_toan_ns_luy_ke = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.KinhPhiDaThanhToan_LuyKe_NganSach
                         , ip_para);
     ip_dc_gia_tri_thuc_hien_da_nghiem_thu_ab_qbt = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.GiaTriThucHienDaNghiemThuAB_QuyBaoTri
                         , ip_para);
     ip_dc_gia_tri_thuc_hien_da_nghiem_thu_ab_ns = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.GiaTriThucHienDaNghiemThuAB_NganSach
                         , ip_para);
     ip_dc_nhu_cau_von_ky_tiep_theo = F350.getSoLieu(ip_lst_giao_kh
                         , ip_lst_giao_von
                         , ip_lst_giai_ngan
                         , ip_lst_khoi_luong
                         , ip_dat_dau_nam
                         , ip_dat_tu_ngay
                         , ip_dat_den_ngay
                         , ip_dc_id_loai_nhiem_vu
                         , ip_dc_id_cong_trinh_khoan
                         , ip_dc_id_du_an_muc_tieu_muc
                         , para_bao_cao.NhuCauVonKyTiepTheo
                         , ip_para);
 }
            public static double getSoLieu(
                List<GD_CHI_TIET_GIAO_KH> ip_lst_giao_kh
                , List<GD_CHI_TIET_GIAO_VON> ip_lst_giao_von
                , List<GD_CHI_TIET_GIAI_NGAN> ip_lst_giai_ngan
                , List<GD_KHOI_LUONG> ip_lst_khoi_luong
                , DateTime ip_dat_dau_nam
                , DateTime ip_dat_tu_ngay
                , DateTime ip_dat_den_ngay
                , decimal ip_dc_id_loai_nhiem_vu
                , decimal? ip_dc_id_cong_trinh_khoan
                , decimal? ip_dc_id_du_an_muc_tieu_muc
                , para_bao_cao ip_para
                , para_Level ip_level
                )
            {
                double v_dc_result = 0;
                List<GD_CHI_TIET_GIAO_KH> v_lst_kh_dieu_chinh;
                List<GD_CHI_TIET_GIAO_KH> v_lst_kh_dau_nam_bo_sung;
                List<GD_CHI_TIET_GIAO_VON> v_lst_giao_von_dau_nam_bo_sung;
                List<GD_CHI_TIET_GIAO_VON> v_lst_giao_von_dieu_chinh;
                decimal? v_dc_dieu_chinh;
                decimal? v_dc_dau_nam_bo_sung;
                switch (ip_para)
                {
                    case para_bao_cao.SoKM:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_dc_result = ip_lst_giao_kh.Sum(x => getDouble(x.GHI_CHU_2 ?? "0"));
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_dc_result = ip_lst_giao_kh
                                                .Where(x => x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                                .Sum(x => getDouble(x.GHI_CHU_2 ?? "0"));
                                break;
                            case para_Level.CongTrinh:
                                v_dc_result = ip_lst_giao_kh
                                                .Where(x => x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                                    && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                                .Sum(x => getDouble(x.GHI_CHU_2 ?? "0"));
                                break;
                            case para_Level.Khoan:
                                v_dc_result = ip_lst_giao_kh
                                                .Where(x => x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                                    && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                                .Sum(x => getDouble(x.GHI_CHU_2 ?? "0"));
                                break;
                            case para_Level.DuAn:
                                v_dc_result = ip_lst_giao_kh
                                                .Where(x => x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                                    && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                                    && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                                .Sum(x => getDouble(x.GHI_CHU_2 ?? "0"));
                                break;
                            case para_Level.Muc:
                                v_dc_result = ip_lst_giao_kh
                                                .Where(x => x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                                    && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                                    && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                                .Sum(x => getDouble(x.GHI_CHU_2 ?? "0"));
                                break;
                            case para_Level.TieuMuc:
                                v_dc_result = ip_lst_giao_kh
                                                .Where(x => x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                                    && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                                    && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                                .Sum(x => getDouble(x.GHI_CHU_2 ?? "0"));
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KeHoachNamTruocChuyenSang_QuyBaoTri:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.CongTrinh:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Khoan:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.DuAn:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Muc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.TieuMuc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KeHoachNamTruocChuyenSang_NganSach:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.CongTrinh:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Khoan:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.DuAn:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Muc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.TieuMuc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NAM_TRUOC_CHUYEN_SANG_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KeHoachGiao_QuyBaoTri:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.CongTrinh:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Khoan:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.DuAn:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                       && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Muc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.TieuMuc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KeHoachGiao_NganSach:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.CongTrinh:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Khoan:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.DuAn:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Muc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.TieuMuc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KinhPhiDaNhan_TrongThang_QuyBaoTri:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.CongTrinh:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Khoan:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.DuAn:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Muc:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.TieuMuc:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KinhPhiDaNhan_LuyKe_QuyBaoTri:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.CongTrinh:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Khoan:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.DuAn:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Muc:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.TieuMuc:
                                v_lst_giao_von_dieu_chinh = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList();
                                v_lst_giao_von_dau_nam_bo_sung = ip_lst_giao_von
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_giao_von_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_giao_von_dieu_chinh.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_dau_nam_bo_sung = v_lst_giao_von_dau_nam_bo_sung.Sum(x => x.SO_TIEN_QUY_BT);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KinhPhiDaNhan_TrongThang_NganSach:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                           && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                           && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                           && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                           && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.CongTrinh:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                       && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Khoan:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                       && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.DuAn:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc
                                       && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                       && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Muc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc
                                       && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                       && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.TieuMuc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc
                                        && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc
                                       && x.DM_QUYET_DINH.NGAY_THANG >= ip_dat_tu_ngay
                                       && x.DM_QUYET_DINH.NGAY_THANG <= ip_dat_den_ngay)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KinhPhiDaNhan_LuyKe_NganSach:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.CongTrinh:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Khoan:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.DuAn:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.Muc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            case para_Level.TieuMuc:
                                v_lst_kh_dieu_chinh = ip_lst_giao_kh
                                    .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO == WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .ToList();
                                v_lst_kh_dau_nam_bo_sung = ip_lst_giao_kh
                                   .Where(x => x.DM_QUYET_DINH.ID_LOAI_QUYET_DINH_GIAO != WebUS.ID_LOAI_GIAO_DICH.DIEU_CHINH
                                       && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                       && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                       && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                   .ToList()
                                    //Loại trừ dự án, mục, tiểu mục điều chỉnh
                                   .Where(x => !v_lst_kh_dieu_chinh.Exists(y =>
                                       y.ID_LOAI_NHIEM_VU == x.ID_LOAI_NHIEM_VU
                                       && y.ID_CONG_TRINH == x.ID_CONG_TRINH
                                       && y.ID_KHOAN == x.ID_KHOAN
                                       && (y.ID_DU_AN == x.ID_DU_AN
                                       || (x.ID_TIEU_MUC == null && y.ID_MUC == x.ID_MUC)
                                       || (x.ID_TIEU_MUC != null && y.ID_TIEU_MUC == x.ID_TIEU_MUC))))
                                   .ToList();
                                v_dc_dieu_chinh = v_lst_kh_dieu_chinh.Sum(x => x.SO_TIEN_NS);
                                v_dc_dau_nam_bo_sung = v_lst_kh_dau_nam_bo_sung.Sum(x => x.SO_TIEN_NS);
                                v_dc_result = Convert.ToDouble(v_dc_dau_nam_bo_sung + v_dc_dieu_chinh);
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KinhPhiDaThanhToan_TrongThang_QuyBaoTri:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N")
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.CongTrinh:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.Khoan:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.DuAn:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.Muc:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.TieuMuc:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KinhPhiDaThanhToan_LuyKe_QuyBaoTri:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N")
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.CongTrinh:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.Khoan:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.DuAn:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.Muc:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.TieuMuc:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "N"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KinhPhiDaThanhToan_TrongThang_NganSach:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y")
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.CongTrinh:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.Khoan:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.DuAn:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.Muc:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.TieuMuc:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_tu_ngay
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.KinhPhiDaThanhToan_LuyKe_NganSach:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y")
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.CongTrinh:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.Khoan:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.DuAn:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                        && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.Muc:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            case para_Level.TieuMuc:
                                v_dc_result = Convert.ToDouble(ip_lst_giai_ngan
                                    .Where(x => x.DM_GIAI_NGAN.NGAY_THANG >= ip_dat_dau_nam
                                        && x.DM_GIAI_NGAN.NGAY_THANG <= ip_dat_den_ngay
                                        && x.DM_GIAI_NGAN.IS_NGUON_NS_YN == "Y"
                                        && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                        && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                        && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                    .Sum(x => x.SO_TIEN_NOP_THUE + (x.SO_TIEN_TT_CHO_DV_HUONG ?? 0)));
                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.GiaTriThucHienDaNghiemThuAB_QuyBaoTri:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU ?? 0)));
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU ?? 0)));
                                break;
                            case para_Level.CongTrinh:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                            && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU ?? 0)));
                                break;
                            case para_Level.Khoan:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                            && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU ?? 0)));
                                break;
                            case para_Level.DuAn:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                            && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                            && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU ?? 0)));
                                break;
                            case para_Level.Muc:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                            && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                            && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU ?? 0)));
                                break;
                            case para_Level.TieuMuc:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                            && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                            && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU ?? 0)));

                                break;
                            default:
                                break;
                        }
                        break;
                    case para_bao_cao.GiaTriThucHienDaNghiemThuAB_NganSach:
                        switch (ip_level)
                        {
                            case para_Level.TongCong:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU_NS ?? 0)));
                                break;
                            case para_Level.LoaiNhiemVu:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU_NS ?? 0)));
                                break;
                            case para_Level.CongTrinh:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                            && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU_NS ?? 0)));
                                break;
                            case para_Level.Khoan:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                            && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU_NS ?? 0)));
                                break;
                            case para_Level.DuAn:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                            && x.ID_CONG_TRINH == ip_dc_id_cong_trinh_khoan
                                            && x.ID_DU_AN == ip_dc_id_du_an_muc_tieu_muc)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU_NS ?? 0)));
                                break;
                            case para_Level.Muc:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                            && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                            && x.ID_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU_NS ?? 0)));
                                break;
                            case para_Level.TieuMuc:
                                v_dc_result = Convert.ToDouble(ip_lst_khoi_luong
                                     .Where(x => x.NGAY_THANG >= ip_dat_dau_nam
                                            && x.NGAY_THANG <= ip_dat_den_ngay
                                            && x.ID_LOAI_NHIEM_VU == ip_dc_id_loai_nhiem_vu
                                            && x.ID_KHOAN == ip_dc_id_cong_trinh_khoan
                                            && x.ID_TIEU_MUC == ip_dc_id_du_an_muc_tieu_muc)
                                     .Sum(x => (x.SO_TIEN_DA_NGHIEM_THU_NS ?? 0)));

                                break;
                            default:
                                break;
                        }
                        break;
                    default:
                        break;
                }
                return v_dc_result;
            }