예제 #1
0
        /// <summary>
        /// 頁籤=單店未開發票對帳單
        /// </summary>
        /// <param name="ParameterList"></param>
        /// <returns></returns>
        public DataTable CAA24_4(ArrayList ParameterList)
        {
            #region 宣告變數

            BCO.CAACommon CAAComm = new BCO.CAACommon();
            ArrayList arl_ReportService = new ArrayList();

            #endregion

            #region 傳入參數

            arl_ReportService.Clear();
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[0].ToString(), "string", false));//[結帳年月](0)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[1].ToString(), "string", false));//[店群]起(1)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[2].ToString(), "string", false));//[店群]迄(2)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[3].ToString(), "string", false));//[路線]起(3)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[4].ToString(), "string", false));//[路線]迄(4)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[5].ToString(), "string", false));//[結帳統編](5)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[6].ToString(), "string", false));//[店號](6)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[7].ToString(), "string", false));//[商品群分類](7)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[8].ToString(), "int", false));//[路線](8)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[9].ToString(), "int", false));//[判斷抓取資料範圍](0=單店開立,1=總部彙開+單店開立)(9)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[10].ToString(), "string", false));//登入人員(10)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[11].ToString(), "string", false));//那一個頁籤(11)
            arl_ReportService.Add(DBNull.Value);//不論作廢否都要(12)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[13].ToString(), "string", false));//總部憑證彙開對帳列印(13)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[12].ToString(), "string", false));//是否為零元對帳單列印 1:是 0:否(14)
            #endregion

            #region 連結資料庫

            DataSet ds_Return = new DataSet();

            BCO.CheckSheetPrint bco = new BCO.CheckSheetPrint(ConntionDB);
            ds_Return = bco.GetDiscCheckSheet(null, arl_ReportService);

            #endregion

            #region 檢查回傳資料

            if (ds_Return.Tables["Main1"].Rows.Count == 0 && //折讓資料
                ds_Return.Tables["INVDISC_ZERO"].Rows.Count == 0)//發票+折讓=零的資料
            { throw new Exception("查無資料"); }

            #endregion

            #region 整理列印資料

            DataTable dt_Temp_Result = new DataTable();
            DateTime d_Now = DateTime.Now;

            //折讓資料
            if (ParameterList[12].ToString() == "0")  //0.一般列印
                dt_Temp_Result = Collate_Information_Print_Disc(d_Now, ds_Return, "4", arl_ReportService[6].ToString());
            else //1:只印零元憑證門市清單按鈕
                dt_Temp_Result = Collate_Information_Print_Disc(d_Now, ds_Return, "41", arl_ReportService[6].ToString());

            //折讓+發票=零的資料
            dt_Temp_Result = Collate_Information_Print_InvDisc_Zero(d_Now, ds_Return, dt_Temp_Result);

            #endregion

            #region 檢查列印資料

            if (dt_Temp_Result.Rows.Count == 0)
            { throw new Exception("查無資料"); }

            #endregion

            return dt_Temp_Result;
        }
예제 #2
0
        /// <summary>
        /// 頁籤=折讓對帳單
        /// </summary>
        /// <param name="ParameterList"></param>
        /// <returns></returns>
        public DataTable CAA24_2(ArrayList ParameterList)
        {
            #region 宣告變數

            BCO.CAACommon CAAComm = new BCO.CAACommon();
            ArrayList arl_ReportService = new ArrayList();

            #endregion

            #region 傳入參數

            arl_ReportService.Clear();
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[0].ToString(), "string", false));//[結帳年月](0)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[1].ToString(), "string", false));//[店群]起(1)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[2].ToString(), "string", false));//[店群]迄(2)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[3].ToString(), "string", false));//[路線]起(3)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[4].ToString(), "string", false));//[路線]迄(4)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[5].ToString(), "string", false));//[結帳統編](5)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[6].ToString(), "string", false));//[店號](6)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[7].ToString(), "string", false));//[商品群分類](7)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[8].ToString(), "int", false));//[路線](8)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[9].ToString(), "int", false));//[判斷抓取資料範圍](0=單店開立,1=總部彙開+單店開立)(9)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[10].ToString(), "string", false));//登入人員(10)
            arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[11].ToString(), "string", false));//那一個頁籤(11)
            arl_ReportService.Add(CAAComm.GetValueSetParameter("0", "string", false));//發票未作廢(12)
            arl_ReportService.Add(CAAComm.GetValueSetParameter("0", "string", false));//總部憑證彙開對帳列印(13)
            arl_ReportService.Add(CAAComm.GetValueSetParameter("0", "string", false));//是否為零元對帳單列印 1:是 0:否(14)
            #endregion

            #region 連結資料庫

            #region 規則

            /*
             * (1)折讓對帳單:左邊上方折讓單的資料
             *    先依照畫面上的條件,把符合條件的折讓單抓取出來
             *    折讓單必須是[系統開立]且[營業系統]且[尚未作廢]
             * (2)折讓對帳單:右半邊發票的資料
             *    依照折讓單號至 VDS_CAA_DISC_MAIN,VDS_CAA_DISC_DETL
             *    抓取相對應的發票號碼
             * (3)折讓對帳單:左邊下方明細的資料
             *    依照折讓單號至 VDS_CAM_ACCT_CHECK_OUT,VDS_CAM_ACCT_CHECK_OUT_DETL
             *    抓取相對應的明細資料
             * (4)折讓對帳單:右半邊發票的資料
             *    為一式四份,每一式可以列印五張發票資料,所以一張對帳單只能印五張發票資料
             * (5)折讓對帳單:左邊下方明細的資料
             *    [未稅金額] = VDS_CAM_ACCT_CHECK_OUT.TOT_AMT
             *    [含稅金額] = 若該筆明細所對應的折讓單的稅別 = [應稅] OR [零稅]
             *                  則[未稅金額] = VDS_CAM_ACCT_CHECK_OUT.TOT_AMT + VDS_CAM_ACCT_CHECK_OUT.TOT_AMT_TAX
             *                  若該筆明細所對應的折讓單的稅別 = [免稅]
             *                  則[未稅金額] = 0
             */

            #endregion

            DataSet ds_Return = new DataSet();

            BCO.CheckSheetPrint bco = new BCO.CheckSheetPrint(ConntionDB);
            ds_Return = bco.GetDiscCheckSheet(null, arl_ReportService);

            #endregion

            #region 檢查回傳資料

            //頁籤=折讓對帳單時,不會有發票+折讓=零的資料
            if (ds_Return.Tables["MAIN1"].Rows.Count == 0)
            { throw new Exception("查無資料"); }

            #endregion

            #region 整理列印資料

            DateTime d_Now = DateTime.Now;
            DataTable dt_Temp_Result = Collate_Information_Print_Disc(d_Now, ds_Return, "2", arl_ReportService[6].ToString());

            #endregion

            #region 檢查列印資料

            if (dt_Temp_Result.Rows.Count == 0)
            { throw new Exception("查無資料"); }

            #endregion

            return dt_Temp_Result;
        }