Index: branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs	(revision 230)
+++ branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs	(revision 231)
@@ -303,13 +303,13 @@
             /// </summary>
             SubConstregistApproval,
             /// <summary>
-            /// 98:æ‰‹é–“æ”¯æ‰•
+            /// 11:æ‰‹é–“æ”¯æ‰•
             /// </summary>
-            FeePayment = 98,
+            FeePayment,
             /// <summary>
-            /// 99:æ¥­è€…æ”¯æ‰•
+            /// 12:æ¥­è€…æ”¯æ‰•
             /// </summary>
-            SubConstrPayment = 99,
+            SubConstrPayment,
         }
         #endregion
 
@@ -350,8 +350,6 @@
                                                                                 {10, "å�”åŠ›ä¼šç¤¾ç™»éŒ²æ‰¿èª�"},
                                                                                 {11, "æ‰‹é–“æ”¯æ‰•ç¢ºèª�æ‰¿èª�"},
                                                                                 {12, "æ¥­ç¤¾æ”¯æ‰•ç¢ºèª�æ‰¿èª�"},
-                                                                                {98, "å…¥é‡‘ç¢ºèª�æ‰¿èª�"},
-                                                                                {99, "è«‹æ±‚ã�¾ã�¨ã‚�æ‰¿èª�"}
                                                                                 };
 
         #endregion
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryList.cs	(revision 230)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryList.cs	(revision 231)
@@ -723,6 +723,7 @@
             StringBuilder sql;
             List<ShoninData> lstDefaultShonin = new List<ShoninData>();
             List<PaymentApprovalInfo> PaIList = new List<PaymentApprovalInfo>();
+            PaymentApprovalInfo PaInfo = null;
 
             IOConstructionBaseInfo IoCbi = new IOConstructionBaseInfo();
             IOMPersonInCharge IoMpic = new IOMPersonInCharge();
@@ -731,6 +732,23 @@
             string KojiTanto = "", KojiTantoCode = "";
             int ConstrDepartmentCode = 0;
 
+            // ‹N“®Œ³‚ÌŠm”F // TODO
+            if (ClsExcute.ProcControlPara.Count > 0)
+            {
+                for (int i = 0; i < ClsExcute.ProcControlPara.Count; i++)
+                {
+                    if ((ClsExcute.ProcControlPara[i].ArrayParameter != null) && (ClsExcute.ProcControlPara[i].ArrayParameter.Count > 0))
+                    {
+                        ArrayList obj = ClsExcute.ProcControlPara[i].ArrayParameter[0];
+                        PaInfo = (PaymentApprovalInfo)obj[0];
+                        if (PaInfo is PaymentApprovalInfo != true)
+                        {
+                            PaInfo = null;
+                        }
+                    }
+                }
+            }
+
             try
             {
 
@@ -761,259 +779,399 @@
 
                 // SQL�ì�¬
                 sql = new StringBuilder();
-                sql.Append("select ");
-                sql.Append("  ifnull(Bd.SeqNo, 1) as SeqNo ");
-                sql.Append("  , ifnull(Bdd.LineCount, 0) as LineCount ");
-                sql.Append("  , ifnull(Bdd.CompanyCode, Cld.CompanyCode) as CompanyCode ");
-                sql.Append("  , ifnull(Scm.CompanyName, Cld.CompanyName) as CompanyName ");
-                sql.Append("  , Sc.DisplayOrder as DisplayOrder ");
-                sql.Append("  , ifnull(Bdd.ConstructionCode, Cl.ConstructionCode) as ConstructionCode ");
-                sql.Append("  , ifnull(Bdd.FieldName, Cbd.DetailString) as FieldName ");
-                sql.Append("  , Bdd.BillPrice as BillPrice ");
-                sql.Append("  , Bdd.HighwPrice as HighwPrice ");
-                sql.Append("  , Bdd.HardwPrice as HardwPrice ");
-                sql.Append("  , Bdd.IndswasteTax as IndswasteTax ");
-                sql.Append("  , DATE_FORMAT(Bdd.UpdateDate, '%Y/%m/%d %H:%i:%s') as UpdateDate ");
-                sql.Append("  , ifnull(Bdd.Note, '') as Bikou ");
-                sql.Append("  , ifnull(Pdd.BillPrice, 0) as KojiSeikyu ");
-                sql.Append("  , ifnull(Pdd.DiscountPrice, 0) as KojiNebiki ");
-                sql.Append("  , ifnull(Pdd.OffsetPrice, 0) as KojiSousai ");
-                sql.Append("  , ifnull(Pdd.NextCoPrice, 0) as JikaiKurikosi ");
-                sql.Append("  , ifnull(Pdd.HighwPrice, 0) as KojiKousoku ");
-                sql.Append("  , ifnull(Pdd.HardwPrice, 0) as KojiKanamono ");
-                sql.Append("  , ifnull(Pdd.IndswasteTax, 0) as KojiSannhaiZei ");
-                sql.Append("  , ifnull(Pdd.CnstrPrice, 0) as CnstrPrice ");
-                sql.Append("  , ifnull(Pdd.CnstrPriceExist, - 1) as CnstrPriceExist ");
-                sql.Append("  , ifnull(Pdd.ApprovalPersonCode, 0) as ApprovalPersonCode ");
-                sql.Append("  , ifnull(Picm.SealPrintName, '') as TantoNM ");
-                sql.Append("  , DATE_FORMAT( ");
-                sql.Append("    ifnull(Pdd.ApprovalDate, '2001/01/01') ");
-                sql.Append("    , '%Y/%m/%d' ");
-                sql.Append("  ) as ApprovalDate ");
-                sql.Append("  , ifnull(Pdd.ApprovalEndFlg, 0) as ApprovalEndFlg ");
-                sql.Append("  , ifnull(Cbi.SalesPersonCode, 0) as SalesPersonCode ");
-                sql.Append("  , ifnull(Cbi.ConstructionPersonCode, 0) as ConstructionPersonCode ");
-                sql.Append("  , ifnull(Cbi.ConstrSubPersonCode, 0) as ConstrSubPersonCode ");
-                sql.Append("  , ifnull(Cbi.ConstructionInstructor, 0) as ConstructionInstructor ");
-                sql.Append("  , Picm2.DepartmentCode ");
-                sql.Append("  , case ifnull(Pod.SendDate, '') ");
-                sql.Append("    when '' then '�~' ");
-                sql.Append("    when '2001/01/01' then '�~' ");
-                sql.Append("    else '�›' ");
-                sql.Append("    end as PurchaseOrderMailingDate ");
-                sql.Append("  , case ifnull(Pod.ReturnCheckDate, '') ");
-                sql.Append("    when '' then '�~' ");
-                sql.Append("    when '2001/01/01' then '�~' ");
-                sql.Append("    else '�›' ");
-                sql.Append("    end as PurchaseOrderReturnDate ");
-                sql.Append("  , case ifnull(Pa.PersonCode, 0) ");
-                sql.Append("    when 0 then case Cld.ConstructionCode ");
-                sql.Append("      when 0 then '' ");
-                sql.Append("      else '�~' ");
-                sql.Append("      end ");
-                sql.Append("    else '�›' ");
-                sql.Append("    end as PaData ");
-                sql.Append("  , Cld.LineCount as LinePoint ");
-                sql.AppendFormat("  , PERIOD_DIFF({0} ,DATE_FORMAT(Cl.ConstructionStart, '%Y%m')) + {1} AS ColPoint ", m_Select_TargetDate, Enum.GetNames(typeof(FrmConstructionLedger.GridColumn)).Length - 1);
-                sql.Append("from ");
-                sql.Append("  ConstructionLedgerDetail as Cld ");
-                sql.Append("  inner join ConstructionLedger as Cl on Cl.ConstructionCode = Cld.ConstructionCode ");
-                sql.Append("    and Cl.ComplateFlg = 0 ");
-                sql.Append("  inner join ConstructionBaseinfoDetail as Cbd on Cbd.ConstructionCode = Cld.ConstructionCode ");
-                sql.Append("    and Cbd.DetailNo = 2 ");
-                sql.Append("  inner join SubContractorMaster as Sc on Sc.COMPANYCODE = Cld.CompanyCode ");
-                sql.AppendFormat("  and Sc.LABOURKIND = {0} ", m_Labourkind);
-                sql.Append("  left join ConstructionLedgerExcute AS Cle on Cle.ConstructionCode = Cld.ConstructionCode ");
-                sql.Append("  and Cle.GroupCount = Cld.GroupCount ");
-                sql.Append("  and Cle.LineCount = Cld.LineCount ");
-                sql.AppendFormat("    and Cle.ColumnCount = (PERIOD_DIFF({0} ,DATE_FORMAT(CL.ConstructionStart, '%Y%m')) + {1}) ", m_Select_TargetDate, Enum.GetNames(typeof(FrmConstructionLedger.GridColumn)).Length - 1);
-                sql.Append("  left join ( ");
-                sql.Append("  BillingData as Bd join ( ");
-                sql.Append("    BillingDataDetail as Bdd join SubContractorMaster as Scm ");
-                sql.Append("      on Bdd.CompanyCode = Scm.CompanyCode ");
-                sql.AppendFormat("      and Scm.LabourKind = {0} ", m_Labourkind);
-                sql.Append("      left join ( ");
-                sql.Append("        PaymentDataDetail as Pdd ");
-                sql.Append("          left join PersonInChargeMaster as Picm ");
-                sql.Append("            on ifnull(Pdd.ApprovalPersonCode, - 1) = Picm.PersonCode ");
-                sql.Append("      ) ");
-                sql.Append("        on Bdd.CompanyCode = Pdd.CompanyCode ");
-                sql.Append("        and Bdd.TargetDate = Pdd.TargetDate ");
-                sql.Append("        and Bdd.SeqNo = Pdd.SeqNo ");
-                sql.Append("        and Bdd.LineCount = Pdd.LineCount ");
-                sql.Append("  ) ");
-                sql.Append("       on Bd.CompanyCode = BdD.CompanyCode ");
-                sql.Append("       and Bd.TargetDate = BdD.TargetDate ");
-                sql.Append("       and Bd.SeqNo = BdD.SeqNo ");
-                sql.AppendFormat("       and Bd.TargetDate = {0} ", m_Select_TargetDate);
-                sql.Append("  ) on Bd.COMPANYCODE = Cld.CompanyCode ");
-                sql.Append("  and Bdd.ConstructionCode = Cld.ConstructionCode ");
-                sql.Append("  left join ( ");
-                sql.Append("    PurchaseOrderDate as Pod ");
-                sql.Append("  ) on Cld.CompanyCode = Pod.CompanyCode ");
-                sql.Append("  and Cld.ConstructionCode = Pod.ConstructionCode ");
-                sql.Append("  left join ( ");
-                sql.Append("    ConstructionBaseInfo as Cbi ");
-                sql.Append("      left join ( ");
-                sql.Append("        PersonInChargeMaster as Picm2 ");
-                sql.Append("          left join ApprovalMaster as Am ");
-                sql.Append("            on Picm2.DepartmentCode = Am.DepartmentCode ");
-                sql.Append("            and Am.ApprovalCode = 3 ");
-                sql.Append("            and ApprovalAuthority = 1 ");
-                sql.Append("      ) ");
-                sql.Append("        on Cbi.ConstructionPersonCode = Picm2.PersonCode ");
-                sql.Append("      left join ProcessApproval as Pa ");
-                sql.Append("        on Cbi.ConstructionCode = Pa.ConstructionCode ");
-                sql.Append("        and Am.ApprovalPerson = Pa.PersonCode ");
-                sql.Append("        and Pa.SeqNo > 1 ");
-                sql.Append("        and Pa.ApprovalStatus = 2 ");
-                sql.Append("  ) ");
-                sql.Append("    on Cld.ConstructionCode = Cbi.ConstructionCode ");
+                if (PaInfo != null)
+                {
+                    sql.Append("select ");
+                    sql.Append("  ifnull(Bd.SeqNo, 1) as SeqNo ");
+                    sql.Append("  , ifnull(Bdd.LineCount, 0) as LineCount ");
+                    sql.Append("  , ifnull(Bdd.CompanyCode, 0) as CompanyCode ");
+                    sql.Append("  , ifnull(Scm.CompanyName, \"\") as CompanyName ");
+                    sql.Append("  , Scm.DisplayOrder as DisplayOrder ");
+                    sql.Append("  , Bdd.ConstructionCode as ConstructionCode ");
+                    sql.Append("  , Bdd.FieldName as FieldName ");
+                    sql.Append("  , Bdd.BillPrice as BillPrice ");
+                    sql.Append("  , Bdd.HighwPrice as HighwPrice ");
+                    sql.Append("  , Bdd.HardwPrice as HardwPrice ");
+                    sql.Append("  , Bdd.IndswasteTax as IndswasteTax ");
+                    sql.Append("  , DATE_FORMAT(Bdd.UpdateDate, '%Y/%m/%d %H:%i:%s') as UpdateDate ");
+                    sql.Append("  , ifnull(Bdd.Note, '') as Bikou ");
+                    sql.Append("  , ifnull(Pdd.BillPrice, 0) as KojiSeikyu ");
+                    sql.Append("  , ifnull(Pdd.DiscountPrice, 0) as KojiNebiki ");
+                    sql.Append("  , ifnull(Pdd.OffsetPrice, 0) as KojiSousai ");
+                    sql.Append("  , ifnull(Pdd.NextCoPrice, 0) as JikaiKurikosi ");
+                    sql.Append("  , ifnull(Pdd.HighwPrice, 0) as KojiKousoku ");
+                    sql.Append("  , ifnull(Pdd.HardwPrice, 0) as KojiKanamono ");
+                    sql.Append("  , ifnull(Pdd.IndswasteTax, 0) as KojiSannhaiZei ");
+                    sql.Append("  , ifnull(Pdd.CnstrPrice, 0) as CnstrPrice ");
+                    sql.Append("  , ifnull(Pdd.CnstrPriceExist, - 1) as CnstrPriceExist ");
+                    sql.Append("  , ifnull(Pdd.ApprovalPersonCode, 0) as ApprovalPersonCode ");
+                    sql.Append("  , ifnull(Picm.SealPrintName, '') as TantoNM ");
+                    sql.Append("  , DATE_FORMAT( ");
+                    sql.Append("    ifnull(Pdd.ApprovalDate, '2001/01/01') ");
+                    sql.Append("    , '%Y/%m/%d' ");
+                    sql.Append("  ) as ApprovalDate ");
+                    sql.Append("  , ifnull(Pdd.ApprovalEndFlg, 0) as ApprovalEndFlg ");
+                    sql.Append("  , ifnull(Cbi.SalesPersonCode, 0) as SalesPersonCode ");
+                    sql.Append("  , ifnull(Cbi.ConstructionPersonCode, 0) as ConstructionPersonCode ");
+                    sql.Append("  , ifnull(Cbi.ConstrSubPersonCode, 0) as ConstrSubPersonCode ");
+                    sql.Append("  , ifnull(Cbi.ConstructionInstructor, 0) as ConstructionInstructor ");
+                    sql.Append("  , Picm2.DepartmentCode ");
+                    sql.Append("  , case ifnull(Pod.SendDate, '') ");
+                    sql.Append("    when '' then '�~' ");
+                    sql.Append("    when '2001/01/01' then '�~' ");
+                    sql.Append("    else '�›' ");
+                    sql.Append("    end as PurchaseOrderMailingDate ");
+                    sql.Append("  , case ifnull(Pod.ReturnCheckDate, '') ");
+                    sql.Append("    when '' then '�~' ");
+                    sql.Append("    when '2001/01/01' then '�~' ");
+                    sql.Append("    else '�›' ");
+                    sql.Append("    end as PurchaseOrderReturnDate ");
+                    sql.Append("  , case ifnull(Pa.PersonCode, 0) ");
+                    sql.Append("    when 0 then case Bdd.ConstructionCode ");
+                    sql.Append("      when 0 then '' ");
+                    sql.Append("      else '�~' ");
+                    sql.Append("      end ");
+                    sql.Append("    else '�›' ");
+                    sql.Append("    end as PaData ");
+                    sql.Append("  , null as LinePoint ");
+                    sql.Append("  , null as ColPoint ");
+                    sql.Append("from ");
+                    sql.Append("  BillingData as Bd join ( ");
+                    sql.Append("    BillingDataDetail as Bdd join SubContractorMaster as Scm ");
+                    sql.Append("      on Bdd.CompanyCode = Scm.CompanyCode ");
+                    sql.AppendFormat("      and Scm.LabourKind = {0} ", m_Labourkind);
+                    sql.Append("      left join ( ");
+                    sql.Append("        PaymentDataDetail as Pdd ");
+                    sql.Append("          left join PersonInChargeMaster as Picm ");
+                    sql.Append("            on ifnull(Pdd.ApprovalPersonCode, - 1) = Picm.PersonCode ");
+                    sql.Append("      ) ");
+                    sql.Append("        on Bdd.CompanyCode = Pdd.CompanyCode ");
+                    sql.Append("        and Bdd.TargetDate = Pdd.TargetDate ");
+                    sql.Append("        and Bdd.SeqNo = Pdd.SeqNo ");
+                    sql.Append("        and Bdd.LineCount = Pdd.LineCount ");
+                    sql.Append("      left join ( ");
+                    sql.Append("        ConstructionBaseInfo as Cbi ");
+                    sql.Append("          left join ( ");
+                    sql.Append("            PersonInChargeMaster as Picm2 ");
+                    sql.Append("              left join ApprovalMaster as Am ");
+                    sql.Append("                on Picm2.DepartmentCode = Am.DepartmentCode ");
+                    sql.Append("                and Am.ApprovalCode = 3 ");
+                    sql.Append("                and ApprovalAuthority = 1 ");
+                    sql.Append("          ) ");
+                    sql.Append("            on Cbi.ConstructionPersonCode = Picm2.PersonCode ");
+                    sql.Append("          left join ProcessApproval as Pa ");
+                    sql.Append("            on Cbi.ConstructionCode = Pa.ConstructionCode ");
+                    sql.Append("            and Am.ApprovalPerson = Pa.PersonCode ");
+                    sql.Append("            and Pa.SeqNo > 1 ");
+                    sql.Append("            and Pa.ApprovalStatus = 2 ");
+                    sql.Append("      ) ");
+                    sql.Append("        on Bdd.ConstructionCode = Cbi.ConstructionCode ");
+                    sql.Append("  ) ");
+                    sql.Append("       on Bd.CompanyCode = Bdd.CompanyCode ");
+                    sql.Append("       and Bd.TargetDate = Bdd.TargetDate ");
+                    sql.Append("       and Bd.SeqNo = Bdd.SeqNo ");
+                    sql.AppendFormat(" and Bd.TargetDate = {0} ", PaInfo.TargetDate);
+                    sql.Append("  left join ( ");
+                    sql.Append("    PurchaseOrderDate as Pod ");
+                    sql.Append("  ) on Bd.CompanyCode = Pod.CompanyCode ");
+                    sql.Append("  and Bdd.ConstructionCode = Pod.ConstructionCode ");
+
+                    sql.Append(" ");
+
+                    sql.Append("group by ");
+                    sql.Append("  SeqNo ");
+                    sql.Append("  , LineCount ");
+                    sql.Append("  , CompanyCode ");
+                    sql.Append("  , CompanyName ");
+                    sql.Append("  , DisplayOrder ");
+                    sql.Append("  , ConstructionCode ");
+                    sql.Append("  , FieldName ");
+                    sql.Append("  , BillPrice ");
+                    sql.Append("  , HighwPrice ");
+                    sql.Append("  , Hardwprice ");
+                    sql.Append("  , IndswasteTax ");
+                    sql.Append("  , UpdateDate ");
+                    sql.Append("  , Bikou ");
+                    sql.Append("  , KojiSeikyu ");
+                    sql.Append("  , KojiNebiki ");
+                    sql.Append("  , KojiSousai ");
+                    sql.Append("  , JikaiKurikosi ");
+                    sql.Append("  , KojiKousoku ");
+                    sql.Append("  , KojiKanamono ");
+                    sql.Append("  , KojiSannhaiZei ");
+                    sql.Append("  , CnstrPrice ");
+                    sql.Append("  , CnstrpriceExist ");
+                    sql.Append("  , ApprovalPersonCode ");
+                    sql.Append("  , TantoNM ");
+                    sql.Append("  , ApprovalDate ");
+                    sql.Append("  , ApprovalEndFlg ");
+                    sql.Append("  , SalesPersonCode ");
+                    sql.Append("  , ConstructionPersonCode ");
+                    sql.Append("  , ConstrSubPersonCode ");
+                    sql.Append("  , ConstructionInstructor ");
+                    sql.Append("  , DepartmentCode ");
+                    sql.Append("  , PurchaseOrderMailingDate ");
+                    sql.Append("  , PurchaseOrderReturnDate ");
+                    sql.Append("  , PaData ");
+                    sql.Append("  , LinePoint ");
+                    sql.Append("  , ColPoint ");
+                }
+                else 
+                {
+                    sql.Append("select ");
+                    sql.Append("  ifnull(Bd.SeqNo, 1) as SeqNo ");
+                    sql.Append("  , ifnull(Bdd.LineCount, 0) as LineCount ");
+                    sql.Append("  , ifnull(Bdd.CompanyCode, Cld.CompanyCode) as CompanyCode ");
+                    sql.Append("  , ifnull(Scm.CompanyName, Cld.CompanyName) as CompanyName ");
+                    sql.Append("  , Sc.DisplayOrder as DisplayOrder ");
+                    sql.Append("  , ifnull(Bdd.ConstructionCode, Cl.ConstructionCode) as ConstructionCode ");
+                    sql.Append("  , ifnull(Bdd.FieldName, Cbd.DetailString) as FieldName ");
+                    sql.Append("  , Bdd.BillPrice as BillPrice ");
+                    sql.Append("  , Bdd.HighwPrice as HighwPrice ");
+                    sql.Append("  , Bdd.HardwPrice as HardwPrice ");
+                    sql.Append("  , Bdd.IndswasteTax as IndswasteTax ");
+                    sql.Append("  , DATE_FORMAT(Bdd.UpdateDate, '%Y/%m/%d %H:%i:%s') as UpdateDate ");
+                    sql.Append("  , ifnull(Bdd.Note, '') as Bikou ");
+                    sql.Append("  , ifnull(Pdd.BillPrice, 0) as KojiSeikyu ");
+                    sql.Append("  , ifnull(Pdd.DiscountPrice, 0) as KojiNebiki ");
+                    sql.Append("  , ifnull(Pdd.OffsetPrice, 0) as KojiSousai ");
+                    sql.Append("  , ifnull(Pdd.NextCoPrice, 0) as JikaiKurikosi ");
+                    sql.Append("  , ifnull(Pdd.HighwPrice, 0) as KojiKousoku ");
+                    sql.Append("  , ifnull(Pdd.HardwPrice, 0) as KojiKanamono ");
+                    sql.Append("  , ifnull(Pdd.IndswasteTax, 0) as KojiSannhaiZei ");
+                    sql.Append("  , ifnull(Pdd.CnstrPrice, 0) as CnstrPrice ");
+                    sql.Append("  , ifnull(Pdd.CnstrPriceExist, - 1) as CnstrPriceExist ");
+                    sql.Append("  , ifnull(Pdd.ApprovalPersonCode, 0) as ApprovalPersonCode ");
+                    sql.Append("  , ifnull(Picm.SealPrintName, '') as TantoNM ");
+                    sql.Append("  , DATE_FORMAT( ");
+                    sql.Append("    ifnull(Pdd.ApprovalDate, '2001/01/01') ");
+                    sql.Append("    , '%Y/%m/%d' ");
+                    sql.Append("  ) as ApprovalDate ");
+                    sql.Append("  , ifnull(Pdd.ApprovalEndFlg, 0) as ApprovalEndFlg ");
+                    sql.Append("  , ifnull(Cbi.SalesPersonCode, 0) as SalesPersonCode ");
+                    sql.Append("  , ifnull(Cbi.ConstructionPersonCode, 0) as ConstructionPersonCode ");
+                    sql.Append("  , ifnull(Cbi.ConstrSubPersonCode, 0) as ConstrSubPersonCode ");
+                    sql.Append("  , ifnull(Cbi.ConstructionInstructor, 0) as ConstructionInstructor ");
+                    sql.Append("  , Picm2.DepartmentCode ");
+                    sql.Append("  , case ifnull(Pod.SendDate, '') ");
+                    sql.Append("    when '' then '�~' ");
+                    sql.Append("    when '2001/01/01' then '�~' ");
+                    sql.Append("    else '�›' ");
+                    sql.Append("    end as PurchaseOrderMailingDate ");
+                    sql.Append("  , case ifnull(Pod.ReturnCheckDate, '') ");
+                    sql.Append("    when '' then '�~' ");
+                    sql.Append("    when '2001/01/01' then '�~' ");
+                    sql.Append("    else '�›' ");
+                    sql.Append("    end as PurchaseOrderReturnDate ");
+                    sql.Append("  , case ifnull(Pa.PersonCode, 0) ");
+                    sql.Append("    when 0 then case Cld.ConstructionCode ");
+                    sql.Append("      when 0 then '' ");
+                    sql.Append("      else '�~' ");
+                    sql.Append("      end ");
+                    sql.Append("    else '�›' ");
+                    sql.Append("    end as PaData ");
+                    sql.Append("  , Cld.LineCount as LinePoint ");
+                    sql.AppendFormat("  , PERIOD_DIFF({0} ,DATE_FORMAT(Cl.ConstructionStart, '%Y%m')) + {1} AS ColPoint ", m_Select_TargetDate, Enum.GetNames(typeof(FrmConstructionLedger.GridColumn)).Length - 1);
+                    sql.Append("from ");
+                    sql.Append("  ConstructionLedgerDetail as Cld ");
+                    sql.Append("  inner join ConstructionLedger as Cl on Cl.ConstructionCode = Cld.ConstructionCode ");
+                    sql.Append("    and Cl.ComplateFlg = 0 ");
+                    sql.Append("  inner join ConstructionBaseinfoDetail as Cbd on Cbd.ConstructionCode = Cld.ConstructionCode ");
+                    sql.Append("    and Cbd.DetailNo = 2 ");
+                    sql.Append("  inner join SubContractorMaster as Sc on Sc.COMPANYCODE = Cld.CompanyCode ");
+                    sql.AppendFormat("  and Sc.LABOURKIND = {0} ", m_Labourkind);
+                    sql.Append("  left join ConstructionLedgerExcute AS Cle on Cle.ConstructionCode = Cld.ConstructionCode ");
+                    sql.Append("  and Cle.GroupCount = Cld.GroupCount ");
+                    sql.Append("  and Cle.LineCount = Cld.LineCount ");
+                    sql.AppendFormat("    and Cle.ColumnCount = (PERIOD_DIFF({0} ,DATE_FORMAT(CL.ConstructionStart, '%Y%m')) + {1}) ", m_Select_TargetDate, Enum.GetNames(typeof(FrmConstructionLedger.GridColumn)).Length - 1);
+                    sql.Append("  left join ( ");
+                    sql.Append("  BillingData as Bd join ( ");
+                    sql.Append("    BillingDataDetail as Bdd join SubContractorMaster as Scm ");
+                    sql.Append("      on Bdd.CompanyCode = Scm.CompanyCode ");
+                    sql.AppendFormat("      and Scm.LabourKind = {0} ", m_Labourkind);
+                    sql.Append("      left join ( ");
+                    sql.Append("        PaymentDataDetail as Pdd ");
+                    sql.Append("          left join PersonInChargeMaster as Picm ");
+                    sql.Append("            on ifnull(Pdd.ApprovalPersonCode, - 1) = Picm.PersonCode ");
+                    sql.Append("      ) ");
+                    sql.Append("        on Bdd.CompanyCode = Pdd.CompanyCode ");
+                    sql.Append("        and Bdd.TargetDate = Pdd.TargetDate ");
+                    sql.Append("        and Bdd.SeqNo = Pdd.SeqNo ");
+                    sql.Append("        and Bdd.LineCount = Pdd.LineCount ");
+                    sql.Append("  ) ");
+                    sql.Append("       on Bd.CompanyCode = BdD.CompanyCode ");
+                    sql.Append("       and Bd.TargetDate = BdD.TargetDate ");
+                    sql.Append("       and Bd.SeqNo = BdD.SeqNo ");
+                    sql.AppendFormat("       and Bd.TargetDate = {0} ", m_Select_TargetDate);
+                    sql.Append("  ) on Bd.COMPANYCODE = Cld.CompanyCode ");
+                    sql.Append("  and Bdd.ConstructionCode = Cld.ConstructionCode ");
+                    sql.Append("  left join ( ");
+                    sql.Append("    PurchaseOrderDate as Pod ");
+                    sql.Append("  ) on Cld.CompanyCode = Pod.CompanyCode ");
+                    sql.Append("  and Cld.ConstructionCode = Pod.ConstructionCode ");
+                    sql.Append("  left join ( ");
+                    sql.Append("    ConstructionBaseInfo as Cbi ");
+                    sql.Append("      left join ( ");
+                    sql.Append("        PersonInChargeMaster as Picm2 ");
+                    sql.Append("          left join ApprovalMaster as Am ");
+                    sql.Append("            on Picm2.DepartmentCode = Am.DepartmentCode ");
+                    sql.Append("            and Am.ApprovalCode = 3 ");
+                    sql.Append("            and ApprovalAuthority = 1 ");
+                    sql.Append("      ) ");
+                    sql.Append("        on Cbi.ConstructionPersonCode = Picm2.PersonCode ");
+                    sql.Append("      left join ProcessApproval as Pa ");
+                    sql.Append("        on Cbi.ConstructionCode = Pa.ConstructionCode ");
+                    sql.Append("        and Am.ApprovalPerson = Pa.PersonCode ");
+                    sql.Append("        and Pa.SeqNo > 1 ");
+                    sql.Append("        and Pa.ApprovalStatus = 2 ");
+                    sql.Append("  ) ");
+                    sql.Append("    on Cld.ConstructionCode = Cbi.ConstructionCode ");
               
-                sql.Append("where ");
-                sql.Append("  Cld.GroupCount = 2 ");
-                sql.Append("  and Cld.CompanyCode > 0 ");
-                sql.AppendFormat("  and Cld.CompanyType = {0}", m_Labourkind);
+                    sql.Append("where ");
+                    sql.Append("  Cld.GroupCount = 2 ");
+                    sql.Append("  and Cld.CompanyCode > 0 ");
+                    sql.AppendFormat("  and Cld.CompanyType = {0}", m_Labourkind);
 
-                sql.Append(" ");
-                sql.Append("union ");
-                sql.Append(" ");
+                    sql.Append(" ");
+                    sql.Append("union ");
+                    sql.Append(" ");
 
-                sql.Append("select ");
-                sql.Append("  ifnull(Bd.SeqNo, 1) as SeqNo ");
-                sql.Append("  , ifnull(Bdd.LineCount, 0) as LineCount ");
-                sql.Append("  , ifnull(Bdd.CompanyCode, 0) as CompanyCode ");
-                sql.Append("  , ifnull(Scm.CompanyName, \"\") as CompanyName ");
-                sql.Append("  , Scm.DisplayOrder as DisplayOrder ");
-                sql.Append("  , Bdd.ConstructionCode as ConstructionCode ");
-                sql.Append("  , Bdd.FieldName as FieldName ");
-                sql.Append("  , Bdd.BillPrice as BillPrice ");
-                sql.Append("  , Bdd.HighwPrice as HighwPrice ");
-                sql.Append("  , Bdd.HardwPrice as HardwPrice ");
-                sql.Append("  , Bdd.IndswasteTax as IndswasteTax ");
-                sql.Append("  , DATE_FORMAT(Bdd.UpdateDate, '%Y/%m/%d %H:%i:%s') as UpdateDate ");
-                sql.Append("  , ifnull(Bdd.Note, '') as Bikou ");
-                sql.Append("  , ifnull(Pdd.BillPrice, 0) as KojiSeikyu ");
-                sql.Append("  , ifnull(Pdd.DiscountPrice, 0) as KojiNebiki ");
-                sql.Append("  , ifnull(Pdd.OffsetPrice, 0) as KojiSousai ");
-                sql.Append("  , ifnull(Pdd.NextCoPrice, 0) as JikaiKurikosi ");
-                sql.Append("  , ifnull(Pdd.HighwPrice, 0) as KojiKousoku ");
-                sql.Append("  , ifnull(Pdd.HardwPrice, 0) as KojiKanamono ");
-                sql.Append("  , ifnull(Pdd.IndswasteTax, 0) as KojiSannhaiZei ");
-                sql.Append("  , ifnull(Pdd.CnstrPrice, 0) as CnstrPrice ");
-                sql.Append("  , ifnull(Pdd.CnstrPriceExist, - 1) as CnstrPriceExist ");
-                sql.Append("  , ifnull(Pdd.ApprovalPersonCode, 0) as ApprovalPersonCode ");
-                sql.Append("  , ifnull(Picm.SealPrintName, '') as TantoNM ");
-                sql.Append("  , DATE_FORMAT( ");
-                sql.Append("    ifnull(Pdd.ApprovalDate, '2001/01/01') ");
-                sql.Append("    , '%Y/%m/%d' ");
-                sql.Append("  ) as ApprovalDate ");
-                sql.Append("  , ifnull(Pdd.ApprovalEndFlg, 0) as ApprovalEndFlg ");
-                sql.Append("  , ifnull(Cbi.SalesPersonCode, 0) as SalesPersonCode ");
-                sql.Append("  , ifnull(Cbi.ConstructionPersonCode, 0) as ConstructionPersonCode ");
-                sql.Append("  , ifnull(Cbi.ConstrSubPersonCode, 0) as ConstrSubPersonCode ");
-                sql.Append("  , ifnull(Cbi.ConstructionInstructor, 0) as ConstructionInstructor ");
-                sql.Append("  , Picm2.DepartmentCode ");
-                sql.Append("  , case ifnull(Pod.SendDate, '') ");
-                sql.Append("    when '' then '�~' ");
-                sql.Append("    when '2001/01/01' then '�~' ");
-                sql.Append("    else '�›' ");
-                sql.Append("    end as PurchaseOrderMailingDate ");
-                sql.Append("  , case ifnull(Pod.ReturnCheckDate, '') ");
-                sql.Append("    when '' then '�~' ");
-                sql.Append("    when '2001/01/01' then '�~' ");
-                sql.Append("    else '�›' ");
-                sql.Append("    end as PurchaseOrderReturnDate ");
-                sql.Append("  , case ifnull(Pa.PersonCode, 0) ");
-                sql.Append("    when 0 then case Bdd.ConstructionCode ");
-                sql.Append("      when 0 then '' ");
-                sql.Append("      else '�~' ");
-                sql.Append("      end ");
-                sql.Append("    else '�›' ");
-                sql.Append("    end as PaData ");
-                sql.Append("  , null as LinePoint ");
-                sql.Append("  , null as ColPoint ");
-                sql.Append("from ");
-                sql.Append("  BillingData as Bd join ( ");
-                sql.Append("    BillingDataDetail as Bdd join SubContractorMaster as Scm ");
-                sql.Append("      on Bdd.CompanyCode = Scm.CompanyCode ");
-                sql.AppendFormat("      and Scm.LabourKind = {0} ", m_Labourkind);
-                sql.Append("      left join ( ");
-                sql.Append("        PaymentDataDetail as Pdd ");
-                sql.Append("          left join PersonInChargeMaster as Picm ");
-                sql.Append("            on ifnull(Pdd.ApprovalPersonCode, - 1) = Picm.PersonCode ");
-                sql.Append("      ) ");
-                sql.Append("        on Bdd.CompanyCode = Pdd.CompanyCode ");
-                sql.Append("        and Bdd.TargetDate = Pdd.TargetDate ");
-                sql.Append("        and Bdd.SeqNo = Pdd.SeqNo ");
-                sql.Append("        and Bdd.LineCount = Pdd.LineCount ");
-                sql.Append("      left join ( ");
-                sql.Append("        ConstructionBaseInfo as Cbi ");
-                sql.Append("          left join ( ");
-                sql.Append("            PersonInChargeMaster as Picm2 ");
-                sql.Append("              left join ApprovalMaster as Am ");
-                sql.Append("                on Picm2.DepartmentCode = Am.DepartmentCode ");
-                sql.Append("                and Am.ApprovalCode = 3 ");
-                sql.Append("                and ApprovalAuthority = 1 ");
-                sql.Append("          ) ");
-                sql.Append("            on Cbi.ConstructionPersonCode = Picm2.PersonCode ");
-                sql.Append("          left join ProcessApproval as Pa ");
-                sql.Append("            on Cbi.ConstructionCode = Pa.ConstructionCode ");
-                sql.Append("            and Am.ApprovalPerson = Pa.PersonCode ");
-                sql.Append("            and Pa.SeqNo > 1 ");
-                sql.Append("            and Pa.ApprovalStatus = 2 ");
-                sql.Append("      ) ");
-                sql.Append("        on Bdd.ConstructionCode = Cbi.ConstructionCode ");
-                sql.Append("  ) ");
-                sql.Append("       on Bd.CompanyCode = Bdd.CompanyCode ");
-                sql.Append("       and Bd.TargetDate = Bdd.TargetDate ");
-                sql.Append("       and Bd.SeqNo = Bdd.SeqNo ");
-                sql.AppendFormat(" and Bd.TargetDate = {0} ", m_Select_TargetDate);
-                sql.Append("    and Bdd.CONSTRUCTIONCODE = 0 ");
-                sql.Append("  left join ( ");
-                sql.Append("    PurchaseOrderDate as Pod ");
-                sql.Append("  ) on Bd.CompanyCode = Pod.CompanyCode ");
-                sql.Append("  and Bdd.ConstructionCode = Pod.ConstructionCode ");
+                    sql.Append("select ");
+                    sql.Append("  ifnull(Bd.SeqNo, 1) as SeqNo ");
+                    sql.Append("  , ifnull(Bdd.LineCount, 0) as LineCount ");
+                    sql.Append("  , ifnull(Bdd.CompanyCode, 0) as CompanyCode ");
+                    sql.Append("  , ifnull(Scm.CompanyName, \"\") as CompanyName ");
+                    sql.Append("  , Scm.DisplayOrder as DisplayOrder ");
+                    sql.Append("  , Bdd.ConstructionCode as ConstructionCode ");
+                    sql.Append("  , Bdd.FieldName as FieldName ");
+                    sql.Append("  , Bdd.BillPrice as BillPrice ");
+                    sql.Append("  , Bdd.HighwPrice as HighwPrice ");
+                    sql.Append("  , Bdd.HardwPrice as HardwPrice ");
+                    sql.Append("  , Bdd.IndswasteTax as IndswasteTax ");
+                    sql.Append("  , DATE_FORMAT(Bdd.UpdateDate, '%Y/%m/%d %H:%i:%s') as UpdateDate ");
+                    sql.Append("  , ifnull(Bdd.Note, '') as Bikou ");
+                    sql.Append("  , ifnull(Pdd.BillPrice, 0) as KojiSeikyu ");
+                    sql.Append("  , ifnull(Pdd.DiscountPrice, 0) as KojiNebiki ");
+                    sql.Append("  , ifnull(Pdd.OffsetPrice, 0) as KojiSousai ");
+                    sql.Append("  , ifnull(Pdd.NextCoPrice, 0) as JikaiKurikosi ");
+                    sql.Append("  , ifnull(Pdd.HighwPrice, 0) as KojiKousoku ");
+                    sql.Append("  , ifnull(Pdd.HardwPrice, 0) as KojiKanamono ");
+                    sql.Append("  , ifnull(Pdd.IndswasteTax, 0) as KojiSannhaiZei ");
+                    sql.Append("  , ifnull(Pdd.CnstrPrice, 0) as CnstrPrice ");
+                    sql.Append("  , ifnull(Pdd.CnstrPriceExist, - 1) as CnstrPriceExist ");
+                    sql.Append("  , ifnull(Pdd.ApprovalPersonCode, 0) as ApprovalPersonCode ");
+                    sql.Append("  , ifnull(Picm.SealPrintName, '') as TantoNM ");
+                    sql.Append("  , DATE_FORMAT( ");
+                    sql.Append("    ifnull(Pdd.ApprovalDate, '2001/01/01') ");
+                    sql.Append("    , '%Y/%m/%d' ");
+                    sql.Append("  ) as ApprovalDate ");
+                    sql.Append("  , ifnull(Pdd.ApprovalEndFlg, 0) as ApprovalEndFlg ");
+                    sql.Append("  , ifnull(Cbi.SalesPersonCode, 0) as SalesPersonCode ");
+                    sql.Append("  , ifnull(Cbi.ConstructionPersonCode, 0) as ConstructionPersonCode ");
+                    sql.Append("  , ifnull(Cbi.ConstrSubPersonCode, 0) as ConstrSubPersonCode ");
+                    sql.Append("  , ifnull(Cbi.ConstructionInstructor, 0) as ConstructionInstructor ");
+                    sql.Append("  , Picm2.DepartmentCode ");
+                    sql.Append("  , case ifnull(Pod.SendDate, '') ");
+                    sql.Append("    when '' then '�~' ");
+                    sql.Append("    when '2001/01/01' then '�~' ");
+                    sql.Append("    else '�›' ");
+                    sql.Append("    end as PurchaseOrderMailingDate ");
+                    sql.Append("  , case ifnull(Pod.ReturnCheckDate, '') ");
+                    sql.Append("    when '' then '�~' ");
+                    sql.Append("    when '2001/01/01' then '�~' ");
+                    sql.Append("    else '�›' ");
+                    sql.Append("    end as PurchaseOrderReturnDate ");
+                    sql.Append("  , case ifnull(Pa.PersonCode, 0) ");
+                    sql.Append("    when 0 then case Bdd.ConstructionCode ");
+                    sql.Append("      when 0 then '' ");
+                    sql.Append("      else '�~' ");
+                    sql.Append("      end ");
+                    sql.Append("    else '�›' ");
+                    sql.Append("    end as PaData ");
+                    sql.Append("  , null as LinePoint ");
+                    sql.Append("  , null as ColPoint ");
+                    sql.Append("from ");
+                    sql.Append("  BillingData as Bd join ( ");
+                    sql.Append("    BillingDataDetail as Bdd join SubContractorMaster as Scm ");
+                    sql.Append("      on Bdd.CompanyCode = Scm.CompanyCode ");
+                    sql.AppendFormat("      and Scm.LabourKind = {0} ", m_Labourkind);
+                    sql.Append("      left join ( ");
+                    sql.Append("        PaymentDataDetail as Pdd ");
+                    sql.Append("          left join PersonInChargeMaster as Picm ");
+                    sql.Append("            on ifnull(Pdd.ApprovalPersonCode, - 1) = Picm.PersonCode ");
+                    sql.Append("      ) ");
+                    sql.Append("        on Bdd.CompanyCode = Pdd.CompanyCode ");
+                    sql.Append("        and Bdd.TargetDate = Pdd.TargetDate ");
+                    sql.Append("        and Bdd.SeqNo = Pdd.SeqNo ");
+                    sql.Append("        and Bdd.LineCount = Pdd.LineCount ");
+                    sql.Append("      left join ( ");
+                    sql.Append("        ConstructionBaseInfo as Cbi ");
+                    sql.Append("          left join ( ");
+                    sql.Append("            PersonInChargeMaster as Picm2 ");
+                    sql.Append("              left join ApprovalMaster as Am ");
+                    sql.Append("                on Picm2.DepartmentCode = Am.DepartmentCode ");
+                    sql.Append("                and Am.ApprovalCode = 3 ");
+                    sql.Append("                and ApprovalAuthority = 1 ");
+                    sql.Append("          ) ");
+                    sql.Append("            on Cbi.ConstructionPersonCode = Picm2.PersonCode ");
+                    sql.Append("          left join ProcessApproval as Pa ");
+                    sql.Append("            on Cbi.ConstructionCode = Pa.ConstructionCode ");
+                    sql.Append("            and Am.ApprovalPerson = Pa.PersonCode ");
+                    sql.Append("            and Pa.SeqNo > 1 ");
+                    sql.Append("            and Pa.ApprovalStatus = 2 ");
+                    sql.Append("      ) ");
+                    sql.Append("        on Bdd.ConstructionCode = Cbi.ConstructionCode ");
+                    sql.Append("  ) ");
+                    sql.Append("       on Bd.CompanyCode = Bdd.CompanyCode ");
+                    sql.Append("       and Bd.TargetDate = Bdd.TargetDate ");
+                    sql.Append("       and Bd.SeqNo = Bdd.SeqNo ");
+                    sql.AppendFormat(" and Bd.TargetDate = {0} ", m_Select_TargetDate);
+                    sql.Append("    and Bdd.CONSTRUCTIONCODE = 0 ");
+                    sql.Append("  left join ( ");
+                    sql.Append("    PurchaseOrderDate as Pod ");
+                    sql.Append("  ) on Bd.CompanyCode = Pod.CompanyCode ");
+                    sql.Append("  and Bdd.ConstructionCode = Pod.ConstructionCode ");
 
-                sql.Append(" ");
+                    sql.Append(" ");
                 
-                sql.Append("group by ");
-                sql.Append("  SeqNo ");
-                sql.Append("  , LineCount ");
-                sql.Append("  , CompanyCode ");
-                sql.Append("  , CompanyName ");
-                sql.Append("  , DisplayOrder ");
-                sql.Append("  , ConstructionCode ");
-                sql.Append("  , FieldName ");
-                sql.Append("  , BillPrice ");
-                sql.Append("  , HighwPrice ");
-                sql.Append("  , Hardwprice ");
-                sql.Append("  , IndswasteTax ");
-                sql.Append("  , UpdateDate ");
-                sql.Append("  , Bikou ");
-                sql.Append("  , KojiSeikyu ");
-                sql.Append("  , KojiNebiki ");
-                sql.Append("  , KojiSousai ");
-                sql.Append("  , JikaiKurikosi ");
-                sql.Append("  , KojiKousoku ");
-                sql.Append("  , KojiKanamono ");
-                sql.Append("  , KojiSannhaiZei ");
-                sql.Append("  , CnstrPrice ");
-                sql.Append("  , CnstrpriceExist ");
-                sql.Append("  , ApprovalPersonCode ");
-                sql.Append("  , TantoNM ");
-                sql.Append("  , ApprovalDate ");
-                sql.Append("  , ApprovalEndFlg ");
-                sql.Append("  , SalesPersonCode ");
-                sql.Append("  , ConstructionPersonCode ");
-                sql.Append("  , ConstrSubPersonCode ");
-                sql.Append("  , ConstructionInstructor ");
-                sql.Append("  , DepartmentCode ");
-                sql.Append("  , PurchaseOrderMailingDate ");
-                sql.Append("  , PurchaseOrderReturnDate ");
-                sql.Append("  , PaData ");
-                sql.Append("  , LinePoint ");
-                sql.Append("  , ColPoint ");
+                    sql.Append("group by ");
+                    sql.Append("  SeqNo ");
+                    sql.Append("  , LineCount ");
+                    sql.Append("  , CompanyCode ");
+                    sql.Append("  , CompanyName ");
+                    sql.Append("  , DisplayOrder ");
+                    sql.Append("  , ConstructionCode ");
+                    sql.Append("  , FieldName ");
+                    sql.Append("  , BillPrice ");
+                    sql.Append("  , HighwPrice ");
+                    sql.Append("  , Hardwprice ");
+                    sql.Append("  , IndswasteTax ");
+                    sql.Append("  , UpdateDate ");
+                    sql.Append("  , Bikou ");
+                    sql.Append("  , KojiSeikyu ");
+                    sql.Append("  , KojiNebiki ");
+                    sql.Append("  , KojiSousai ");
+                    sql.Append("  , JikaiKurikosi ");
+                    sql.Append("  , KojiKousoku ");
+                    sql.Append("  , KojiKanamono ");
+                    sql.Append("  , KojiSannhaiZei ");
+                    sql.Append("  , CnstrPrice ");
+                    sql.Append("  , CnstrpriceExist ");
+                    sql.Append("  , ApprovalPersonCode ");
+                    sql.Append("  , TantoNM ");
+                    sql.Append("  , ApprovalDate ");
+                    sql.Append("  , ApprovalEndFlg ");
+                    sql.Append("  , SalesPersonCode ");
+                    sql.Append("  , ConstructionPersonCode ");
+                    sql.Append("  , ConstrSubPersonCode ");
+                    sql.Append("  , ConstructionInstructor ");
+                    sql.Append("  , DepartmentCode ");
+                    sql.Append("  , PurchaseOrderMailingDate ");
+                    sql.Append("  , PurchaseOrderReturnDate ");
+                    sql.Append("  , PaData ");
+                    sql.Append("  , LinePoint ");
+                    sql.Append("  , ColPoint ");
+                }
 
                 if (dgvCompany.Visible == true)         // ‹ÆŽÒ’PˆÊ•\Ž¦
                 {
@@ -1439,7 +1597,10 @@
             {
                 sql.AppendLine("select Am.APPROVALPERSON,Picm.SealPrintName,Am.ApprovalAuthority ");
                 sql.AppendLine("from ApprovalMaster as Am left join PersonInChargeMaster as Picm on Am.APPROVALPERSON = Picm.PERSONCODE ");
-                sql.AppendLine("where Am.APPROVALCODE = 99 ");
+                // ApprovalListNo ‚ÌƒR�[ƒh‚ÅŽæ“¾‚·‚é
+                //sql.AppendLine("where Am.APPROVALCODE = 99 "); // TODO
+                int iApprovalCode = ClsExcute.AppovalList.First(x => x.Value.Equals(s_MyProcessName[m_Labourkind])).Key;
+                sql.AppendFormat("where Am.APPROVALCODE = {0} ", iApprovalCode);
                 sql.AppendFormat("and Am.DepartmentCode = {0} ", DepartmentCode);
                 sql.AppendLine("order by Am.SEQNO desc ");
 
@@ -4375,8 +4536,46 @@
         /// <param name="e"></param>
         private void btnApproval_Click(object sender, EventArgs e)
         {
-            // �³”Fƒ{ƒ^ƒ“‰Ÿ‰º�ˆ—�
-            ApprovalProcess();
+            // ‘I‘ðŒÂ�Š‚ÌŒŸ�o
+            DataGridView dgv = null;
+            DataGridViewCell SelectCell = null;
+            if (dgvCompany.Visible == true)         // ‹ÆŽÒ’PˆÊ•\Ž¦
+            {
+                dgv = dgvCompany;
+            }
+            else if (dgvProject.Visible == true)    // Œ»�ê’PˆÊ•\Ž¦
+            {
+                dgv = dgvProject;
+            }
+            foreach (DataGridViewCell c in dgv.SelectedCells)
+            {
+                SelectCell = c;
+            }
+
+            if (SelectCell != null)
+            {
+                // Žx•¥�³”F�î•ñƒf�[ƒ^�Ý’è
+                PaymentApprovalInfo PaIWork = new PaymentApprovalInfo();
+                PaIWork.CompanyCode = CommonMotions.cnvInt(dgv.Rows[SelectCell.RowIndex].Cells[m_Company_Column].Value);
+                PaIWork.TargetDate = m_Select_TargetDate;
+                PaIWork.SeqNo = CommonMotions.cnvInt(dgv.Rows[SelectCell.RowIndex].Cells[(int)DispColumn.GroupSeqNo].Value);
+                PaIWork.LineCount = CommonMotions.cnvInt(dgv.Rows[SelectCell.RowIndex].Cells[(int)DispColumn.LineCount].Value);
+
+                if ((PaIWork.CompanyCode == 0)
+                || (PaIWork.SeqNo == 0)
+                || (PaIWork.LineCount == 0)
+                    )
+                {
+                    MessageBox.Show("Œ»�ê‚ª�Ý’è‚³‚ê‚Ä‚¢‚È‚¢‚½‚ß�³”F‚ª�s‚¦‚Ü‚¹‚ñ�B", "�³”FƒGƒ‰�[", MessageBoxButtons.OK, MessageBoxIcon.Error); return;
+                }
+                if (MessageBox.Show("‘I‘ð‚³‚ê‚Ä‚¢‚é�s‚Ì�³”F‚ð�s‚¢‚Ü‚·�B", "�³”FŠm”F", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return;
+                // �³”Fƒ{ƒ^ƒ“‰Ÿ‰º�ˆ—�
+                ApprovalProcess(PaIWork);
+            }
+            else
+            {
+                MessageBox.Show("�s‚ª‘I‘ð‚³‚ê‚Ä‚¢‚È‚¢‚½‚ß�³”F�\�¿‚ª�s‚¦‚Ü‚¹‚ñ�B", "�³”F�\�¿ƒGƒ‰�[", MessageBoxButtons.OK, MessageBoxIcon.Error); return;
+            }
         }
         #endregion
 
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryListAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryListAuxiliary.cs	(revision 230)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryListAuxiliary.cs	(revision 231)
@@ -1303,7 +1303,7 @@
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void ApprovalProcess()
+        private void ApprovalProcess(PaymentApprovalInfo PaymentApprovalInfoData)
         {
             try
             {
@@ -1326,6 +1326,11 @@
                 // Žó•t”Ô�†
                 ClsExcute.ProcControlPara[NowPoint].IntExecParameter.Add(CommonDefine.s_Default_OrderNo);
 
+                // Žx•¥�³”F�î•ñƒf�[ƒ^
+                ArrayList PaymentApprovalInfoDataList = new ArrayList();
+                PaymentApprovalInfoDataList.Add(PaymentApprovalInfoData);
+                ClsExcute.ProcControlPara[NowPoint].ArrayParameter.Add(PaymentApprovalInfoDataList);
+
                 // Ž©ƒtƒH�[ƒ€�I—¹
                 this.Close();
             }
