Esempio n. 1
0
        private bool FindData_List(SAPbouiCOM.Form oForm, string edtCode)
        {
            string query = string.Empty;
            StringBuilder pQuery = new StringBuilder();

            pQuery.Append("SELECT U_READCD2                     ");
            pQuery.Append("     , U_DATE                        ");
            pQuery.Append("     , U_TYPE                        ");
            pQuery.Append("     , U_DEPAMT                      ");
            pQuery.Append("     , U_SUBAMT                      ");
            pQuery.Append("     , U_AMT                         ");
            pQuery.Append("  FROM KIS_VW_SO02404_HRD            ");
            pQuery.Append(" WHERE U_READCD = '{0}'              ");
            //pQuery.Append(" ORDER BY U_READCD, U_SORT, U_DATE   ");


            query = string.Format(pQuery.ToString(), edtCode);


            string expr = "Editable=false"
                        + "&" + "Caption(U_READCD2=독자코드,U_DATE=일자,U_TYPE=유형,U_DEPAMT=입금,U_SUBAMT=출금,U_AMT=소계)"
                        + "&" + "RightJustified=false(U_DEPAMT=true,U_SUBAMT=true,U_AMT=true)"
                        + "&" + "Visible(U_READCD2=false)"
                        ;

            KIS_SO0001F_HRD KIS_SO0001F_HRD = new KIS_SO0001F_HRD();
            return KIS_SO0001F_HRD.Act0_SubFormInit("선수금내역", oForm.UniqueID, SO.SO_COMMON_HRD.ConfirmType.Close, BoMatrixSelect.ms_Single, query, -1, 550, 450, expr);
        }
Esempio n. 2
0
        private bool FindData(SAPbouiCOM.Form oForm)
        {
            string query = string.Empty;
            StringBuilder pQuery = new StringBuilder();
            pQuery.Append(" SELECT U_BRCCD      \r");
            pQuery.Append("      , U_BRCNM      \r");
            pQuery.Append("      , Code         \r");
            pQuery.Append("      , Name         \r");
            pQuery.Append("      , U_SNM        \r");
            pQuery.Append("      , U_TEL1       \r");
            pQuery.Append("      , U_TEL2       \r");
            pQuery.Append("      , U_TEL3       \r");
            pQuery.Append("      , U_KHCNT      \r");
            pQuery.Append("      , U_HECNT      \r");
            pQuery.Append("      , U_STATUS     \r");
            pQuery.Append("      , U_CARNO      \r");
            pQuery.Append("      , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO90' AND F.U_USEYN = 'Y' AND F.U_SMLCD = U_AREA) AS U_AREA  \r");
            pQuery.Append("      , U_BRCMNG     \r");
            pQuery.Append("      , U_ZIPCD1     \r");
            pQuery.Append("      , U_ADDR1      \r");
            pQuery.Append("      , U_ADDR1_D    \r");
            pQuery.Append("      , U_ZIPCD2     \r");
            pQuery.Append("      , U_ADDR2      \r");
            pQuery.Append("      , U_ADDR2_D    \r");
            pQuery.Append("      , U_DAREA      \r");
            pQuery.Append("      , U_EMAIL      \r");
            pQuery.Append("      , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.CODE = 'SO17' AND F.U_USEYN = 'Y' AND F.U_SMLCD = U_CENTGBN ) AS U_CENTGBN   \r");
            pQuery.Append("   FROM [@KIS_SO0330M_HRD]   \r");
            pQuery.Append("  WHERE EXISTS ( SELECT 'X'  \r");
            pQuery.Append(" 				   FROM [@KIS_SO0010M_HRD] A, [@KIS_SO00101_HRD] B  \r");
            pQuery.Append(" 				  WHERE A.Code = B.Code AND A.Code = '{0}'  \r");
            pQuery.Append(" 					AND B.U_USEYN = 'Y' \r");
            pQuery.Append(" 					AND B.U_CENTCD = [@KIS_SO0330M_HRD].U_BRCCD )   \r");

            query = string.Format(pQuery.ToString(), B1Connections.diCompany.UserName);

            string expr = "Editable=false"
                        + "&" + "Caption(U_BRCCD=지국코드,U_BRCNM=지국이름,Code=분국코드,Name=분국이름,U_SNM=약칭,U_KHCNT=KH부수,U_HECNT=HB부수"
                              + ",U_STATUS=상태,U_CARNO=차량번호,U_AREA=지역,U_BRCMNG=지국장명,U_ZIPCD1=우편번호1,U_ADDR1=주소1,U_ADDR1_D=주소상세1"
                              + ",U_ZIPCD2=우편번호2,U_ADDR2=주소2,U_ADDR2_D=주소상세2,U_DAREA=배포구역,U_TEL1=전화번호1,U_TEL2=전화번호2,U_TEL3=전화번호3"
                              + ",U_EMAIL=이메일,U_CENTGBN=분국구분)"
                        + "&" + "RightJustified=false(U_KHCNT=true,U_HECNT=true)"
                //+ "&" + "Visible=false(U_READCD=true,U_REQNM=true,U_REQYM=true,U_AMT=true,U_MODAMT=true)"
                        ;

            KIS_SO0001F_HRD KIS_SO0001F_HRD = new KIS_SO0001F_HRD();

            return KIS_SO0001F_HRD.Act0_SubFormInit("분국조회", oForm.UniqueID, SO.SO_COMMON_HRD.ConfirmType.Close, BoMatrixSelect.ms_Single, query, -1, 600, 450, expr);

        }
Esempio n. 3
0
        private bool FindData_Over(SAPbouiCOM.Form oForm)
        {
            string edtREADCD1 = FN.GetItemValue(ref oForm, "edtREADCD1");
            string edtREADCD2 = FN.GetItemValue(ref oForm, "edtREADCD2");
            string edtREQNM = FN.GetItemValue(ref oForm, "edtREQNM");
            string edtDEPNM = FN.GetItemValue(ref oForm, "edtDEPNM");
            string edtJDTDT = FN.GetItemValue(ref oForm, "edtJDTDT");

            string query = string.Empty;
            StringBuilder pQuery = new StringBuilder();
            pQuery.Append(" SELECT    'Y' AS U_CHK                              \r");
            pQuery.Append("         , -1  AS DOCENTRY                           \r");
            pQuery.Append(" 		, NULL AS LINEID                            \r");
            pQuery.Append(" 		, NULL AS VisOrder                          \r");
            pQuery.Append(" 		, B.U_READCD                                \r");
            //pQuery.Append(" 		, B.U_REQNM                                 \r");
            pQuery.Append(" 		, C.U_REQNAME AS U_REQNM                    \r");
            pQuery.Append(" 		, B.U_USEYM AS U_REQYM	                    \r");
            pQuery.Append(" 		, B.U_AMT                                   \r");
            pQuery.Append(" 		, U_MODAMT AS U_MODAMT			            \r");
            pQuery.AppendFormat(" 		, CONVERT(DATETIME, '{0}') AS U_DEPDT               \r", FN.SetDateFormatToDB(edtJDTDT, FN.eDateType.n_YYYYMMDD));
            pQuery.Append(" 		, CONVERT(NVARCHAR(50), '') AS U_DEPNM      \r");
            pQuery.Append(" 		, CONVERT(NUMERIC(19,6),0) AS U_DEPAMT      \r");
            pQuery.Append(" 		, CONVERT(NUMERIC(19,6),0) AS U_CMMAMT      \r");
            pQuery.Append(" 		, CONVERT(INT, NULL) AS U_HBNKCD            \r");
            pQuery.Append(" 		, CONVERT(NVARCHAR(100), '') AS U_BANKCD    \r");
            pQuery.Append(" 		, CONVERT(NVARCHAR(100), '') AS U_BANKNM    \r");
            pQuery.Append(" 		, CONVERT(NVARCHAR(50), '') AS U_BNKHOLD	\r");
            pQuery.Append(" 		, CONVERT(NVARCHAR(16), '') AS U_BNKACCT	\r");
            pQuery.Append(" 		, CONVERT(NVARCHAR(15), '') AS U_ACCT       \r");
            pQuery.Append(" 		, CONVERT(NVARCHAR(20), '') AS U_CREDTBP	\r");
            pQuery.Append(" 		, CONVERT(NVARCHAR(20), '') AS U_CREDTNO	\r");
            pQuery.Append(" 		, CONVERT(NVARCHAR(6), '') AS U_VALIDMY		\r");
            pQuery.Append(" 		, CONVERT(NVARCHAR(20), '') AS U_CREDTNM	\r");
            pQuery.Append(" 		, CONVERT(NVARCHAR(16), '') AS U_JMNO		\r");
            pQuery.Append(" 		, (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.CODE = 'SO09' AND F.U_SMLCD = B.U_PMETHOD) AS U_PMETHOD     \r");
            pQuery.Append(" 		, B.U_SUMCNT AS U_CNT                                                                                         \r");
            pQuery.Append(" 		, (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.CODE = 'SO11' AND F.U_SMLCD = B.U_PAYPERD) AS U_PAYPERD     \r");
            pQuery.Append(" 		, B.U_PAPERTP   \r");
            pQuery.Append(" 		, B.U_BTYPE     \r");
            pQuery.Append(" 		, B.U_BENTRY    \r");
            pQuery.Append(" 		, B.U_BLINEID   \r");
            pQuery.Append(" 		, C.U_CARDCD    \r");
            pQuery.Append("   FROM (SELECT A.DocEntry AS U_BENTRY	\r");
            pQuery.Append(" 			 , A.LineId AS U_BLINEID	\r");
            pQuery.Append(" 			 , A.U_BTYPE                \r");
            pQuery.Append(" 			 , A.DocEntry               \r");
            pQuery.Append(" 			 , A.LineId                 \r");
            pQuery.Append(" 			 , A.U_READCD				\r");
            pQuery.Append(" 			 , A.U_REQNM				\r");
            pQuery.Append(" 			 , ISNULL((SELECT F.U_AMT FROM KIS_VW_SO02401_HRD F WHERE F.U_READCD = A.U_READCD),0) AS U_MODAMT         \r");
            pQuery.Append(" 			 , A.U_REQAMT				\r");
            pQuery.Append(" 			 , A.U_USEYM				\r");
            pQuery.Append(" 			 , A.U_REQYM				\r");
            pQuery.Append(" 			 , A.U_PMETHOD				\r");
            pQuery.Append(" 			 , A.U_PAYPERD				\r");
            pQuery.Append(" 			 , A.U_PAPERTP				\r");
            pQuery.Append(" 			 , A.U_SUMCNT				\r");
            pQuery.Append(" 			 , A.U_STATUS				\r");
            pQuery.Append(" 			 , A.U_AMT                  \r");
            pQuery.Append(" 		  FROM KIS_VW_SO02405_HRD A     \r");
            pQuery.Append(" 		 WHERE A.U_AMT < 0              \r");
            pQuery.Append(" 	   ) B                              \r");
            pQuery.Append(" 	 , [dbo].[@KIS_SO0030M_HRD] C       \r");
            pQuery.Append("  WHERE B.U_READCD = C.Code              \r");
            pQuery.Append("    --AND B.U_PMETHOD IN ('U010')        \r");
            pQuery.Append("    AND B.U_PAPERTP IN ('UKH','UHB')     \r");
            pQuery.Append("    AND ISNULL(B.U_AMT,0) < 0            \r");
            pQuery.Append("    AND (ISNULL('{0}','') = '' OR B.U_READCD >= '{0}')   \r");
            pQuery.Append("    AND (ISNULL('{1}','') = '' OR B.U_READCD <= '{1}')   \r");
            pQuery.Append("    AND (ISNULL('{2}','') = '' OR B.U_REQNM = '{2}')     \r");
            pQuery.Append("    AND (ISNULL('{3}','') = '' OR C.Name = '{3}')        \r");
            //pQuery.Append("  ORDER BY B.U_READCD, B.U_USEYM                         \r");


            query = string.Format(pQuery.ToString(), edtREADCD1
                                                   , edtREADCD2
                                                   , edtREQNM
                                                   , edtDEPNM
                                                   , FN.SetDateFormatToDB(edtJDTDT, FN.eDateType.n_YYYYMMDD));

            string orderBy = "U_READCD, U_REQYM";

            string expr = "Editable=false"
                        + "&" + "Caption(U_READCD=독자코드,U_REQNM=청구처이름,U_REQYM=청구월,U_AMT=청구잔액,U_MODAMT=선수금잔액)"
                        + "&" + "RightJustified=false(U_AMT=true,U_CNT=true,U_MODAMT=true)"
                        + "&" + "Visible=false(U_READCD=true,U_REQNM=true,U_REQYM=true,U_AMT=true,U_MODAMT=true)"
                        ;

            KIS_SO0001F_HRD KIS_SO0001F_HRD = new KIS_SO0001F_HRD();

            return KIS_SO0001F_HRD.Act0_SubFormInit("과입금내역", oForm.UniqueID, SO.SO_COMMON_HRD.ConfirmType.Open, BoMatrixSelect.ms_Auto, query, -1, 550, 450, expr, orderBy);
        }
Esempio n. 4
0
        private bool FindData(SAPbouiCOM.Form oForm)
        {
            string edtREADCD1 = FN.GetItemValue(ref oForm, "edtREADCD1");
            string edtREADCD2 = FN.GetItemValue(ref oForm, "edtREADCD2");
            string edtREQNM = FN.GetItemValue(ref oForm, "edtREQNM");
            string edtDEPNM = FN.GetItemValue(ref oForm, "edtDEPNM");
            string edtDOCNUM = ""; //FN.GetItemValue(ref oForm, "edtDOCNUM");
            string edtJDTDT = FN.GetItemValue(ref oForm, "edtJDTDT");


            string query = string.Empty;
            StringBuilder pQuery = new StringBuilder();
            pQuery.Append(" SELECT M.DocEntry AS '문서번호'         \r");
            pQuery.Append("      , M.LineId AS '문서라인'           \r");
            pQuery.Append("      , M.U_READCD AS '독자번호'         \r");
            pQuery.Append("      , M.U_REQNM AS '청구자이름'        \r");
            pQuery.Append("      , M.U_REQYM AS '청구년월'          \r");
            pQuery.Append("      , M.U_DEPDT AS '입금일자'          \r");
            pQuery.Append(" 	 , M.U_DEPNM AS '입금자'            \r");
            pQuery.Append("      , M.U_DEPAMT AS '입금액'           \r");
            pQuery.Append("      , M.U_DEPTP  AS '입금유형'         \r");
            pQuery.Append("      , M.U_DEPMD  AS '입금방법'         \r");
            pQuery.Append("      , CASE ISNULL(M.Status, '') WHEN 'O' THEN '정상' ELSE '취소' END AS '문서상태'                                    \r");
            //pQuery.Append("      , M.U_JDTDOC  AS '분개번호'        \r");
            //pQuery.Append("      , M.U_RJDTDOC  AS '역분개번호'     \r");
            pQuery.Append("  FROM ( SELECT A.DocEntry               \r");
            pQuery.Append(" 			 , B.LineId                 \r");
            pQuery.Append(" 			 , B.U_READCD               \r");
            pQuery.Append(" 			 , (SELECT F.U_REQNAME FROM [dbo].[@KIS_SO0030M_HRD] F WHERE F.Code = B.U_READCD) AS U_REQNM               \r");
            pQuery.Append(" 			 , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO50' AND F.U_SMLCD = A.U_DEPTP)  AS U_DEPTP    \r");
            pQuery.Append(" 			 , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO51' AND F.U_SMLCD = A.U_DEPMD)  AS U_DEPMD    \r");
            pQuery.Append(" 			 , B.U_REQYM                \r");
            pQuery.Append(" 			 , B.U_DEPDT                \r");
            pQuery.Append(" 			 , B.U_DEPAMT               \r");
            pQuery.Append(" 			 , B.U_DEPNM                \r");
            pQuery.Append(" 			 , A.Status                 \r");
            pQuery.Append(" 			 , A.U_JDTDOC               \r");
            pQuery.Append(" 			 , A.U_RJDTDOC              \r");
            pQuery.Append(" 		  FROM [@KIS_SO0240T_HRD] A     \r");
            pQuery.Append(" 			 , [@KIS_SO02401_HRD] B     \r");
            pQuery.Append(" 		 WHERE A.DocEntry = B.DocEntry  \r");
            pQuery.Append(" 		   AND (ISNULL('{0}','') = '' OR B.DocEntry = '{0}')                \r");
            pQuery.Append(" 		   AND (ISNULL('{1}','') = '' OR B.U_READCD >= '{1}')               \r");
            pQuery.Append(" 		   AND (ISNULL('{2}','') = '' OR B.U_READCD <= '{2}')               \r");
            pQuery.Append(" 		   AND (ISNULL('{3}','') = '' OR B.U_DEPNM LIKE '%' + '{3}' + '%')  \r");
            pQuery.Append("       ) M                                                                   \r");
            pQuery.Append("  WHERE (ISNULL('{4}','') = '' OR M.U_REQNM = '{4}')                         \r");
            //pQuery.Append("  ORDER BY M.U_DEPDT                                                         ");

            query = string.Format(pQuery.ToString(), edtDOCNUM
                                                   , edtREADCD1
                                                   , edtREADCD2
                                                   , edtDEPNM
                                                   , edtREQNM
                                                   , FN.SetDateFormatToDB(edtJDTDT, FN.eDateType.n_YYYYMMDD));

            string orderBy = "독자번호, 청구년월";

            string expr = "Editable=false & RightJustified(입금액=true)";

            KIS_SO0001F_HRD KIS_SO0001F_HRD = new KIS_SO0001F_HRD();

            return KIS_SO0001F_HRD.Act0_SubFormInit("개별입금내역", oForm.UniqueID, SO.SO_COMMON_HRD.ConfirmType.Close, BoMatrixSelect.ms_Single, query, -1, 900, 600, expr, orderBy);
        }
Esempio n. 5
0
        private bool FindData_Detail(SAPbouiCOM.Form oForm, string pREADCD)
        {
            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0140T_HRD");
            string strDocEntry = oDB_M.GetValue("DocEntry", 0).ToString();

            string query = string.Empty;
            StringBuilder sb = new StringBuilder();
            sb.AppendLine(" SELECT T0.DocEntry                                                                      ");
            sb.AppendLine("      , T0.LineId                                                                        ");
            sb.AppendLine("      , T0.U_YYYYMM                                                                      ");
            sb.AppendLine("      , T0.U_REQYM                                                                       ");
            sb.AppendLine("      , T0.U_PAPERTP                                                                     ");
            sb.AppendLine("      , T1.U_SMLNM AS PAPERTP_NM                                                         ");
            sb.AppendLine("      , T0.U_READCD                                                                      ");
            sb.AppendLine("      , T0.U_READNM                                                                      ");
            sb.AppendLine("      , T0.U_REQNAME                                                                     ");
            sb.AppendLine("      , T0.U_DELVCD                                                                      ");
            sb.AppendLine("      , T0.U_READTP                                                                      ");
            sb.AppendLine("      , T2.U_SMLNM AS READTP_NM                                                          ");
            sb.AppendLine("      , T0.U_BRCHCD                                                                      ");
            sb.AppendLine("      , T0.U_BRCHNM                                                                      ");
            sb.AppendLine("      , T0.U_BRCHTP                                                                      ");
            sb.AppendLine("      , T3.U_SMLNM AS BRCHTP_NM                                                          ");
            sb.AppendLine("      , T0.U_PAYCD                                                                       ");
            sb.AppendLine("      , T0.U_PAYNM                                                                       ");
            sb.AppendLine("      , T0.U_PMETHOD                                                                     ");
            sb.AppendLine("      , T4.U_SMLNM AS PMETHOD_NM                                                         ");
            sb.AppendLine("      , T0.U_PAYPERD                                                                     ");
            sb.AppendLine("      , T5.U_SMLNM AS PAYPERD_NM                                                         ");
            sb.AppendLine("      , T0.U_DELVCNT                                                                     ");
            sb.AppendLine("      , T0.U_REQAMT                                                                      ");
            sb.AppendLine("      , T0.U_SALEAMT                                                                     ");
            sb.AppendLine("   FROM [@KIS_SO01404_HRD] T0                                                            ");
            sb.AppendLine("        LEFT JOIN [@KIS_AD00201] T1 ON T0.U_PAPERTP = T1.U_SMLCD AND T1.Code = 'SO01'    ");
            sb.AppendLine("        LEFT JOIN [@KIS_AD00201] T2 ON T0.U_READTP = T2.U_SMLCD AND T2.Code = 'SO08'     ");
            sb.AppendLine("        LEFT JOIN [@KIS_AD00201] T3 ON T0.U_BRCHTP = T3.U_SMLCD AND T3.Code = 'SO17'     ");
            sb.AppendLine("        LEFT JOIN [@KIS_AD00201] T4 ON T0.U_PMETHOD = T4.U_SMLCD AND T4.Code = 'SO09'    ");
            sb.AppendLine("        LEFT JOIN [@KIS_AD00201] T5 ON T0.U_PAYPERD = T5.U_SMLCD AND T5.Code = 'SO11'    ");
            sb.AppendLine("  WHERE T0.DocEntry = {0}                                                                ");


            query = string.Format(sb.ToString(), strDocEntry);


            string expr = "Editable=false"
                        + "&" + "Caption(DocEntry=문서번호,LineId=라인번호,U_YYYYMM=마감년월,U_REQYM=청구년월,U_PAPERTP=지종코드,PAPERTP_NM=지종명,U_READCD=독자코드,U_READNM=독자명,U_REQNAME=청구처명,U_DELVCD=배송코드,U_READTP=독자구분,READTP_NM=독자구분명,U_BRCHCD=분국코드,U_BRCHNM=분국명,U_BRCHTP=분국구분코드,BRCHTP_NM=분국명,U_PAYCD=요금제코드,U_PAYNM=요금제명,U_PMETHOD=납부방법코드,PMETHOD_NM=납부방법명,U_PAYPERD=분납구분,PAYPERD_NM=분납구분명,U_DELVCNT=배달부수,U_REQAMT=청구금액,U_SALEAMT=매출금액)"
                        + "&" + "RightJustified=false(LineId=true,U_DELVCNT=true,U_REQAMT=true,U_SALEAMT=true)"
                        + "&" + "Visible=false(DocEntry=true,LineId=true,U_YYYYMM=true,U_REQYM=true,U_PAPERTP=true,PAPERTP_NM=true,U_READCD=true,U_READNM=true,U_REQNAME=true,U_DELVCD=true,U_READTP=true,READTP_NM=true,U_BRCHCD=true,U_BRCHNM=true,U_BRCHTP=true,BRCHTP_NM=true,U_PAYCD=true,U_PAYNM=true,U_PMETHOD=true,PMETHOD_NM=true,U_PAYPERD=true,PAYPERD_NM=true,U_DELVCNT=true,U_REQAMT=true,U_SALEAMT=true)"
                        ;

            KIS_SO0001F_HRD KIS_SO0001F_HRD = new KIS_SO0001F_HRD();

            return KIS_SO0001F_HRD.Act0_SubFormInit("독자청구상세", oForm.UniqueID, SO.SO_COMMON_HRD.ConfirmType.Open, BoMatrixSelect.ms_Auto, query, -1, 720, 490, expr);
        }
Esempio n. 6
0
        private bool FindData_Def(SAPbouiCOM.Form oForm)
        {
            string edtMETHOD = FN.GetItemValue(ref oForm, "cboMETHOD");
            string edtCENTCD1 = FN.GetItemValue(ref oForm, "edtCENTCD1");
            string edtCENTCD2 = FN.GetItemValue(ref oForm, "edtCENTCD2");
            string edtDOCDT = FN.GetItemValue(ref oForm, "edtDOCDT");

            string query = string.Empty;
            StringBuilder sb = new StringBuilder();
            sb.AppendLine(" SELECT 'Y' AS U_CHK                                                                                             ");
            sb.AppendLine("      , T1.U_YYYYMM                                                                                              ");
            sb.AppendLine("      , T0.U_CENTCD                                                                                              ");
            sb.AppendLine("      , T0.U_CENTNM                                                                                              ");
            sb.AppendLine("      , T0.U_REQAMT                                                                                              ");
            sb.AppendLine("      , T0.U_SAVEAMT                                                                                             ");
            sb.AppendLine("      , T2.REQ_UNPAID                                                                                            ");
            sb.AppendLine("      , T3.SAV_UNPAID                                                                                            ");
            sb.AppendLine("      , T4.LIMIT_AMT                                                                                             ");
            sb.AppendLine("      , T1.Object AS U_BTYPE                                                                                     ");
            sb.AppendLine("      , T0.DocEntry AS U_BENTRY                                                                                  ");
            sb.AppendLine("      , T0.LineId AS U_BLINEID                                                                                   ");
            sb.AppendLine("   FROM [@KIS_SO03101_HRD] T0                                                                                    ");
            sb.AppendLine("        INNER JOIN [@KIS_SO0310T_HRD] T1 ON T0.DocEntry = T1.DocEntry                                            ");
            sb.AppendLine("        LEFT JOIN (SELECT DocEntry, U_CENTCD, SUM (ISNULL (U_DEBIT, 0) - ISNULL (U_CREDIT, 0)) AS REQ_UNPAID     ");
            sb.AppendLine("                     FROM [@KIS_SO03103_HRD]                                                                     ");
            sb.AppendLine("                   GROUP BY DocEntry, U_CENTCD) T2                                                               ");
            sb.AppendLine("           ON T0.DocEntry = T2.DocEntry AND T0.U_CENTCD = T2.U_CENTCD AND T2.REQ_UNPAID > 0                      ");
            sb.AppendLine("        LEFT JOIN (SELECT DocEntry, U_CENTCD, SUM (ISNULL (U_DEBIT, 0) - ISNULL (U_CREDIT, 0)) AS SAV_UNPAID     ");
            sb.AppendLine("                     FROM [@KIS_SO03102_HRD]                                                                     ");
            sb.AppendLine("                   GROUP BY DocEntry, U_CENTCD) T3                                                               ");
            sb.AppendLine("           ON T0.DocEntry = T3.DocEntry AND T0.U_CENTCD = T3.U_CENTCD AND T3.SAV_UNPAID > 0                      ");
            sb.AppendLine("        LEFT JOIN (SELECT U_CENTCD, U_AMT AS LIMIT_AMT FROM KIS_VW_SO03201_HRD) T4 ON T0.U_CENTCD = T4.U_CENTCD  ");
            sb.AppendLine("  WHERE ISNULL (T1.U_JDTDOC, '') <> '' AND ISNULL (T1.U_RJDTDOC, '') = ''                                        ");
            sb.AppendLine("    AND (T2.REQ_UNPAID > 0 OR T3.SAV_UNPAID > 0)                                                                 ");

            if (edtMETHOD == "S11")
                sb.AppendLine("    AND T4.LIMIT_AMT > 0                                                                                     ");

            if (!string.IsNullOrEmpty(edtCENTCD1) && !string.IsNullOrEmpty(edtCENTCD2))
                sb.AppendLine("    AND T0.U_CENTCD BETWEEN '{0}' AND '{1}'                                                                  ");




            query = string.Format(sb.ToString(), edtCENTCD1
                                               , edtCENTCD2);


            string expr = "Editable=false"
                        + "&" + "Caption(U_CENTCD=지국코드,U_CENTNM=지국명,U_YYYYMM=청구월,U_REQAMT=청구금액,U_SAVEAMT=보증금,REQ_UNPAID=청구액미납금,SAV_UNPAID=보증금미납,LIMIT_AMT=보증금한도)"
                        + "&" + "RightJustified=false(REQ_UNPAID=true,SAV_UNPAID=true,LIMIT_AMT=true)"
                        + "&" + "Visible=false(U_CENTCD=true,U_CENTNM=true,U_YYYYMM=true,REQ_UNPAID=true,SAV_UNPAID=true,LIMIT_AMT=true)"
                        ;

            KIS_SO0001F_HRD KIS_SO0001F_HRD = new KIS_SO0001F_HRD();

            return KIS_SO0001F_HRD.Act0_SubFormInit("지대청구잔액", oForm.UniqueID, SO.SO_COMMON_HRD.ConfirmType.Open, BoMatrixSelect.ms_Auto, query, -1, 550, 450, expr);
        }