/// <summary> /// 頁籤=發票對帳單 /// </summary> /// <param name="ParameterList"></param> /// <returns></returns> public DataTable CAA24_1(ArrayList ParameterList) { #region 宣告變數 BCO.CAACommon CAAComm = new BCO.CAACommon(); ArrayList arl_ReportService = new ArrayList(); #endregion #region 傳入參數 #region 規則 /* * 當頁籤=發票對帳單時 * 抓取[單店開立]的資料 * 當頁籤=單店未開發票對帳單 * 抓取[單店開立]&[總部彙開]的資料 * 當頁籤=計算機發票 * 抓取[單店開立]&[總部彙開]的資料 */ #endregion 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(), "string", false));//[發票對帳單送達](9) arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[10].ToString(), "int", false));//[列印註記](0=未列印,1=已列印)(10) arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[11].ToString(), "int", false));//[判斷抓取資料範圍](0=單店開立,1=總部彙開+單店開立)(11) arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[12].ToString(), "string", false));//登入人員(12) arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[13].ToString(), "string", false));//那一個頁籤(13) arl_ReportService.Add(CAAComm.GetValueSetParameter("0", "string", false));//發票未作廢(14) #endregion #region 連結資料庫 #region 規則 /* * (1)當頁籤=發票對帳單時 * 只抓取[單店開立]的資料 * (2)發票對帳單:左邊上方發票的資料 * 先依照畫面上的條件,把符合條件的發票抓取出來 * 發票必須是[營業系統]且[尚未作廢] * 抓出的發票依照拆單條件[發票的建立日期][店號][群分類][開立依據][票期][是否檔期]分類 * 左邊上方發票的資料就抓每一個群組的第一筆資料 * (3)發票對帳單:右半邊發票的資料 * 抓取 VDS_CAA_INV_MAIN 的資料 * (4)發票對帳單:左邊下方明細的資料 * 依照發票號碼至 VDS_CAM_ACCT_CHECK_OUT,VDS_CAM_ACCT_CHECK_OUT_DETL * 抓取相對應的明細資料 * (5)發票對帳單:右半邊發票的資料 * 為一式二份,所以一張對帳單只能印兩張發票資料 * (6)發票對帳單:左邊下方明細的資料 * [未稅金額] = VDS_CAM_ACCT_CHECK_OUT.TOT_AMT * [含稅金額] = 若該筆明細所對應的折讓單的稅別 = [應稅] OR [零稅] * 則[未稅金額] = VDS_CAM_ACCT_CHECK_OUT.TOT_AMT + VDS_CAM_ACCT_CHECK_OUT.TOT_AMT_TAX * 若該筆明細所對應的折讓單的稅別 = [免稅] * 則[未稅金額] = 0 * (7)頁籤 = [發票對帳單] * 只抓取[單店開立]的資料,不抓取[總部彙開]的資料 * 頁籤 = [單店未開發票對帳單] OR [計算機發票] * 則抓全部的發票 */ #endregion DataSet ds_Return = new DataSet(); BCO.CheckSheetPrint bco = new BCO.CheckSheetPrint(ConntionDB); ds_Return = bco.OneNonCheckSheet(null, arl_ReportService); #endregion #region 檢查回傳資料 if (ds_Return.Tables["MAIN"].Rows.Count == 0) { throw new Exception("查無資料"); } #endregion #region 整理列印資料 DataTable dt_Temp_Result = new DataTable(); dt_Temp_Result = Collate_Information_Print_Inv(ds_Return, "1", arl_ReportService[6].ToString()); #endregion #region 檢查列印資料 if (dt_Temp_Result.Rows.Count == 0) { throw new Exception("查無資料"); } #endregion #region 更新發票主檔的列印註記 #region 規則 /* * 當頁籤 = 發票對帳單 & 計算機發票 * 查詢完成後必須更新發票主檔的列印註記 * 當頁籤 = 單店未開發票對帳單 * 查詢完成後不必更新發票主檔的列印註記 */ #endregion DateTime d_Now = DateTime.Now; string s_LogUser = arl_ReportService[12].ToString(); bco.CAA241_UPDATE_INV_MAIN(null, ds_Return.Tables["MAIN"], d_Now, s_LogUser); #endregion return dt_Temp_Result; }
/// <summary> /// 頁籤=單店對帳單 /// </summary> /// <param name="ParameterList"></param> /// <returns></returns> public DataTable CAA24_3(ArrayList ParameterList) { #region 宣告變數 BCO.CAACommon CAAComm = new BCO.CAACommon(); ArrayList arl_ReportService = new ArrayList(); #endregion #region 傳入參數 #region 規則 /* * 當頁籤=發票對帳單時 * 抓取[單店開立]的資料 * 當頁籤=單店未開發票對帳單 * 抓取[單店開立]&[總部彙開]的資料 * 當頁籤=計算機發票 * 抓取[單店開立]&[總部彙開]的資料 */ #endregion 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(), "string", false));//[發票對帳單送達](9) arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[10].ToString(), "int", false));//[列印註記](0=未列印,1=已列印)(10) arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[11].ToString(), "int", false));//[判斷抓取資料範圍](0=單店開立,1=總部彙開+單店開立)(11) arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[12].ToString(), "string", false));//登入人員(12) arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[13].ToString(), "string", false));//那一個頁籤(13) arl_ReportService.Add(CAAComm.GetValueSetParameter(ParameterList[14].ToString(), "string", false));//發票作廢(14) #endregion #region 連結資料庫 DataSet ds_Return = new DataSet(); BCO.CheckSheetPrint bco = new BCO.CheckSheetPrint(ConntionDB); ds_Return = bco.OneNonCheckSheet(null, arl_ReportService); #endregion #region 檢查回傳資料 if (ds_Return.Tables["MAIN"].Rows.Count == 0) { throw new Exception("查無資料"); } #endregion #region 整理列印資料 DataTable dt_Temp_Result = new DataTable(); try { dt_Temp_Result = Collate_Information_Print_Inv(ds_Return, "3", arl_ReportService[6].ToString()); } catch (Exception ex) { throw new Exception("Collate_Information_Print_Inv!錯誤訊息:" + ex.ToString()); } #endregion #region 檢查列印資料 if (dt_Temp_Result.Rows.Count == 0) { throw new Exception("查無資料"); } #endregion return dt_Temp_Result; }