Index: trunk/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs	(revision 18)
@@ -1052,6 +1052,9 @@
         /// å·¥æ•°å�˜ä½�æ—¥æ•°
         /// </summary>
         public static double s_ManHourUnitDays = 3.0;
+        /// <summary>
+        /// æœˆå·¥æ•°å�˜ä½�æ—¥æ•°
+        /// </summary>
         public static double s_ManHourUnitMonth = 30.0;
         #endregion
 
@@ -1350,5 +1353,22 @@
             Fluctuates,
         }
         #endregion
+
+        #region æ‹…å½“è€…ãƒžã‚¹ã‚¿ï¼šå·¥äº‹è©³ç´°å�°å¸³è¨ˆç®—å¯¾è±¡ãƒ•ãƒ©ã‚°
+        /// <summary>
+        /// æ‹…å½“è€…ãƒžã‚¹ã‚¿ï¼šå·¥äº‹è©³ç´°å�°å¸³è¨ˆç®—å¯¾è±¡ãƒ•ãƒ©ã‚°
+        /// </summary>
+        public enum PersonLedgerDivNo
+        {
+            /// <summary>
+            /// å¯¾è±¡å¤–
+            /// </summary>
+            CalcOuter = 0,
+            /// <summary>
+            /// å¯¾è±¡
+            /// </summary>
+            CalcTarget,
+        }
+        #endregion
     }
 }
Index: trunk/src/ProcessManagement/ProcessManagement/Common/CommonMotions.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Common/CommonMotions.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Common/CommonMotions.cs	(revision 18)
@@ -55,6 +55,11 @@
         private static PersonInChargeMaster m_LoginUserData = new PersonInChargeMaster();
 
         /// <summary>
+        /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ãƒ�ã‚§ãƒƒã‚¯å‡¦ç�†ã‚¯ãƒ©ã‚¹
+        /// </summary>
+        private static ClsSystemOnceExecute m_CheckProc = null;
+        
+        /// <summary>
         /// å»ºç¯‰å·¥äº‹è²»ã�®æ§‹æˆ�
         /// </summary>
         //private static Dictionary<int, string> m_StructureTypeName = new Dictionary<int, string>();
@@ -123,6 +128,13 @@
             get { return m_ProductVersionInfo; }
         }
 
+        /// <summary>
+        /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ãƒ�ã‚§ãƒƒã‚¯å‡¦ç�†ã‚¯ãƒ©ã‚¹
+        /// </summary>
+        public static ClsSystemOnceExecute CheckProc
+        {
+            get { return m_CheckProc; }
+        }
         #endregion
 
         #region åˆ�æœŸåŒ–
@@ -143,6 +155,8 @@
                 // ç®¡ç�†ãƒžã‚¹ã‚¿å�–å¾—
                 SetSystemMaster();
 
+                // èµ·å‹•ãƒ�ã‚§ãƒƒã‚¯ã‚¯ãƒ©ã‚¹åˆ�æœŸåŒ–
+                m_CheckProc = new ClsSystemOnceExecute();
             }
             catch (Exception ex)
             {
@@ -151,7 +165,7 @@
         }
         #endregion
 
-        #region ãƒ—ãƒ©ã‚¤ãƒ™ãƒ¼ãƒˆãƒ¡ã‚½ãƒƒãƒ‰
+        #region å®šç¾©ãƒ•ã‚¡ã‚¤ãƒ«èª­è¾¼
         /// <summary>
         /// å®šç¾©ãƒ•ã‚¡ã‚¤ãƒ«èª­è¾¼
         /// </summary>
Index: trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs	(revision 18)
@@ -63,7 +63,8 @@
             Proceedings,                        // 16:ç™ºæ³¨è€…æ‰“ã�¡å�ˆã‚�ã�›è­°äº‹éŒ²å…¥åŠ›
             DailyReportList,                    // 17:æ—¥å ±ä¸€è¦§
             DailyReport,                        // 18:æ—¥å ±å…¨èˆ¬
-            DepartmentExpenssList,              // 19:éƒ¨ç½²åˆ¥å�°å¸³ä¸€è¦§
+            DepartmentExpenssList,              // 19:éƒ¨ç½²åˆ¥å�°å¸³ã�¾ã�¨ã‚�ä¸€è¦§
+            ConstrLedgerPrsonList,              // 20:å·¥äº‹è©³ç´°å�°å¸³ä¸€è¦§(å€‹äººæŒ‡å®š)
         }
         #endregion
 
@@ -354,6 +355,11 @@
                         case (int)ProcessExecuteNo.DepartmentExpenssList:               // 19:éƒ¨ç½²åˆ¥å�°å¸³ä¸€è¦§
                             ProcessExecuteNo_DepartmentExpenssList(m_ProcControlPara[NowPoint]);
                             break;
+
+                        case (int)ProcessExecuteNo.ConstrLedgerPrsonList:               // 20:å·¥äº‹è©³ç´°å�°å¸³ä¸€è¦§(å€‹äººæŒ‡å®š)
+                            ProcessExecuteNo_ConstrLedgerPersonList(m_ProcControlPara[NowPoint]);
+                            break;
+
                         #endregion
 
                         #region ãƒžã‚¹ã‚¿ãƒ¡ãƒ³ãƒ†
@@ -1242,8 +1248,48 @@
         }
         #endregion
 
+        #region å·¥äº‹è©³ç´°å�°å¸³ä¸€è¦§ï¼ˆå€‹äººæŒ‡å®šï¼‰
+        /// <summary>
+        /// å·¥äº‹è©³ç´°å�°å¸³ä¸€è¦§ï¼ˆå€‹äººæŒ‡å®šï¼‰
+        /// </summary>
+        /// <returns></returns>
+        public static void ProcessExecuteNo_ConstrLedgerPersonList(ProcessParameter CurrentPara)
+        {
+            //ã€€å·¥äº‹è©³ç´°å�°å¸³ä¸€è¦§
+            FrmConstructionLedgerList frm = new FrmConstructionLedgerList();
+            try
+            {
+                // æ¬¡èµ·å‹•ãƒ—ãƒ­ã‚»ã‚¹ã‚»ãƒƒãƒˆ
+                frm.ExecuteFlg = CurrentPara.IntExecParameter[0];
+
+                // åˆ�æœŸé�¸æŠžç„¡ã�—ãƒ•ãƒ©ã‚°
+                frm.FirstStartFlg = false;
+
+                // åˆ�æœŸé�¸æŠžå¹´åº¦
+                frm.FirstStartPeriod = CurrentPara.IntExecParameter[1];
+
+                // åˆ�æœŸé�¸æŠžéƒ¨ç½²ã‚³ãƒ¼ãƒ‰
+                frm.FirstStartDepartmentCode = CurrentPara.IntExecParameter[2];
+
+                // åˆ�æœŸé�¸æŠžæ‹…å½“è€…ã‚³ãƒ¼ãƒ‰
+                frm.FirstStartPersonCode = CurrentPara.IntExecParameter[3];
+
+                // ãƒ•ã‚©ãƒ¼ãƒ è¡¨ç¤º
+                frm.ShowDialog();
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                frm.Dispose(); frm = null;
+            }
+        }
         #endregion
 
+        #endregion
+
         #region ãƒžã‚¹ã‚¿ãƒ¡ãƒ³ãƒ†ãƒŠãƒ³ã‚¹
         // ----------------- ãƒ¡ãƒ³ãƒ†ãƒŠãƒ³ã‚¹èµ·å‹•
         #region ç®¡ç�†ãƒžã‚¹ã‚¿
Index: trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsMessageBoradAccess.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsMessageBoradAccess.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsMessageBoradAccess.cs	(revision 18)
@@ -40,12 +40,9 @@
             IOMessageBoardTerget mbtDB = new IOMessageBoardTerget();
             try
             {
-                mbdDB.connect();
-                mbdDB.beginTran();
+                mbdDB.connect(); mbdDB.beginTran();
+                mbtDB.connect(); mbtDB.beginTran();
 
-                mbtDB.connect();
-                mbtDB.beginTran();
-
                 // ã‚­ãƒ¼ã‚³ãƒ¼ãƒ‰ã‚»ãƒƒãƒˆ
                 WriteData.RecordNumber = mbdDB.SelectMaxMessageBoardDataKeyCount("", false) + 1;
 
Index: trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsSystemOnceExecute.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsSystemOnceExecute.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsSystemOnceExecute.cs	(revision 18)
@@ -43,14 +43,16 @@
         /// åˆ�æœŸåŒ–å‡¦ç�†æˆ�å�¦ãƒ•ãƒ©ã‚°
         /// </summary>
         private bool m_bExecuteFlg = true;
+        
         /// <summary>
-        /// æ¤œç´¢ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ãƒ†ãƒ¼ãƒ–ãƒ«
+        /// çŠ¶æ…‹æ¯ŽæœŸé™�ãƒžã‚¹ã‚¿ãƒªã‚¹ãƒˆ
         /// </summary>
-        private Dictionary<int, int> arrayTblIndex = new Dictionary<int, int>();
+        private List<TermMasterList> SystemOnceExecuteTermMstList = new List<TermMasterList>();
+
         /// <summary>
-        /// çŠ¶æ…‹æ¯ŽæœŸé™�ãƒžã‚¹ã‚¿ãƒªã‚¹ãƒˆ
+        /// æœ€çµ‚èµ·å‹•æ—¥
         /// </summary>
-        private List<TermMasterList> m_arrayList = new List<TermMasterList>();
+        DateTime m_lastsessionDate = DateTime.MinValue;
         #endregion
 
         #region ã‚³ãƒ³ã‚¹ãƒˆãƒ©ã‚¯ã‚¿
@@ -71,12 +73,13 @@
         /// <returns></returns>
         public void FirstExecute()
         {
+            bool ProcessFlg = true;
             try
             {
-                DateTime lastsessionDate = DateTime.MinValue;
-
                 // æœ¬æ—¥ã�®åˆ�å›žèµ·å‹•ã�Œã�•ã‚Œã�¦ã�„ã‚‹å ´å�ˆã�¯å‡¦ç�†ã�—ã�ªã�„
-                if (!ExecuteCheck(ref lastsessionDate)) return;
+                if (!ExecuteCheck(ref m_lastsessionDate)) return;
+                // æ›´æ–°æ¸ˆã�¿ã�«ã�™ã‚‹ã�Ÿã‚�ã�«æ—¥ä»˜ã�®æ›´æ–°
+                UpDateTargetDate(DateTime.Now);
 
                 // åˆ�æœŸåŒ–ã�«å¤±æ•—ã�—ã�Ÿã‚‰å‡¦ç�†ã�—ã�ªã�„
                 if (!m_bExecuteFlg) return;
@@ -83,16 +86,16 @@
 
                 // ãƒ‡ãƒ¼ã‚¿ãƒ�ã‚§ãƒƒã‚¯
                 // æ—¥ä»˜ã�®æœŸé™�ãƒ�ã‚§ãƒƒã‚¯ã‚’è¡Œã�†
-                SubmittedDateCheck(lastsessionDate);
+                ProcessFlg = SubmittedDateCheck(m_lastsessionDate);
 
                 // è¦‹ç©�æœ‰åŠ¹æœŸé™�åˆ‡ã‚Œã‚’é�žå�—æ³¨ã�¸ç§»è¡Œã�™ã‚‹
-                ChangeNonOrdersData();
+                if (ProcessFlg) ProcessFlg &= ChangeNonOrdersData();
 
                 // å·¥äº‹è©³ç´°å�°å¸³ã�®çµ¦ä¸Žã‚’åŠ ç®—ã�™ã‚‹
-                CalculateDaysSalary();
+                if (ProcessFlg) ProcessFlg &= CalculateDaysSalary();
 
-                // æ—¥ä»˜ã�®æ›´æ–°
-                UpDateTargetDate();
+                // ã‚¨ãƒ©ãƒ¼æ™‚ã�¯å…ƒã�®æ—¥ä»˜ã�«æ›´æ–°
+                if (!ProcessFlg) UpDateTargetDate(m_lastsessionDate);
             }
             catch (Exception ex)
             {
@@ -115,16 +118,24 @@
                 int PCode = CommonDefine.ExePrimaryCode.First(x => x.Value.Equals("åˆ�å›žèµ·å‹•æ—¥ä»˜")).Key;
                 // æ—¥ä»˜èª­è¾¼
                 string strSQL = seDB.CreatePrimarykeyString(PCode);
-                List<SystemExecute> recordRec = new List<SystemExecute>();
-                if (!seDB.SelectAction(strSQL, ref recordRec)) return false;
-                if (recordRec.Count != 0)
+                SystemExecute recordRec = new SystemExecute();
+                if (!seDB.SelectAction(strSQL, ref recordRec))
                 {
-                    // æ—¥ä»˜æ¯”è¼ƒ
-                    if (DateTime.Today == recordRec[0].TargetDate.Date) return false;
+                    // ã‚­ãƒ¼ã‚»ãƒƒãƒˆ
+                    recordRec.PrimaryCode = PCode;
+                    // èµ·å‹•æ—¥ä»˜
+                    recordRec.TargetDate = DateTime.Now;
+                    // ãƒ‡ãƒ¼ã‚¿ã�Œã�ªã�„ã‚‚ã�—ã��ã�¯ã‚¨ãƒ©ãƒ¼æ™‚ã�¯ãƒ‡ãƒ¼ã‚¿ä½œæˆ�
+                    if (!seDB.InsertAction(recordRec)) return false;
+                    // æ—¥ä»˜ã‚’1æ—¥å‰�ã�«ã�™ã‚‹
+                    recordRec.TargetDate = DateTime.Now.AddDays(-1);
                 }
-                
+
                 // å‰�å›žèµ·å‹•æ—¥ã‚’å�–å¾—ã�™ã‚‹
-                lastsessionDate = recordRec[0].TargetDate;
+                lastsessionDate = recordRec.TargetDate;
+
+                // æ—¥ä»˜æ¯”è¼ƒ
+                if (DateTime.Today == recordRec.TargetDate.Date) return false;
                 
                 return true;
             }
@@ -145,35 +156,16 @@
         /// æ—¥ä»˜å¤‰æ›´
         /// </summary>
         /// <returns></returns>
-        private bool UpDateTargetDate()
+        private bool UpDateTargetDate(DateTime TargetDate)
         {
             IOSystemExecute seDB = new IOSystemExecute();
             try
             {
-                // å…ˆé ­ã�®ã‚­ãƒ¼ã‚’å�–å¾—ã�™ã‚‹
-                int PCode = 0;
-                foreach (KeyValuePair<int, string> tmp in CommonDefine.ExePrimaryCode)
-                {
-                    PCode = tmp.Key;
-                    break;
-                }
-                // æ—¥ä»˜èª­è¾¼
-                string strSQL = seDB.CreatePrimarykeyString(PCode);
-                List<SystemExecute> recordRec = new List<SystemExecute>();
+                // ã‚­ãƒ¼ã‚’å�–å¾—ã�™ã‚‹
+                int PCode = CommonDefine.ExePrimaryCode.First(x => x.Value.Equals("åˆ�å›žèµ·å‹•æ—¥ä»˜")).Key;
 
-                SystemExecute writeRec = new SystemExecute();
-                writeRec.PrimaryCode = PCode;
-                writeRec.TargetDate = DateTime.Today;
-               
-                if (!seDB.SelectAction(strSQL, ref recordRec)) return false;
-                if (recordRec.Count == 0)
-                {
-                    seDB.InsertAction(writeRec);
-                }
-                else
-                {
-                    seDB.UpdateAction(strSQL, writeRec);
-                }
+                // æ—¥ä»˜æ›´æ–°
+                if (!seDB.UpdateFeild(PCode, (int)IOSystemExecute.TableColumn.TargetDate, TargetDate)) return false;
 
                 return true;
             }
@@ -204,23 +196,37 @@
                 List<TermMaster> tmList = new List<TermMaster>();
                 if (!tmDB.SelectAction(strSQL, ref tmList)) return false;
 
+                // ãƒ©ã‚¹ãƒˆã�®ã�Ÿã‚�ã�«ãƒ«ãƒ¼ãƒ—å¤–ã�§å®šç¾©
+                TermMasterList CheckList = null;
+                int iTmpStatus = -1;
                 // ãƒ‡ãƒ¼ã‚¿ã‚»ãƒƒãƒˆ
-                int iTmpStatus = -1;
-                TermMasterList CheckList = null;
-                foreach (TermMaster tmData in tmList)
+                foreach (TermMaster tmRec in tmList)
                 {
                     // ã‚­ãƒ¼ã�Œé�•ã�ˆã�°Arrayãƒ†ãƒ¼ãƒ–ãƒ«ã�¸è¿½åŠ ã�™ã‚‹
-                    if (iTmpStatus != tmData.ConstructionStatusFlg)
+                    if (iTmpStatus != tmRec.ConstructionStatusFlg)
                     {
-                        // ãƒ�ã‚§ãƒƒã‚¯ãƒ†ãƒ¼ãƒ–ãƒ«ã�¸è¿½åŠ 
+                        // ãƒ�ã‚§ãƒƒã‚¯ãƒ†ãƒ¼ãƒ–ãƒ«ã�¸æ–°ã�Ÿã�ªçŠ¶æ…‹ãƒ†ãƒ¼ãƒ–ãƒ«ã‚’è¿½åŠ 
                         CheckList = new TermMasterList();
-                        m_arrayList.Add(CheckList);
-                        iTmpStatus = tmData.ConstructionStatusFlg;
+                        SystemOnceExecuteTermMstList.Add(CheckList);
+
+                        // ãƒ–ãƒ¬ã‚¤ã‚¯ã‚­ãƒ¼ã�®æ›´æ–°
+                        iTmpStatus = tmRec.ConstructionStatusFlg;
                     }
-                    CheckList.TermMstTBL.Add(tmData);
+                    // å�–å¾—ãƒ‡ãƒ¼ã‚¿ã‚’ã‚»ãƒƒãƒˆã�™ã‚‹
+                    CheckList.TermMstTBL.Add(tmRec);
                 }
-                if (CheckList.TermMstTBL.Count != 0) m_arrayList.Add(CheckList);
 
+                // ãƒ�ãƒƒãƒ•ã‚¡ãƒ†ãƒ¼ãƒ–ãƒ«ã�Œç©ºã�§ã�¯ã�ªã�„å ´å�ˆ
+                if (CheckList.TermMstTBL.Count != 0)
+                {
+                    // ãƒžã‚¹ã‚¿ãƒ¼ãƒ†ãƒ¼ãƒ–ãƒ«ãƒªã‚¹ãƒˆã‚ˆã‚Šæœ€å¾Œã�®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚’å�–å¾—ã�™ã‚‹
+                    int SetTableStatus = SystemOnceExecuteTermMstList[SystemOnceExecuteTermMstList.Count - 1].TermMstTBL[0].ConstructionStatusFlg;
+                    // ãƒ�ãƒƒãƒ•ã‚¡ãƒ†ãƒ¼ãƒ–ãƒ«ã�®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚’å�–å¾—ã�™ã‚‹
+                    int NowStatus = CheckList.TermMstTBL[0].ConstructionStatusFlg;
+                    // ãƒ�ãƒƒãƒ•ã‚¡ãƒ†ãƒ¼ãƒ–ãƒ«ã�Œã�™ã�§ã�«ã‚»ãƒƒãƒˆã�•ã‚Œã�¦ã�„ã�ªã�‘ã‚Œã�°ã‚»ãƒƒãƒˆã�™ã‚‹
+                    if (SetTableStatus != NowStatus) SystemOnceExecuteTermMstList.Add(CheckList);
+                }
+
                 return true;
             }
             catch (Exception ex)
@@ -239,7 +245,7 @@
         /// <summary>
         /// æ—¥ä»˜ã�®æœŸé™�ãƒ�ã‚§ãƒƒã‚¯ã‚’è¡Œã�†
         /// </summary>
-        private void SubmittedDateCheck(DateTime StartDate)
+        private bool SubmittedDateCheck(DateTime StartDate)
         {
             IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
             try
@@ -248,7 +254,7 @@
                 string strSQL = " WHERE CONSTRUCTIONSTATUSFLG IN (SELECT DISTINCT CONSTRUCTIONSTATUSFLG FROM TERMMASTER)";
                 strSQL = " ORDER BY CONSTRUCTIONSTATUSFLG ASC, CONSTRUCTIONCODE ASC";
                 List<ConstructionBaseInfo> cbiList = new List<ConstructionBaseInfo>();
-                if (!cbiDB.SelectAction(strSQL, ref cbiList)) return;
+                if (!cbiDB.SelectAction(strSQL, ref cbiList)) return true;
 
                 // çµŒé�Žæ—¥æ•°ã‚’å�–å¾—ã�™ã‚‹
                 TimeSpan ts = DateTime.Now - StartDate;
@@ -260,6 +266,7 @@
                     StartDate = DateTime.Now.AddDays(-1);
                 }
 
+                bool procflg = true;
                 // çµŒé�Žæ—¥æ•°åˆ†å‡¦ç�†ã‚’è¡Œã�†
                 for (int ix = 0; ix < diffDays; ix++)
                 {
@@ -272,13 +279,20 @@
                         // å¢—æ¸›å·¥äº‹ã�®å­�ã�¯å‡¦ç�†ã�—ã�ªã�„
                         if (wrkRec.TyingFlg == (int)CommonDefine.BaseInfoTyingFlg.Tying) continue;
                         // ãƒ�ã‚§ãƒƒã‚¯
-                        ConstructionStatusCheck(wrkRec, CriteriaDate, ref sErrorMessage, ref sBackColor, ref sForeColor);
+                        if (!ConstructionStatusCheck(wrkRec, CriteriaDate, ref sErrorMessage, ref sBackColor, ref sForeColor))
+                        {
+                            procflg = false;
+                            break;
+                        }
                     }
+                    if (!procflg) break;
                 }
+                return procflg;
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}", ex.Message);
+                return false;
             }
             finally
             {
@@ -307,9 +321,6 @@
         {
             try
             {
-                // æˆ»ã‚Šå€¤
-                bool bCheckPass = true;
-
                 // åˆ�æœŸåŒ–ã�«å¤±æ•—ã�—ã�¦ã�„ã�Ÿã‚‰å‡¦ç�†ã�—ã�ªã�„
                 if (!m_bExecuteFlg) return false;
 
@@ -318,9 +329,10 @@
                 // å�–å¾—ãƒ‡ãƒ¼ã‚¿ã�®é€²æ�—çŠ¶æ…‹ã�Œãƒ�ã‚§ãƒƒã‚¯åˆ¤å®šãƒ†ãƒ¼ãƒ–ãƒ«ã�«ã�‚ã‚‹ã�‹ã�®å­˜åœ¨ãƒ�ã‚§ãƒƒã‚¯
                 bool exestFlg = false;
                 int itblCnt = 0;
-                for (int i = 0; i < m_arrayList.Count; i++)
+                for (int i = 0; i < SystemOnceExecuteTermMstList.Count; i++)
                 {
-                    if (m_arrayList[i].TermMstTBL[0].ConstructionStatusFlg == checkRec.ConstructionStatusFlg)
+                    // åˆ¤å®šå¯¾è±¡ãƒ‡ãƒ¼ã‚¿ã�®çŠ¶æ…‹ã�Œãƒ�ã‚§ãƒƒã‚¯åˆ¤å®šãƒ†ãƒ¼ãƒ–ãƒ«ã�«ã�‚ã‚Œã�°å‡¦ç�†ã‚’ã�Šã�“ã�ªã�†
+                    if (SystemOnceExecuteTermMstList[i].TermMstTBL[0].ConstructionStatusFlg == checkRec.ConstructionStatusFlg)
                     {
                         exestFlg = true;
                         itblCnt = i;
@@ -328,10 +340,12 @@
                     }
                 }
                 // å�–å¾—ãƒ‡ãƒ¼ã‚¿ã�Œãƒ�ã‚§ãƒƒã‚¯åˆ¤å®šä»¥å¤–ã�¯å‡¦ç�†ã�—ã�ªã�„
-                if (!exestFlg) return bCheckPass;
+                if (!exestFlg) return true;
 
-                List<TermMaster> Termtbl = m_arrayList[itblCnt].TermMstTBL;
+                // æˆ»ã‚Šå€¤
+                bool bCheckNoError = true;
 
+                List<TermMaster> Termtbl = SystemOnceExecuteTermMstList[itblCnt].TermMstTBL;
                 // ã‚¨ãƒ©ãƒ¼ãƒ�ã‚§ãƒƒã‚¯
                 foreach (TermMaster wrkCheck in Termtbl)
                 {
@@ -440,8 +454,6 @@
                         sBackColor = wrkCheck.BackColor;
                         sForeColor = wrkCheck.ForeColor;
 
-                        // æˆ»ã‚Šå€¤ã�«ã‚¨ãƒ©ãƒ¼
-                        bCheckPass = false;
 
                         // æŽ²ç¤ºæ�¿ã�«ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’è¼‰ã�›ã�ªã�„å ´å�ˆã�Œã�‚ã‚‹ã�®ã�§ãƒ•ãƒ©ã‚°åˆ¶å¾¡
                         if (bCreateMessage)
@@ -452,7 +464,8 @@
                     }
                 }
 
-                return bCheckPass;
+
+                return bCheckNoError;
             }
             catch (Exception ex)
             {
@@ -540,7 +553,7 @@
 
                 // ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãƒ•ãƒ©ã‚°ã‚’è‡ªå‹•ã�«è¨­å®šã�™ã‚‹
                 WriteData.MessageFlag = (int)CommonDefine.MessageFlg.Secretary;
-                
+
                 // æŽ²ç¤ºæ�¿ã�¸ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’è¼‰ã�›ã‚‹
                 ClsMessageBoradAccess.CreateMessage(WriteData, WriteDetail);
 
@@ -561,7 +574,7 @@
         /// <summary>
         /// è¦‹ç©�æœ‰åŠ¹æœŸé™�ã�ŒçµŒé�Žã�—ã�Ÿãƒ‡ãƒ¼ã‚¿ã‚’é�žå�—æ³¨ã�¸å¤‰æ›´ã�™ã‚‹
         /// </summary>
-        private void ChangeNonOrdersData()
+        private bool ChangeNonOrdersData()
         {
             IOConstructionBaseInfo BaseDB = new IOConstructionBaseInfo();
             try
@@ -580,10 +593,10 @@
                 if (!BaseDB.ExecuteReader(strSQL, ref arList))
                 {
                     logger.ErrorFormat("å·¥äº‹åŸºæœ¬æƒ…å ±æ›´æ–°ã‚¨ãƒ©ãƒ¼ã€€é�žå�—æ³¨æ¡ˆä»¶ç§»è¡Œå‡¦ç�†å¤±æ•—ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), strSQL);
-                    return;
+                    return false;
                 }
                 object[] wrkcount = (object[])arList[0];
-                if (Common.CommonMotions.cnvInt(wrkcount[0]) == 0) return;
+                if (Common.CommonMotions.cnvInt(wrkcount[0]) == 0) return true;
 
                 // å¯¾è±¡ãƒ‡ãƒ¼ã‚¿ã�Œå­˜åœ¨ã�™ã‚Œã�°æ›´æ–°ã�™ã‚‹
                 strSQL = string.Format("UPDATE CONSTRUCTIONBASEINFO SET CONSTRUCTIONSTATUSFLG = {0}", iCode1);
@@ -596,11 +609,15 @@
                 if (!BaseDB.ExecuteNonQuery(strSQL))
                 {
                     logger.ErrorFormat("å·¥äº‹åŸºæœ¬æƒ…å ±æ›´æ–°ã‚¨ãƒ©ãƒ¼ã€€é�žå�—æ³¨æ¡ˆä»¶ç§»è¡Œå‡¦ç�†å¤±æ•—ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), strSQL);
+                    return false;
                 }
+
+                return true;
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
             }
             finally
             {
@@ -613,7 +630,7 @@
         /// <summary>
         /// å·¥äº‹è©³ç´°å�°å¸³ã�®çµ¦ä¸Žã‚’åŠ ç®—ã�™ã‚‹
         /// </summary>
-        private void CalculateDaysSalary()
+        private bool CalculateDaysSalary()
         {
             IOConstructionLedger LedgerDB = new IOConstructionLedger();
             try
@@ -622,7 +639,7 @@
                 string strSQL = " WHERE ComplateFlg <> 1 ORDER BY ConstructionStart ASC";
                 List<ConstructionLedger> LedgerList = new List<ConstructionLedger>();
                 // ã‚¨ãƒ©ãƒ¼ã‚‚ã�—ã��ã�¯ãƒ‡ãƒ¼ã‚¿ã�Œç„¡ã�„å ´å�ˆã�¯å‡¦ç�†ã�—ã�ªã�„
-                if (!LedgerDB.SelectAction(strSQL, ref LedgerList) || LedgerList.Count == 0) return;
+                if (!LedgerDB.SelectAction(strSQL, ref LedgerList) || LedgerList.Count == 0) return true;
 
                 foreach (ConstructionLedger CurRec in LedgerList)
                 {
@@ -632,10 +649,13 @@
                     // çµ¦ä¸Žã‚’åŠ ç®—ã�™ã‚‹
                     if (!ClsChangeLedgerData.CalculatePayment(CurRec.ConstructionCode, DateTime.Now, false)) break;
                 }
+
+                return true;
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
             }
             finally
             {
Index: trunk/src/ProcessManagement/ProcessManagement/DB/Core/DBCommon.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/DB/Core/DBCommon.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/DB/Core/DBCommon.cs	(revision 18)
@@ -61,9 +61,10 @@
         public void Initialize()
         {
             // DBæŽ¥ç¶šæƒ…å ±ä½œæˆ�
-            m_dbconnectString = "User Id=" + CommonMotions.DFRModel.DBConnect.DBUser + ";";
-            m_dbconnectString += "Password=" + CommonMotions.DFRModel.DBConnect.Password + ";";
-            m_dbconnectString += "Data Source=" + CommonMotions.DFRModel.DBConnect.DBDataSource + ";";
+            m_dbconnectString = string.Format("User Id={0};", CommonMotions.DFRModel.DBConnect.DBUser);
+            m_dbconnectString += string.Format("Password={0};", CommonMotions.DFRModel.DBConnect.Password);
+            m_dbconnectString += string.Format("Data Source={0};", CommonMotions.DFRModel.DBConnect.DBDataSource);
+            //m_dbconnectString += "Pooling=false";
         }
 
         #endregion
Index: trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMPersonInCharge.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMPersonInCharge.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMPersonInCharge.cs	(revision 18)
@@ -49,6 +49,7 @@
             Qualification,
             SealPrintName,
             EmployeeClassFlg,
+            LedgerFlg,
             DeleteFlg,
             EntryDate,
             UpdateDate,
@@ -93,6 +94,7 @@
             strcmd += ", Qualification";
             strcmd += ", SealPrintName";
             strcmd += ", EmployeeClassFlg";
+            strcmd += ", LedgerFlg";
 
             strcmd += ", DeleteFlg";
             strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
@@ -196,6 +198,28 @@
                 {
                     strcmd = "INSERT INTO PersonInChargeMaster";
 
+                    strcmd += " (PersonCode";
+                    strcmd += ", DisplayOrder";
+                    strcmd += ", PersonName";
+
+                    strcmd += ", StartDate";
+                    strcmd += ", EndDate";
+                    strcmd += ", PassWord";
+                    strcmd += ", SecurityManagement";
+                    strcmd += ", MsgBackColor";
+                    strcmd += ", DisplayString";
+                    strcmd += ", DepartmentCode";
+                    strcmd += ", MonthlySalary";
+                    strcmd += ", YearSalary";
+                    strcmd += ", Qualification";
+                    strcmd += ", SealPrintName";
+                    strcmd += ", EmployeeClassFlg";
+                    strcmd += ", LedgerFlg";
+
+                    strcmd += ", DeleteFlg";
+                    strcmd += ", EntryDate";
+                    strcmd += ", UpdateDate)";
+
                     strcmd += " VALUES (";
 
                     strcmd += string.Format("  {0}", work.PersonCode);
@@ -213,6 +237,7 @@
                     strcmd += string.Format(", '{0}'", work.Qualification);
                     strcmd += string.Format(", '{0}'", work.SealPrintName);
                     strcmd += string.Format(", {0}", work.EmployeeClassFlg);
+                    strcmd += string.Format(", {0}", work.LedgerFlg);
 
                     strcmd += string.Format(", {0}", work.DeleteFlg.ToString());
                     strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
@@ -263,6 +288,7 @@
                 strcmd += string.Format(", Qualification = '{0}'", data.Qualification);
                 strcmd += string.Format(", SealPrintName = '{0}'", data.SealPrintName);
                 strcmd += string.Format(", EmployeeClassFlg = {0}", data.EmployeeClassFlg.ToString());
+                strcmd += string.Format(", LedgerFlg = {0}", data.LedgerFlg);
                 
                 strcmd += string.Format(", DeleteFlg = {0}", data.DeleteFlg);
                 strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
@@ -333,6 +359,7 @@
                 wrk.Qualification = objwrk[(int)NameColumn.Qualification].ToString();
                 wrk.SealPrintName = objwrk[(int)NameColumn.SealPrintName].ToString();
                 wrk.EmployeeClassFlg = int.Parse(objwrk[(int)NameColumn.EmployeeClassFlg].ToString());
+                wrk.LedgerFlg = int.Parse(objwrk[(int)NameColumn.LedgerFlg].ToString());
 
                 wrk.DeleteFlg = int.Parse(objwrk[(int)NameColumn.DeleteFlg].ToString());
                 wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString());
@@ -374,6 +401,7 @@
             wrk.SealPrintName = string.Empty;       // å�°é‘‘è¡¨ç¤ºå��
 
             wrk.EmployeeClassFlg = 0;               // ç¤¾å“¡åŒºåˆ†
+            wrk.LedgerFlg = 0;                      // å�°å¸³è¨ˆç®—å¯¾è±¡ãƒ•ãƒ©ã‚°
 
             wrk.DeleteFlg = 0;                      // å‰Šé™¤ãƒ•ãƒ©ã‚°
             wrk.EntryDate = DateTime.MinValue;      // ç™»éŒ²æ—¥ä»˜
@@ -381,8 +409,13 @@
         }
         #endregion
 
-        #region ãƒ‘ãƒ–ãƒªãƒƒã‚¯ãƒ¡ã‚½ãƒƒãƒ‰ï¼ˆç‰¹æ®Šå‡¦ç�†ï¼‰
-
+        #region MAXæ‹…å½“è€…ç•ªå�·å�–å¾—
+        /// <summary>
+        /// MAXæ‹…å½“è€…ç•ªå�·å�–å¾—
+        /// </summary>
+        /// <param name="AddSQLString"></param>
+        /// <param name="bConnect"></param>
+        /// <returns></returns>
         public int SelectMaxPersonCodeCount(string AddSQLString, bool bConnect = true)
         {
             //Oracle ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹
@@ -413,7 +446,15 @@
 
             return iRet;
         }
+        #endregion
 
+        #region MAXè¡¨ç¤ºé †ç•ªå�–å¾—
+        /// <summary>
+        /// MAXè¡¨ç¤ºé †ç•ªå�–å¾—
+        /// </summary>
+        /// <param name="AddSQLString"></param>
+        /// <param name="bConnect"></param>
+        /// <returns></returns>
         public int SelectMaxDisplayCount(string AddSQLString, bool bConnect = true)
         {
             //Oracle ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹
@@ -444,7 +485,9 @@
 
             return iRet;
         }
+        #endregion
 
+        #region ä¸»ã‚­ãƒ¼æ¤œç´¢ã�®æ–‡å­—åˆ—ã‚’è¿”ã�™
         /// <summary>
         /// ä¸»ã‚­ãƒ¼æ¤œç´¢ã�®æ–‡å­—åˆ—ã‚’è¿”ã�™
         /// </summary>
Index: trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSystemExecute.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSystemExecute.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOSystemExecute.cs	(revision 18)
@@ -31,7 +31,7 @@
         /// <summary>
         /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ä¸¦ã�³
         /// </summary>
-        public enum DataColumn
+        public enum TableColumn
         {
             PrimaryCode = 0,
             TargetDate,
@@ -52,9 +52,9 @@
 
         #endregion
 
-        #region ãƒ‘ãƒ–ãƒªãƒƒã‚¯ãƒ¡ã‚½ãƒƒãƒ‰
+        #region ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿æ¤œç´¢SQLä½œæˆ�
         /// <summary>
-        /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿æ¤œç´¢
+        /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿æ¤œç´¢SQLä½œæˆ�
         /// </summary>
         /// <param name="AddSQLString">æ¤œç´¢æ�¡ä»¶SQLæ–‡å­—åˆ—</param>
         /// <param name="data">ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿ãƒ‡ãƒ¼ã‚¿</param>
@@ -71,6 +71,16 @@
 
             return strcmd;
         }
+        #endregion
+
+        #region ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿è¤‡æ•°ä»¶æ¤œç´¢
+        /// <summary>
+        /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿è¤‡æ•°ä»¶æ¤œç´¢
+        /// </summary>
+        /// <param name="AddSQLString"></param>
+        /// <param name="data"></param>
+        /// <param name="bConnect"></param>
+        /// <returns></returns>
         public bool SelectAction(string AddSQLString, ref List<SystemExecute> data, bool bConnect = true)
         {
             //Oracle ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹
@@ -102,6 +112,16 @@
                 return false;
             }
         }
+        #endregion
+
+        #region ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿1ä»¶æ¤œç´¢
+        /// <summary>
+        /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿1ä»¶æ¤œç´¢
+        /// </summary>
+        /// <param name="AddSQLString"></param>
+        /// <param name="data"></param>
+        /// <param name="bConnect"></param>
+        /// <returns></returns>
         public bool SelectAction(string AddSQLString, ref SystemExecute data, bool bConnect = true)
         {
             //Oracle ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹
@@ -134,9 +154,11 @@
                 return false;
             }
         }
+        #endregion
 
+        #region ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿è¿½åŠ SQLä½œæˆ�
         /// <summary>
-        /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿è¿½åŠ 
+        /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿è¿½åŠ SQLä½œæˆ�
         /// </summary>
         /// <param name="data">ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿ãƒ‡ãƒ¼ã‚¿</param>
         /// <returns>trueï¼šæˆ�åŠŸ falseï¼šå¤±æ•—</returns>
@@ -144,6 +166,11 @@
         {
             string strcmd = "INSERT INTO SystemExecute";
 
+            strcmd += "(PrimaryCode";
+            strcmd += " ,TargetDate";
+            strcmd += " ,EntryDate";
+            strcmd += " ,UpdateDate)";
+
             strcmd += " VALUES (";
             strcmd += string.Format("{0}", work.PrimaryCode);
             strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", work.TargetDate.ToShortDateString());
@@ -154,6 +181,15 @@
 
             return strcmd;
         }
+        #endregion
+
+        #region ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿è¤‡æ•°ä»¶è¿½åŠ 
+        /// <summary>
+        /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿è¤‡æ•°ä»¶è¿½åŠ 
+        /// </summary>
+        /// <param name="data"></param>
+        /// <param name="bConnect"></param>
+        /// <returns></returns>
         public bool InsertAction(List<SystemExecute> data, bool bConnect = true)
         {
             string strcmd = "";
@@ -173,6 +209,15 @@
                 return false;
             }
         }
+        #endregion
+
+        #region ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿ï¼‘ä»¶è¿½åŠ 
+        /// <summary>
+        /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿ï¼‘ä»¶è¿½åŠ 
+        /// </summary>
+        /// <param name="data"></param>
+        /// <param name="bConnect"></param>
+        /// <returns></returns>
         public bool InsertAction(SystemExecute data, bool bConnect = true)
         {
             string strcmd = "";
@@ -189,7 +234,9 @@
                 return false;
             }
         }
+        #endregion
 
+        #region ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿æ›´æ–°
         /// <summary>
         /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿æ›´æ–°
         /// </summary>
@@ -222,8 +269,9 @@
                 return false;
             }
         }
+        #endregion
 
-
+        #region ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿å‰Šé™¤
         /// <summary>
         /// ã‚·ã‚¹ãƒ†ãƒ èµ·å‹•ç¢ºèª�ãƒ‡ãƒ¼ã‚¿å‰Šé™¤
         /// </summary>
@@ -248,8 +296,52 @@
                 return false;
             }
         }
+        #endregion
 
+        #region 1é …ç›®æ›´æ–°å‡¦ç�†
         /// <summary>
+        /// 1é …ç›®ã�®æ›´æ–°ã‚’è¡Œã�†
+        /// </summary>
+        /// <param name="PrimaryCode"></param>
+        /// <param name="FeildNo"></param>
+        /// <param name="value"></param>
+        /// <param name="bConnect"></param>
+        /// <returns></returns>
+        public bool UpdateFeild(int PrimaryCode, int FeildNo, object value, bool bConnect = true)
+        {
+            string strcmd = "";
+            try
+            {
+                strcmd = "UPDATE SystemExecute";
+
+                strcmd += " SET";
+                switch (FeildNo)
+                {
+                    case (int)TableColumn.PrimaryCode:
+                        strcmd += string.Format(" PrimaryCode = {0}", ((int)value).ToString());
+                        break;
+                    case (int)TableColumn.TargetDate:
+                        strcmd += string.Format(" TargetDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
+                        break;
+                }
+
+                strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
+                strcmd += CreatePrimarykeyString(PrimaryCode);
+
+                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}ï¼š{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
+                return false;
+            }
+        }
+        #endregion
+
+        #region OracleDataReaderã‚ˆã‚Šæ§‹é€ ä½“ã�¸ã‚»ãƒƒãƒˆã�™ã‚‹
+        /// <summary>
         /// OracleDataReaderã‚ˆã‚Šæ§‹é€ ä½“ã�¸ã‚»ãƒƒãƒˆã�™ã‚‹
         /// </summary>
         /// <param name="reader">OracleDataReader</param>
@@ -259,11 +351,11 @@
             try
             {
                 // ãƒ‡ãƒ¼ã‚¿å�–å¾—
-                wrk.PrimaryCode = int.Parse(objwrk[(int)DataColumn.PrimaryCode].ToString());
-                wrk.TargetDate = DateTime.Parse(objwrk[(int)DataColumn.TargetDate].ToString());
+                wrk.PrimaryCode = int.Parse(objwrk[(int)TableColumn.PrimaryCode].ToString());
+                wrk.TargetDate = DateTime.Parse(objwrk[(int)TableColumn.TargetDate].ToString());
 
-                wrk.EntryDate = DateTime.Parse(objwrk[(int)DataColumn.EntryDate].ToString());
-                wrk.UpdateDate = DateTime.Parse(objwrk[(int)DataColumn.UpdateDate].ToString());
+                wrk.EntryDate = DateTime.Parse(objwrk[(int)TableColumn.EntryDate].ToString());
+                wrk.UpdateDate = DateTime.Parse(objwrk[(int)TableColumn.UpdateDate].ToString());
             }
             catch (OracleException oraex)
             {
@@ -277,8 +369,7 @@
 
         #endregion
 
-        #region ãƒ‘ãƒ–ãƒªãƒƒã‚¯ãƒ¡ã‚½ãƒƒãƒ‰ï¼ˆç‰¹æ®Šå‡¦ç�†ï¼‰
-
+        #region ä¸»ã‚­ãƒ¼æ¤œç´¢ã�®æ–‡å­—åˆ—ã‚’è¿”ã�™
         /// <summary>
         /// ä¸»ã‚­ãƒ¼æ¤œç´¢ã�®æ–‡å­—åˆ—ã‚’è¿”ã�™
         /// </summary>
Index: trunk/src/ProcessManagement/ProcessManagement/DataModel/ConstructionBaseInfo.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/DataModel/ConstructionBaseInfo.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/DataModel/ConstructionBaseInfo.cs	(revision 18)
@@ -53,7 +53,7 @@
         private int         m_ConstructionStatusFlg = -1;	                    // å·¥äº‹çŠ¶æ…‹ãƒ•ãƒ©ã‚°
         private int         m_ConstructionType = 0;                             // å·¥äº‹ç¨®åˆ¥åŒºåˆ†å��ç§°ã‚³ãƒ¼ãƒ‰
         private int         m_EstimateType = 1;                                 // è¦‹ç©�ç¨®åˆ¥
-        private DateTime    m_BillingStartDate=DateTime.MinValue;	            // è«‹æ±‚æº–å‚™é–‹å§‹æ—¥
+        private DateTime    m_BillingStartDate = DateTime.MinValue;	            // è«‹æ±‚æº–å‚™é–‹å§‹æ—¥
         private DateTime    m_BillingDate = DateTime.MinValue;	                // è«‹æ±‚æ—¥
         private int         m_BillingSplitFlg = 1;                              // è«‹æ±‚å›žæ•°ãƒ•ãƒ©ã‚°
         private DateTime    m_BillingSendDate = DateTime.MinValue;              // è«‹æ±‚æ›¸éƒµé€�/æ‰‹æ¸¡ã�—æ—¥
Index: trunk/src/ProcessManagement/ProcessManagement/DataModel/PersonInChargeMaster.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/DataModel/PersonInChargeMaster.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/DataModel/PersonInChargeMaster.cs	(revision 18)
@@ -30,7 +30,8 @@
         private string      m_SealPrintName = string.Empty;     // å�°é‘‘è¡¨ç¤ºå��
 
         private int         m_EmployeeClassFlg = 0;             // ç¤¾å“¡åŒºåˆ†
-        
+        private int         m_LedgerFlg = 1;                    // å�°å¸³è¨ˆç®—å¯¾è±¡ãƒ•ãƒ©ã‚°
+
         private int         m_DeleteFlg = 0;                    // å‰Šé™¤ãƒ•ãƒ©ã‚°
         private DateTime    m_EntryDate = DateTime.MinValue;    // ç™»éŒ²æ—¥ä»˜
         private DateTime    m_UpdateDate = DateTime.MinValue;   // æ›´æ–°æ—¥ä»˜
@@ -161,6 +162,14 @@
             set { m_EmployeeClassFlg = value; }
         }
         /// <summary>
+        /// å�°å¸³è¨ˆç®—å¯¾è±¡ãƒ•ãƒ©ã‚°
+        /// </summary>
+        public int LedgerFlg
+        {
+            get { return m_LedgerFlg; }
+            set { m_LedgerFlg = value; }
+        }
+        /// <summary>
         /// å‰Šé™¤ãƒ•ãƒ©ã‚°
         /// </summary>
         public int DeleteFlg
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionListAuxiliary.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionListAuxiliary.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionListAuxiliary.cs	(revision 18)
@@ -1137,7 +1137,6 @@
         private bool SetcmbDepartment()
         {
             IOMDepartment depDB = new IOMDepartment();
-            List<DepartmentMaster> workList = new List<DepartmentMaster>();
             bool bSave = m_initDataLoad;
             m_initDataLoad = true;
             try
@@ -1148,39 +1147,36 @@
                 cmbDepartment.Text = "";
 
                 string strSQL = string.Empty;
+                // •”��ƒ}ƒXƒ^‚ðŒŸ�õ‚·‚é
+                strSQL = "SELECT A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER, COUNT(*)";
+                strSQL += " FROM DEPARTMENTMASTER A, PERSONINCHARGEMASTER B, CONSTRUCTIONBASEINFO C";
+                strSQL += " WHERE A.DELETEFLG = 0";
+
                 // ƒVƒXƒeƒ€Œ ŒÀ‚É‚æ‚Á‚Äƒf�[ƒ^ƒAƒNƒZƒX‚É�§ŒÀ‚ª‚ ‚é
-                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.AdminSecurityManagement
-                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.PresidentAuthority].Key
-                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SupervisorAuthority].Key
-                || CommonMotions.LoginUserData.DepartmentCode == CommonDefine.s_GeneralAffairsDevision)
+                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SuperiorAuthority].Key
+                    || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
                 {
-                    // ƒVƒXƒeƒ€ŠÇ—�ŽÒ
-                    // �Å�‚‹@–§ŠÇ—�ŽÒ
-                    // “�Š‡‹@–§ŠÇ—�ŽÒ
-                    // ‘�–±•”�Š‘®ŽÒ‚Í‘S‚ÄŒ©‚¦‚é
-                    // •”��ƒ}ƒXƒ^‚ðŒŸ�õ‚·‚é
-                    strSQL = " Where DeleteFlg = 0 Order By DisplayOrder ASC";
-                }
-                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SuperiorAuthority].Key)
-                {
                     // �Š‘®’·
-                    strSQL = string.Format(" WHERE DEPARTMENTCODE = {0} AND DeleteFlg = 0 Order By DisplayOrder ASC", CommonMotions.LoginUserData.DepartmentCode);
-                }
-                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
-                {
                     // ˆê”ÊŽg—pŽÒ�iŽ©•ª‚Ì‚ÝƒAƒNƒZƒX‰Â”\�j
-                    strSQL = string.Format(" WHERE DEPARTMENTCODE = {0} AND DeleteFlg = 0 Order By DisplayOrder ASC", CommonMotions.LoginUserData.DepartmentCode);
+                    strSQL += string.Format(" AND A.DEPARTMENTCODE = {0}", CommonMotions.LoginUserData.DepartmentCode);
                 }
+                strSQL += " AND A.DEPARTMENTCODE = B.DEPARTMENTCODE";
+                strSQL += " AND B.PERSONCODE = C.CONSTRUCTIONPERSONCODE";
+                strSQL += " GROUP BY A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER";
+                strSQL += " ORDER BY A.DISPLAYORDER ASC";
 
                 // •”��ƒ}ƒXƒ^“Ç�ž
-                if (!depDB.SelectAction(strSQL, ref workList)) return false;
+                ArrayList arList = new ArrayList();
+                if (!depDB.ExecuteReader(strSQL, ref arList)) return false;
 
+
                 List<KeyValuePair<int, string>> ConstructionDataList = new List<KeyValuePair<int, string>>();
                 ConstructionDataList.Add(new KeyValuePair<int, string>(0, ""));
 
-                foreach (DepartmentMaster work in workList)
+                foreach (object[] work in arList)
                 {
-                    KeyValuePair<int, string> keyval = new KeyValuePair<int, string>(work.DepartmentCode, work.DepartmentString);
+                    KeyValuePair<int, string> keyval = new KeyValuePair<int, string>(CommonMotions.cnvInt(work[0])
+                                                                                    , CommonMotions.cnvString(work[1]));
 
                     ConstructionDataList.Add(keyval);
                 }
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/DataChange.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/DataChange.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/DataChange.cs	(revision 18)
@@ -47,7 +47,7 @@
 
                 string strSQL = "SELECT SUM(ORDERSDECISIONPRICE) FROM CONSTRUCTIONBASEINFO";
                 strSQL += string.Format(" WHERE (TRUNC(CONSTRUCTIONCODE / 100) = {0})", (int)(m_ConstructionCode / 100));
-                strSQL += string.Format(" AND CONSTRUCTIONSTATUSFLG != {0})", iCode1);
+                strSQL += string.Format(" AND CONSTRUCTIONSTATUSFLG != {0}", iCode1);
                 strSQL += " GROUP BY TRUNC(CONSTRUCTIONCODE / 100)";
 
                 ArrayList Arlist = new ArrayList();
@@ -93,7 +93,7 @@
                 ExecutionAmount = iInput;                                                     // ŽÀ�s‹àŠz
 
                 AmountConfigRate = (iInput / OrdersDecisionPrice) * 100.0;          // ‹àŠz�\�¬—¦
-
+                if (AmountConfigRate < -999.00 || 999.00 < AmountConfigRate) AmountConfigRate = 0;
             }
             catch (Exception ex)
             {
@@ -905,9 +905,11 @@
                                         IOMPersonInCharge PersonDB,
                                         IOConstructionLink cbLinkDB,
                                         int TotalOrdersPrice,
-                                        bool TyingDataFlag)
+                                        bool TyingDataFlag,
+                                        ref bool LedgerReCalc,
+                                        ref int ConstrCode)
         {
-            FrmConstructionLedger frm = new FrmConstructionLedger();
+            FrmConstructionLedger frm = new FrmConstructionLedger();                    // �HŽ–�Ú�×‘ä’ “ü—Í
             try
             {
                 // ----- “–�ˆ—�“à‚Å‚Ì�HŽ–”Ô�†Ši”[ƒGƒŠƒA
@@ -992,7 +994,7 @@
                 // �HŽ–�î•ñ‚ðŽæ“¾‚·‚é
                 ConstructionBaseInfo BaseRec = new ConstructionBaseInfo();
                 string strBase = cbiDB.CreatePrimarykeyString(ProcConstrCode);
-                if (!cbiDB.SelectAction(strBase, ref BaseRec)) return false;
+                if (!cbiDB.SelectAction(strBase, ref BaseRec, false)) return false;
                 // �HŠú‚Ìƒ`ƒFƒbƒN
                 DateTime StDate = BaseRec.ConstructionPeriodStart;
                 DateTime EdDate = BaseRec.ConstructionPeriodEnd;
@@ -1001,21 +1003,10 @@
                 if (StDate != LedgerRec.ConstructionStart) bChangeCode = false;
                 if (EdDate != LedgerRec.ConstructionEnd) bChangeCode = false;
 
-                // ˆá‚¢‚ª–³‚¯‚ê‚Î�ˆ—�‚µ‚È‚¢
-                if (!bChangeCode) return true;
+                // ˆá‚¢‚ª‚ ‚ê‚Î�ˆ—�‚·‚é
+                if (bChangeCode) LedgerReCalc = true;
+                ConstrCode = ProcConstrCode;
 
-                // �HŽ–ƒR�[ƒh‚ÌƒZƒbƒg
-                frm.ConstructionCode = ProcConstrCode;
-
-                // Œ©‚¦‚È‚¢‰æ–Ê‚ð�o‚·
-                frm.Hide();
-
-                // �ÄŒvŽZ�ˆ—�
-                bool bret = frm.RecalculateLedger;
-
-                // ‰æ–Ê‚ð•Â‚¶‚é
-                frm.Close();
-
                 return true;
             }
             catch (Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfo.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfo.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfo.cs	(revision 18)
@@ -645,6 +645,7 @@
                         {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},     // 77:�HŽ–•›’S“–•”��
                         {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},     // 78:Žw“±ˆõ•”��
                         {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},     // 79:�HŽ–•›’S“–ŽÒƒR�[ƒh
+                        {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},     // 80:�HŽ–�Ú�×‘ä’ “ü—ÍŠ®—¹“ú
         };
         //�@0:ˆË—ŠŽó‚¯’†�|1:Œ©�Ï’ñ�o�|2:ˆê”Ê•â�C�HŽ–�|3:‰¼ Žó ’��|4:Žó’��|5:•”��ˆøŒp
         //�|6:Ž{�H�€”õ�|7:Ž{�HŠJŽn�|8:Ž{�HŠ®—¹�|9:�¿‹��€”õ�|10:�¿‹�Š®—¹�|11:”ñŽó’�
@@ -743,12 +744,13 @@
                         { true,  true,  true,  true,  true,  true,  true,  false, false, false, false, false, false, false, false, false,  true,  true},   // 78:Žw“±ˆõ•”��
                         { true,  true,  true,  true,  true,  true,  true,  false, false, false, false, false, false, false, false, false,  true,  true},   // 79:�HŽ–•›’S“–ŽÒƒR�[ƒh
 
-                        { true,  false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},   // �y�Å�I�z+ 1:�Á”ï�Åƒtƒ‰ƒO
-                        { true,  false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},   // �y�Å�I�z+ 2:Œ³�¿ƒtƒ‰ƒO �¦–¢Žg—p
-                        { true,  false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},   // �y�Å�I�z+ 3:‰c‹ÆŒo”ï”­�¶ƒtƒ‰ƒO
+                        { true,  false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},    // �y�Å�I�z+ 1:�Á”ï�Åƒtƒ‰ƒO
+                        { true,  false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},    // �y�Å�I�z+ 2:Œ³�¿ƒtƒ‰ƒO �¦–¢Žg—p
+                        { true,  false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},    // �y�Å�I�z+ 3:‰c‹ÆŒo”ï”­�¶ƒtƒ‰ƒO
                         { true,  true,  true,  true,  true,  true,  true,  true,  true,  true,  true,  true,  true,  true,  false, false,  true,  true},    // �y�Å�I�z+ 4:�HŽ–�ó‘Ôƒtƒ‰ƒO
-                        { true,  false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},   // �y�Å�I�z+ 5:Œ©�ÏŽí•Ê
-                        { true,  true,  false, true,  true,  true,  true,  false, false, false, true,  false, false, false, false, false, false, false}};  // �y�Å�I�z+ 6:�¿‹�‹æ•ª
+                        { true,  false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},    // �y�Å�I�z+ 5:Œ©�ÏŽí•Ê
+                        { true,  true,  false, true,  true,  true,  true,  false, false, false, true,  false, false, false, false, false, false, false},    // �y�Å�I�z+ 6:�¿‹�‹æ•ª
+                        { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}};   // �y�Å�I�z+ 7:�HŽ–�Ú�×‘ä’ “ü—ÍŠ®—¹“ú
 
         //  0:ˆË—ŠŽó‚¯’†�|1:Œ©�Ï’ñ�o�|2:ˆê”Ê•â�C�HŽ–�|3:‰¼Žó’��|4:Žó’��|5:•”��ˆøŒp
         //�|6:Ž{�H�€”õ�|7:Ž{�HŠJŽn�|8:Ž{�HŠ®—¹�|9:�¿‹��€”õ�|10:�¿‹�Š®—¹�|11:”ñŽó’�
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs	(revision 18)
@@ -2474,6 +2474,8 @@
             IOConstructionLedger LedgerDB = new IOConstructionLedger();                 // �HŽ–�Ú�×‘ä’ ƒf�[ƒ^
             IOConstructionLedgerDetail LedgerDDB = new IOConstructionLedgerDetail();    // �HŽ–�Ú�×‘ä’ –¾�×ƒf�[ƒ^
             IOConstructionLedgerExcute LedgerEDB = new IOConstructionLedgerExcute();    // �HŽ–�Ú�×‘ä’ Žx•¥‚¢ƒf�[ƒ^
+
+            FrmConstructionLedger frm = new FrmConstructionLedger();                    // �HŽ–�Ú�×‘ä’ “ü—Í
             try
             {
                 //ƒf�[ƒ^ƒ`ƒFƒbƒN
@@ -2515,6 +2517,7 @@
                 ConstructionBaseInfo BaseRec = new ConstructionBaseInfo();
                 cbiDB.SelectAction(strTyCheck, ref BaseRec);
                 if (BaseRec.TyingFlg != (int)CommonDefine.BaseInfoTyingFlg.Standard) TyingDataFlag = true;
+                if (rdbNotFluctuation.Checked) TyingDataFlag = false;
                 //if ((pnlFluctuation.Visible == true && rdbExistsFluctuation.Checked == true) || (pnlFluctuation.Visible == false)) LastDateUpDate = true;
 
                 // ‘�Œ¸�HŽ–‚Ì�e‚à‚µ‚­‚ÍŽq‚Ì�ê�‡‚Íˆê”Ô�ÅŒã‚Ì�HŠú�I—¹‚ðŽæ“¾‚·‚é
@@ -2585,8 +2588,10 @@
                     return false;
                 }
 
+                bool bLedgerReCalc = false;
+                int ProcConstrCode = 0;
                 // �HŽ–�Ú�×‘ä’ ƒf�[ƒ^�X�V
-                if (!LedgerDataChange(cbiDB, LedgerDB, LedgerDDB, LedgerEDB, PersonDB, cbLinkDB, TotalOrdersPrice, TyingDataFlag))
+                if (!LedgerDataChange(cbiDB, LedgerDB, LedgerDDB, LedgerEDB, PersonDB, cbLinkDB, TotalOrdersPrice, TyingDataFlag, ref bLedgerReCalc, ref ProcConstrCode))
                 {
                     MessageBox.Show("�HŽ–�Ú�×‘ä’ ƒf�[ƒ^�X�VƒGƒ‰�[‚Å‚·�B", "�X�VƒGƒ‰�[", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     cbiDB.rollback();
@@ -2622,6 +2627,21 @@
                 LedgerDDB.commit();
                 LedgerEDB.commit();
 
+                if (bLedgerReCalc)
+                {
+                    // �HŽ–ƒR�[ƒh‚ÌƒZƒbƒg
+                    frm.ConstructionCode = ProcConstrCode;
+
+                    // Œ©‚¦‚È‚¢‰æ–Ê‚ð�o‚·
+                    frm.Hide();
+
+                    // �ÄŒvŽZ�ˆ—�
+                    bool bret = frm.RecalculateLedger;
+
+                    // ‰æ–Ê‚ð•Â‚¶‚é
+                    frm.Close();
+                }
+                
                 // “o˜^�¬Œ÷‚Í•Ï‰»ƒtƒ‰ƒOƒNƒŠƒA
                 m_bChengeAns = false;
 
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/ProcessControl.cs	(revision 18)
@@ -209,6 +209,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudget.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudget.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudget.cs	(revision 18)
@@ -659,22 +659,7 @@
         /// <param name="e"></param>
         private void FrmConstructionBudget_KeyDown(object sender, KeyEventArgs e)
         {
-            //Alt‚©CtrlƒL�[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚éŽž‚Í–³Ž‹‚·‚é
-            if (e.Alt || e.Control) return;
 
-            //EnterƒL�[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚é‚©Šm”F
-            if (e.KeyCode == Keys.Enter)
-            {
-                //‚ ‚½‚©‚àTabƒL�[‚ª‰Ÿ‚³‚ê‚½‚©‚Ì‚æ‚¤‚É‚·‚é�B
-                // Shift‚ª‰Ÿ‚³‚ê‚Ä‚¢‚éŽž‚Í‘O‚ÌƒRƒ“ƒgƒ��[ƒ‹‚ÖƒtƒH�[ƒJƒX‚ðˆÚ“®
-                this.ProcessTabKey(!e.Shift);
-
-                e.Handled = true;
-                //.NET Framework 2.0ˆÈ�~
-                e.SuppressKeyPress = true;
-            }
-            // Žx•¥�æ‚ÍƒNƒŠƒA‚Å‚«‚é
-            // if((int)DispGridColumn.SubContractorName)
         }
         #endregion
 
@@ -1123,7 +1108,7 @@
                     dTotal += CommonMotions.cnvDouble(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value);
                     if (CommonMotions.chkNumeric(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value)) NumericCnt++;
                 }
-                if (DataCnt == 0 || dTotal == 0 || NumericCnt == 0) return;
+                if (DataCnt <= 1 || dTotal == 0 || NumericCnt == 0) return;
                 string strTotal = CommonMotions.cnvTruncate(dTotal).ToString("#,#");
                 if (dTotal - System.Math.Floor(dTotal) != 0) strTotal = dTotal.ToString("#,#.00");
 
@@ -1559,40 +1544,6 @@
         }
         #endregion
 
-        #region Žw“±ˆõ‹‹—^‹æ•ª“ü—Í
-        /// <summary>
-        /// Žw“±ˆõ‹‹—^‹æ•ª“ü—Í
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void Grp3radioButton_CheckedChanged(object sender, EventArgs e)
-        {
-            textBox3.Enabled = false;
-            textBox3.Text = "";
-
-            // “ú�”Žw’è‚ÌŽž‚Ì‚Ý“ú�”“ü—Í—L
-            // ‘S“úŽž�ÄŒvŽZ
-            if (radioButton7.Checked)
-            {
-                // Žw“±ˆõŽÒ‹‹—^Œo”ï�ÄŒvŽZ
-                if (!m_bInitFlg) CreateInstructorCosts(false);
-            }
-            else if (radioButton8.Checked)
-            {
-                // Žw“±ˆõŽÒ‹‹—^Œo”ïƒNƒŠƒA
-                if (!m_bInitFlg) ClearDetailLine((int)CostsRowLine.InstructorRowLine);
-            }
-            else if (radioButton9.Checked)
-            {
-                textBox3.Enabled = true;
-                textBox3.Focus();
-            }
-
-            // •Ï�Xƒtƒ‰ƒOON
-            m_bChengeAns = true;
-        }
-        #endregion
-
         #region •›’S“–ŽÒ�U•ª“ú•t“ü—Í
         /// <summary>
         /// •›’S“–ŽÒ�U•ª“ú•t“ü—Í
@@ -1643,7 +1594,13 @@
         {
             CalcExpenese();
         }
+
+        private void button3_Click(object sender, EventArgs e)
+        {
+            CreateOhtherData();
+        }
         #endregion
 
+
     }
 }
\ No newline at end of file
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudget.designer.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudget.designer.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudget.designer.cs	(revision 18)
@@ -47,12 +47,6 @@
             this.panel1 = new System.Windows.Forms.Panel();
             this.lblLabel06 = new System.Windows.Forms.Label();
             this.label23 = new System.Windows.Forms.Label();
-            this.pnlGroup3 = new System.Windows.Forms.Panel();
-            this.label22 = new System.Windows.Forms.Label();
-            this.radioButton7 = new System.Windows.Forms.RadioButton();
-            this.textBox3 = new System.Windows.Forms.TextBox();
-            this.radioButton8 = new System.Windows.Forms.RadioButton();
-            this.radioButton9 = new System.Windows.Forms.RadioButton();
             this.pnlGroup2 = new System.Windows.Forms.Panel();
             this.label9 = new System.Windows.Forms.Label();
             this.radioButton4 = new System.Windows.Forms.RadioButton();
@@ -126,8 +120,8 @@
             this.btnOtherProc = new System.Windows.Forms.Button();
             this.button1 = new System.Windows.Forms.Button();
             this.button2 = new System.Windows.Forms.Button();
+            this.button3 = new System.Windows.Forms.Button();
             this.panel1.SuspendLayout();
-            this.pnlGroup3.SuspendLayout();
             this.pnlGroup2.SuspendLayout();
             this.pnlGroup1.SuspendLayout();
             this.pnlApproval.SuspendLayout();
@@ -199,7 +193,6 @@
             this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.panel1.Controls.Add(this.lblLabel06);
             this.panel1.Controls.Add(this.label23);
-            this.panel1.Controls.Add(this.pnlGroup3);
             this.panel1.Controls.Add(this.pnlGroup2);
             this.panel1.Controls.Add(this.label10);
             this.panel1.Controls.Add(this.label8);
@@ -252,81 +245,6 @@
             this.label23.Text = "ç™ºæ³¨è€…å��ç§°";
             this.label23.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
-            // pnlGroup3
-            // 
-            this.pnlGroup3.BackColor = System.Drawing.Color.MistyRose;
-            this.pnlGroup3.Controls.Add(this.label22);
-            this.pnlGroup3.Controls.Add(this.radioButton7);
-            this.pnlGroup3.Controls.Add(this.textBox3);
-            this.pnlGroup3.Controls.Add(this.radioButton8);
-            this.pnlGroup3.Controls.Add(this.radioButton9);
-            this.pnlGroup3.Location = new System.Drawing.Point(959, 122);
-            this.pnlGroup3.Name = "pnlGroup3";
-            this.pnlGroup3.Size = new System.Drawing.Size(360, 30);
-            this.pnlGroup3.TabIndex = 62;
-            // 
-            // label22
-            // 
-            this.label22.AutoSize = true;
-            this.label22.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label22.Location = new System.Drawing.Point(328, 7);
-            this.label22.Name = "label22";
-            this.label22.Size = new System.Drawing.Size(25, 16);
-            this.label22.TabIndex = 15;
-            this.label22.Text = "æ—¥";
-            // 
-            // radioButton7
-            // 
-            this.radioButton7.AutoSize = true;
-            this.radioButton7.Checked = true;
-            this.radioButton7.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.radioButton7.Location = new System.Drawing.Point(7, 5);
-            this.radioButton7.Name = "radioButton7";
-            this.radioButton7.Size = new System.Drawing.Size(94, 20);
-            this.radioButton7.TabIndex = 6;
-            this.radioButton7.TabStop = true;
-            this.radioButton7.Text = "å…¨æ—¥æŒ¯åˆ†";
-            this.radioButton7.UseVisualStyleBackColor = true;
-            this.radioButton7.CheckedChanged += new System.EventHandler(this.Grp3radioButton_CheckedChanged);
-            // 
-            // textBox3
-            // 
-            this.textBox3.BackColor = System.Drawing.Color.White;
-            this.textBox3.Enabled = false;
-            this.textBox3.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.textBox3.Location = new System.Drawing.Point(272, 4);
-            this.textBox3.MaxLength = 6;
-            this.textBox3.Name = "textBox3";
-            this.textBox3.Size = new System.Drawing.Size(56, 23);
-            this.textBox3.TabIndex = 13;
-            this.textBox3.TabStop = false;
-            this.textBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
-            this.textBox3.Validated += new System.EventHandler(this.textBox3_Validated);
-            // 
-            // radioButton8
-            // 
-            this.radioButton8.AutoSize = true;
-            this.radioButton8.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.radioButton8.Location = new System.Drawing.Point(101, 5);
-            this.radioButton8.Name = "radioButton8";
-            this.radioButton8.Size = new System.Drawing.Size(77, 20);
-            this.radioButton8.TabIndex = 7;
-            this.radioButton8.Text = "æœªæŒ¯åˆ†";
-            this.radioButton8.UseVisualStyleBackColor = true;
-            this.radioButton8.CheckedChanged += new System.EventHandler(this.Grp3radioButton_CheckedChanged);
-            // 
-            // radioButton9
-            // 
-            this.radioButton9.AutoSize = true;
-            this.radioButton9.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.radioButton9.Location = new System.Drawing.Point(178, 5);
-            this.radioButton9.Name = "radioButton9";
-            this.radioButton9.Size = new System.Drawing.Size(94, 20);
-            this.radioButton9.TabIndex = 14;
-            this.radioButton9.Text = "æ—¥æ•°æŒ‡å®š";
-            this.radioButton9.UseVisualStyleBackColor = true;
-            this.radioButton9.CheckedChanged += new System.EventHandler(this.Grp3radioButton_CheckedChanged);
-            // 
             // pnlGroup2
             // 
             this.pnlGroup2.BackColor = System.Drawing.Color.Beige;
@@ -1215,7 +1133,7 @@
             // button1
             // 
             this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.button1.Location = new System.Drawing.Point(1300, 555);
+            this.button1.Location = new System.Drawing.Point(1300, 531);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(37, 35);
             this.button1.TabIndex = 101;
@@ -1227,7 +1145,7 @@
             // button2
             // 
             this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.button2.Location = new System.Drawing.Point(1300, 591);
+            this.button2.Location = new System.Drawing.Point(1300, 566);
             this.button2.Name = "button2";
             this.button2.Size = new System.Drawing.Size(37, 35);
             this.button2.TabIndex = 101;
@@ -1236,6 +1154,18 @@
             this.button2.Visible = false;
             this.button2.Click += new System.EventHandler(this.button2_Click);
             // 
+            // button3
+            // 
+            this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.button3.Location = new System.Drawing.Point(1300, 601);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(37, 35);
+            this.button3.TabIndex = 102;
+            this.button3.Text = "ï¼’";
+            this.button3.UseVisualStyleBackColor = true;
+            this.button3.Visible = false;
+            this.button3.Click += new System.EventHandler(this.button3_Click);
+            // 
             // FrmConstructionBudget
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@@ -1242,6 +1172,7 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
             this.BackColor = System.Drawing.Color.Black;
             this.ClientSize = new System.Drawing.Size(1344, 692);
+            this.Controls.Add(this.button3);
             this.Controls.Add(this.button2);
             this.Controls.Add(this.button1);
             this.Controls.Add(this.btnOtherProc);
@@ -1268,11 +1199,8 @@
             this.Load += new System.EventHandler(this.FrmConstructionBudget_Load);
             this.Shown += new System.EventHandler(this.FrmConstructionBudget_Shown);
             this.SizeChanged += new System.EventHandler(this.FrmConstructionBudget_SizeChanged);
-            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmConstructionBudget_KeyDown);
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
-            this.pnlGroup3.ResumeLayout(false);
-            this.pnlGroup3.PerformLayout();
             this.pnlGroup2.ResumeLayout(false);
             this.pnlGroup2.PerformLayout();
             this.pnlGroup1.ResumeLayout(false);
@@ -1338,8 +1266,6 @@
         private System.Windows.Forms.RadioButton radioButton3;
         private System.Windows.Forms.RadioButton radioButton2;
         private System.Windows.Forms.RadioButton radioButton1;
-        private System.Windows.Forms.RadioButton radioButton8;
-        private System.Windows.Forms.RadioButton radioButton7;
         private System.Windows.Forms.RadioButton radioButton5;
         private System.Windows.Forms.RadioButton radioButton4;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
@@ -1361,18 +1287,15 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column13;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column16;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column17;
-        private System.Windows.Forms.Label label22;
-        private System.Windows.Forms.TextBox textBox3;
-        private System.Windows.Forms.RadioButton radioButton9;
         private System.Windows.Forms.Label label9;
         private System.Windows.Forms.TextBox textBox2;
         private System.Windows.Forms.RadioButton radioButton6;
         private System.Windows.Forms.Panel pnlGroup1;
-        private System.Windows.Forms.Panel pnlGroup3;
         private System.Windows.Forms.Panel pnlGroup2;
         private System.Windows.Forms.Label lblLabel06;
         private System.Windows.Forms.Label label23;
         private System.Windows.Forms.Button button1;
         private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.Button button3;
     }
 }
\ No newline at end of file
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudgetAuxiliary.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudgetAuxiliary.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudgetAuxiliary.cs	(revision 18)
@@ -196,6 +196,7 @@
                 PersonInChargeMaster picRec = new PersonInChargeMaster();
                 if(!picDB.SelectAction(strPerson,ref picRec)) return false;
 
+                m_ExpensesList.Clear();
                 // éƒ¨ç½²çµŒè²»çŽ‡ãƒžã‚¹ã‚¿å�–å¾—
                 string strSQL = "SELECT A.NAMESTRING, NVL(B.EXPENSESRATIO, 0), B.NAMECODE";
                 strSQL += " FROM DIVISIONMASTER A";
@@ -255,7 +256,6 @@
 
             m_DspLabelCtrl[(int)DspLblCtrlName.SalaryDays] = textBox1;
             m_DspLabelCtrl[(int)DspLblCtrlName.A_SalaryDays] = textBox2;
-            m_DspLabelCtrl[(int)DspLblCtrlName.I_SalaryDays] = textBox3;
 
             // ãƒ‡ãƒ¼ã‚¿è¡Œæ•°
             int DispLineCnt = Enum.GetNames(typeof(CostsRowLine)).Length;
@@ -406,11 +406,11 @@
                 strSQL = cbidDB.CreatePrimarykeyString(m_ConstructionCode, (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
                 ConstructionBaseInfoDetail workRec = new ConstructionBaseInfoDetail();
                 if (!cbidDB.SelectAction(strSQL, ref workRec)) return false;
-                
+
                 // å·¥äº‹å��ç§°
                 m_DspLabelCtrl[(int)DspLblCtrlName.ConstName].Text = workRec.DetailString;
                 m_HeaderToolTip.SetToolTip(m_DspLabelCtrl[(int)DspLblCtrlName.ConstName], workRec.DetailString);
-                
+
                 // å·¥äº‹å ´æ‰€
                 strSQL = cbidDB.CreatePrimarykeyString(m_ConstructionCode);
                 strSQL += string.Format(" And (DetailNo = {0} Or DetailNo = {1} Or DetailNo = {2})",
@@ -471,11 +471,11 @@
                     m_HeaderToolTip.SetToolTip(m_DspLabelCtrl[(int)DspLblCtrlName.AssistantName], subPersonRec.PersonName);
                 }
 
-                // æŒ‡å°Žå“¡å�–å¾—
-                pnlGroup3.Visible = false;
+                // æŒ‡å°Žå“¡ã�¯ç©ºã‚‰ã�šå…¨æ—¥ï¼ˆ2016/10/25ï¼‰
+                //pnlGroup3.Visible = false;
                 if (m_Instructor != 0)
                 {
-                    pnlGroup3.Visible = true;
+                    //    pnlGroup3.Visible = true;
                     strSQL = picDB.CreatePrimarykeyString(m_Instructor);
                     PersonInChargeMaster instructorRec = new PersonInChargeMaster();
                     picDB.SelectAction(strSQL, ref instructorRec);
@@ -530,17 +530,6 @@
                     radioButton4.Checked = true;
                 }
 
-                // æŒ‡å°Žå“¡çµ¦ä¸ŽæŒ¯åˆ†åŒºåˆ†
-                if (bBudgetExist)
-                {
-                    textBox3.Enabled = false;
-                    SalaryRadioButtonCheck(cbRec.I_SalaryFlg, radioButton7, radioButton8, radioButton9, textBox3);
-                    textBox3.Text = cbRec.I_SalaryDays.ToString("#,#");
-                }
-                else
-                {
-                    radioButton7.Checked = true;
-                }
                 // ä¸€èˆ¬ãƒ¦ãƒ¼ã‚¶ãƒ¼ã�¯äººä»¶è²»ã‚’å¤‰æ›´ã�§ã��ã�ªã�„
                 int User = CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key;                  // ä¸€èˆ¬ãƒ¦ãƒ¼ã‚¶ãƒ¼
                 if (CommonMotions.LoginUserData.SecurityManagement == User)
@@ -547,7 +536,6 @@
                 {
                     pnlGroup1.Enabled = false;
                     pnlGroup2.Enabled = false;
-                    pnlGroup3.Enabled = false;
                 }
                 return true;
             }
@@ -1263,7 +1251,6 @@
                 // å�„ã‚°ãƒ«ãƒ¼ãƒ—ãƒœãƒƒã‚¯ã‚¹ã‚’ä½¿ç”¨ç¦�æ­¢ã�«ã�™ã‚‹
                 pnlGroup1.Enabled = false;
                 pnlGroup2.Enabled = false;
-                pnlGroup3.Enabled = false;
 
                 // ãƒ‡ãƒ¼ã‚¿ç·¨é›†ã�«é–¢ã�™ã‚‹ãƒœã‚¿ãƒ³ã‚’é�žè¡¨ç¤ºã�«ã�™ã‚‹
                 btnDataEntry.Visible = false;                       // ç™»éŒ²ãƒœã‚¿ãƒ³
@@ -2511,34 +2498,17 @@
 
                 // è¨­å®šç„¡æ™‚ã�¯ã‚»ãƒƒãƒˆã�—ã�ªã�„
                 if (PersonCode == 0) goto GridSet;
-                if (!pnlGroup3.Visible) goto GridSet;
 
-                if (radioButton7.Checked)
-                {   // ----- å…¨æ—¥æŒ¯åˆ†
-                    // å·¥æœŸå�–å¾—
-                    BetweenTimes = CommonMotions.cnvDouble(m_DspLabelCtrl[(int)DspLblCtrlName.BetweenTimes].Text);
-                    // çµ¦ä¸Žè¨ˆç®—
-                    CostsValue = CommonMotions.cnvRound(CommonDefine.InstructorMonthryCost * BetweenTimes);
-                    Content = string.Format(CommonDefine.s_SalaryCostMonthlyFormat, BetweenTimes, CommonDefine.InstructorMonthryCost.ToString("#,0"));
-                }
-                else if (radioButton8.Checked)
-                {
-                    CodeType = 0;
-                    PersonCode = 0;
-                }
-                else if (radioButton9.Checked)
-                {   // ----- æ—¥æ•°æŒ‡å®š
-                    // æ—¥æ•°å�–å¾—
-                    int daycount = CommonMotions.cnvInt(m_DspLabelCtrl[(int)DspLblCtrlName.I_SalaryDays].Text);
-                    // æ—¥é¡�çµ¦ä¸Žå�–å¾—
-                    double daylySalary = CommonMotions.cnvRound(CommonDefine.AssistantMonthryCost / CommonDefine.s_ManHourUnitMonth);
-                    CostsValue = CommonMotions.cnvRound(daylySalary * daycount);
-                    Content = string.Format(CommonDefine.s_SalaryCostDaylyFormat, daycount.ToString("0"), daylySalary.ToString("#,0"));
-                }
+                // ----- å…¨æ—¥æŒ¯åˆ†
+                // å·¥æœŸå�–å¾—
+                BetweenTimes = CommonMotions.cnvDouble(m_DspLabelCtrl[(int)DspLblCtrlName.BetweenTimes].Text);
+                // çµ¦ä¸Žè¨ˆç®—
+                CostsValue = CommonMotions.cnvRound(CommonDefine.InstructorMonthryCost * BetweenTimes);
+                Content = string.Format(CommonDefine.s_SalaryCostMonthlyFormat, BetweenTimes, CommonDefine.InstructorMonthryCost.ToString("#,0"));
 
                 // å·¥äº‹å†…å®¹
                 if (!CheckUserAndLeader()) Content = string.Empty;
-                
+
             GridSet:
 
                 DataGridView dgv = dgvAllDisplay;
@@ -3502,22 +3472,8 @@
                     work.A_SalaryDays = CommonMotions.cnvInt(textBox2.Text);
                 }
 
-                // æŒ‡å°Žå“¡çµ¦ä¸ŽæŒ¯åˆ†åŒºåˆ†
-                HopeValue = 0; ExecValue = 0;
-                GetInstructorLineValue(ref HopeValue, ref ExecValue);
-                if (radioButton7.Checked)
-                {
-                    work.I_SalaryFlg = (int)CommonDefine.SalaryDevision.All;       // å…¨æ—¥
-                }
-                else if (radioButton8.Checked)
-                {
-                    work.I_SalaryFlg = (int)CommonDefine.SalaryDevision.Noting;    // æŒ¯åˆ†ç„¡
-                }
-                else if (radioButton6.Checked)
-                {
-                    work.I_SalaryFlg = (int)CommonDefine.SalaryDevision.DaysInput; // æ—¥æ•°å…¥åŠ›
-                    work.I_SalaryDays = CommonMotions.cnvInt(textBox3.Text);
-                }
+                // æŒ‡å°Žå“¡ã�¯è¨­å®šã�•ã‚Œã�¦ã�„ã‚Œã�°å¿…ã�šå…¨æ—¥
+                if (m_Instructor != 0) work.I_SalaryFlg = (int)CommonDefine.SalaryDevision.All;       // å…¨æ—¥
 
                 // æ¤œç´¢æ–‡å­—åˆ—ä½œæˆ�
                 string strWhere = BudgetDB.CreatePrimarykeyString(work.ConstructionCode);
@@ -4538,6 +4494,49 @@
             }
         }
         #endregion
+
+        #region æœªä½œæˆ�ãƒ‡ãƒ¼ã‚¿è¡Œä½œæˆ�å‡¦ç�†
+        /// <summary>
+        /// æœªä½œæˆ�ãƒ‡ãƒ¼ã‚¿è¡Œä½œæˆ�å‡¦ç�†
+        /// </summary>
+        private void CreateOhtherData()
+        {
+            IOConstructionLedger LedgerDB = new IOConstructionLedger();
+            FrmConstructionLedger frm = new FrmConstructionLedger();
+
+            try
+            {
+                string strSQL = "SELECT B.CONSTRUCTIONCODE FROM CONSTRUCTIONLEDGER A, CONSTRUCTIONBASEINFO B WHERE A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE AND B.CONSTRUCTIONPERIOD = 16";
+                ArrayList arList = new ArrayList();
+                if (!LedgerDB.ExecuteReader(strSQL, ref arList)) return;
+                foreach (object[] CurRec in arList)
+                {
+                    // å·¥äº‹ã‚³ãƒ¼ãƒ‰ã�®ã‚»ãƒƒãƒˆ
+                    frm.ConstructionCode = CommonMotions.cnvInt(CurRec[0]);
+
+                    // è¦‹ã�ˆã�ªã�„ç”»é�¢ã‚’å‡ºã�™
+                    frm.Hide();
+                    // ãƒ•ã‚©ãƒ¼ãƒ é�žè¡¨ç¤º
+                    //frm.Visible = false;
+
+                    // å†�è¨ˆç®—å‡¦ç�†
+                    if (!frm.RecalculateLedger) break;
+                }
+                // ç”»é�¢ã‚’é–‰ã�˜ã‚‹
+                frm.Close();
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                LedgerDB.close(); LedgerDB = null;
+
+                frm.Dispose(); frm = null;
+            }
+        }
+        #endregion
         // ---------- ãƒ‡ãƒ¼ã‚¿ã‚³ãƒ³ãƒ�ãƒ¼ãƒˆãƒ­ã‚¸ãƒƒã‚¯
     }
 }
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/ProcessControl.cs	(revision 18)
@@ -209,6 +209,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.cs	(revision 18)
@@ -1215,7 +1215,7 @@
                     dTotal += CommonMotions.cnvDouble(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value);
                     if (CommonMotions.chkNumeric(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value)) NumericCnt++;
                 }
-                if (DataCnt == 0 || dTotal == 0 || NumericCnt == 0) return;
+                if (DataCnt <= 1 || dTotal == 0 || NumericCnt == 0) return;
                 string strTotal = CommonMotions.cnvTruncate(dTotal).ToString("#,#");
                 if (dTotal - System.Math.Floor(dTotal) != 0) strTotal = dTotal.ToString("#,#.00");
 
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedgerAuxiliary.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedgerAuxiliary.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedgerAuxiliary.cs	(revision 18)
@@ -628,6 +628,9 @@
                     // æ”¯æ‰•å�¯èƒ½é¡�ã‚’æ”¯æ‰•è£œå¡«æž ã�¸ã‚»ãƒƒãƒˆã�™ã‚‹
                     int Burdens = GridColCnt + (int)ColPayTotal.PaymentBurdens;
                     int Results = GridColCnt + (int)ColPayTotal.Results;
+                    // æ®‹é‡‘ã�Œç„¡ã�‘ã‚Œã�°æ¬¡ã�®è¡Œã�¸ç§»å‹•ã�™ã‚‹
+                    if (CommonMotions.cnvInt(CurRow.Cells[Results].Value) < 1) continue;
+                    // æ®‹é‡‘ã‚’ã‚»ãƒƒãƒˆã�™ã‚‹
                     CurRow.Cells[Burdens].Value = CommonMotions.cnvInt(CurRow.Cells[Results].Value).ToString("#,0");
                 }
             }
@@ -1006,6 +1009,7 @@
 
                 dwork = dInput / dBase * 100.0;
 
+                if (dwork < -999.00 || 999.00 < dwork) dwork = 0;
                 return dwork;
             }
             catch (Exception ex)
@@ -1263,7 +1267,7 @@
                     RowData[(int)GridColumn.No] = string.Format("{0}-{1}", GroupNo, ++icnt);
                     RowData[(int)GridColumn.FixFlg] = "*";
                     RowData[(int)GridColumn.GroupCount] = GroupNo;
-                    RowData[(int)GridColumn.ComponentCode] = CommonMotions.cnvDouble(wrkExpense[(int)ExpensesArray.NameCode]);
+                    RowData[(int)GridColumn.ComponentCode] = CommonMotions.cnvInt(wrkExpense[(int)ExpensesArray.NameCode]);
                     RowData[(int)GridColumn.ItemName] = string.Format("{0}({1}%)", strVallue, dExpenses.ToString("0.00"));
                     RowData[(int)GridColumn.CompanyType] = 0;
                     RowData[(int)GridColumn.CompanyCode] = 0;
@@ -1953,12 +1957,14 @@
                 // å�ˆè¨ˆæ¬„ä½�ç½®å�–å¾—
                 int TotalPoint = dgv.ColumnCount + (int)ColPayTotal.Totals;
 
+                // å�ˆè¨ˆé‡‘é¡�è¡Œå�–å¾—
+                int AllTotalRow = m_CostsRowCount[(int)CostsRowLine.AllTotalRowLine];
                 // å�ˆè¨ˆé‡‘é¡�å�–å¾—
-                int AllTotalRow = m_CostsRowCount[(int)CostsRowLine.AllTotalRowLine];
                 int AllTotal = CommonMotions.cnvInt(dgv.Rows[AllTotalRow].Cells[TotalPoint].Value);
 
                 // è«‹æ±‚é‡‘é¡�è¡Œæ•°å�–å¾—
                 int BillingAmountRow = m_CostsRowCount[(int)CostsRowLine.BillingAmountRowLine];
+                // è«‹æ±‚é‡‘é¡�è¡Œå�–å¾—
                 int BillingAmount = CommonMotions.cnvInt(dgv.Rows[BillingAmountRow].Cells[TotalPoint].Value);
 
                 int LineCnt = m_CostsRowCount[(int)CostsRowLine.CurrentProfitRowLine];
@@ -2305,6 +2311,14 @@
                 ConstructionLedgerDetail SaveBillingData = new ConstructionLedgerDetail();
                 foreach (ConstructionLedgerDetail DetailRec in DetailList)
                 {
+                    // ------ èª­ã�¿é£›ã�°ã�—ãƒ‡ãƒ¼ã‚¿(2016/10/20ã€€ä½œæˆ�ã�•ã‚Œã�¦ã�„ã�ªã�„ã�‹ã�£ã�Ÿãƒ‡ãƒ¼ã‚¿è¡Œã‚’ä½œæˆ�ã�™ã‚‹ã‚ˆã�†ã�«ã�—ã�Ÿ)
+                    // ç´”åˆ©ç›Šã�¯èª­ã�¿è¾¼ã�¾ã�ªã�„
+                    if (DetailRec.GroupCount == (int)DataGroup.NetIncome) continue;
+                    // å�ˆè¨ˆé‡‘é¡�ã�¯èª­ã�¿è¾¼ã�¾ã�ªã�„
+                    if (DetailRec.GroupCount == (int)DataGroup.AllTotal) continue;
+                    // ç�¾åœ¨åˆ©ç›Šé‡‘é¡�ã�¯èª­ã�¿è¾¼ã�¾ã�ªã�„
+                    if (DetailRec.GroupCount == (int)DataGroup.CurrentProfit) continue;
+
                     // ã‚°ãƒ«ãƒ¼ãƒ—ç•ªå�·ã�Œé�•ã�ˆã�°ã‚¿ã‚¤ãƒˆãƒ«è¡Œè¡¨ç¤º
                     if (GroupNo != DetailRec.GroupCount)
                     {
@@ -2335,6 +2349,7 @@
                     SetDisplayNo(DetailRec, GroupNo, ref Block, ref icnt, ref RowData, ref strParentNo, ref childNo);
 
                     RowData[(int)GridColumn.GroupCount] = DetailRec.GroupCount;
+                    RowData[(int)GridColumn.ComponentCode] = DetailRec.ComponentCode;
                     RowData[(int)GridColumn.ItemName] = DetailRec.FirstString;
                     RowData[(int)GridColumn.TextName] = DetailRec.SecondString;
                     RowData[(int)GridColumn.CompanyType] = DetailRec.CompanyType;
@@ -3819,9 +3834,9 @@
         }
         #endregion
 
-        #region å·¥äº‹äºˆç®—æ›¸ãƒ‡ãƒ¼ã‚¿æ˜Žç´°ç™»éŒ²
+        #region å·¥äº‹è©³ç´°å�°å¸³ãƒ‡ãƒ¼ã‚¿æ˜Žç´°ç™»éŒ²
         /// <summary>
-        /// å·¥äº‹äºˆç®—æ›¸ãƒ‡ãƒ¼ã‚¿æ˜Žç´°ç™»éŒ²
+        /// å·¥äº‹è©³ç´°å�°å¸³ãƒ‡ãƒ¼ã‚¿æ˜Žç´°ç™»éŒ²
         /// </summary>
         private bool ConstructionLedgerDetailEntry(IOConstructionLedgerDetail DetailDB)
         {
@@ -3837,12 +3852,12 @@
                 foreach (DataGridViewRow wrkRow in dgv.Rows)
                 {
                     RowLineCnt++;
-                    // ç´”åˆ©ç›Šã�¯æ›¸ã��è¾¼ã�¾ã�ªã�„
-                    if (CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.GroupCount].Value) == (int)DataGroup.NetIncome) continue;
-                    // å�ˆè¨ˆé‡‘é¡�ã�¯æ›¸ã��è¾¼ã�¾ã�ªã�„
-                    if (CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.GroupCount].Value) == (int)DataGroup.AllTotal) continue;
-                    // ç�¾åœ¨åˆ©ç›Šé‡‘é¡�ã�¯æ›¸ã��è¾¼ã�¾ã�ªã�„
-                    if (CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.GroupCount].Value) == (int)DataGroup.CurrentProfit) continue;
+                    //// ç´”åˆ©ç›Šã�¯æ›¸ã��è¾¼ã�¾ã�ªã�„ï¼ˆ2016/10/20ã€€ãƒ‡ãƒ¼ã‚¿ã‚’ä½œæˆ�ã�™ã‚‹ï¼‰
+                    //if (CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.GroupCount].Value) == (int)DataGroup.NetIncome) continue;
+                    //// å�ˆè¨ˆé‡‘é¡�ã�¯æ›¸ã��è¾¼ã�¾ã�ªã�„
+                    //if (CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.GroupCount].Value) == (int)DataGroup.AllTotal) continue;
+                    //// ç�¾åœ¨åˆ©ç›Šé‡‘é¡�ã�¯æ›¸ã��è¾¼ã�¾ã�ªã�„
+                    //if (CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.GroupCount].Value) == (int)DataGroup.CurrentProfit) continue;
 
                     // ãƒ‡ãƒ¼ã‚¿å®šç¾©
                     ConstructionLedgerDetail work = new ConstructionLedgerDetail();
@@ -3885,8 +3900,24 @@
                     work.CompanyName = CommonMotions.cnvString(wrkRow.Cells[(int)GridColumn.CompanyName].Value);
                     // ç©�ç®—æ™‚è¦‹ç©�é‡‘é¡�
                     work.EstimatePrice = CommonMotions.cnvDouble(wrkRow.Cells[(int)GridColumn.EstimatePrice].Value);
+
                     // å®Ÿè¡Œé‡‘é¡�
-                    work.ExecutionAmount = CommonMotions.cnvDouble(wrkRow.Cells[(int)GridColumn.ExecPrice].Value);
+                    switch (work.GroupCount)
+                    {
+                        // 14:è«‹æ±‚é‡‘é¡�
+                        case (int)DataGroup.BillingAmount:
+                        // 15:ç�¾åœ¨åˆ©ç›Šé‡‘é¡�
+                        case (int)DataGroup.CurrentProfit:
+                            int TotalPoint = dgv.ColumnCount + (int)ColPayTotal.Totals;
+                            work.ExecutionAmount = CommonMotions.cnvDouble(wrkRow.Cells[TotalPoint].Value);
+                            break;
+                        default:
+                            // 1ï½ž12ï¼šæ™®é€šè¡Œãƒ‡ãƒ¼ã‚¿
+                            // 13:å�ˆè¨ˆé‡‘é¡�
+                            work.ExecutionAmount = CommonMotions.cnvDouble(wrkRow.Cells[(int)GridColumn.ExecPrice].Value);
+                            break;
+                    }
+
                     // é‡‘é¡�æ§‹æˆ�çŽ‡
                     work.AmountConfigRate = CommonMotions.cnvDouble(wrkRow.Cells[(int)GridColumn.Percent].Value);
                     // æ”¯æ‰•è£œå¡«é¡�
@@ -3958,9 +3989,9 @@
         }
         #endregion
 
-        #region å·¥äº‹äºˆç®—æ›¸æ”¯æ‰•ãƒ‡ãƒ¼ã‚¿ç™»éŒ²
+        #region å·¥äº‹è©³ç´°å�°å¸³æ”¯æ‰•ãƒ‡ãƒ¼ã‚¿ç™»éŒ²
         /// <summary>
-        /// å·¥äº‹äºˆç®—æ›¸æ”¯æ‰•ãƒ‡ãƒ¼ã‚¿ç™»éŒ²
+        /// å·¥äº‹è©³ç´°å�°å¸³æ”¯æ‰•ãƒ‡ãƒ¼ã‚¿ç™»éŒ²
         /// </summary>
         private bool ConstructionLedgerExcuteEntry(IOConstructionLedgerExcute ExcuteDB)
         {
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/ProcessControl.cs	(revision 18)
@@ -209,6 +209,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.cs	(revision 18)
@@ -58,11 +58,11 @@
             /// <summary>
             /// �HŽ–ƒR�[ƒh
             /// </summary>
-            ConstructionCode,
+            SelectionCode,
             /// <summary>
             /// �HŽ––¼�Ì
             /// </summary>
-            ConstructionName,
+            SelectionName,
             /// <summary>
             /// �HŽ–�i’»�ó‘Ô
             /// </summary>
@@ -125,23 +125,27 @@
         private enum RowTitleNum
         {
             /// <summary>
-            /// Ž{�H’†�‡Œv�s
+            /// Ž{�H’†�‡Œv
             /// </summary>
             Execution = 0,
             /// <summary>
-            /// Š®—¹�Ï‚Ý
+            /// Š®—¹�ÏŒv
             /// </summary>
             Completed,
             /// <summary>
-            /// Œo”ïŒv�s
+            /// ‘S�HŽ–Œv
             /// </summary>
+            AllConstrutions,
+            /// <summary>
+            /// Œo”ï�‡Œv
+            /// </summary>
             Expenses,
             /// <summary>
-            /// •â�•�U•ª
+            /// •â�•�U•ªŒv
             /// </summary>
             Auxiliary,
             /// <summary>
-            /// ‘��‡Œv�s
+            /// ‘��‡Œv
             /// </summary>
             AllTotal,
         }
@@ -151,8 +155,9 @@
         /// </summary>
         private static string[] s_TotalTitleArray = new string[] {  "�–Ž{�@�H�@’†�@�‡�@Œv�–",
                                                                     "�–Š®�@—¹�@�Ï�@�‡�@Œv�–",
+                                                                    "�–‘S�@�H�@Ž–�@�‡�@Œv�–",
                                                                     "�–�@Œo�@�@”ï�@�@Œv�@�–",
-                                                                    "�–�U�@•ª�@•â�@�•�@Œv�–",
+                                                                    "�–�l Œ� ”ï �U •ª Œv�–",
                                                                     "�–�–�@‘��@�‡�@Œv�@�–�–",
                                                                 };
         #endregion
@@ -161,8 +166,9 @@
         /// <summary>
         /// ƒOƒŠƒbƒh�€–Ú�sƒ^ƒCƒgƒ‹
         /// </summary>
-        private static string[] s_GroupTitle = new string[] {"•› ’S “– ŽÒ ‹‹ —^"
-                                                            ,"Žw “± ˆõ ‹‹ —^"};
+        private static string[] s_GroupTitle = new string[] {"•›’S“–ŽÒ�U•ª",
+                                                            "Žw “± ˆõ �U •ª",
+                                                            "’S“–ŽÒ‹‹—^�·Šz"};
         #endregion
         #endregion
 
@@ -216,14 +222,57 @@
         /// </summary>
         private int m_GridWidthSize = 0;
         #endregion
+
+        #region �‰Šú‘I‘ð–³‚µƒtƒ‰ƒO
+        /// <summary>
+        /// �‰Šú‘I‘ð–³‚µƒtƒ‰ƒO
+        /// </summary>
+        private bool m_FirstStartFlg = true;
         #endregion
 
+        #region �‰Šú‘I‘ð”N“x
+        /// <summary>
+        /// �‰Šú‘I‘ð”N“x
+        /// </summary>
+        private int m_FirstStartPeriod = 0;
+        #endregion
+
+        #region �‰Šú‘I‘ð•”��ƒR�[ƒh
+        /// <summary>
+        /// �‰Šú‘I‘ð•”��ƒR�[ƒh
+        /// </summary>
+        private int m_FirstStartDepartmentCode = 0;
+        #endregion
+
+        #region �‰Šú‘I‘ð’S“–ŽÒƒR�[ƒh
+        /// <summary>
+        /// �‰Šú‘I‘ð’S“–ŽÒƒR�[ƒh
+        /// </summary>
+        private int m_FirstStartPersonCode = 0;
+        #endregion
+
+        #region ŽŸƒvƒ�ƒZƒX‹N“®ƒtƒ‰ƒO
+        /// <summary>
+        /// ŽŸƒvƒ�ƒZƒX‹N“®ƒtƒ‰ƒO
+        /// </summary>
+        private bool m_NextProcFlg = false;
+        #endregion
+        #endregion
+
         #region ƒvƒ�ƒpƒeƒB
+
+        #region ‹N“®ƒtƒ‰ƒO
+        /// <summary>
+        /// ‹N“®ƒtƒ‰ƒO
+        /// </summary>
         public int ExecuteFlg
         {
             get { return m_ExecuteFlg; }
             set { m_ExecuteFlg = value; }
         }
+        #endregion
+
+        #region ƒf�[ƒ^’Ç‰Áƒ{ƒ^ƒ“•\Ž¦
         /// <summary>
         /// ƒf�[ƒ^’Ç‰Áƒ{ƒ^ƒ“•\Ž¦
         /// </summary>
@@ -234,6 +283,73 @@
         }
         #endregion
 
+        #region �‰Šú‘I‘ð–³‚µƒtƒ‰ƒO
+        /// <summary>
+        /// �‰Šú‘I‘ð–³‚µƒtƒ‰ƒO
+        /// </summary>
+        public bool FirstStartFlg
+        {
+            get { return m_FirstStartFlg; }
+            set { m_FirstStartFlg = value; }
+        }
+        #endregion
+
+        #region �‰Šú‘I‘ð”N“x
+        /// <summary>
+        /// �‰Šú‘I‘ð”N“x
+        /// </summary>
+        public int FirstStartPeriod
+        {
+            get { return m_FirstStartPeriod; }
+            set { m_FirstStartPeriod = value; }
+        }
+        #endregion
+
+        #region �‰Šú‘I‘ð•”��ƒR�[ƒh
+        /// <summary>
+        /// �‰Šú‘I‘ð•”��ƒR�[ƒh
+        /// </summary>
+        public int FirstStartDepartmentCode
+        {
+            get { return m_FirstStartDepartmentCode; }
+            set { m_FirstStartDepartmentCode = value; }
+        }
+        #endregion
+
+        #region �‰Šú‘I‘ð’S“–ŽÒƒR�[ƒh
+        /// <summary>
+        /// �‰Šú‘I‘ð’S“–ŽÒƒR�[ƒh
+        /// </summary>
+        public int FirstStartPersonCode
+        {
+            get { return m_FirstStartPersonCode; }
+            set { m_FirstStartPersonCode = value; }
+        }
+        #endregion
+
+        #region ’S“–ŽÒƒR�[ƒhŽæ“¾
+        /// <summary>
+        /// ’S“–ŽÒƒR�[ƒhŽæ“¾
+        /// </summary>
+        public int NowPersonCode
+        {
+            get { return CommonMotions.cnvInt(cmbConstructionPerson.SelectedValue); }
+        }
+        #endregion
+
+        #region ŽŸƒvƒ�ƒZƒX‹N“®ƒtƒ‰ƒO
+        /// <summary>
+        /// ŽŸƒvƒ�ƒZƒX‹N“®ƒtƒ‰ƒO
+        /// </summary>
+        public bool NextProcFlg
+        {
+            get { return m_NextProcFlg; }
+            set { m_NextProcFlg = value; }
+        }
+        #endregion
+
+        #endregion
+
         #region ƒRƒ“ƒXƒgƒ‰ƒNƒ^
         public FrmConstructionLedgerList()
         {
@@ -296,10 +412,10 @@
         {
             // ƒf�[ƒ^‚ª‚È‚¢�ê�‡‚Í”²‚¯‚é
             if (dgvMaster.RowCount == 0) return;
-            if (CommonMotions.chkCellBlank(dgvMaster.CurrentRow.Cells[(int)DispColumn.ConstructionName].Value)) return;
+            if (CommonMotions.chkCellBlank(dgvMaster.CurrentRow.Cells[(int)DispColumn.SelectionName].Value)) return;
 
             // Še�ˆ—�‹N“®
-            SubProcessExecute(CommonMotions.cnvIntFromStringCode(dgvMaster.CurrentRow.Cells[(int)DispColumn.ConstructionCode].Value.ToString(), "-"));
+            SubProcessExecute(CommonMotions.cnvIntFromStringCode(dgvMaster.CurrentRow.Cells[(int)DispColumn.SelectionCode].Value.ToString(), "-"));
         }
         #endregion
 
@@ -313,13 +429,15 @@
         {
 
             // ƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
+            SetcmbPeriod();
             InitcmbDepartment();
             InitcmbPersons();
+
             // ƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒg
             m_initDataLoad = true;
             SetcmbDepartment();
+            SetcmbPersons();
             m_initDataLoad = true;
-            SetcmbPersons();
 
             // ƒOƒŠƒbƒh�‰Šú�Ý’è
             SetDisplayObject();
@@ -346,14 +464,14 @@
 
             // ƒf�[ƒ^‚ª‚È‚¢�ê�‡‚Í”²‚¯‚é
             if (dgv.RowCount == 0) return;
-            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.ConstructionCode].Value)) return;
-            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.ConstructionName].Value)) return;
+            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.SelectionCode].Value)) return;
+            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.SelectionName].Value)) return;
             // –¾�×�sˆÈŠO‚Í�ˆ—�‚µ‚È‚¢
-            string strCode = CommonMotions.cnvString(CurRow.Cells[(int)DispColumn.ConstructionCode].Value);
+            string strCode = CommonMotions.cnvString(CurRow.Cells[(int)DispColumn.SelectionCode].Value);
             if (CommonMotions.cnvInt(strCode.Replace("-", "")) == 0) return;
 
             // Še�ˆ—�‹N“®
-            SubProcessExecute(CommonMotions.cnvIntFromStringCode(CurRow.Cells[(int)DispColumn.ConstructionCode].Value.ToString(), "-"));
+            SubProcessExecute(CommonMotions.cnvIntFromStringCode(CurRow.Cells[(int)DispColumn.SelectionCode].Value.ToString(), "-"));
         }
         #endregion
 
@@ -429,6 +547,11 @@
 
             // ƒf�[ƒ^•\Ž¦
             DataDisplay();
+            // •”��•Êˆê——‚©‚ç‚Ì‹N“®‚Í’S“–ŽÒ•Ï�XŽžƒpƒ‰ƒ��[ƒ^•Ï�X
+            if (!m_FirstStartFlg)
+            {
+                m_FirstStartPersonCode = CommonMotions.cnvInt(cmbConstructionPerson.SelectedValue);
+            }
         }
         #endregion
 
@@ -502,7 +625,7 @@
                     dTotal += CommonMotions.cnvDouble(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value);
                     if (CommonMotions.chkNumeric(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value)) NumericCnt++;
                 }
-                if (DataCnt == 0 || dTotal == 0 || NumericCnt == 0) return;
+                if (DataCnt <= 1 || dTotal == 0 || NumericCnt == 0) return;
                 string strTotal = CommonMotions.cnvTruncate(dTotal).ToString("#,#");
                 if (dTotal - System.Math.Floor(dTotal) != 0) strTotal = dTotal.ToString("#,#.00");
 
@@ -534,8 +657,8 @@
 
             // ƒf�[ƒ^‚ª‚È‚¢�ê�‡‚Í”²‚¯‚é
             if (dgv.RowCount == 0) return;
-            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.ConstructionCode].Value) &&
-                CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.ConstructionName].Value))
+            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.SelectionCode].Value) &&
+                CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.SelectionName].Value))
             {
                 return;
             }
@@ -542,7 +665,7 @@
             else
             {
                 // �‡Œv�s‚Í�ˆ—�‚µ‚È‚¢
-                string strWork = CommonMotions.cnvString(CurRow.Cells[(int)DispColumn.ConstructionName].Value);
+                string strWork = CommonMotions.cnvString(CurRow.Cells[(int)DispColumn.SelectionName].Value);
                 bool bTitle = false;
                 foreach (string strTitle in s_TotalTitleArray)
                 {
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.designer.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.designer.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.designer.cs	(revision 18)
@@ -50,22 +50,30 @@
             this.label1 = new System.Windows.Forms.Label();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.pnlPayroll = new System.Windows.Forms.Panel();
+            this.lblTotalCalcValue2 = new System.Windows.Forms.Label();
+            this.label23 = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
+            this.lblTotalCalcValue1 = new System.Windows.Forms.Label();
+            this.label19 = new System.Windows.Forms.Label();
+            this.lblPlusorMinus2 = new System.Windows.Forms.Label();
+            this.label16 = new System.Windows.Forms.Label();
+            this.lblPlusorMinus1 = new System.Windows.Forms.Label();
+            this.lblTotalCalcValue = new System.Windows.Forms.Label();
             this.label12 = new System.Windows.Forms.Label();
-            this.label19 = new System.Windows.Forms.Label();
-            this.label21 = new System.Windows.Forms.Label();
             this.label22 = new System.Windows.Forms.Label();
+            this.lblTotalValue2 = new System.Windows.Forms.Label();
+            this.label14 = new System.Windows.Forms.Label();
+            this.lblCalcValue2 = new System.Windows.Forms.Label();
             this.label20 = new System.Windows.Forms.Label();
             this.label13 = new System.Windows.Forms.Label();
-            this.label10 = new System.Windows.Forms.Label();
-            this.label16 = new System.Windows.Forms.Label();
-            this.label14 = new System.Windows.Forms.Label();
+            this.lblCalcValue3 = new System.Windows.Forms.Label();
+            this.lblTotalValue = new System.Windows.Forms.Label();
             this.label17 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.lblPayroll = new System.Windows.Forms.Label();
             this.label15 = new System.Windows.Forms.Label();
-            this.label11 = new System.Windows.Forms.Label();
+            this.lblCalcValue1 = new System.Windows.Forms.Label();
             this.label9 = new System.Windows.Forms.Label();
-            this.label18 = new System.Windows.Forms.Label();
             this.cmbDepartment = new System.Windows.Forms.ComboBox();
             this.label5 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
@@ -141,171 +149,292 @@
             this.groupBox1.ForeColor = System.Drawing.Color.White;
             this.groupBox1.Location = new System.Drawing.Point(5, 40);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(1330, 84);
+            this.groupBox1.Size = new System.Drawing.Size(1330, 124);
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabStop = false;
             // 
             // pnlPayroll
             // 
-            this.pnlPayroll.BackColor = System.Drawing.Color.Yellow;
+            this.pnlPayroll.BackColor = System.Drawing.Color.PaleGoldenrod;
             this.pnlPayroll.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.pnlPayroll.Controls.Add(this.lblTotalCalcValue2);
+            this.pnlPayroll.Controls.Add(this.label23);
+            this.pnlPayroll.Controls.Add(this.label11);
+            this.pnlPayroll.Controls.Add(this.lblTotalCalcValue1);
+            this.pnlPayroll.Controls.Add(this.label19);
+            this.pnlPayroll.Controls.Add(this.lblPlusorMinus2);
+            this.pnlPayroll.Controls.Add(this.label16);
+            this.pnlPayroll.Controls.Add(this.lblPlusorMinus1);
+            this.pnlPayroll.Controls.Add(this.lblTotalCalcValue);
             this.pnlPayroll.Controls.Add(this.label12);
-            this.pnlPayroll.Controls.Add(this.label19);
-            this.pnlPayroll.Controls.Add(this.label21);
             this.pnlPayroll.Controls.Add(this.label22);
+            this.pnlPayroll.Controls.Add(this.lblTotalValue2);
+            this.pnlPayroll.Controls.Add(this.label14);
+            this.pnlPayroll.Controls.Add(this.lblCalcValue2);
             this.pnlPayroll.Controls.Add(this.label20);
             this.pnlPayroll.Controls.Add(this.label13);
-            this.pnlPayroll.Controls.Add(this.label10);
-            this.pnlPayroll.Controls.Add(this.label16);
-            this.pnlPayroll.Controls.Add(this.label14);
+            this.pnlPayroll.Controls.Add(this.lblCalcValue3);
+            this.pnlPayroll.Controls.Add(this.lblTotalValue);
             this.pnlPayroll.Controls.Add(this.label17);
             this.pnlPayroll.Controls.Add(this.label6);
             this.pnlPayroll.Controls.Add(this.lblPayroll);
             this.pnlPayroll.Controls.Add(this.label15);
-            this.pnlPayroll.Controls.Add(this.label11);
+            this.pnlPayroll.Controls.Add(this.lblCalcValue1);
             this.pnlPayroll.Controls.Add(this.label9);
-            this.pnlPayroll.Controls.Add(this.label18);
-            this.pnlPayroll.Location = new System.Drawing.Point(5, 44);
+            this.pnlPayroll.Location = new System.Drawing.Point(5, 36);
             this.pnlPayroll.Name = "pnlPayroll";
-            this.pnlPayroll.Size = new System.Drawing.Size(1320, 34);
+            this.pnlPayroll.Size = new System.Drawing.Size(1320, 84);
             this.pnlPayroll.TabIndex = 45;
-            this.pnlPayroll.Visible = false;
             // 
+            // lblTotalCalcValue2
+            // 
+            this.lblTotalCalcValue2.BackColor = System.Drawing.Color.White;
+            this.lblTotalCalcValue2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblTotalCalcValue2.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblTotalCalcValue2.ForeColor = System.Drawing.Color.Black;
+            this.lblTotalCalcValue2.Location = new System.Drawing.Point(643, 53);
+            this.lblTotalCalcValue2.Name = "lblTotalCalcValue2";
+            this.lblTotalCalcValue2.Size = new System.Drawing.Size(140, 25);
+            this.lblTotalCalcValue2.TabIndex = 52;
+            this.lblTotalCalcValue2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label23
+            // 
+            this.label23.BackColor = System.Drawing.Color.LightSalmon;
+            this.label23.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label23.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label23.ForeColor = System.Drawing.Color.White;
+            this.label23.Location = new System.Drawing.Point(533, 53);
+            this.label23.Name = "label23";
+            this.label23.Size = new System.Drawing.Size(110, 25);
+            this.label23.TabIndex = 51;
+            this.label23.Text = "å½“æœŸç´”åˆ©ç›Š";
+            this.label23.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.label11.Font = new System.Drawing.Font("Myriad Web Pro", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label11.ForeColor = System.Drawing.Color.Black;
+            this.label11.Location = new System.Drawing.Point(807, 25);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(42, 31);
+            this.label11.TabIndex = 48;
+            this.label11.Text = "ï¼�";
+            this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblTotalCalcValue1
+            // 
+            this.lblTotalCalcValue1.BackColor = System.Drawing.Color.White;
+            this.lblTotalCalcValue1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblTotalCalcValue1.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblTotalCalcValue1.ForeColor = System.Drawing.Color.Black;
+            this.lblTotalCalcValue1.Location = new System.Drawing.Point(983, 28);
+            this.lblTotalCalcValue1.Name = "lblTotalCalcValue1";
+            this.lblTotalCalcValue1.Size = new System.Drawing.Size(140, 25);
+            this.lblTotalCalcValue1.TabIndex = 50;
+            this.lblTotalCalcValue1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label19
+            // 
+            this.label19.BackColor = System.Drawing.Color.LightSalmon;
+            this.label19.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label19.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label19.ForeColor = System.Drawing.Color.White;
+            this.label19.Location = new System.Drawing.Point(873, 28);
+            this.label19.Name = "label19";
+            this.label19.Size = new System.Drawing.Size(110, 25);
+            this.label19.TabIndex = 49;
+            this.label19.Text = "å½“æœŸç´”åˆ©ç›Š";
+            this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblPlusorMinus2
+            // 
+            this.lblPlusorMinus2.AutoSize = true;
+            this.lblPlusorMinus2.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.lblPlusorMinus2.Font = new System.Drawing.Font("Myriad Web Pro", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblPlusorMinus2.ForeColor = System.Drawing.Color.Black;
+            this.lblPlusorMinus2.Location = new System.Drawing.Point(471, 52);
+            this.lblPlusorMinus2.Name = "lblPlusorMinus2";
+            this.lblPlusorMinus2.Size = new System.Drawing.Size(35, 27);
+            this.lblPlusorMinus2.TabIndex = 47;
+            this.lblPlusorMinus2.Text = "ï¼‹";
+            this.lblPlusorMinus2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.label16.Font = new System.Drawing.Font("Myriad Web Pro", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label16.ForeColor = System.Drawing.Color.Black;
+            this.label16.Location = new System.Drawing.Point(807, 50);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(42, 31);
+            this.label16.TabIndex = 31;
+            this.label16.Text = "ï¼�";
+            this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblPlusorMinus1
+            // 
+            this.lblPlusorMinus1.AutoSize = true;
+            this.lblPlusorMinus1.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.lblPlusorMinus1.Font = new System.Drawing.Font("Myriad Web Pro", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblPlusorMinus1.ForeColor = System.Drawing.Color.Black;
+            this.lblPlusorMinus1.Location = new System.Drawing.Point(471, 27);
+            this.lblPlusorMinus1.Name = "lblPlusorMinus1";
+            this.lblPlusorMinus1.Size = new System.Drawing.Size(35, 27);
+            this.lblPlusorMinus1.TabIndex = 31;
+            this.lblPlusorMinus1.Text = "ï¼‹";
+            this.lblPlusorMinus1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblTotalCalcValue
+            // 
+            this.lblTotalCalcValue.BackColor = System.Drawing.Color.White;
+            this.lblTotalCalcValue.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblTotalCalcValue.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblTotalCalcValue.ForeColor = System.Drawing.Color.Black;
+            this.lblTotalCalcValue.Location = new System.Drawing.Point(983, 53);
+            this.lblTotalCalcValue.Name = "lblTotalCalcValue";
+            this.lblTotalCalcValue.Size = new System.Drawing.Size(140, 25);
+            this.lblTotalCalcValue.TabIndex = 33;
+            this.lblTotalCalcValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
             // label12
             // 
             this.label12.AutoSize = true;
-            this.label12.BackColor = System.Drawing.Color.Yellow;
-            this.label12.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label12.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.label12.Font = new System.Drawing.Font("Myriad Web Pro", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.label12.ForeColor = System.Drawing.Color.Black;
-            this.label12.Location = new System.Drawing.Point(803, 6);
+            this.label12.Location = new System.Drawing.Point(471, 2);
             this.label12.Name = "label12";
-            this.label12.Size = new System.Drawing.Size(30, 19);
+            this.label12.Size = new System.Drawing.Size(35, 27);
             this.label12.TabIndex = 2;
             this.label12.Text = "ï¼�";
             this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
-            // label19
+            // label22
             // 
-            this.label19.BackColor = System.Drawing.Color.Yellow;
-            this.label19.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label19.ForeColor = System.Drawing.Color.Black;
-            this.label19.Location = new System.Drawing.Point(783, 5);
-            this.label19.Name = "label19";
-            this.label19.Size = new System.Drawing.Size(20, 20);
-            this.label19.TabIndex = 10;
-            this.label19.Text = "ï¼‰";
-            this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            this.label22.BackColor = System.Drawing.Color.Navy;
+            this.label22.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label22.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label22.ForeColor = System.Drawing.Color.Yellow;
+            this.label22.Location = new System.Drawing.Point(873, 53);
+            this.label22.Name = "label22";
+            this.label22.Size = new System.Drawing.Size(110, 25);
+            this.label22.TabIndex = 32;
+            this.label22.Text = "å½“æœŸæš«å®šç´”åˆ©ç›Š";
+            this.label22.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
-            // label21
+            // lblTotalValue2
             // 
-            this.label21.BackColor = System.Drawing.Color.White;
-            this.label21.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.label21.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label21.ForeColor = System.Drawing.Color.Black;
-            this.label21.Location = new System.Drawing.Point(383, 3);
-            this.label21.Name = "label21";
-            this.label21.Size = new System.Drawing.Size(140, 25);
-            this.label21.TabIndex = 46;
-            this.label21.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            this.lblTotalValue2.BackColor = System.Drawing.Color.White;
+            this.lblTotalValue2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblTotalValue2.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblTotalValue2.ForeColor = System.Drawing.Color.Black;
+            this.lblTotalValue2.Location = new System.Drawing.Point(643, 28);
+            this.lblTotalValue2.Name = "lblTotalValue2";
+            this.lblTotalValue2.Size = new System.Drawing.Size(140, 25);
+            this.lblTotalValue2.TabIndex = 33;
+            this.lblTotalValue2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
             // 
-            // label22
+            // label14
             // 
-            this.label22.AutoSize = true;
-            this.label22.BackColor = System.Drawing.Color.Yellow;
-            this.label22.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label22.ForeColor = System.Drawing.Color.Black;
-            this.label22.Location = new System.Drawing.Point(253, 6);
-            this.label22.Name = "label22";
-            this.label22.Size = new System.Drawing.Size(30, 19);
-            this.label22.TabIndex = 11;
-            this.label22.Text = "ï¼‹";
-            this.label22.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            this.label14.BackColor = System.Drawing.Color.DarkSeaGreen;
+            this.label14.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label14.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label14.ForeColor = System.Drawing.Color.DarkRed;
+            this.label14.Location = new System.Drawing.Point(533, 28);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(110, 25);
+            this.label14.TabIndex = 32;
+            this.label14.Text = "çµŒé�Žçµ¦ä¸Žå·®é¡�";
+            this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
+            // lblCalcValue2
+            // 
+            this.lblCalcValue2.BackColor = System.Drawing.Color.White;
+            this.lblCalcValue2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCalcValue2.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblCalcValue2.ForeColor = System.Drawing.Color.Black;
+            this.lblCalcValue2.Location = new System.Drawing.Point(303, 28);
+            this.lblCalcValue2.Name = "lblCalcValue2";
+            this.lblCalcValue2.Size = new System.Drawing.Size(140, 25);
+            this.lblCalcValue2.TabIndex = 46;
+            this.lblCalcValue2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
             // label20
             // 
             this.label20.BackColor = System.Drawing.Color.DarkOrange;
             this.label20.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.label20.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label20.ForeColor = System.Drawing.Color.Black;
-            this.label20.Location = new System.Drawing.Point(283, 3);
+            this.label20.ForeColor = System.Drawing.Color.White;
+            this.label20.Location = new System.Drawing.Point(193, 28);
             this.label20.Name = "label20";
-            this.label20.Size = new System.Drawing.Size(100, 25);
+            this.label20.Size = new System.Drawing.Size(110, 25);
             this.label20.TabIndex = 11;
-            this.label20.Text = "æŒ¯åˆ†æ¸ˆåˆ†ç´”åˆ©ç›Š";
+            this.label20.Text = "æŒ¯åˆ†æ¸ˆç´”åˆ©ç›Š";
             this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
             // label13
             // 
             this.label13.AutoSize = true;
-            this.label13.BackColor = System.Drawing.Color.Yellow;
-            this.label13.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label13.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.label13.Font = new System.Drawing.Font("Myriad Web Pro", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.label13.ForeColor = System.Drawing.Color.Black;
-            this.label13.Location = new System.Drawing.Point(1063, 6);
+            this.label13.Location = new System.Drawing.Point(807, 0);
             this.label13.Name = "label13";
-            this.label13.Size = new System.Drawing.Size(30, 19);
+            this.label13.Size = new System.Drawing.Size(42, 31);
             this.label13.TabIndex = 3;
             this.label13.Text = "ï¼�";
             this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
-            // label10
+            // lblCalcValue3
             // 
-            this.label10.AutoSize = true;
-            this.label10.BackColor = System.Drawing.Color.Yellow;
-            this.label10.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label10.ForeColor = System.Drawing.Color.Black;
-            this.label10.Location = new System.Drawing.Point(523, 6);
-            this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(30, 19);
-            this.label10.TabIndex = 8;
-            this.label10.Text = "ï¼‹";
-            this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            this.lblCalcValue3.BackColor = System.Drawing.Color.White;
+            this.lblCalcValue3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCalcValue3.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblCalcValue3.ForeColor = System.Drawing.Color.Black;
+            this.lblCalcValue3.Location = new System.Drawing.Point(303, 53);
+            this.lblCalcValue3.Name = "lblCalcValue3";
+            this.lblCalcValue3.Size = new System.Drawing.Size(140, 25);
+            this.lblCalcValue3.TabIndex = 7;
+            this.lblCalcValue3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
             // 
-            // label16
+            // lblTotalValue
             // 
-            this.label16.BackColor = System.Drawing.Color.White;
-            this.label16.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.label16.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label16.ForeColor = System.Drawing.Color.Black;
-            this.label16.Location = new System.Drawing.Point(643, 3);
-            this.label16.Name = "label16";
-            this.label16.Size = new System.Drawing.Size(140, 25);
-            this.label16.TabIndex = 7;
-            this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            this.lblTotalValue.BackColor = System.Drawing.Color.White;
+            this.lblTotalValue.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblTotalValue.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblTotalValue.ForeColor = System.Drawing.Color.Black;
+            this.lblTotalValue.Location = new System.Drawing.Point(983, 3);
+            this.lblTotalValue.Name = "lblTotalValue";
+            this.lblTotalValue.Size = new System.Drawing.Size(140, 25);
+            this.lblTotalValue.TabIndex = 5;
+            this.lblTotalValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
             // 
-            // label14
-            // 
-            this.label14.BackColor = System.Drawing.Color.White;
-            this.label14.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.label14.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label14.ForeColor = System.Drawing.Color.Black;
-            this.label14.Location = new System.Drawing.Point(1153, 3);
-            this.label14.Name = "label14";
-            this.label14.Size = new System.Drawing.Size(140, 25);
-            this.label14.TabIndex = 5;
-            this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
-            // 
             // label17
             // 
-            this.label17.BackColor = System.Drawing.Color.DarkOrange;
+            this.label17.BackColor = System.Drawing.Color.Green;
             this.label17.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.label17.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label17.ForeColor = System.Drawing.Color.Black;
-            this.label17.Location = new System.Drawing.Point(553, 3);
+            this.label17.ForeColor = System.Drawing.Color.White;
+            this.label17.Location = new System.Drawing.Point(193, 53);
             this.label17.Name = "label17";
-            this.label17.Size = new System.Drawing.Size(90, 25);
+            this.label17.Size = new System.Drawing.Size(110, 25);
             this.label17.TabIndex = 6;
-            this.label17.Text = "æœªæŒ¯åˆ†ç²—åˆ©ç›Š";
+            this.label17.Text = "æœªæŒ¯åˆ†ç´”åˆ©ç›Š";
             this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
             // label6
             // 
-            this.label6.BackColor = System.Drawing.Color.DarkOrange;
+            this.label6.BackColor = System.Drawing.Color.Black;
             this.label6.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.label6.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label6.ForeColor = System.Drawing.Color.Black;
-            this.label6.Location = new System.Drawing.Point(833, 3);
+            this.label6.ForeColor = System.Drawing.Color.White;
+            this.label6.Location = new System.Drawing.Point(533, 3);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(90, 25);
+            this.label6.Size = new System.Drawing.Size(110, 25);
             this.label6.TabIndex = 0;
             this.label6.Text = "å½“æœŸçµŒé�Žçµ¦ä¸Ž";
             this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -316,7 +445,7 @@
             this.lblPayroll.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.lblPayroll.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.lblPayroll.ForeColor = System.Drawing.Color.Black;
-            this.lblPayroll.Location = new System.Drawing.Point(923, 3);
+            this.lblPayroll.Location = new System.Drawing.Point(643, 3);
             this.lblPayroll.Name = "lblPayroll";
             this.lblPayroll.Size = new System.Drawing.Size(140, 25);
             this.lblPayroll.TabIndex = 0;
@@ -324,55 +453,43 @@
             // 
             // label15
             // 
-            this.label15.BackColor = System.Drawing.Color.DarkOrange;
+            this.label15.BackColor = System.Drawing.Color.DarkSeaGreen;
             this.label15.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.label15.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label15.ForeColor = System.Drawing.Color.Black;
-            this.label15.Location = new System.Drawing.Point(1093, 3);
+            this.label15.ForeColor = System.Drawing.Color.DarkRed;
+            this.label15.Location = new System.Drawing.Point(873, 3);
             this.label15.Name = "label15";
-            this.label15.Size = new System.Drawing.Size(60, 25);
+            this.label15.Size = new System.Drawing.Size(110, 25);
             this.label15.TabIndex = 4;
-            this.label15.Text = "å·®é¡�";
+            this.label15.Text = "çµŒé�Žçµ¦ä¸Žå·®é¡�";
             this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
-            // label11
+            // lblCalcValue1
             // 
-            this.label11.BackColor = System.Drawing.Color.White;
-            this.label11.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.label11.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label11.ForeColor = System.Drawing.Color.Black;
-            this.label11.Location = new System.Drawing.Point(113, 3);
-            this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(140, 25);
-            this.label11.TabIndex = 1;
-            this.label11.Text = "-999,999,999";
-            this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            this.lblCalcValue1.BackColor = System.Drawing.Color.White;
+            this.lblCalcValue1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCalcValue1.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblCalcValue1.ForeColor = System.Drawing.Color.Black;
+            this.lblCalcValue1.Location = new System.Drawing.Point(303, 3);
+            this.lblCalcValue1.Name = "lblCalcValue1";
+            this.lblCalcValue1.Size = new System.Drawing.Size(140, 25);
+            this.lblCalcValue1.TabIndex = 1;
+            this.lblCalcValue1.Text = "-999,999,999";
+            this.lblCalcValue1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
             // 
             // label9
             // 
-            this.label9.BackColor = System.Drawing.Color.DarkOrange;
+            this.label9.BackColor = System.Drawing.Color.Blue;
             this.label9.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.label9.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label9.ForeColor = System.Drawing.Color.Black;
-            this.label9.Location = new System.Drawing.Point(23, 3);
+            this.label9.ForeColor = System.Drawing.Color.White;
+            this.label9.Location = new System.Drawing.Point(193, 3);
             this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(90, 25);
+            this.label9.Size = new System.Drawing.Size(110, 25);
             this.label9.TabIndex = 0;
             this.label9.Text = "æŒ¯åˆ†æ¸ˆçµ¦ä¸Ž";
             this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
-            // label18
-            // 
-            this.label18.BackColor = System.Drawing.Color.Yellow;
-            this.label18.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label18.ForeColor = System.Drawing.Color.Black;
-            this.label18.Location = new System.Drawing.Point(3, 5);
-            this.label18.Name = "label18";
-            this.label18.Size = new System.Drawing.Size(20, 20);
-            this.label18.TabIndex = 9;
-            this.label18.Text = "ï¼ˆ";
-            this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
             // cmbDepartment
             // 
             this.cmbDepartment.BackColor = System.Drawing.Color.White;
@@ -379,7 +496,7 @@
             this.cmbDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cmbDepartment.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
             this.cmbDepartment.FormattingEnabled = true;
-            this.cmbDepartment.Location = new System.Drawing.Point(408, 15);
+            this.cmbDepartment.Location = new System.Drawing.Point(408, 11);
             this.cmbDepartment.Name = "cmbDepartment";
             this.cmbDepartment.Size = new System.Drawing.Size(200, 23);
             this.cmbDepartment.TabIndex = 1;
@@ -387,11 +504,11 @@
             // 
             // label5
             // 
-            this.label5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.label5.BackColor = System.Drawing.Color.PaleGoldenrod;
             this.label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.label5.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.label5.ForeColor = System.Drawing.Color.Black;
-            this.label5.Location = new System.Drawing.Point(280, 14);
+            this.label5.Location = new System.Drawing.Point(280, 10);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(120, 25);
             this.label5.TabIndex = 40;
@@ -400,11 +517,11 @@
             // 
             // label2
             // 
-            this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.label2.BackColor = System.Drawing.Color.PaleGoldenrod;
             this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.label2.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.label2.ForeColor = System.Drawing.Color.Black;
-            this.label2.Location = new System.Drawing.Point(6, 14);
+            this.label2.Location = new System.Drawing.Point(6, 10);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(120, 25);
             this.label2.TabIndex = 38;
@@ -416,7 +533,7 @@
             this.numUDConstPro.BackColor = System.Drawing.Color.White;
             this.numUDConstPro.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.numUDConstPro.ForeColor = System.Drawing.Color.Black;
-            this.numUDConstPro.Location = new System.Drawing.Point(159, 15);
+            this.numUDConstPro.Location = new System.Drawing.Point(159, 11);
             this.numUDConstPro.Name = "numUDConstPro";
             this.numUDConstPro.ReadOnly = true;
             this.numUDConstPro.Size = new System.Drawing.Size(80, 23);
@@ -430,7 +547,7 @@
             this.cmbConstructionPerson.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cmbConstructionPerson.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
             this.cmbConstructionPerson.FormattingEnabled = true;
-            this.cmbConstructionPerson.Location = new System.Drawing.Point(752, 15);
+            this.cmbConstructionPerson.Location = new System.Drawing.Point(752, 11);
             this.cmbConstructionPerson.Name = "cmbConstructionPerson";
             this.cmbConstructionPerson.Size = new System.Drawing.Size(200, 23);
             this.cmbConstructionPerson.TabIndex = 2;
@@ -438,11 +555,11 @@
             // 
             // label3
             // 
-            this.label3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.label3.BackColor = System.Drawing.Color.PaleGoldenrod;
             this.label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.label3.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.label3.ForeColor = System.Drawing.Color.Black;
-            this.label3.Location = new System.Drawing.Point(624, 14);
+            this.label3.Location = new System.Drawing.Point(624, 10);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(120, 25);
             this.label3.TabIndex = 4;
@@ -453,7 +570,7 @@
             // 
             this.label4.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.label4.ForeColor = System.Drawing.Color.Black;
-            this.label4.Location = new System.Drawing.Point(239, 18);
+            this.label4.Location = new System.Drawing.Point(239, 14);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(25, 16);
             this.label4.TabIndex = 0;
@@ -464,7 +581,7 @@
             // 
             this.label7.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.label7.ForeColor = System.Drawing.Color.Black;
-            this.label7.Location = new System.Drawing.Point(134, 18);
+            this.label7.Location = new System.Drawing.Point(134, 14);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(25, 16);
             this.label7.TabIndex = 0;
@@ -539,7 +656,7 @@
             dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
             this.dgvMaster.DefaultCellStyle = dataGridViewCellStyle18;
             this.dgvMaster.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
-            this.dgvMaster.Location = new System.Drawing.Point(5, 130);
+            this.dgvMaster.Location = new System.Drawing.Point(5, 168);
             this.dgvMaster.Name = "dgvMaster";
             this.dgvMaster.RowHeadersVisible = false;
             this.dgvMaster.RowHeadersWidth = 20;
@@ -546,7 +663,7 @@
             this.dgvMaster.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
             this.dgvMaster.RowTemplate.Height = 21;
             this.dgvMaster.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
-            this.dgvMaster.Size = new System.Drawing.Size(1330, 483);
+            this.dgvMaster.Size = new System.Drawing.Size(1330, 446);
             this.dgvMaster.TabIndex = 5;
             this.dgvMaster.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvMaster_CellDoubleClick);
             this.dgvMaster.SelectionChanged += new System.EventHandler(this.dgvMaster_SelectionChanged);
@@ -776,19 +893,15 @@
         private System.Windows.Forms.Label label9;
         private System.Windows.Forms.Label lblPayroll;
         private System.Windows.Forms.Label label6;
-        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.Label lblCalcValue3;
         private System.Windows.Forms.Label label17;
-        private System.Windows.Forms.Label label14;
+        private System.Windows.Forms.Label lblTotalValue;
         private System.Windows.Forms.Label label15;
         private System.Windows.Forms.Label label13;
         private System.Windows.Forms.Label label12;
-        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Label lblCalcValue1;
         private System.Windows.Forms.Label lblCellTotal;
-        private System.Windows.Forms.Label label18;
-        private System.Windows.Forms.Label label10;
-        private System.Windows.Forms.Label label19;
-        private System.Windows.Forms.Label label21;
-        private System.Windows.Forms.Label label22;
+        private System.Windows.Forms.Label lblCalcValue2;
         private System.Windows.Forms.Label label20;
         private System.Windows.Forms.ProgressBar ProgressBar;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
@@ -806,5 +919,17 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column10;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column11;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
+        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.Label lblPlusorMinus1;
+        private System.Windows.Forms.Label lblTotalCalcValue;
+        private System.Windows.Forms.Label label22;
+        private System.Windows.Forms.Label lblTotalValue2;
+        private System.Windows.Forms.Label label14;
+        private System.Windows.Forms.Label lblTotalCalcValue2;
+        private System.Windows.Forms.Label label23;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Label lblTotalCalcValue1;
+        private System.Windows.Forms.Label label19;
+        private System.Windows.Forms.Label lblPlusorMinus2;
     }
 }
\ No newline at end of file
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerListAuxiliary.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerListAuxiliary.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerListAuxiliary.cs	(revision 18)
@@ -80,9 +80,9 @@
                 // ŒŸ�õ”N
                 ClsExcute.ProcControlPara[NowPoint].StringSaveParameter.Add(numUDConstPro.Value.ToString());
                 // ŒŸ�õ•”��
-                ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add(cmbDepartment.SelectedIndex);
+                ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add(CommonMotions.cnvInt(cmbDepartment.SelectedValue));
                 // ŒŸ�õ’S“–ŽÒ
-                ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add(cmbConstructionPerson.SelectedIndex);
+                ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add(CommonMotions.cnvInt(cmbConstructionPerson.SelectedValue));
                 // ƒ\�[ƒg�ó‘Ô
                 if (dgvMaster.SortedColumn != null)
                 {
@@ -94,6 +94,12 @@
                 NowPoint = ClsExcute.NextProcess((int)(int)ClsExcute.ProcessExecuteNo.ConstructionLedger);
                 // ‘I‘ð�HŽ–”Ô�†ƒZƒbƒg
                 ClsExcute.ProcControlPara[NowPoint].IntExecParameter.Add(para_ConstructionCode);
+                
+                // •”��‘ä’ ˆê——‚æ‚è‚Ì‹N“®
+                if (!m_FirstStartFlg)
+                {
+                    ClsExcute.ProcessExecuteNo_ConstructionLedger(ClsExcute.ProcControlPara[NowPoint]);
+                }
             }
             catch (Exception ex)
             {
@@ -101,10 +107,14 @@
             }
             finally
             {
-                // ƒNƒ��[ƒY�ˆ—�‚ðOFF‚É‚·‚é�B
-                m_CloseingProcessOff = true;
-                // ‰æ–ÊƒNƒ��[ƒY
-                this.Close();
+                // •”��‘ä’ ˆê——‚æ‚è‚Ì‹N“®
+                if (m_FirstStartFlg)
+                {
+                    // ƒNƒ��[ƒY�ˆ—�‚ðOFF‚É‚·‚é�B
+                    m_CloseingProcessOff = true;
+                    // ‰æ–ÊƒNƒ��[ƒY
+                    this.Close();
+                }
             }
         }
         #endregion
@@ -165,133 +175,6 @@
         }
         #endregion
 
-        #region •”��ƒRƒ“ƒ{‚æ‚è’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
-        /// <summary>
-        /// •”��ƒRƒ“ƒ{‚æ‚è’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
-        /// </summary>
-        /// <returns></returns>
-        private int GetDepartmentCode()
-        {
-            try
-            {
-                // •\Ž¦‚³‚ê‚Ä‚¢‚È‚¢�ê�‡‚Í‘I‘ð–³
-                //if (!cmbDepartment.Visible) return 0;
-
-                return CommonMotions.cnvInt(cmbDepartment.SelectedValue);
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}", ex.Message);
-                return 0;
-            }
-        }
-        #endregion
-
-        #region ’S“–ŽÒƒRƒ“ƒ{‚æ‚è’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
-        /// <summary>
-        /// ’S“–ŽÒƒRƒ“ƒ{‚æ‚è’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
-        /// </summary>
-        /// <returns></returns>
-        private int GetConstructionPersonCode()
-        {
-            try
-            {
-                // •\Ž¦‚³‚ê‚Ä‚¢‚È‚¢�ê�‡‚Í‘I‘ð–³
-                //if (!cmbConstructionPerson.Visible) return 0;
-
-                return CommonMotions.cnvInt(cmbConstructionPerson.SelectedValue);
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}", ex.Message);
-                return 0;
-            }
-        }
-        #endregion
-
-        #region ‚c‚aŽæ“¾�‡”Ô
-        /// <summary>
-        /// ‚c‚aŽæ“¾�‡”Ô
-        /// </summary>
-        private enum DBGetData
-        {
-            ConstructionCode,
-            CreatorCode,
-            CreatorName,
-            DetailString,
-            OrdersDecisionPrice,
-            CompanyExpenses,
-            DepartmentExpenses,
-            SalesExpenses,
-            TotalPayment,
-            GrossProfit,
-            Allowance,
-            NetProfit,
-            ComplateFlg,
-            DepartmentDisplayOrder,
-            PoersonDisplayOrder,
-            DepartmentCode,
-            DepartmentString,
-            ConstructionStatusflg
-        }
-        #endregion
-
-        #region ƒf�[ƒ^Žæ“¾SQL�ì�¬
-        /// <summary>
-        /// •\Ž¦—pƒf�[ƒ^Žæ“¾SQL�ì�¬
-        /// </summary>
-        private void CreateInitSQL(ref string strSQL)
-        {
-            try
-            {
-                // SQL‚ÉƒAƒNƒZƒX�§ŒÀ‚ð‚©‚¯‚é
-                List<string> strSecurity = new List<string>();
-                CreateSecuritySQL(ref strSecurity);
-
-                // •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX’lŽæ“¾
-                int DepartmentCode = GetDepartmentCode();
-                // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX’lŽæ“¾
-                int PersonCode = GetConstructionPersonCode();
-
-                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
-                // ----- ‚r‚p‚k�ì�¬
-                // ‘¶�Ý�Ú�×‘ä’ ƒf�[ƒ^ŒŸ�õ
-                //strSQL += " UNION";
-                strSQL = " SELECT A.CONSTRUCTIONCODE, A.CREATORCODE, C.PERSONNAME, B.DETAILSTRING, A.ORDERSDECISIONPRICE, A.COMPANYEXPENSES,";
-                strSQL += " A.DEPARTMENTEXPENSES, A.SALESEXPENSES, A.TOTALPAYMENT, A.GROSSPROFIT, A.ALLOWANCE, A.NETPROFIT, A.COMPLATEFLG,";
-                strSQL += " E.DISPLAYORDER, C.DISPLAYORDER, C.DEPARTMENTCODE, E.DepartmentString, D.CONSTRUCTIONSTATUSFLG";
-                strSQL += " FROM CONSTRUCTIONLEDGER A, CONSTRUCTIONBASEINFODETAIL B, PERSONINCHARGEMASTER C, CONSTRUCTIONBASEINFO D,";
-                strSQL += " DEPARTMENTMASTER E";
-                strSQL += " WHERE A.CONSTRUCTIONCODE = D.CONSTRUCTIONCODE";
-                strSQL += string.Format(" AND D.TyingFlg != {0}", (int)CommonDefine.BaseInfoTyingFlg.Tying);
-                strSQL += string.Format(" AND (A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE AND B.DETAILNO = {0})", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
-                strSQL += string.Format(" AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
-                strSQL += " AND D.CONSTRUCTIONPERSONCODE = C.PERSONCODE";
-                strSQL += " AND C.DEPARTMENTCODE = E.DEPARTMENTCODE";
-                strSQL += string.Format(" AND D.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
-                strSQL += " AND A.CREATORCODE = C.PERSONCODE";
-                if (strSecurity.Count > 0) strSQL += strSecurity[1];
-                if (DepartmentCode != 0) strSQL += string.Format(" AND C.DEPARTMENTCODE = {0}", DepartmentCode);
-                if (PersonCode != 0)
-                {
-                    strSQL += string.Format(" AND (D.CONSTRUCTIONPERSONCODE = {0} OR D.CONSTRUCTIONINSTRUCTOR = {0} OR D.CONSTRSUBPERSONCODE = {0})", PersonCode);
-                }
-
-                strSQL += string.Format(" ORDER BY {0} ASC, {1} ASC, {2} ASC, {3} ASC, {4} ASC",
-                                                    ((int)DBGetData.ComplateFlg + 1),
-                                                    ((int)DBGetData.DepartmentDisplayOrder + 1),
-                                                    ((int)DBGetData.ConstructionStatusflg + 1),
-                                                    ((int)DBGetData.PoersonDisplayOrder + 1),
-                                                    ((int)DBGetData.ConstructionCode + 1));
-
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", ex.Message, strSQL);
-            }
-        }
-        #endregion
-
         #region ƒOƒŠƒbƒh�sƒf�[ƒ^ƒZƒbƒg
         /// <summary>
         /// ƒOƒŠƒbƒh�sƒf�[ƒ^ƒZƒbƒg
@@ -309,7 +192,7 @@
 
                 // “ü—ÍŠ®—¹‚Íƒtƒ‰ƒO‚ðŽg‚¤
                 string FlgString = string.Empty;
-                if (CommonMotions.cnvInt(objwrk[(int)DBGetData.ComplateFlg]) == 1) FlgString = "�Ï";
+                if (CommonMotions.cnvInt(objwrk[(int)DBGetData.ComplateFlg]) == (int)CommonDefine.ComplateTitleNo.Complated) FlgString = "�Ï";
 
                 // ƒXƒe�[ƒ^ƒXƒtƒ‰ƒO‚ªˆá‚¦‚Î1�sŠJ‚¯‚é
                 if (StatusFlg != CommonMotions.cnvInt(objwrk[(int)DBGetData.ConstructionStatusflg]))
@@ -348,221 +231,69 @@
         }
         #endregion
 
-        #region ƒf�[ƒ^•\Ž¦�ˆ—�
+        #region �‰ŠúŽžƒf�[ƒ^Žæ“¾
         /// <summary>
-        /// ˆê——ƒf�[ƒ^•\Ž¦�ˆ—�
+        /// �‰ŠúŽžƒf�[ƒ^Žæ“¾
         /// </summary>
-        private void DataDisplay()
+        private void InitDataLoad()
         {
-            IOConstructionLedger LedgerDB = new IOConstructionLedger();
-            DataGridView dgv = dgvMaster;
-            ProgressBar prgber = ProgressBar;
             try
             {
-                dgv.SuspendLayout();
+                m_initDataLoad = true;
 
-                dgv.Rows.Clear();
-                pnlPayroll.Visible = false;
-
-                // Šú‚ÌƒZƒbƒg
-                prgber.Visible = true;
-                prgber.Minimum = 0;
-                prgber.Maximum = 10;
-                prgber.Value = 0;
-
-                string strSQL = "";
-                // SQL�ì�¬
-                CreateInitSQL(ref strSQL);
-
-                ArrayList arData = new ArrayList();
-                string FlgString = string.Empty;
-                // �HŽ–�Ú�×‘ä’ Žæ“¾
-                if (!LedgerDB.ExecuteReader(strSQL, ref arData)) return;
-
-                // “Ç�žŽžƒf�[ƒ^ƒJƒEƒ“ƒgŽæ“¾
-                m_initDataCount = arData.Count;
-                if (arData.Count == 0) return;
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value ++;
-                prgber.Update();
-
-                // �‡ŒvƒGƒŠƒA
-                int TotalColCnt = Enum.GetNames(typeof(DispColumn)).Length;
-                int[] TotalArea = new int[TotalColCnt];
-                Array.Clear(TotalArea, 0, TotalArea.Length);
-
-                // ƒf�[ƒ^•\Ž¦
-                int ino = 1;
-                int StatusFlg = -1;
-                bool initFlg = true;
-                string strStatus = string.Empty;
-                // ----- Ž{�H’†ƒf�[ƒ^•\Ž¦
-                foreach (object[] objwrk in arData)
+                int NowPoint = ClsExcute.GetNowProcessPoint();
+                // �‰Šú•\Ž¦Žž‚É‘¼‚Ì‰æ–Ê‚æ‚è‚Ìƒpƒ‰ƒ��[ƒ^‚ª‚ ‚Á‚½�ê�‡
+                if (!m_FirstStartFlg)
                 {
-                    // “ü—ÍŠ®—¹‚Í•\Ž¦‚µ‚È‚¢
-                    if (CommonMotions.cnvInt(objwrk[(int)DBGetData.ComplateFlg]) == 1) break;
-
-                    // ƒOƒŠƒbƒh‚Öƒf�[ƒ^•\Ž¦
-                    GridDataSet(objwrk, ref ino, ref TotalArea, ref initFlg, ref StatusFlg);
+                    // ”N“x
+                    numUDConstPro.Value = m_FirstStartPeriod;
+                    // •”��
+                    cmbDepartment.SelectedValue = m_FirstStartDepartmentCode;
+                    // ’S“–ŽÒ
+                    cmbConstructionPerson.SelectedValue = m_FirstStartPersonCode;
                 }
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value++;
-                prgber.Update();
-
-                // ----- �‡Œv•\Ž¦
-                if (arData.Count != 0)
+                else
                 {
-                    dgv.Rows.Add();       // ‹ó�s
-
-                    // �‡Œv�s•\Ž¦
-                    int TotalRow = dgv.Rows.Add(1);
-                    dgv.Rows[TotalRow].Cells[(int)DispColumn.ConstructionName].Value = s_TotalTitleArray[(int)RowTitleNum.Execution];
-                    // �s‚Ì�F‚ð•Ï‚¦‚é
-                    SetRowColor(dgv.Rows[TotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
-
-                    // �”’l•\Ž¦
-                    for (int i = (int)DispColumn.OrdersDecisionPrice; i <= (int)DispColumn.NetProfit; i++)
+                    // ----- ‘Þ”ðŒŸ�õƒf�[ƒ^‚ª‚ ‚Á‚½�ê�‡‚ÍƒZƒbƒg‚·‚é
+                    if (ClsExcute.ProcControlPara[NowPoint].StringSaveParameter.Count > 0)
                     {
-                        dgv.Rows[TotalRow].Cells[i].Value = TotalArea[i].ToString("#,0");
+                        // ”N“x
+                        numUDConstPro.Value = CommonMotions.cnvInt(ClsExcute.ProcControlPara[NowPoint].StringSaveParameter[0]);
                     }
-                    dgv.Rows.Add();       // ‹ó�s
-                }
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value++;
-                prgber.Update();
-
-                // ----- �Ïƒf�[ƒ^•\Ž¦
-                bool bRowPrint = false;
-                int[] ComplateTotalArea = new int[TotalColCnt];
-                Array.Clear(ComplateTotalArea, 0, ComplateTotalArea.Length);
-                foreach (object[] objwrk in arData)
-                {
-                    // “ü—ÍŠ®—¹ˆÈŠO‚Í•\Ž¦‚µ‚È‚¢
-                    if (CommonMotions.cnvInt(objwrk[(int)DBGetData.ComplateFlg]) != 1) continue;
-
-                    // ƒOƒŠƒbƒh‚Öƒf�[ƒ^•\Ž¦
-                    GridDataSet(objwrk, ref ino, ref ComplateTotalArea, ref initFlg, ref StatusFlg);
-                    bRowPrint = true;
-                }
-                // �‡Œv‚ð‘��‡Œv‚É‘«‚·
-                for (int i = 0; i < ComplateTotalArea.Length;i++ )
-                {
-                    TotalArea[i] += ComplateTotalArea[i];
-                }
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value++;
-                prgber.Update();
-
-                // �Ïƒf�[ƒ^‚ª‚ ‚ê‚Î•\Ž¦
-                if (bRowPrint)
-                {
-                    dgv.Rows.Add();       // ‹ó�s
-                    int CompTotalRow = dgv.Rows.Add(1);
-                    dgv.Rows[CompTotalRow].Cells[(int)DispColumn.ConstructionName].Value = s_TotalTitleArray[(int)RowTitleNum.Completed];
-                    // �s‚Ì�F‚ð•Ï‚¦‚é
-                    SetRowColor(dgv.Rows[CompTotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
-                    // �”’l•\Ž¦
-                    for (int i = (int)DispColumn.OrdersDecisionPrice; i <= (int)DispColumn.NetProfit; i++)
+                    // •”���E’S“–ŽÒ
+                    if (ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Count > 0)
                     {
-                        dgv.Rows[CompTotalRow].Cells[i].Value = ComplateTotalArea[i].ToString("#,0");
+                        cmbConstructionPerson.SelectedValue = ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[1];
+                        cmbDepartment.SelectedValue = ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[0];
                     }
                 }
-                dgv.Rows.Add();       // ‹ó�s
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value++;
-                prgber.Update();
-
-                // ----- Œo”ï‚ð•\Ž¦‚·‚é
-                int Expenses = SetOtherCost();
-
-                dgv.Rows.Add();       // ‹ó�s
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value++;
-                prgber.Update();
-
-                // ------ •â�•�U•ª‚ð•\Ž¦‚·‚é
-                int Auxiliary = SetAuxiliaryCost();
-
-                dgv.Rows.Add();       // ‹ó�s
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value++;
-                prgber.Update();
-
-                // Œo”ï�^•â�•�U•ª‚ðŽx•¥Šz‚Ö‘«‚µ‚Ä�A—˜‰v‚æ‚èˆø‚­
-                TotalArea[(int)DispColumn.TotalPayment] += Expenses;
-                TotalArea[(int)DispColumn.GrossProfit] -= Expenses;
-                TotalArea[(int)DispColumn.NetProfit] -= Expenses;
-                
-                // ----- ‘��‡Œv�s•\Ž¦
-                int AllTotalRow = dgv.Rows.Add(1);
-                dgv.Rows[AllTotalRow].Cells[(int)DispColumn.ConstructionName].Value = s_TotalTitleArray[(int)RowTitleNum.AllTotal];
-                
-                // �s‚Ì�F‚ð•Ï‚¦‚é
-                SetRowColor(dgv.Rows[AllTotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
-
-                // �”’l•\Ž¦
-                for (int i = (int)DispColumn.OrdersDecisionPrice; i <= (int)DispColumn.NetProfit; i++)
+                // ˆê”ÊŽg—pŽÒ‚Í‹‹—^‚Ì—“‚ªŒ©‚¦‚È‚¢‚æ‚¤‚É‚·‚é
+                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
                 {
-                    dgv.Rows[AllTotalRow].Cells[i].Value = TotalArea[i].ToString("#,0");
+                    dgvMaster.Columns[(int)DispColumn.Allowance].Visible = false;
+                    m_CellSize[(int)DispColumn.Allowance] = 0;
                 }
 
-                dgv.Rows.Add();       // ‹ó�s
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value++;
-                prgber.Update();
-
-                // ’S“–ŽÒ‚ð�i‚è�ž‚ñ‚¾Žž‚É–{�l‚©�ã’·‚ÍŒo‰ß‹‹—^‚ªŒ©‚¦‚é�iƒwƒbƒ_�[‚É•\Ž¦�j
-                //SetPayrollData();
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value++;
-                prgber.Update();
-
+                // ƒf�[ƒ^•\Ž¦
+                DataDisplay();
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
             }
-            finally
-            {
-                // ƒf�[ƒ^‚ª‘½‚­‚È‚ê‚Îƒ\�[ƒg‚Å‚«‚é
-                if (CommonDefine.s_MaxInitLineCount < dgv.RowCount)
-                {
-                    foreach (DataGridViewColumn wrkCol in dgv.Columns)
-                        wrkCol.SortMode = DataGridViewColumnSortMode.Automatic;
-                }
-                else
-                {
-                    dgv.RowCount += (CommonDefine.s_MaxInitLineCount - m_initDataCount);
-                }
-
-                LedgerDB.close(); LedgerDB = null;
-                dgv.ResumeLayout();
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value = prgber.Maximum;
-                prgber.Update();
-                prgber.Visible = false;
-            }
         }
         #endregion
 
-        #region �‰ŠúŽžƒf�[ƒ^Žæ“¾
+        #region Ž–‹ÆŠú�‰ŠúƒZƒbƒg
         /// <summary>
-        /// �‰ŠúŽžƒf�[ƒ^Žæ“¾
+        /// Ž–‹ÆŠú�‰ŠúƒZƒbƒg
         /// </summary>
-        private void InitDataLoad()
+        private void SetcmbPeriod()
         {
             try
             {
                 m_initDataLoad = true;
-                // ƒf�[ƒ^‚É‚ ‚éŽ–‹ÆŠú‚ÆŒ»�Ý‚ÌŽ–‹ÆƒZƒbƒg
+                // ƒf�[ƒ^‚É‚ ‚éŽ–‹ÆŠú‚ÆŒ»�Ý‚ÌŽ–‹ÆŠúƒZƒbƒg
                 int minval = 0;
                 int maxval = 0;
                 CommonMotions.GetPeriodYear(ref minval, ref maxval);
@@ -570,79 +301,15 @@
                 numUDConstPro.Maximum = maxval;
                 numUDConstPro.Value = CommonMotions.SystemMasterData.BusinessPeriod;
                 m_initDataLoad = false;
-
-                // ----- ‘Þ”ðŒŸ�õƒf�[ƒ^‚ª‚ ‚Á‚½�ê�‡‚ÍƒZƒbƒg‚·‚é
-                int NowPoint = ClsExcute.GetNowProcessPoint();
-                if (ClsExcute.ProcControlPara[NowPoint].StringSaveParameter.Count > 0)
-                {
-                    // ”N“x
-                    numUDConstPro.Value = CommonMotions.cnvInt(ClsExcute.ProcControlPara[NowPoint].StringSaveParameter[0]);
-                }
-                // •”��’S“–ŽÒ
-                if (ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Count > 0)
-                {
-                    cmbConstructionPerson.SelectedIndex = ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[1];
-                    cmbDepartment.SelectedIndex = ClsExcute.ProcControlPara[NowPoint].IntSaveParameter[0];
-                }
-
-                // ˆê”ÊŽg—pŽÒ‚Í‹‹—^‚Ì—“‚ªŒ©‚¦‚È‚¢‚æ‚¤‚É‚·‚é
-                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
-                {
-                    dgvMaster.Columns[(int)DispColumn.Allowance].Visible = false;
-                    m_CellSize[(int)DispColumn.Allowance] = 0;
-                }
-
-                // ƒf�[ƒ^•\Ž¦
-                DataDisplay();
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
             }
-        }
-        #endregion
-
-        #region •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
-        /// <summary>
-        /// •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
-        /// </summary>
-        private void InitcmbDepartment()
-        {
-            try
+            finally
             {
-                // ƒVƒXƒeƒ€Œ ŒÀ‚É‚æ‚Á‚Äƒf�[ƒ^ƒAƒNƒZƒX‚É�§ŒÀ‚ª‚ ‚é
-                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.AdminSecurityManagement
-                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.PresidentAuthority].Key
-                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SupervisorAuthority].Key)
-                {
-                    // ƒVƒXƒeƒ€ŠÇ—�ŽÒ
-                    // �Å�‚‹@–§ŠÇ—�ŽÒ
-                    // “�Š‡‹@–§ŠÇ—�ŽÒ
-                    // •”��ƒ}ƒXƒ^‚ðŒŸ�õ‚·‚é
-                }
-                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SuperiorAuthority].Key)
-                {
-                    // �Š‘®’·
-                    // •”��ƒRƒ“ƒ{”ñ•\Ž¦
-                    label5.Visible = false;
-                    cmbDepartment.Visible = false;
-                    label3.Location = label5.Location;
-                    cmbConstructionPerson.Location = cmbDepartment.Location;
-                }
-                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
-                {
-                    // ˆê”ÊŽg—pŽÒ�iŽ©•ª‚Ì‚ÝƒAƒNƒZƒX‰Â”\�j
-                    // •”���E’S“–ŽÒƒRƒ“ƒ{”ñ•\Ž¦
-                    label5.Visible = false;
-                    cmbDepartment.Visible = false;
-                    label3.Visible = false;
-                    cmbConstructionPerson.Visible = false;
-                }
+                m_initDataLoad = false;
             }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
         }
         #endregion
 
@@ -653,7 +320,6 @@
         private bool SetcmbDepartment()
         {
             IOMDepartment depDB = new IOMDepartment();
-            List<DepartmentMaster> workList = new List<DepartmentMaster>();
             try
             {
                 m_initDataLoad = true;
@@ -663,37 +329,36 @@
                 cmbDepartment.Text = "";
 
                 string strSQL = string.Empty;
+                // •”��ƒ}ƒXƒ^‚ðŒŸ�õ‚·‚é
+                strSQL = "SELECT A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER, COUNT(*)";
+                strSQL += " FROM DEPARTMENTMASTER A, PERSONINCHARGEMASTER B, CONSTRUCTIONBASEINFO C , CONSTRUCTIONLEDGERDETAIL D";
+                strSQL += " WHERE A.DELETEFLG = 0";
+
                 // ƒVƒXƒeƒ€Œ ŒÀ‚É‚æ‚Á‚Äƒf�[ƒ^ƒAƒNƒZƒX‚É�§ŒÀ‚ª‚ ‚é
-                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.AdminSecurityManagement
-                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.PresidentAuthority].Key
-                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SupervisorAuthority].Key)
+                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SuperiorAuthority].Key
+                    || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
                 {
-                    // ƒVƒXƒeƒ€ŠÇ—�ŽÒ
-                    // �Å�‚‹@–§ŠÇ—�ŽÒ
-                    // “�Š‡‹@–§ŠÇ—�ŽÒ
-                    // •”��ƒ}ƒXƒ^‚ðŒŸ�õ‚·‚é
-                    strSQL = " Where DeleteFlg = 0 Order By DisplayOrder ASC";
-                }
-                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SuperiorAuthority].Key)
-                {
                     // �Š‘®’·
-                    strSQL = string.Format(" WHERE DEPARTMENTCODE = {0} AND DeleteFlg = 0 Order By DisplayOrder ASC", CommonMotions.LoginUserData.DepartmentCode);
-                }
-                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
-                {
                     // ˆê”ÊŽg—pŽÒ�iŽ©•ª‚Ì‚ÝƒAƒNƒZƒX‰Â”\�j
-                    strSQL = string.Format(" WHERE DEPARTMENTCODE = {0} AND DeleteFlg = 0 Order By DisplayOrder ASC", CommonMotions.LoginUserData.DepartmentCode);
+                    strSQL += string.Format(" AND A.DEPARTMENTCODE = {0}", CommonMotions.LoginUserData.DepartmentCode);
                 }
+                strSQL += " AND A.DEPARTMENTCODE = B.DEPARTMENTCODE";
+                strSQL += " AND B.PERSONCODE = C.CONSTRUCTIONPERSONCODE";
+                strSQL += " AND D.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
+                strSQL += " GROUP BY A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER";
+                strSQL += " ORDER BY A.DISPLAYORDER ASC";
 
                 // •”��ƒ}ƒXƒ^“Ç�ž
-                if (!depDB.SelectAction(strSQL, ref workList)) return false;
+                ArrayList arList = new ArrayList();
+                if (!depDB.ExecuteReader(strSQL, ref arList)) return false;
 
                 List<KeyValuePair<int, string>> ConstructionDataList = new List<KeyValuePair<int, string>>();
                 ConstructionDataList.Add(new KeyValuePair<int, string>(0, ""));
 
-                foreach (DepartmentMaster work in workList)
+                foreach (object[] work in arList)
                 {
-                    KeyValuePair<int, string> keyval = new KeyValuePair<int, string>(work.DepartmentCode, work.DepartmentString);
+                    KeyValuePair<int, string> keyval = new KeyValuePair<int, string>(CommonMotions.cnvInt(work[0])
+                                                                                    , CommonMotions.cnvString(work[1]));
 
                     ConstructionDataList.Add(keyval);
                 }
@@ -724,104 +389,25 @@
         }
         #endregion
 
-        #region ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
+        #region •”��ƒRƒ“ƒ{‚æ‚è’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
         /// <summary>
-        /// ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
+        /// •”��ƒRƒ“ƒ{‚æ‚è’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
         /// </summary>
-        private void InitcmbPersons()
+        /// <returns></returns>
+        private int GetDepartmentCode()
         {
             try
             {
-                // ƒVƒXƒeƒ€Œ ŒÀ‚É‚æ‚Á‚Äƒf�[ƒ^ƒAƒNƒZƒX‚É�§ŒÀ‚ª‚ ‚é
-                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.AdminSecurityManagement
-                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.PresidentAuthority].Key
-                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SupervisorAuthority].Key)
-                {
-                    // ƒVƒXƒeƒ€ŠÇ—�ŽÒ
-                    // �Å�‚‹@–§ŠÇ—�ŽÒ
-                    // “�Š‡‹@–§ŠÇ—�ŽÒ
-                }
-                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SuperiorAuthority].Key)
-                {
-                    // �Š‘®’·
-                    // •”��ƒRƒ“ƒ{”ñ•\Ž¦
-                    label5.Visible = false;
-                    cmbDepartment.Visible = false;
-                    label3.Location = label5.Location;
-                    cmbConstructionPerson.Location = cmbDepartment.Location;
-                }
-                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
-                {
-                    // ˆê”ÊŽg—pŽÒ�iŽ©•ª‚Ì‚ÝƒAƒNƒZƒX‰Â”\�j
-                    // •”���E’S“–ŽÒƒRƒ“ƒ{”ñ•\Ž¦
-                    label5.Visible = false;
-                    cmbDepartment.Visible = false;
-                    label3.Visible = false;
-                    cmbConstructionPerson.Visible = false;
-                }
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-        }
-        #endregion
+                // •\Ž¦‚³‚ê‚Ä‚¢‚È‚¢�ê�‡‚Í‘I‘ð–³
+                //if (!cmbDepartment.Visible) return 0;
 
-        #region ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX‚ðƒZƒbƒg‚·‚é
-        /// <summary>
-        /// ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX‚Ö•¶Žš‚ðƒZƒbƒg‚·‚é
-        /// </summary>
-        private bool SetcmbPersons()
-        {
-            IOMPersonInCharge picDB = new IOMPersonInCharge();
-            List<PersonInChargeMaster> workList = new List<PersonInChargeMaster>();
-            try
-            {
-                m_initDataLoad = true;
-                cmbConstructionPerson.DataSource = null;
-                cmbConstructionPerson.Items.Clear();
-                cmbConstructionPerson.Text = "";
-
-                string strSQL = string.Empty;
-                int DepartmentCode = GetDepartmentCode();
-                if (DepartmentCode == 0)
-                    strSQL = " WHERE DeleteFlg = 0 Order By EmployeeClassFlg ASC, DisplayOrder ASC";
-                else
-                    strSQL = string.Format(" WHERE DEPARTMENTCODE = {0} AND DeleteFlg = 0 Order By EmployeeClassFlg ASC, DisplayOrder ASC", DepartmentCode);
-
-                // ’S“–ŽÒƒ}ƒXƒ^“Ç�ž
-                if (!picDB.SelectAction(strSQL, ref workList)) return false;
-
-                List<KeyValuePair<int, string>> ConstructionDataList = new List<KeyValuePair<int, string>>();
-                ConstructionDataList.Add(new KeyValuePair<int, string>(0, ""));
-
-                foreach (PersonInChargeMaster work in workList)
-                {
-                    KeyValuePair<int, string> keyval = new KeyValuePair<int, string>(work.PersonCode, work.PersonName);
-
-                    ConstructionDataList.Add(keyval);
-                }
-
-                // ƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
-                ComboBoxAction.InitDataSetCombBox(cmbConstructionPerson, ConstructionDataList);
-
-                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
-                {
-                    cmbConstructionPerson.SelectedValue = CommonMotions.LoginUserData.PersonCode;
-                }
-
-                return true;
+                return CommonMotions.cnvInt(cmbDepartment.SelectedValue);
             }
             catch (Exception ex)
             {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}", ex.Message);
+                return 0;
             }
-            finally
-            {
-                picDB.close(); picDB = null;
-                m_initDataLoad = false;
-            }
         }
         #endregion
 
@@ -875,62 +461,6 @@
         }
         #endregion
 
-        #region ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
-        /// <summary>
-        /// ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
-        /// </summary>
-        /// <returns></returns>
-        private bool SetPerosonToDepartment()
-        {
-            IOMPersonInCharge PersonDB = new IOMPersonInCharge();
-            try
-            {
-                // ƒRƒ“ƒ{ƒ{ƒbƒNƒX‚æ‚è‘I‘ð’S“–ŽÒ‚ðŽæ“¾‚·‚é
-                int PersonCode = GetConstructionPersonCode();
-                if (PersonCode < 1) return false;
-
-                int DepartmentCode = GetDepartmentCode();
-
-                string strSQL = PersonDB.CreatePrimarykeyString(PersonCode);
-                PersonInChargeMaster PersonRec = new PersonInChargeMaster();
-                PersonDB.SelectAction(strSQL, ref PersonRec);
-
-                // •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX‚Ö•”��ƒR�[ƒhƒZƒbƒg
-                if (PersonRec.DepartmentCode > 0 && DepartmentCode != PersonRec.DepartmentCode)
-                {
-                    m_initDataLoad = true;
-                    cmbDepartment.SelectedValue = PersonRec.DepartmentCode;
-                    m_initDataLoad = false;
-                }
-
-                return true;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
-            }
-            finally
-            {
-                PersonDB.close(); PersonDB = null;
-            }
-        }
-        #endregion
-
-        #region ‹‹—^ƒGƒŠƒAƒNƒŠƒA
-        /// <summary>
-        /// ‹‹—^ƒGƒŠƒAƒNƒŠƒA
-        /// </summary>
-        private void ClearSalary()
-        {
-            lblPayroll.Text = "";
-            label11.Text = "";
-            label14.Text = "";
-            label16.Text = "";
-            label21.Text = "";
-        }
-        #endregion
-
         #region �s�F�Ý’è
         /// <summary>
         /// �s‚ð‘I‘ð�F‚É‚·‚é
@@ -1022,7 +552,7 @@
         /// </summary>
         /// <param name="dtStart"></param>
         /// <param name="dtEnd"></param>
-        private void CreateDefaultStartAndEndDate(ref DateTime dtStart,ref DateTime dtEnd)
+        private void CreateDefaultStartAndEndDate(ref DateTime dtStart, ref DateTime dtEnd)
         {
             try
             {
@@ -1039,6 +569,10 @@
                 CommonMotions.GetBeginningMonthDay(bPeriod, ref month, ref day);
                 dtStart = new DateTime(iYear, month, day);
                 dtEnd = dtStart.AddYears(1).AddDays(-1);     // �I—¹‚Í�{1”N�|1“ú
+
+                // �¡Šú‚Ì�ê�‡‚Í�¡“ú‚Ì“ú•t‚Ü‚Å‚ðŒvŽZ‚·‚é
+                if (CommonMotions.cnvInt(numUDConstPro.Value) == CommonMotions.SystemMasterData.BusinessPeriod) dtEnd = DateTime.Today;
+
             }
             catch (Exception ex)
             {
@@ -1088,15 +622,14 @@
         /// <summary>
         /// �HŽ–‚É‘®‚µ‚Ä‚¢‚È‚¢Œo”ï‚ð•\Ž¦‚·‚é
         /// </summary>
-        private int SetOtherCost()
+        /// <param name="PersonCDArray"></param>
+        /// <param name="dtStartArray"></param>
+        /// <param name="dtCompArray"></param>
+        /// <returns></returns>
+        private int SetOtherCost(List<int> PersonCDArray, List<DateTime> dtStartArray, List<DateTime> dtCompArray)
         {
             try
             {
-                // •”��ƒR�[ƒhŽæ“¾
-                int DepartmentCode = GetDepartmentCode();
-                // ’S“–ŽÒƒR�[ƒhŽæ“¾
-                int PersonCode = GetConstructionPersonCode();
-
                 // “–ŠúŠúŽñ“ú�EŠú––“ú‚ðŽæ“¾
                 DateTime dtDefaultStart = DateTime.MinValue;
                 DateTime dtDefaultEnd = DateTime.MinValue;
@@ -1107,31 +640,15 @@
                 // •\Ž¦ƒGƒŠƒAƒNƒŠƒA
                 Array.Clear(CostValue, 0, CostValue.Length);
 
-                // ’S“–ŽÒ‚ªƒZƒbƒg‚³‚ê‚Ä‚¢‚ê‚Î’S“–ŽÒ�AˆÈŠO‚Í‘Î�Û‘S‚Ä‚ð�WŒv‚·‚é
-                if (PersonCode != 0)
+                // �‡Œv‚ð�WŒv‚·‚é
+                for (int ii = 0; ii < PersonCDArray.Count; ii++)
                 {
-                    // ’S“–ŽÒ‚ª‘I‘ð‚³‚ê‚Ä‚¢‚ê‚Î‚»‚ÌŒo”ï‚ðŽæ“¾‚·‚é
-                    GetPersonExpensesCostValue(PersonCode, dtDefaultStart, dtDefaultEnd, ref CostValue);
-                }
-                else
-                {
-                    // ’S“–‚ª‘I‘ð‚³‚ê‚Ä‚¢‚È‚¯‚ê‚Î�‡Œv‚ð�WŒv‚·‚é
-                    List<int> PersonArrsy = new List<int>(); ;
-                    if (GetPersonInDepartment(DepartmentCode, ref PersonArrsy) == 0) return 0;
-                    int[] OneCost = new int[ArrayCount];
-                    for (int ii = 0; ii < PersonArrsy.Count; ii++)
-                    {
-                        // �WŒvƒGƒŠƒAƒNƒŠƒA
-                        Array.Clear(OneCost, 0, OneCost.Length);
+                    // ŠJŽn�E�I—¹“ú‚ª–³‚¢�ê�‡‚ÍƒfƒtƒHƒ‹ƒg‚ÌŠúŽñ�EŠú––‚ðŽg—p‚·‚é
+                    if (dtStartArray[ii] == DateTime.MinValue || dtStartArray[ii] == DateTime.MaxValue) dtStartArray[ii] = dtDefaultStart;
+                    if (dtCompArray[ii] == DateTime.MinValue || dtCompArray[ii] == DateTime.MaxValue) dtCompArray[ii] = dtDefaultEnd;
 
-                        // Œo”ïŽæ“¾
-                        GetPersonExpensesCostValue(PersonArrsy[ii], dtDefaultStart, dtDefaultEnd, ref OneCost);
-                        // �WŒv
-                        for (int iii = 0; iii < CostValue.Length; iii++)
-                        {
-                            CostValue[iii] += OneCost[iii];
-                        }
-                    }
+                    // Œo”ïŽæ“¾
+                    GetPersonExpensesCostValue(PersonCDArray[ii], dtStartArray[ii], dtCompArray[ii], ref CostValue);
                 }
 
                 // ----- Œo”ï‚Ì�WŒv
@@ -1142,23 +659,24 @@
                     // �s�ì�¬
                     int RowCnt = dgv.Rows.Add(1);
                     // Œo”ï–¼�Ì
-                    dgv.Rows[RowCnt].Cells[(int)DispColumn.ConstructionName].Value = CommonDefine.CostDataNoString[i];
+                    dgv.Rows[RowCnt].Cells[(int)DispColumn.SelectionName].Value = CommonDefine.CostDataNoString[i];
                     // ‹àŠzƒZƒbƒg
-                    dgv.Rows[RowCnt].Cells[(int)DispColumn.OrdersDecisionPrice].Value = CostValue[i].ToString("#,0");
+                    dgv.Rows[RowCnt].Cells[(int)DispColumn.TotalPayment].Value = CostValue[i].ToString("#,0");
                     SumData += CostValue[i];
                 }
 
-                dgv.Rows.Add();       // ‹ó�s
                 // ----- Œo”ï‚ÌŒv‚ð•\Ž¦‚·‚é
                 // �s�ì�¬
                 int ExpensesCnt = dgv.Rows.Add(1);
                 // Œo”ï–¼�Ì
-                dgv.Rows[ExpensesCnt].Cells[(int)DispColumn.ConstructionName].Value = s_TotalTitleArray[(int)RowTitleNum.Expenses];
+                dgv.Rows[ExpensesCnt].Cells[(int)DispColumn.SelectionName].Value = s_TotalTitleArray[(int)RowTitleNum.Expenses];
                 // ‹àŠzƒZƒbƒg
-                dgv.Rows[ExpensesCnt].Cells[(int)DispColumn.OrdersDecisionPrice].Value = SumData.ToString("#,0");
+                dgv.Rows[ExpensesCnt].Cells[(int)DispColumn.TotalPayment].Value = SumData.ToString("#,0");
                 // �s‚Ì�F‚ð•Ï‚¦‚é
                 SetRowColor(dgv.Rows[ExpensesCnt], s_RowTotalBackColor, s_RowTotalForeColor);
 
+                dgv.Rows.Add();       // ‹ó�s
+
                 return SumData;
             }
             catch (Exception ex)
@@ -1179,70 +697,51 @@
             {
                 // •”��ƒR�[ƒhŽæ“¾
                 int DepartmentCode = GetDepartmentCode();
-                // ’S“–ŽÒƒR�[ƒhŽæ“¾
-                int PersonCode = GetConstructionPersonCode();
 
                 int[] CostValue = new int[2];
                 // •\Ž¦ƒGƒŠƒAƒNƒŠƒA
                 Array.Clear(CostValue, 0, CostValue.Length);
 
-                DateTime dtStart = DateTime.MinValue;
-                DateTime dtEnd = DateTime.MinValue;
-                // ’S“–ŽÒ‚ªƒZƒbƒg‚³‚ê‚Ä‚¢‚ê‚Î’S“–ŽÒ�AˆÈŠO‚Í‘Î�Û‘S‚Ä‚ð�WŒv‚·‚é
-                if (PersonCode != 0)
-                {
-                    // ’S“–ŽÒ‚ª‘I‘ð‚³‚ê‚Ä‚¢‚ê‚Î‚»‚ÌŒo”ï‚ðŽæ“¾‚·‚é
-                    GetPersonAuxiliaryCostValue(PersonCode, ref CostValue);
-                }
-                else
-                {
-                    // ’S“–‚ª‘I‘ð‚³‚ê‚Ä‚¢‚È‚¯‚ê‚Î�‡Œv‚ð�WŒv‚·‚é
-                    List<int> PersonArrsy = new List<int>(); ;
-                    if (GetPersonInDepartment(DepartmentCode, ref PersonArrsy) == 0) return 0;
-                    int[] OneCost = new int[2];
-                    for (int i = 0; i < PersonArrsy.Count; i++)
-                    {
-                        // �WŒvƒGƒŠƒAƒNƒŠƒA
-                        Array.Clear(OneCost, 0, OneCost.Length);
+                // �U•ª‹àŠz‚ðŽæ“¾‚·‚é
+                GetPersonAuxiliaryCostValue(ref CostValue);
 
-                        // Œo”ïŽæ“¾
-                        GetPersonAuxiliaryCostValue(PersonArrsy[i], ref OneCost);
-                        // �WŒv
-                        for (int ix = 0; ix < CostValue.Length; ix++)
-                        {
-                            CostValue[ix] += OneCost[ix];
-                        }
-                    }
-                }
-
                 // ----- •â�•�U•ª‚Ì�WŒv
                 DataGridView dgv = dgvMaster;
-
                 int SumData = 0;
+                int RowCnt = 0;
+                
                 for (int i = 0; i < CostValue.Length; i++)
                 {
                     // �s�ì�¬
-                    int RowCnt = dgv.Rows.Add(1);
+                    RowCnt = dgv.Rows.Add(1);
                     // Œo”ï–¼�Ì
-                    dgv.Rows[RowCnt].Cells[(int)DispColumn.ConstructionName].Value = s_GroupTitle[i];
+                    dgv.Rows[RowCnt].Cells[(int)DispColumn.SelectionName].Value = s_GroupTitle[i];
                     // ‹àŠzƒZƒbƒg
-                    dgv.Rows[RowCnt].Cells[(int)DispColumn.OrdersDecisionPrice].Value = CostValue[i].ToString("#,0");
+                    dgv.Rows[RowCnt].Cells[(int)DispColumn.GrossProfit].Value = CostValue[i].ToString("#,0");
                     SumData += CostValue[i];
                 }
 
+                // ’S“–ŽÒ‚Ì�U•ª
+                int ConstrCost = CommonMotions.cnvInt(lblTotalValue.Text);
+                // �s�ì�¬
+                RowCnt = dgv.Rows.Add(1);
+                // Œo”ï–¼�Ì
+                dgv.Rows[RowCnt].Cells[(int)DispColumn.SelectionName].Value = s_GroupTitle[2];
+                // ‹àŠzƒZƒbƒg
+                dgv.Rows[RowCnt].Cells[(int)DispColumn.GrossProfit].Value = ConstrCost.ToString("#,0");
+                SumData += ConstrCost;
 
-                dgv.Rows.Add();       // ‹ó�s
                 // ----- •â�•�U•ª‚ÌŒv‚ð•\Ž¦‚·‚é
                 // �s�ì�¬
                 int AuxiliaryCnt = dgv.Rows.Add(1);
                 // Œo”ï–¼�Ì
-                dgv.Rows[AuxiliaryCnt].Cells[(int)DispColumn.ConstructionName].Value = s_TotalTitleArray[(int)RowTitleNum.Auxiliary];
+                dgv.Rows[AuxiliaryCnt].Cells[(int)DispColumn.SelectionName].Value = s_TotalTitleArray[(int)RowTitleNum.Auxiliary];
                 // ‹àŠzƒZƒbƒg
-                dgv.Rows[AuxiliaryCnt].Cells[(int)DispColumn.OrdersDecisionPrice].Value = SumData.ToString("#,0");
+                dgv.Rows[AuxiliaryCnt].Cells[(int)DispColumn.GrossProfit].Value = SumData.ToString("#,0");
                 // �s‚Ì�F‚ð•Ï‚¦‚é
                 SetRowColor(dgv.Rows[AuxiliaryCnt], s_RowTotalBackColor, s_RowTotalForeColor);
 
-                return (CostValue[0] + CostValue[1]);
+                return SumData;
             }
             catch (Exception ex)
             {
@@ -1252,76 +751,233 @@
         }
         #endregion
 
-        #region ’S“–ŽÒ–ˆ‚ÌŽw’èŠú‚Ì�HŽ–ŠJŽn“ú‚ðŽæ“¾‚·‚é
+        #region ’S“–ŽÒƒRƒ“ƒ{‚æ‚è’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
         /// <summary>
-        /// ’S“–ŽÒ–ˆ‚ÌŽw’èŠú‚Ì�HŽ–ŠJŽn“ú‚ðŽæ“¾‚·‚é
+        /// ’S“–ŽÒƒRƒ“ƒ{‚æ‚è’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
         /// </summary>
         /// <returns></returns>
-        private DateTime GetConstructionDate(int PersonCode, bool bStart = true)
+        private int GetConstructionPersonCode()
         {
-            IOConstructionBaseInfo BaseDB = new IOConstructionBaseInfo();
             try
             {
-                // ‹ó‚Ì�ê�‡‚Íƒ�ƒOƒCƒ“ƒ†�[ƒU�[
-                if (PersonCode == 0) PersonCode = CommonMotions.LoginUserData.PersonCode;
+                // •\Ž¦‚³‚ê‚Ä‚¢‚È‚¢�ê�‡‚Í‘I‘ð–³
+                //if (!cmbConstructionPerson.Visible) return 0;
 
-                // ŠJŽn“úŽæ“¾
-                string strSQL = string.Empty;
-                strSQL = "SELECT A.CONSTRUCTIONPERSONCODE, MIN(B.CONSTRUCTIONSTART) FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBUDGET B";
-                // �I—¹Žw’è‚Í�I—¹‚ÌMAX‚É•Ï�X
-                if (!bStart) strSQL = strSQL.Replace("MIN(B.CONSTRUCTIONSTART)", "MAX(B.CONSTRUCTIONEND)");
-
-                strSQL += string.Format(" WHERE A.CONSTRUCTIONPERSONCODE = {0}", PersonCode);
-                strSQL += string.Format("  AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
-                strSQL += " AND A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE GROUP BY A.CONSTRUCTIONPERSONCODE";
-                ArrayList ArrayList = new ArrayList();
-                if (!BaseDB.ExecuteReader(strSQL, ref ArrayList)) return DateTime.MinValue;
-                if (ArrayList.Count == 0) return DateTime.MinValue;
-
-                object[] objRec = (object[])ArrayList[0];
-
-                return CommonMotions.cnvDate(objRec[1]);
+                return CommonMotions.cnvInt(cmbConstructionPerson.SelectedValue);
             }
             catch (Exception ex)
             {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return DateTime.MinValue;
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}", ex.Message);
+                return 0;
             }
-            finally
-            {
-                BaseDB.close(); BaseDB = null;
-            }
         }
         #endregion
 
+        #region ŠúŠÔƒf�[ƒ^Žæ“¾�‡
+        /// <summary>
+        /// ŠúŠÔƒf�[ƒ^Žæ“¾�‡
+        /// </summary>
+        private enum GetPersonTerm
+        {
+            /// <summary>
+            /// ’S“–ŽÒƒR�[ƒh
+            /// </summary>
+            Personcode = 0,
+            /// <summary>
+            /// ’S“–ŽÒ–¼
+            /// </summary>
+            Personname,
+            /// <summary>
+            /// •\Ž¦�‡
+            /// </summary>
+            Displayorder,
+            /// <summary>
+            /// ŒŽŠz‹‹—^
+            /// </summary>
+            MonthlySalary,
+            /// <summary>
+            /// ’S“–ŽÒŒ_–ñ�HŠúŠJŽn
+            /// </summary>
+            MainStart1,
+            /// <summary>
+            /// ’S“–ŽÒŒ_–ñ�HŠú‰„’·ŠJŽn
+            /// </summary>
+            MainStart2,
+            /// <summary>
+            /// •›’S“–ŽÒŒ_–ñ�HŠúŠJŽn
+            /// </summary>
+            AssistStart1,
+            /// <summary>
+            /// •›’S“–ŽÒŒ_–ñ�HŠú‰„’·ŠJŽn
+            /// </summary>
+            AssistStart2,
+            /// <summary>
+            /// Žw“±ˆõŒ_–ñ�HŠúŠJŽn
+            /// </summary>
+            InstStart1,
+            /// <summary>
+            /// Žw“±ˆõŒ_–ñ�HŠú‰„’·ŠJŽn
+            /// </summary>
+            InstStart2,
+            /// <summary>
+            /// ’S“–ŽÒŒ_–ñ�HŠú�I—¹
+            /// </summary>
+            MainEnd1,
+            /// <summary>
+            /// ’S“–ŽÒŒ_–ñ�HŠú‰„’·�I—¹
+            /// </summary>
+            MainEnd2,
+            /// <summary>
+            /// •›’S“–ŽÒŒ_–ñ�HŠú�I—¹
+            /// </summary>
+            AssistEnd1,
+            /// <summary>
+            /// •›’S“–ŽÒŒ_–ñ�HŠú‰„’·�I—¹
+            /// </summary>
+            AssistEnd2,
+            /// <summary>
+            /// Žw“±ˆõŒ_–ñ�HŠú�I—¹
+            /// </summary>
+            InstEnd1,
+            /// <summary>
+            /// Žw“±ˆõŒ_–ñ�HŠú‰„’·�I—¹
+            /// </summary>
+            InstEnd2,
+            /// <summary>
+            /// ’S“–ŽÒ‹àŠz�WŒv
+            /// </summary>
+            MainSumAmount,
+            /// <summary>
+            /// •›’S“–ŽÒ‹àŠz�WŒv
+            /// </summary>
+            AssistSumAmount,
+            /// <summary>
+            /// Žw“±ˆõ‹àŠz�WŒv
+            /// </summary>
+            InstSumAmount,
+            /// <summary>
+            /// ’S“–ŽÒƒf�[ƒ^Œ��”
+            /// </summary>
+            MainDataCount,
+            /// <summary>
+            /// •›’S“–ŽÒƒf�[ƒ^Œ��”
+            /// </summary>
+            AssistDataCmount,
+            /// <summary>
+            /// Žw“±ˆõƒf�[ƒ^Œ��”
+            /// </summary>
+            InstDataCmount,
+        }
+        #endregion
+
         #region •”��“à‚Ì’S“–ŽÒƒR�[ƒh‚ðˆê——‚Å•Ô‚·
         /// <summary>
         /// •”��“à‚Ì’S“–ŽÒƒR�[ƒh‚ðˆê——‚Å•Ô‚·
         /// </summary>
         /// <param name="DepartmentCode">•”��ƒR�[ƒh</param>
-        /// <param name="PersonCode">’S“–ŽÒƒR�[ƒhˆê——</param>
+        /// <param name="PersonCodeList">’S“–ŽÒƒR�[ƒhˆê——</param>
         /// <returns>ƒf�[ƒ^Œ��”</returns>
-        private int GetPersonInDepartment(int DepartmentCode,ref List<int> PersonCode)
+        private int GetPersonInDepartment(ref List<int> PersonCodeList, ref List<DateTime> dtStartList, ref List<DateTime> dtCompList, ref List<int> MonthSalaryList)
         {
             IOMPersonInCharge PersonDB = new IOMPersonInCharge();
             try
             {
-                string strSQL = string.Format(" WHERE (PERSONCODE IN (SELECT SALESPERSONCODE FROM CONSTRUCTIONBASEINFO WHERE CONSTRUCTIONPERIOD = {0})", numUDConstPro.Value);
-                strSQL += string.Format(" OR PERSONCODE IN (SELECT CONSTRUCTIONPERSONCODE FROM CONSTRUCTIONBASEINFO WHERE CONSTRUCTIONPERIOD = {0})", numUDConstPro.Value);
-                strSQL += string.Format(" OR PERSONCODE IN (SELECT CONSTRSUBPERSONCODE FROM CONSTRUCTIONBASEINFO WHERE CONSTRUCTIONPERIOD = {0})", numUDConstPro.Value);
-                strSQL += string.Format(" OR PERSONCODE IN (SELECT CONSTRUCTIONINSTRUCTOR FROM CONSTRUCTIONBASEINFO WHERE CONSTRUCTIONPERIOD = {0}))", numUDConstPro.Value);
-                strSQL += " AND EMPLOYEECLASSFLG = 1";
-                if (DepartmentCode != 0)
-                    strSQL += string.Format(" AND DEPARTMENTCODE = {0}", DepartmentCode);
-                strSQL += " ORDER BY DISPLAYORDER ";
-                List<PersonInChargeMaster> PersonList = new List<PersonInChargeMaster>();
-                if (!PersonDB.SelectAction(strSQL, ref PersonList)) return 0;
+                int DepartmentCode = GetDepartmentCode();
+                int PersonCode = CommonMotions.cnvInt(cmbConstructionPerson.SelectedValue);
+                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
 
-                foreach (PersonInChargeMaster wrkRec in PersonList)
+                string strSQL = "SELECT P.PERSONCODE, P.PERSONNAME, P.DISPLAYORDER, P.MonthlySalary,";
+                strSQL += "  MIN(C.CONSTRUCTIONPERIODSTART) M1, MIN(C.CONSTRUCTIONPERIODSTART2) M2";
+                strSQL += " ,MIN(D.CONSTRUCTIONPERIODSTART) S1, MIN(D.CONSTRUCTIONPERIODSTART2) S2";
+                strSQL += " ,MIN(E.CONSTRUCTIONPERIODSTART) I1, MIN(E.CONSTRUCTIONPERIODSTART2) I2";
+                strSQL += " ,MAX(C.CONSTRUCTIONPERIODEND) M3, MAX(C.CONSTRUCTIONPERIODEND2) M4";
+                strSQL += " ,MAX(D.CONSTRUCTIONPERIODEND) S3, MAX(D.CONSTRUCTIONPERIODEND2) S4";
+                strSQL += " ,MAX(E.CONSTRUCTIONPERIODEND) I3, MAX(E.CONSTRUCTIONPERIODEND2) I4";
+                strSQL += " ,SUM(C2.EXECUTIONAMOUNT) M5, SUM(D2.EXECUTIONAMOUNT) S5, SUM(E2.EXECUTIONAMOUNT) I5";
+                strSQL += " ,COUNT(C2.EXECUTIONAMOUNT) M6, COUNT(D2.EXECUTIONAMOUNT) S6, COUNT(E2.EXECUTIONAMOUNT) I6";
+                strSQL += " FROM PERSONINCHARGEMASTER P";
+
+                // �HŽ–’S“–ŽÒ‚Ìƒf�[ƒ^Žæ“¾
+                strSQL += " LEFT JOIN CONSTRUCTIONBASEINFO C ON C.CONSTRUCTIONPERSONCODE = P.PERSONCODE";
+                strSQL += string.Format(" AND C.CONSTRUCTIONSTATUSFLG <> {0}", NotOrder);
+                strSQL += string.Format(" AND C.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " LEFT JOIN CONSTRUCTIONLEDGERDETAIL C2 ON C2.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND C2.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Payroll);
+
+                // �HŽ–•›’S“–ŽÒ‚Ìƒf�[ƒ^Žæ“¾
+                strSQL += " LEFT JOIN CONSTRUCTIONBASEINFO D ON D.CONSTRSUBPERSONCODE = P.PERSONCODE";
+                strSQL += string.Format(" AND D.CONSTRUCTIONSTATUSFLG <> {0}", NotOrder);
+                strSQL += string.Format(" AND D.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " LEFT JOIN CONSTRUCTIONLEDGERDETAIL D2 ON D2.CONSTRUCTIONCODE = D.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND D2.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Assistant);
+
+                // �HŽ–Žw“±ˆõ‚Ìƒf�[ƒ^Žæ“¾
+                strSQL += " LEFT JOIN CONSTRUCTIONBASEINFO E ON E.CONSTRUCTIONINSTRUCTOR = P.PERSONCODE";
+                strSQL += string.Format(" AND E.CONSTRUCTIONSTATUSFLG <> {0}", NotOrder);
+                strSQL += string.Format(" AND E.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " LEFT JOIN CONSTRUCTIONLEDGERDETAIL E2 ON E2.CONSTRUCTIONCODE = E.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND E2.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Instructor);
+
+                strSQL += " WHERE P.DELETEFLG = 0";
+                strSQL += string.Format(" AND P.LEDGERFLG = {0}", (int)CommonDefine.PersonLedgerDivNo.CalcTarget);
+                // �HŽ–‘ä’ ƒf�[ƒ^‚Ì•”��‚¾‚¯‚ª‘Î�Û
+                strSQL += " AND P.DEPARTMENTCODE IN";
+                strSQL += " (SELECT DEPARTMENTCODE FROM (SELECT A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER, COUNT(*) CNT";
+                strSQL += " FROM DEPARTMENTMASTER A, PERSONINCHARGEMASTER B, CONSTRUCTIONBASEINFO C , CONSTRUCTIONLEDGERDETAIL D";
+                strSQL += " WHERE A.DELETEFLG = 0";
+                strSQL += " AND A.DEPARTMENTCODE = B.DEPARTMENTCODE";
+                strSQL += " AND B.PERSONCODE = C.CONSTRUCTIONPERSONCODE";
+                strSQL += " AND D.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
+                strSQL += " GROUP BY A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER))";
+
+                // 16ŠúŒÀ’èƒŠƒtƒH�[ƒ€‚ÍŒ_–ñŽÐˆõ‚à’Ç‰Á‚·‚é
+                if (numUDConstPro.Value < 17 && DepartmentCode == 9)
                 {
-                    PersonCode.Add(wrkRec.PersonCode);
                 }
-                return PersonCode.Count;
+                else
+                {
+                    strSQL += string.Format(" AND P.EMPLOYEECLASSFLG = {0}", (int)CommonDefine.EmployeeClassFlg.Regular);
+                }
+                // •”��ƒR�[ƒh‘I‘ðŽž‚Í•”��‚ðŒŸ�õ�ðŒ�‚Ö“ü‚ê‚é
+                if (DepartmentCode != 0) strSQL += string.Format(" AND P.DEPARTMENTCODE = {0}", DepartmentCode);
+                if (PersonCode != 0) strSQL += string.Format(" AND P.PERSONCODE = {0}", PersonCode);
+                strSQL += " GROUP BY P.PERSONCODE, P.PERSONNAME, P.DISPLAYORDER, P.MonthlySalary";
+                strSQL += " ORDER BY P.DISPLAYORDER";
+
+                ArrayList arList = new ArrayList();
+                if (!PersonDB.ExecuteReader(strSQL, ref arList)) return 0;
+
+                // “–ŠúŠúŽñ“ú�EŠú––“ú‚ðŽæ“¾
+                DateTime dtDefaultStart = DateTime.MinValue;
+                DateTime dtDefaultEnd = DateTime.MinValue;
+                CreateDefaultStartAndEndDate(ref dtDefaultStart, ref dtDefaultEnd);
+
+                DateTime stDate = dtDefaultStart;
+                DateTime edDate = dtDefaultEnd;
+                foreach (object[] objRec in arList)
+                {
+                    // ’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
+                    int Person = CommonMotions.cnvInt(objRec[(int)GetPersonTerm.Personcode]);
+
+                    DateTime wrkDate = DateTime.MinValue;
+                    // �Å�¬‚ÌŠJŽn“ú‚ðŽæ“¾‚·‚é
+                    stDate = dtDefaultStart;
+                    wrkDate = CommonMotions.cnvDate(objRec[(int)GetPersonTerm.MainStart1]).Date;
+                    if (wrkDate != DateTime.MinValue && wrkDate < stDate) stDate = wrkDate;
+                    wrkDate = CommonMotions.cnvDate(objRec[(int)GetPersonTerm.MainStart2]).Date;
+                    if (wrkDate != DateTime.MinValue && wrkDate < stDate) stDate = wrkDate;
+
+                    // �Å‘å‚Ì�I—¹“ú‚ðŽæ“¾‚·‚é
+                    edDate = dtDefaultEnd;
+                    // ŒŽŠz‹‹—^‚ðŽæ“¾‚·‚é
+                    int Salary = CommonMotions.cnvInt(objRec[(int)GetPersonTerm.MonthlySalary]);
+
+                    PersonCodeList.Add(Person);     // ’S“–ŽÒƒR�[ƒh
+                    dtStartList.Add(stDate);        // ŠJŽn“ú
+                    dtCompList.Add(edDate);         // �I—¹“ú
+                    MonthSalaryList.Add(Salary);    // ‹‹—^‹àŠz
+                }
+                return arList.Count;
             }
             catch (Exception ex)
             {
@@ -1366,7 +1022,7 @@
                     {
                         if (CommonMotions.cnvInt(wrkobj[1]) == i)
                         {
-                            CostValue[i] = CommonMotions.cnvInt(wrkobj[2]);
+                            CostValue[i] += CommonMotions.cnvInt(wrkobj[2]);
                             break;
                         }
                     }
@@ -1387,23 +1043,49 @@
         /// <summary>
         /// ’S“–ŽÒ–ˆ‚Ì•â�•�U•ª‚ðŽæ“¾‚·‚é
         /// </summary>
-        /// <param name="PersonCode"></param>
+        /// <param name="PersonCDArray"></param>
         /// <param name="CostValue"></param>
-        private void GetPersonAuxiliaryCostValue(int PersonCode, ref int[] CostValue)
+        private void GetPersonAuxiliaryCostValue(ref int[] CostValue)
         {
             IOConstructionLedgerDetail DetailDB = new IOConstructionLedgerDetail();
             try
             {
+                int DepartmentCode = GetDepartmentCode();
+                int PersonCode = CommonMotions.cnvInt(cmbConstructionPerson.SelectedValue);
+                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
+
                 // �HŽ–�Ú�×‘ä’ ƒf�[ƒ^‚æ‚è•â�•�U•ª‚ðŽæ“¾‚·‚é
-                string strSQL = "SELECT A.COMPANYCODE, A.GROUPCOUNT, SUM(A.EXECUTIONAMOUNT)";
-                strSQL += " FROM CONSTRUCTIONLEDGERDETAIL A, CONSTRUCTIONBASEINFO B";
-                strSQL += string.Format(" WHERE (A.GROUPCOUNT = {0} OR A.GROUPCOUNT = {1})"
-                                        , (int)FrmConstructionLedger.DataGroup.Assistant, (int)FrmConstructionLedger.DataGroup.Instructor);
-                strSQL += string.Format(" AND A.COMPANYCODE = {0}", PersonCode);
-                strSQL += " AND A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
-                strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
-                strSQL += " GROUP BY A.COMPANYCODE, A.GROUPCOUNT";
-                strSQL += " ORDER BY A.COMPANYCODE, A.GROUPCOUNT";
+                string strSQL = "SELECT A.CONSTRUCTIONPERIOD, P.GROUPCOUNT, SUM(P.EXECUTIONAMOUNT)";
+                strSQL += " FROM CONSTRUCTIONLEDGERDETAIL P, CONSTRUCTIONBASEINFO A";
+                strSQL += string.Format(" WHERE P.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Instructor);
+
+                strSQL += " AND P.COMPANYCODE IN (SELECT PERSONCODE FROM PERSONINCHARGEMASTER WHERE DELETEFLG = 0";
+
+                if (DepartmentCode != 0) strSQL += string.Format(" AND DEPARTMENTCODE = {0}", DepartmentCode);
+                if (PersonCode != 0) strSQL += string.Format(" AND PERSONCODE = {0}", PersonCode);
+                
+                strSQL += " )";
+                strSQL += " AND P.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND A.CONSTRUCTIONSTATUSFLG <> {0}", NotOrder);
+                strSQL += string.Format(" AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " GROUP BY A.CONSTRUCTIONPERIOD, P.GROUPCOUNT";
+
+                strSQL += " UNION";
+                strSQL += " SELECT A.CONSTRUCTIONPERIOD, P.GROUPCOUNT, SUM(P.EXECUTIONAMOUNT)";
+                strSQL += " FROM CONSTRUCTIONLEDGERDETAIL P, CONSTRUCTIONBASEINFO A";
+                strSQL += string.Format(" WHERE P.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Assistant);
+
+                strSQL += " AND P.COMPANYCODE IN (SELECT PERSONCODE FROM PERSONINCHARGEMASTER WHERE DELETEFLG = 0";
+                
+                if (DepartmentCode != 0) strSQL += string.Format(" AND DEPARTMENTCODE = {0}", DepartmentCode);
+                if (PersonCode != 0) strSQL += string.Format(" AND PERSONCODE = {0}", PersonCode);
+
+                strSQL += " )";
+                strSQL += " AND P.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND A.CONSTRUCTIONSTATUSFLG <> {0}", NotOrder);
+                strSQL += string.Format(" AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " GROUP BY A.CONSTRUCTIONPERIOD, P.GROUPCOUNT";
+
                 ArrayList arList = new ArrayList();
                 if (!DetailDB.ExecuteReader(strSQL, ref arList)) return;
 
@@ -1431,6 +1113,740 @@
         }
         #endregion
 
+        #region �HŽ–�Ú�×‘ä’ ‚æ‚è�U•ª‹‹—^‹àŠz�E‘e—˜‰v‚ðŽæ“¾‚·‚é
+        /// <summary>
+        /// �HŽ–�Ú�×‘ä’ ‚æ‚è�U•ª‹‹—^‹àŠz�E‘e—˜‰v‚ðŽæ“¾‚·‚é
+        /// </summary>
+        /// <param name="OnSalary">�U•ª‹‹—^‹àŠz</param>
+        /// <param name="NetIncome">�ƒ—˜‰v‹àŠz</param>
+        /// <param name="NonSalary">‘e—˜‰v‹àŠz</param>
+        private void ProfitGeneral(ref int OnSalary, ref int NetIncome, ref int NonSalary)
+        {
+            IOConstructionLedger LedgerlDB = new IOConstructionLedger();
+            try
+            {
+                // •”��ƒR�[ƒhŽæ“¾
+                int DepartmentCode = GetDepartmentCode();
+                int PersonCode = CommonMotions.cnvInt(cmbConstructionPerson.SelectedValue);
+                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
+
+                // �U•ª‹‹—^‹àŠzŽæ“¾
+                //string strSQL = "SELECT SUM(E.PAYMENTAMOUNT) FROM CONSTRUCTIONLEDGER P, CONSTRUCTIONBASEINFO B, CONSTRUCTIONLEDGERDETAIL C, PERSONINCHARGEMASTER D, CONSTRUCTIONLEDGEREXCUTE E";
+                string strSQL = "SELECT SUM(C.EXECUTIONAMOUNT) FROM CONSTRUCTIONLEDGER P, CONSTRUCTIONBASEINFO B, CONSTRUCTIONLEDGERDETAIL C, PERSONINCHARGEMASTER D";
+                // �U•ª–³‚Å‚Í–³‚¢
+                strSQL += " WHERE P.CONSTRUCTIONCODE IN (SELECT A.CONSTRUCTIONCODE FROM CONSTRUCTIONLEDGERDETAIL A";
+                strSQL += string.Format(" WHERE A.GROUPCOUNT = {0} AND A.OPERATINGFLG = {1} AND (A.SALARYFLG = {2} OR A.SALARYFLG = {3}))"
+                                        , (int)FrmConstructionLedger.DataGroup.Payroll
+                                        , (int)CommonDefine.SalaryOperateKind.Oparateing
+                                        , (int)CommonDefine.SalaryDevision.All
+                                        , (int)CommonDefine.SalaryDevision.DaysInput);
+
+                strSQL += " AND P.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
+                strSQL += " AND C.CONSTRUCTIONCODE = P.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND C.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Payroll);
+                strSQL += string.Format(" AND C.OPERATINGFLG = {0}", (int)CommonDefine.SalaryOperateKind.Oparateing);
+                //strSQL += " AND E.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
+                //strSQL += " AND E.GROUPCOUNT = C.GROUPCOUNT";
+                //strSQL += " AND E.LINECOUNT = C.LINECOUNT";
+                strSQL += " AND D.PERSONCODE = B.CONSTRUCTIONPERSONCODE";
+                if (DepartmentCode != 0) strSQL += string.Format(" AND D.DEPARTMENTCODE = {0}", DepartmentCode);
+                if (PersonCode != 0) strSQL += string.Format(" AND D.PERSONCODE = {0}", PersonCode);
+
+                ArrayList arList = new ArrayList();
+                if (!LedgerlDB.ExecuteReader(strSQL, ref arList)) return;
+                object[] objSalary = (object[])arList[0];
+                OnSalary = CommonMotions.cnvInt(objSalary[0]);
+
+                // �U•ª�Ï‚Ý•ª�ƒ—˜‰vŽæ“¾
+                strSQL = "SELECT SUM(P.NETPROFIT) FROM CONSTRUCTIONLEDGER P, CONSTRUCTIONBASEINFO B, PERSONINCHARGEMASTER D";
+                // �U•ª�Ï‚Ý•ª�ƒ—˜‰v
+                strSQL += " WHERE P.CONSTRUCTIONCODE IN (SELECT A.CONSTRUCTIONCODE  FROM CONSTRUCTIONLEDGERDETAIL A";
+                strSQL += string.Format(" WHERE A.GROUPCOUNT = {0} AND A.OPERATINGFLG = {1} AND (A.SALARYFLG = {2} OR A.SALARYFLG = {3}))"
+                                        , (int)FrmConstructionLedger.DataGroup.Payroll
+                                        , (int)CommonDefine.SalaryOperateKind.Oparateing
+                                        , (int)CommonDefine.SalaryDevision.All
+                                        , (int)CommonDefine.SalaryDevision.DaysInput);
+
+                strSQL += " AND P.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
+                strSQL += " AND D.PERSONCODE = B.CONSTRUCTIONPERSONCODE";
+                if (DepartmentCode != 0) strSQL += string.Format(" AND D.DEPARTMENTCODE = {0}", DepartmentCode);
+                if (PersonCode != 0) strSQL += string.Format(" AND D.PERSONCODE = {0}", PersonCode);
+
+                ArrayList arList2 = new ArrayList();
+                if (!LedgerlDB.ExecuteReader(strSQL, ref arList2)) return;
+                object[] objNetIncome = (object[])arList2[0];
+                NetIncome = CommonMotions.cnvInt(objNetIncome[0]);
+
+                // �U•ª–³‚µ•ª�ƒ—˜‰vŽæ“¾
+                strSQL = "SELECT SUM(P.NETPROFIT) FROM CONSTRUCTIONLEDGER P, CONSTRUCTIONBASEINFO B, PERSONINCHARGEMASTER D";
+                // �U•ª�Ï‚Ý•ª�ƒ—˜‰v
+                strSQL += " WHERE P.CONSTRUCTIONCODE NOT IN (SELECT A.CONSTRUCTIONCODE  FROM CONSTRUCTIONLEDGERDETAIL A";
+                strSQL += string.Format(" WHERE A.GROUPCOUNT = {0} AND A.OPERATINGFLG = {1} AND (A.SALARYFLG = {2} OR A.SALARYFLG = {3}))"
+                                        , (int)FrmConstructionLedger.DataGroup.Payroll
+                                        , (int)CommonDefine.SalaryOperateKind.Oparateing
+                                        , (int)CommonDefine.SalaryDevision.All
+                                        , (int)CommonDefine.SalaryDevision.DaysInput);
+
+                strSQL += " AND P.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
+                strSQL += " AND D.PERSONCODE = B.CONSTRUCTIONPERSONCODE";
+                if (DepartmentCode != 0) strSQL += string.Format(" AND D.DEPARTMENTCODE = {0}", DepartmentCode);
+                if (PersonCode != 0) strSQL += string.Format(" AND D.PERSONCODE = {0}", PersonCode);
+
+                ArrayList arList3 = new ArrayList();
+                if (!LedgerlDB.ExecuteReader(strSQL, ref arList3)) return;
+                object[] objNonSalary = (object[])arList3[0];
+                NonSalary = CommonMotions.cnvInt(objNonSalary[0]);
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                LedgerlDB.close(); LedgerlDB = null;
+            }
+        }
+        #endregion
+
+        #region ƒwƒbƒ_�[‚Ì—˜‰v‚©‚çŒo”ï‚ðˆø‚­
+        /// <summary>
+        /// ƒwƒbƒ_�[‚Ì—˜‰v‚©‚çŒo”ï‚ðˆø‚­
+        /// </summary>
+        private void ReCalcHeader(int Expenses)
+        {
+            try
+            {
+                // �U•ª‹‹—^‹àŠz
+                int OnSalary = CommonMotions.cnvInt(lblCalcValue1.Text);
+
+                // �ƒ—˜‰v‹àŠz
+                int NetIncome = CommonMotions.cnvInt(lblCalcValue2.Text);
+
+                // ‘e—˜‰v‹àŠzŽæ“¾
+                int NonSalary = CommonMotions.cnvInt(lblCalcValue3.Text);
+
+                // ‹‹—^—Ý�Ï•\Ž¦
+                int TotalSalary = CommonMotions.cnvInt(lblPayroll.Text);
+
+
+                // �U•ª‹‹—^‹àŠz•\Ž¦
+                lblCalcValue1.Text = OnSalary.ToString("#,0");
+
+                // ‹‹—^—Ý�Ï•\Ž¦
+                lblPayroll.Text = TotalSalary.ToString("#,0");
+
+                // ‹‹—^�·ŠzŒvŽZ�E•\Ž¦
+                int TotalValue = OnSalary - TotalSalary;
+                lblTotalValue.Text = TotalValue.ToString("#,0");
+                lblTotalValue2.Text = TotalValue.ToString("#,0");
+
+                // �ƒ—˜‰v‹àŠz•\Ž¦
+                lblCalcValue2.Text = NetIncome.ToString("#,0");
+
+                // “–Šú�ƒ—˜‰vŒvŽZ
+                int CalcTotal1 = NetIncome + TotalValue;
+                lblTotalCalcValue1.Text = CalcTotal1.ToString("#,0");
+                lblTotalCalcValue2.Text = CalcTotal1.ToString("#,0");
+
+                // ‘e—˜‰v‹àŠzŽæ“¾
+                lblCalcValue3.Text = NonSalary.ToString("#,0");
+
+                // “–Šú�ƒ—˜‰vŒvŽZ
+                int CalcTotal = NonSalary + CalcTotal1 - Expenses;
+                lblTotalCalcValue.Text = CalcTotal.ToString("#,0");
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region ˆê——ƒf�[ƒ^•\Ž¦�ˆ—�
+        /// <summary>
+        /// ˆê——ƒf�[ƒ^•\Ž¦�ˆ—�
+        /// </summary>
+        private void DataDisplay()
+        {
+            IOConstructionLedger LedgerDB = new IOConstructionLedger();
+            DataGridView dgv = dgvMaster;
+            ProgressBar prgber = ProgressBar;
+            try
+            {
+                dgv.SuspendLayout();
+                dgv.Rows.Clear();
+
+                // ƒvƒ�ƒOƒŒƒXƒo�[‚ÌƒZƒbƒg
+                prgber.Visible = true;
+                prgber.Minimum = 0;
+                prgber.Maximum = 10;
+                prgber.Value = 0;
+
+                string strSQL = string.Empty;
+                // SQL�ì�¬
+                CreateInitSQL(ref strSQL);
+
+                ArrayList arData = new ArrayList();
+                // ----- �HŽ–�Ú�×‘ä’ Žæ“¾
+                LedgerDB.ExecuteReader(strSQL, ref arData);
+
+                // “Ç�žŽžƒf�[ƒ^ƒJƒEƒ“ƒgŽæ“¾
+                m_initDataCount = arData.Count;
+                //if (arData.Count == 0) return;
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // �‡ŒvƒGƒŠƒA
+                int TotalColCnt = Enum.GetNames(typeof(DispColumn)).Length;
+                int[] TotalArea = new int[TotalColCnt];
+                Array.Clear(TotalArea, 0, TotalArea.Length);
+
+                // ƒf�[ƒ^•\Ž¦
+                int ino = 1;
+                int StatusFlg = -1;
+                bool initFlg = true;
+                string strStatus = string.Empty;
+                // ----- Ž{�H’†ƒf�[ƒ^•\Ž¦
+                bool DataExists = false;
+                foreach (object[] objwrk in arData)
+                {
+                    // “ü—ÍŠ®—¹‚Í•\Ž¦‚µ‚È‚¢
+                    if (CommonMotions.cnvInt(objwrk[(int)DBGetData.ComplateFlg]) == (int)CommonDefine.ComplateTitleNo.Complated) break;
+
+                    // ƒOƒŠƒbƒh‚Öƒf�[ƒ^•\Ž¦
+                    GridDataSet(objwrk, ref ino, ref TotalArea, ref initFlg, ref StatusFlg);
+                    DataExists = true;
+                }
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // •\Ž¦ƒf�[ƒ^‚ª‚ ‚é‚©‚Ìƒ`ƒFƒbƒN
+                // ----- �‡Œv•\Ž¦
+                if (DataExists)
+                {
+                    //dgv.Rows.Add();       // ‹ó�s
+
+                    // �‡Œv�s•\Ž¦
+                    int TotalRow = dgv.Rows.Add(1);
+                    dgv.Rows[TotalRow].Cells[(int)DispColumn.SelectionName].Value = s_TotalTitleArray[(int)RowTitleNum.Execution];
+                    // �s‚Ì�F‚ð•Ï‚¦‚é
+                    SetRowColor(dgv.Rows[TotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
+
+                    // �”’l•\Ž¦
+                    for (int i = (int)DispColumn.OrdersDecisionPrice; i <= (int)DispColumn.NetProfit; i++)
+                    {
+                        dgv.Rows[TotalRow].Cells[i].Value = TotalArea[i].ToString("#,0");
+                    }
+                    dgv.Rows.Add();       // ‹ó�s
+                }
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // ----- �Ïƒf�[ƒ^•\Ž¦
+                bool bRowPrint = false;
+                int[] ComplateTotalArea = new int[TotalColCnt];
+                Array.Clear(ComplateTotalArea, 0, ComplateTotalArea.Length);
+                foreach (object[] objwrk in arData)
+                {
+                    // “ü—ÍŠ®—¹ˆÈŠO‚Í•\Ž¦‚µ‚È‚¢
+                    if (CommonMotions.cnvInt(objwrk[(int)DBGetData.ComplateFlg]) != (int)CommonDefine.ComplateTitleNo.Complated) continue;
+
+                    // ƒOƒŠƒbƒh‚Öƒf�[ƒ^•\Ž¦
+                    GridDataSet(objwrk, ref ino, ref ComplateTotalArea, ref initFlg, ref StatusFlg);
+                    bRowPrint = true;
+                }
+                // �‡Œv‚ð‘��‡Œv‚É‘«‚·
+                for (int i = 0; i < ComplateTotalArea.Length; i++)
+                {
+                    TotalArea[i] += ComplateTotalArea[i];
+                }
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // �Ïƒf�[ƒ^‚ª‚ ‚ê‚Î•\Ž¦
+                if (bRowPrint)
+                {
+                    //dgv.Rows.Add();       // ‹ó�s
+                    int CompTotalRow = dgv.Rows.Add(1);
+                    dgv.Rows[CompTotalRow].Cells[(int)DispColumn.SelectionName].Value = s_TotalTitleArray[(int)RowTitleNum.Completed];
+                    // �s‚Ì�F‚ð•Ï‚¦‚é
+                    SetRowColor(dgv.Rows[CompTotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
+                    // �”’l•\Ž¦
+                    for (int i = (int)DispColumn.OrdersDecisionPrice; i <= (int)DispColumn.NetProfit; i++)
+                    {
+                        dgv.Rows[CompTotalRow].Cells[i].Value = ComplateTotalArea[i].ToString("#,0");
+                    }
+                    dgv.Rows.Add();       // ‹ó�s
+                }
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // ----- �HŽ–�‡Œv‚ð•\Ž¦‚·‚é
+                if (DataExists || bRowPrint)
+                {
+                    //dgv.Rows.Add();       // ‹ó�s
+                    int TotalRow = dgv.Rows.Add(1);
+                    dgv.Rows[TotalRow].Cells[(int)DispColumn.SelectionName].Value = s_TotalTitleArray[(int)RowTitleNum.AllConstrutions];
+                    // �s‚Ì�F‚ð•Ï‚¦‚é
+                    SetRowColor(dgv.Rows[TotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
+                    // �”’l•\Ž¦
+                    for (int i = (int)DispColumn.OrdersDecisionPrice; i <= (int)DispColumn.NetProfit; i++)
+                    {
+                        dgv.Rows[TotalRow].Cells[i].Value = TotalArea[i].ToString("#,0");
+                    }
+                    dgv.Rows.Add();       // ‹ó�s
+                }
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // ----- ’S“–ŽÒ–ˆ‚ÌŽw’èŠú‚ÌŠJŽn�E�I—¹”NŒŽ“ú‚ðŽæ“¾‚·‚é
+                List<int> PersonCDArray = new List<int>();
+                List<DateTime> dtStartArray = new List<DateTime>();
+                List<DateTime> dtCompArray = new List<DateTime>();
+                List<int> SalaryArray = new List<int>();
+                GetPersonInDepartment(ref PersonCDArray, ref dtStartArray, ref dtCompArray, ref SalaryArray);
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // ----- Œo‰ß‹‹—^•\Ž¦�iƒwƒbƒ_�[‚É•\Ž¦�j
+                SetPayrollData(PersonCDArray, dtStartArray, dtCompArray, SalaryArray);
+
+                // ----- Œo”ï‚ð•\Ž¦‚·‚é
+                int Expenses = SetOtherCost(PersonCDArray, dtStartArray, dtCompArray);
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // ------ �U•ª‹‹—^‚ð•\Ž¦‚·‚é
+                int Auxiliary = 0;
+                Auxiliary = SetAuxiliaryCost();
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // Œo”ï�^•â�•�U•ª‚ðŽx•¥Šz‚Ö‘«‚µ‚Ä�A—˜‰v‚æ‚èˆø‚­
+                TotalArea[(int)DispColumn.TotalPayment] += Expenses;                // Žx•¥‘�Šz+Œo”ï
+                TotalArea[(int)DispColumn.GrossProfit] -= Expenses;                 // ‘e—˜-Œo”ï
+                TotalArea[(int)DispColumn.GrossProfit] += Auxiliary;                // ‘e—˜+•â�•�lŒ�”ï
+                TotalArea[(int)DispColumn.NetProfit] -= Expenses;                   // �ƒ—˜‰v-Œo”ï
+                TotalArea[(int)DispColumn.NetProfit] += Auxiliary;                  // �ƒ—˜‰v+•â�•�lŒ�”ï
+
+                // ----- ‘��‡Œv�s•\Ž¦
+                dgv.Rows.Add();       // ‹ó�s
+                int AllTotalRow = dgv.Rows.Add(1);
+                dgv.Rows[AllTotalRow].Cells[(int)DispColumn.SelectionName].Value = s_TotalTitleArray[(int)RowTitleNum.AllTotal];
+
+                // �s‚Ì�F‚ð•Ï‚¦‚é
+                SetRowColor(dgv.Rows[AllTotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
+
+                // �”’l•\Ž¦
+                for (int i = (int)DispColumn.OrdersDecisionPrice; i <= (int)DispColumn.NetProfit; i++)
+                {
+                    dgv.Rows[AllTotalRow].Cells[i].Value = TotalArea[i].ToString("#,0");
+                }
+
+                // ----- �ÅŒã‚ÉŒo”ï‚ª‚ ‚ê‚Î�ÄŒvŽZ
+                //ReCalcHeader(Expenses);
+
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value = prgber.Maximum;
+                prgber.Update();
+
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                // ƒf�[ƒ^‚ª‘½‚­‚È‚ê‚Îƒ\�[ƒg‚Å‚«‚é
+                if (CommonDefine.s_MaxInitLineCount < dgv.RowCount)
+                {
+                    foreach (DataGridViewColumn wrkCol in dgv.Columns)
+                        wrkCol.SortMode = DataGridViewColumnSortMode.Automatic;
+                }
+                else
+                {
+                    dgv.RowCount += (CommonDefine.s_MaxInitLineCount - m_initDataCount);
+                }
+
+                LedgerDB.close(); LedgerDB = null;
+                dgv.ResumeLayout();
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value = prgber.Maximum;
+                prgber.Update();
+                prgber.Visible = false;
+            }
+        }
+        #endregion
+
+        #region ‚c‚aŽæ“¾�‡”Ô
+        /// <summary>
+        /// ‚c‚aŽæ“¾�‡”Ô
+        /// </summary>
+        private enum DBGetData
+        {
+            ConstructionCode,
+            CreatorCode,
+            CreatorName,
+            DetailString,
+            OrdersDecisionPrice,
+            CompanyExpenses,
+            DepartmentExpenses,
+            SalesExpenses,
+            TotalPayment,
+            GrossProfit,
+            Allowance,
+            NetProfit,
+            ComplateFlg,
+            DepartmentDisplayOrder,
+            PoersonDisplayOrder,
+            DepartmentCode,
+            DepartmentString,
+            ConstructionStatusflg
+        }
+        #endregion
+
+        #region ƒf�[ƒ^Žæ“¾SQL�ì�¬
+        /// <summary>
+        /// •\Ž¦—pƒf�[ƒ^Žæ“¾SQL�ì�¬
+        /// </summary>
+        private void CreateInitSQL(ref string strSQL)
+        {
+            try
+            {
+                // SQL‚ÉƒAƒNƒZƒX�§ŒÀ‚ð‚©‚¯‚é
+                List<string> strSecurity = new List<string>();
+                CreateSecuritySQL(ref strSecurity);
+
+                // •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX’lŽæ“¾
+                int DepartmentCode = GetDepartmentCode();
+                // ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX’lŽæ“¾
+                int PersonCode = GetConstructionPersonCode();
+
+                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
+                // ----- ‚r‚p‚k�ì�¬
+                // ‘¶�Ý�Ú�×‘ä’ ƒf�[ƒ^ŒŸ�õ
+                //strSQL += " UNION";
+                strSQL = " SELECT A.CONSTRUCTIONCODE, A.CREATORCODE, C.PERSONNAME, B.DETAILSTRING, A.ORDERSDECISIONPRICE, A.COMPANYEXPENSES,";
+                strSQL += " A.DEPARTMENTEXPENSES, A.SALESEXPENSES, A.TOTALPAYMENT, A.GROSSPROFIT, A.ALLOWANCE, A.NETPROFIT, A.COMPLATEFLG,";
+                strSQL += " E.DISPLAYORDER, C.DISPLAYORDER, C.DEPARTMENTCODE, E.DepartmentString, D.CONSTRUCTIONSTATUSFLG";
+                strSQL += " FROM CONSTRUCTIONLEDGER A, CONSTRUCTIONBASEINFODETAIL B, PERSONINCHARGEMASTER C, CONSTRUCTIONBASEINFO D,";
+                strSQL += " DEPARTMENTMASTER E";
+                strSQL += " WHERE A.CONSTRUCTIONCODE = D.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND D.TyingFlg != {0}", (int)CommonDefine.BaseInfoTyingFlg.Tying);
+                strSQL += string.Format(" AND (A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE AND B.DETAILNO = {0})", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
+                strSQL += string.Format(" AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " AND D.CONSTRUCTIONPERSONCODE = C.PERSONCODE";
+                strSQL += " AND C.DEPARTMENTCODE = E.DEPARTMENTCODE";
+                strSQL += string.Format(" AND D.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
+                strSQL += " AND A.CREATORCODE = C.PERSONCODE";
+                if (strSecurity.Count > 0) strSQL += strSecurity[1];
+                if (DepartmentCode != 0) strSQL += string.Format(" AND C.DEPARTMENTCODE = {0}", DepartmentCode);
+                if (PersonCode != 0)
+                {
+                    //strSQL += string.Format(" AND (D.CONSTRUCTIONPERSONCODE = {0} OR D.CONSTRUCTIONINSTRUCTOR = {0} OR D.CONSTRSUBPERSONCODE = {0})", PersonCode);
+                    strSQL += string.Format(" AND D.CONSTRUCTIONPERSONCODE = {0}", PersonCode);
+                }
+
+                strSQL += string.Format(" ORDER BY {0} ASC, {1} ASC, {2} ASC, {3} ASC, {4} ASC",
+                                                    ((int)DBGetData.ComplateFlg + 1),
+                                                    ((int)DBGetData.DepartmentDisplayOrder + 1),
+                                                    ((int)DBGetData.ConstructionStatusflg + 1),
+                                                    ((int)DBGetData.PoersonDisplayOrder + 1),
+                                                    ((int)DBGetData.ConstructionCode + 1));
+
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", ex.Message, strSQL);
+            }
+        }
+        #endregion
+
+        #region •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
+        /// <summary>
+        /// •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
+        /// </summary>
+        private void InitcmbDepartment()
+        {
+            try
+            {
+                // ƒVƒXƒeƒ€Œ ŒÀ‚É‚æ‚Á‚Äƒf�[ƒ^ƒAƒNƒZƒX‚É�§ŒÀ‚ª‚ ‚é
+                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.AdminSecurityManagement
+                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.PresidentAuthority].Key
+                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SupervisorAuthority].Key)
+                {
+                    // ƒVƒXƒeƒ€ŠÇ—�ŽÒ
+                    // �Å�‚‹@–§ŠÇ—�ŽÒ
+                    // “�Š‡‹@–§ŠÇ—�ŽÒ
+                    // •”��ƒ}ƒXƒ^‚ðŒŸ�õ‚·‚é
+                }
+                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SuperiorAuthority].Key)
+                {
+                    // �Š‘®’·
+                    // •”��ƒRƒ“ƒ{”ñ•\Ž¦
+                    label5.Visible = false;
+                    cmbDepartment.Visible = false;
+                    label3.Location = label5.Location;
+                    cmbConstructionPerson.Location = cmbDepartment.Location;
+                }
+                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
+                {
+                    // ˆê”ÊŽg—pŽÒ�iŽ©•ª‚Ì‚ÝƒAƒNƒZƒX‰Â”\�j
+                    // •”���E’S“–ŽÒƒRƒ“ƒ{”ñ•\Ž¦
+                    label5.Visible = false;
+                    cmbDepartment.Visible = false;
+                    label3.Visible = false;
+                    cmbConstructionPerson.Visible = false;
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
+        /// <summary>
+        /// ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
+        /// </summary>
+        private void InitcmbPersons()
+        {
+            try
+            {
+                // ƒVƒXƒeƒ€Œ ŒÀ‚É‚æ‚Á‚Äƒf�[ƒ^ƒAƒNƒZƒX‚É�§ŒÀ‚ª‚ ‚é
+                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.AdminSecurityManagement
+                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.PresidentAuthority].Key
+                || CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SupervisorAuthority].Key)
+                {
+                    // ƒVƒXƒeƒ€ŠÇ—�ŽÒ
+                    // �Å�‚‹@–§ŠÇ—�ŽÒ
+                    // “�Š‡‹@–§ŠÇ—�ŽÒ
+                }
+                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SuperiorAuthority].Key)
+                {
+                    // �Š‘®’·
+                    // •”��ƒRƒ“ƒ{”ñ•\Ž¦
+                    label5.Visible = false;
+                    cmbDepartment.Visible = false;
+                    label3.Location = label5.Location;
+                    cmbConstructionPerson.Location = cmbDepartment.Location;
+                }
+                else if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
+                {
+                    // ˆê”ÊŽg—pŽÒ�iŽ©•ª‚Ì‚ÝƒAƒNƒZƒX‰Â”\�j
+                    // •”���E’S“–ŽÒƒRƒ“ƒ{”ñ•\Ž¦
+                    label5.Visible = false;
+                    cmbDepartment.Visible = false;
+                    label3.Visible = false;
+                    cmbConstructionPerson.Visible = false;
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX‚ðƒZƒbƒg‚·‚é
+        /// <summary>
+        /// ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒX‚Ö•¶Žš‚ðƒZƒbƒg‚·‚é
+        /// </summary>
+        private bool SetcmbPersons()
+        {
+            IOMPersonInCharge picDB = new IOMPersonInCharge();
+            try
+            {
+                m_initDataLoad = true;
+                cmbConstructionPerson.DataSource = null;
+                cmbConstructionPerson.Items.Clear();
+                cmbConstructionPerson.Text = "";
+
+                string strSQL = string.Empty;
+                int DepartmentCode = GetDepartmentCode();
+                if (m_initDataLoad) DepartmentCode = m_FirstStartDepartmentCode;
+
+                //strSQL = "SELECT A.PERSONCODE, A.PERSONNAME, A.DISPLAYORDER, A.EMPLOYEECLASSFLG, COUNT(*)";
+                //strSQL += " FROM PERSONINCHARGEMASTER A, DEPARTMENTMASTER B, CONSTRUCTIONBASEINFO C, CONSTRUCTIONLEDGERDETAIL D";
+                strSQL = "SELECT A.PERSONCODE, A.PERSONNAME, A.DISPLAYORDER, A.EMPLOYEECLASSFLG";
+                strSQL +=" FROM PERSONINCHARGEMASTER A, DEPARTMENTMASTER B, CONSTRUCTIONBASEINFO C";
+                strSQL +=" WHERE A.DELETEFLG = 0";
+                if (DepartmentCode != 0) strSQL += string.Format(" AND A.DEPARTMENTCODE = {0}", DepartmentCode);
+                // 16ŠúŒÀ’èƒŠƒtƒH�[ƒ€‚ÍŒ_–ñŽÐˆõ‚à’Ç‰Á‚·‚é
+                if (numUDConstPro.Value <= 16 && DepartmentCode != 9)
+                    strSQL += string.Format(" AND A.EMPLOYEECLASSFLG = {0}", (int)CommonDefine.EmployeeClassFlg.Regular);
+                strSQL += " AND A.DEPARTMENTCODE = B.DEPARTMENTCODE";
+                //strSQL += " AND A.PERSONCODE = C.CONSTRUCTIONPERSONCODE";
+                strSQL += " AND (A.PERSONCODE = C.CONSTRUCTIONPERSONCODE OR A.PERSONCODE = C.CONSTRUCTIONINSTRUCTOR OR A.PERSONCODE = C.CONSTRSUBPERSONCODE)";
+                //strSQL += " AND D.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
+                strSQL += " GROUP BY A.PERSONCODE, A.PERSONNAME, A.DISPLAYORDER, A.EMPLOYEECLASSFLG";
+                strSQL += " ORDER BY A.EMPLOYEECLASSFLG, A.DISPLAYORDER ASC";
+
+                ArrayList arList = new ArrayList();
+                // ’S“–ŽÒƒ}ƒXƒ^“Ç�ž
+                if (!picDB.ExecuteReader(strSQL, ref arList)) return false;
+
+                List<KeyValuePair<int, string>> ConstructionDataList = new List<KeyValuePair<int, string>>();
+                ConstructionDataList.Add(new KeyValuePair<int, string>(0, ""));
+
+                foreach (object[] work in arList)
+                {
+                    KeyValuePair<int, string> keyval = new KeyValuePair<int, string>(CommonMotions.cnvInt(work[0]), CommonMotions.cnvString(work[1]));
+
+                    ConstructionDataList.Add(keyval);
+                }
+
+                // ƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
+                ComboBoxAction.InitDataSetCombBox(cmbConstructionPerson, ConstructionDataList);
+
+                if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
+                {
+                    cmbConstructionPerson.SelectedValue = CommonMotions.LoginUserData.PersonCode;
+                }
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
+            }
+            finally
+            {
+                picDB.close(); picDB = null;
+                m_initDataLoad = false;
+            }
+        }
+        #endregion
+
+        #region ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+        /// <summary>
+        /// ’S“–ŽÒƒRƒ“ƒ{ƒ{ƒbƒNƒXƒZƒbƒgŽž•”��‚ðƒZƒbƒg‚·‚é
+        /// </summary>
+        /// <returns></returns>
+        private bool SetPerosonToDepartment()
+        {
+            IOMPersonInCharge PersonDB = new IOMPersonInCharge();
+            try
+            {
+                // ƒRƒ“ƒ{ƒ{ƒbƒNƒX‚æ‚è‘I‘ð’S“–ŽÒ‚ðŽæ“¾‚·‚é
+                int PersonCode = GetConstructionPersonCode();
+                if (PersonCode < 1) return false;
+
+                int DepartmentCode = GetDepartmentCode();
+
+                string strSQL = PersonDB.CreatePrimarykeyString(PersonCode);
+                PersonInChargeMaster PersonRec = new PersonInChargeMaster();
+                PersonDB.SelectAction(strSQL, ref PersonRec);
+
+                // •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX‚Ö•”��ƒR�[ƒhƒZƒbƒg
+                if (PersonRec.DepartmentCode < 0 || DepartmentCode == PersonRec.DepartmentCode) return true;
+
+                m_initDataLoad = true;
+
+                // •”��ƒR�[ƒhƒZƒbƒg
+                cmbDepartment.SelectedValue = PersonRec.DepartmentCode;
+
+                // ’S“–ŽÒƒR�[ƒh�ÄƒZƒbƒg
+                cmbConstructionPerson.SelectedValue = PersonCode;
+
+                m_initDataLoad = false;
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
+            }
+            finally
+            {
+                PersonDB.close(); PersonDB = null;
+            }
+        }
+        #endregion
+
+        #region ‹‹—^ƒGƒŠƒAƒNƒŠƒA
+        /// <summary>
+        /// ‹‹—^ƒGƒŠƒAƒNƒŠƒA
+        /// </summary>
+        private void ClearSalary()
+        {
+            lblPayroll.Text = "";
+            lblCalcValue1.Text = "";
+            lblTotalValue.Text = "";
+            lblCalcValue3.Text = "";
+            lblCalcValue2.Text = "";
+        }
+        #endregion
+
+        #region ’S“–ŽÒ–ˆ‚ÌŽw’èŠú‚Ì�HŽ–ŠJŽn“ú‚ðŽæ“¾‚·‚é
+        /// <summary>
+        /// ’S“–ŽÒ–ˆ‚ÌŽw’èŠú‚Ì�HŽ–ŠJŽn“ú‚ðŽæ“¾‚·‚é
+        /// </summary>
+        /// <returns></returns>
+        private DateTime GetConstructionDate(int PersonCode, bool bStart = true)
+        {
+            IOConstructionBaseInfo BaseDB = new IOConstructionBaseInfo();
+            try
+            {
+                // ‹ó‚Ì�ê�‡‚Íƒ�ƒOƒCƒ“ƒ†�[ƒU�[
+                if (PersonCode == 0) PersonCode = CommonMotions.LoginUserData.PersonCode;
+
+                // ŠJŽn“úŽæ“¾
+                string strSQL = string.Empty;
+                strSQL = "SELECT A.CONSTRUCTIONPERSONCODE, MIN(B.CONSTRUCTIONSTART) FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBUDGET B";
+                // �I—¹Žw’è‚Í�I—¹‚ÌMAX‚É•Ï�X
+                if (!bStart) strSQL = strSQL.Replace("MIN(B.CONSTRUCTIONSTART)", "MAX(B.CONSTRUCTIONEND)");
+
+                strSQL += string.Format(" WHERE A.CONSTRUCTIONPERSONCODE = {0}", PersonCode);
+                strSQL += string.Format("  AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " AND A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE GROUP BY A.CONSTRUCTIONPERSONCODE";
+                ArrayList ArrayList = new ArrayList();
+                if (!BaseDB.ExecuteReader(strSQL, ref ArrayList)) return DateTime.MinValue;
+                if (ArrayList.Count == 0) return DateTime.MinValue;
+
+                object[] objRec = (object[])ArrayList[0];
+
+                return CommonMotions.cnvDate(objRec[1]);
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+                return DateTime.MinValue;
+            }
+            finally
+            {
+                BaseDB.close(); BaseDB = null;
+            }
+        }
+        #endregion
+
         #region ‹‹—^ƒf�[ƒ^•\Ž¦”»’è
         /// <summary>
         /// ‹‹—^ƒf�[ƒ^•\Ž¦”»’è
@@ -1485,8 +1901,8 @@
                 }
                 
                 // ƒf�[ƒ^•\Ž¦
-                //pnlPayroll.Visible = bRet;
-                pnlPayroll.Visible = false;
+                pnlPayroll.Visible = bRet;
+                //pnlPayroll.Visible = false;
 
                 // —ÌˆæƒNƒŠƒA
                 ClearSalary();
@@ -1505,54 +1921,20 @@
         }
         #endregion
 
-        #region Œo‰ß‹‹—^‚ðŒvŽZ‚·‚é
-        /// <summary>
-        /// Œo‰ß‹‹—^‚ðŒvŽZ‚·‚é
-        /// </summary>
-        /// <param name="dtStart"></param>
-        /// <param name="PersonCode"></param>
-        /// <returns></returns>
-        private int CalcElapsedSalary(DateTime dtStart, int PersonCode)
-        {
-            try
-            {
-                //// ‰Ò“­“ú�”‚ðŽæ“¾‚·‚é
-                //int WorkingDay = ClsCalendar.CalcOperatingDaysCount(dtStart, DateTime.Now);
-                // Œo‰ß“ú�”‚ðŽæ“¾‚·‚é
-                int WorkingDay = ClsCalendar.CalcPassedDaysCount(dtStart, DateTime.Now);
-
-                // Œo‰ßŒŽ�”Žæ“¾
-                double dmounth = CommonMotions.DiffMounthTimes(dtStart, DateTime.Now);
-
-                // ‹‹—^—Ý�ÏŽæ“¾
-                int MonthlyPay = GetPersonMonthlySalary(PersonCode);
-                double DayPay = CommonMotions.cnvRound((double)MonthlyPay / CommonDefine.s_ManHourUnitMonth);
-                
-                return CommonMotions.cnvRound(WorkingDay * DayPay);
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return 0;
-            }
-        }
-        #endregion
-
         #region �¡Šú‚ÌŒo‰ß‹‹—^‚ð•\Ž¦‚·‚é
         /// <summary>
         /// �¡Šú‚ÌŒo‰ß‹‹—^‚ð•\Ž¦‚·‚é
         /// </summary>
-        private void SetPayrollData()
+        /// <param name="PersonCDArray"></param>
+        /// <param name="dtStartArray"></param>
+        /// <param name="dtCompArray"></param>
+        /// <param name="SalaryArray"></param>
+        private void SetPayrollData(List<int> PersonCDArray, List<DateTime> dtStartArray, List<DateTime> dtCompArray, List<int> SalaryArray)
         {
             try
             {
-                // ‹‹—^‚Ì•\Ž¦”»’è
-                if (!SalaryDisplay()) return;
-
                 // •”��ƒR�[ƒhŽæ“¾
                 int DepartmentCode = GetDepartmentCode();
-                // ’S“–ŽÒƒR�[ƒhŽæ“¾
-                int PersonCode = GetConstructionPersonCode();
 
                 // “–ŠúŠúŽñ“ú�EŠú––“ú‚ðŽæ“¾
                 DateTime dtDefaultStart = DateTime.MinValue;
@@ -1566,68 +1948,52 @@
 
                 DateTime dtStart = DateTime.MinValue;
                 DateTime dtEnd = DateTime.MinValue;
-                // ’S“–ŽÒ‚ªƒZƒbƒg‚³‚ê‚Ä‚¢‚ê‚Î’S“–ŽÒ�AˆÈŠO‚Í‘Î�Û‘S‚Ä‚ð�WŒv‚·‚é
-                if (PersonCode != 0)
+                // ‹‹—^‚ð�WŒv‚·‚é
+                for (int i = 0; i < PersonCDArray.Count; i++)
                 {
                     // ŠJŽn“úŽæ“¾
-                    dtStart = GetConstructionDate(PersonCode, true);
+                    dtStart = dtStartArray[i];
                     // ƒf�[ƒ^‚ª–³‚¢�ê�‡‚ÍŠúŽñ“ú‚ðƒZƒbƒg‚·‚é
                     if (dtStart == DateTime.MinValue) dtStart = dtDefaultStart;
                     // �I—¹“úŽæ“¾
-                    dtEnd = GetConstructionDate(PersonCode, false);
+                    dtEnd = dtCompArray[i];
                     if (dtEnd == DateTime.MinValue) dtEnd = dtDefaultEnd;
 
                     // ‹‹—^—Ý�ÏŽæ“¾
-                    TotalSalary = CalcElapsedSalary(dtStart, PersonCode);
-                    // �U•ª‹‹—^‹àŠzŽæ“¾
-                    OnSalary = GetPersonBudgetDetail(PersonCode, (int)FrmConstructionBudget.DataGroup.PayrollExpenses);
-                    // �ƒ—˜‰v‹àŠzŽæ“¾
-                    NetIncome = GetPersonBudgetDetail(PersonCode, (int)FrmConstructionBudget.DataGroup.NetIncome);
-                    // ‘e—˜‰v‹àŠzŽæ“¾
-                    NonSalary = GetPersonBudgetDetail(PersonCode, (int)FrmConstructionBudget.DataGroup.GrossProfit);
-                }
-                else
-                {
-                    // ’S“–‚ª‘I‘ð‚³‚ê‚Ä‚¢‚È‚¯‚ê‚Î�‡Œv‚ð�WŒv‚·‚é
-                    List<int> PersonArrsy = new List<int>(); ;
-                    if (GetPersonInDepartment(DepartmentCode, ref PersonArrsy) == 0) return;
-                    for (int ii = 0; ii < PersonArrsy.Count; ii++)
-                    {
-                        // ŠJŽn“úŽæ“¾
-                        dtStart = GetConstructionDate(PersonArrsy[ii], true);
-                        // ƒf�[ƒ^‚ª–³‚¢�ê�‡‚ÍŠúŽñ“ú‚ðƒZƒbƒg‚·‚é
-                        if (dtStart == DateTime.MinValue) dtStart = dtDefaultStart;
-                        // �I—¹“úŽæ“¾
-                        dtEnd = GetConstructionDate(PersonArrsy[ii], false);
-                        if (dtEnd == DateTime.MinValue) dtEnd = dtDefaultEnd;
+                    int workSalary = CalcElapsedSalary(dtStart, dtEnd, PersonCDArray[i], SalaryArray[i]);
+                    // —ÝŒv‰ÁŽZ
+                    if (workSalary > 0) TotalSalary += workSalary;
 
-                        // ‹‹—^—Ý�ÏŽæ“¾
-                        int workSalary = CalcElapsedSalary(dtStart, PersonArrsy[ii]);
-                        if (workSalary > 0) TotalSalary += workSalary;
-                        // �U•ª‹‹—^‹àŠzŽæ“¾
-                        OnSalary += GetPersonBudgetDetail(PersonArrsy[ii], (int)FrmConstructionBudget.DataGroup.PayrollExpenses);
-                        // �ƒ—˜‰v‹àŠzŽæ“¾
-                        NetIncome += GetPersonBudgetDetail(PersonArrsy[ii], (int)FrmConstructionBudget.DataGroup.NetIncome);
-                        // ‘e—˜‰v‹àŠzŽæ“¾
-                        NonSalary += GetPersonBudgetDetail(PersonArrsy[ii], (int)FrmConstructionBudget.DataGroup.GrossProfit);
-                    }
                 }
 
-                // ‹‹—^—Ý�ÏŽæ“¾
+                // �U•ª‹‹—^‹àŠz�E�ƒ—˜‰v‹àŠz�E‘e—˜‰v‹àŠzŽæ“¾
+                ProfitGeneral(ref OnSalary, ref  NetIncome, ref  NonSalary);
+
+                // �U•ª‹‹—^‹àŠz•\Ž¦
+                lblCalcValue1.Text = OnSalary.ToString("#,0");
+
+                // ‹‹—^—Ý�Ï•\Ž¦
                 lblPayroll.Text = TotalSalary.ToString("#,0");
 
-                // �U•ª‹‹—^‹àŠzŽæ“¾
-                label11.Text = OnSalary.ToString("#,0");
+                // ‹‹—^�·ŠzŒvŽZ�E•\Ž¦
+                int TotalValue = OnSalary - TotalSalary;
+                lblTotalValue.Text = TotalValue.ToString("#,0");
+                lblTotalValue2.Text = TotalValue.ToString("#,0");
 
-                // �ƒ—˜‰v‹àŠzŽæ“¾
-                label21.Text = NetIncome.ToString("#,0");
+                // �ƒ—˜‰v‹àŠz•\Ž¦
+                lblCalcValue2.Text = NetIncome.ToString("#,0");
+                
+                // “–Šú�ƒ—˜‰vŒvŽZ
+                int CalcTotal1 = NetIncome + TotalValue;
+                lblTotalCalcValue1.Text = CalcTotal1.ToString("#,0");
+                lblTotalCalcValue2.Text = CalcTotal1.ToString("#,0");
 
                 // ‘e—˜‰v‹àŠzŽæ“¾
-                label16.Text = NonSalary.ToString("#,0");
+                lblCalcValue3.Text = NonSalary.ToString("#,0");
 
-                // �·ŠzŒvŽZ
-                label14.Text = ((OnSalary + NetIncome + NonSalary) - TotalSalary).ToString("#,0");
-
+                // “–Šú�ƒ—˜‰vŒvŽZ
+                int CalcTotal = NonSalary + CalcTotal1;
+                lblTotalCalcValue.Text = CalcTotal.ToString("#,0");
             }
             catch (Exception ex)
             {
@@ -1636,23 +2002,30 @@
         }
         #endregion
 
-        #region ’S“–ŽÒƒ}ƒXƒ^‚æ‚èŒŽŠz‹‹—^Žæ“¾
+        #region Œo‰ß‹‹—^‚ðŒvŽZ‚·‚é
         /// <summary>
-        /// ’S“–ŽÒƒ}ƒXƒ^‚æ‚èŒŽŠz‹‹—^Žæ“¾
+        /// Œo‰ß‹‹—^‚ðŒvŽZ‚·‚é
         /// </summary>
+        /// <param name="dtStart"></param>
         /// <param name="PersonCode"></param>
         /// <returns></returns>
-        private int GetPersonMonthlySalary(int PersonCode)
+        private int CalcElapsedSalary(DateTime dtStart, DateTime dtLast, int PersonCode, int Salary)
         {
-            IOMPersonInCharge PersonDB = new IOMPersonInCharge();
             try
             {
-                if (PersonCode == 0) PersonCode = CommonMotions.LoginUserData.PersonCode;
-                string strSQL = PersonDB.CreatePrimarykeyString(PersonCode);
-                PersonInChargeMaster PersonRec = new PersonInChargeMaster();
-                PersonDB.SelectAction(strSQL, ref PersonRec);
-                
-                return CommonMotions.cnvRound(PersonRec.MonthlySalary);
+                // ‰Ò“­“ú�”‚ðŽæ“¾‚·‚é
+                int WorkingDay = ClsCalendar.CalcPassedDaysCount(dtStart, dtLast);
+
+                // ‹‹—^Žæ“¾
+                int MonthlyPay = CommonMotions.cnvRound(Salary * CommonDefine.s_SalaryCorrection);
+
+                // “ú“–ŒvŽZ
+                double daylySalary = CommonMotions.cnvRound(MonthlyPay / CommonDefine.s_ManHourUnitMonth);
+
+                // Œo‰ß‹‹—^ŒvŽZ
+                int RetSalary = CommonMotions.cnvRound(WorkingDay * daylySalary);
+
+                return RetSalary;
             }
             catch (Exception ex)
             {
@@ -1659,53 +2032,26 @@
                 logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
                 return 0;
             }
-            finally
-            {
-                PersonDB.close(); PersonDB = null;
-            }
         }
         #endregion
 
-        #region �HŽ–—\ŽZ�‘‚æ‚è�U•ª‹‹—^‹àŠz�E‘e—˜‰v‚ðŽæ“¾‚·‚é
+        #region ’S“–ŽÒƒ}ƒXƒ^‚æ‚èŒŽŠz‹‹—^Žæ“¾
         /// <summary>
-        /// �HŽ–—\ŽZ�‘‚æ‚è�U•ª‹‹—^‹àŠz�E‘e—˜‰v‚ðŽæ“¾‚·‚é
+        /// ’S“–ŽÒƒ}ƒXƒ^‚æ‚èŒŽŠz‹‹—^Žæ“¾
         /// </summary>
+        /// <param name="PersonCode"></param>
         /// <returns></returns>
-        private int GetPersonBudgetDetail(int PersonCode, int GroupNo)
+        private int GetPersonMonthlySalary(int PersonCode)
         {
-            IOConstructionBudgetDetail DetailDB = new IOConstructionBudgetDetail();
+            IOMPersonInCharge PersonDB = new IOMPersonInCharge();
             try
             {
                 if (PersonCode == 0) PersonCode = CommonMotions.LoginUserData.PersonCode;
-
-                string strSQL = "SELECT A.CONSTRUCTIONPERSONCODE, SUM(C.EXECUTIONAMOUNT)";
-                strSQL += " FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBUDGET B, CONSTRUCTIONBUDGETDETAIL C ";
-                strSQL += string.Format(" WHERE A.CONSTRUCTIONPERSONCODE = {0}", PersonCode);
-                strSQL += string.Format(" AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
-                strSQL += " AND A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
+                string strSQL = PersonDB.CreatePrimarykeyString(PersonCode);
+                PersonInChargeMaster PersonRec = new PersonInChargeMaster();
+                PersonDB.SelectAction(strSQL, ref PersonRec);
                 
-                switch(GroupNo)
-                {
-                    case (int)FrmConstructionBudget.DataGroup.PayrollExpenses:     // ‹‹—^Œo”ï
-                    case (int)FrmConstructionBudget.DataGroup.NetIncome:           // �ƒ—˜‰v
-                    strSQL += string.Format(" AND B.SALARYFLG != {0}", (int)CommonDefine.SalaryDevision.Noting);
-                        break;
-                    case (int)FrmConstructionBudget.DataGroup.GrossProfit:         // ‘e—˜‰v
-                        strSQL += string.Format(" AND B.SALARYFLG = {0}", (int)CommonDefine.SalaryDevision.Noting);
-                        break;
-                }
-                    
-                strSQL += " AND B.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
-
-                strSQL += string.Format(" AND C.GROUPCOUNT = {0}", GroupNo);
-
-                strSQL += " GROUP BY A.CONSTRUCTIONPERSONCODE";
-
-                ArrayList ArrayList = new ArrayList();
-                if (!DetailDB.ExecuteReader(strSQL, ref ArrayList) || ArrayList.Count == 0) return 0;
-                object[] objRec = (object[])ArrayList[0];
-
-                return CommonMotions.cnvInt(objRec[1]);
+                return CommonMotions.cnvRound(PersonRec.MonthlySalary);
             }
             catch (Exception ex)
             {
@@ -1714,7 +2060,7 @@
             }
             finally
             {
-                DetailDB.close(); DetailDB = null;
+                PersonDB.close(); PersonDB = null;
             }
         }
         #endregion
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionPersonList/FrmConstructionPersonList.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionPersonList/FrmConstructionPersonList.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionPersonList/FrmConstructionPersonList.cs	(revision 18)
@@ -502,7 +502,7 @@
                     dTotal += CommonMotions.cnvDouble(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value);
                     if (CommonMotions.chkNumeric(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value)) NumericCnt++;
                 }
-                if (DataCnt == 0 || dTotal == 0 || NumericCnt == 0) return;
+                if (DataCnt <= 1 || dTotal == 0 || NumericCnt == 0) return;
                 string strTotal = CommonMotions.cnvTruncate(dTotal).ToString("#,#");
                 if (dTotal - System.Math.Floor(dTotal) != 0) strTotal = dTotal.ToString("#,#.00");
 
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DRConstruction/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DRConstruction/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DRConstruction/ProcessControl.cs	(revision 18)
@@ -202,6 +202,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DailyReport/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DailyReport/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DailyReport/ProcessControl.cs	(revision 18)
@@ -202,6 +202,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.cs	(revision 18)
@@ -40,17 +40,17 @@
         private enum DispColumn
         {
             /// <summary>
-            /// •”��ƒR�[ƒh
+            /// •\Ž¦’†ƒf�[ƒ^ƒR�[ƒh
             /// </summary>
-            DepartmentCode = 0,
+            SelectionCode = 0,
             /// <summary>
             /// ‡‚
             /// </summary>
             No,
             /// <summary>
-            /// •”��–¼
+            /// •\Ž¦’†ƒf�[ƒ^–¼
             /// </summary>
-            DepartmentName,
+            SelectionName,
             /// <summary>
             /// Žó’�‹àŠz
             /// </summary>
@@ -76,10 +76,6 @@
             /// </summary>
             GrossProfit,
             /// <summary>
-            /// ‹‹—^
-            /// </summary>
-            Allowance,
-            /// <summary>
             /// �ƒ—˜‰v
             /// </summary>
             NetProfit,
@@ -133,10 +129,10 @@
         /// <summary>
         /// �‡Œv�sƒ^ƒCƒgƒ‹
         /// </summary>
-        private static string[] s_TotalTitleArray = new string[] {  "�–Ž{�@�H�@’†�@�‡�@Œv�–",
+        private static string[] s_TotalTitleArray = new string[] {  "�–’S�@“–�@ŽÒ�@�‡�@Œv�–",
                                                                     "�–Š®�@—¹�@�Ï�@�‡�@Œv�–",
                                                                     "�–�@Œo�@�@”ï�@�@Œv�@�–",
-                                                                    "�–�U�@•ª�@•â�@�•�@Œv�–",
+                                                                    "�–�l Œ� ”ï �U •ª Œv�–",
                                                                     "�–�–�@‘��@�‡�@Œv�@�–�–",
                                                                 };
         #endregion
@@ -145,11 +141,45 @@
         /// <summary>
         /// ƒOƒŠƒbƒh�€–Ú�sƒ^ƒCƒgƒ‹
         /// </summary>
-        private static string[] s_GroupTitle = new string[] {"•› ’S “– ŽÒ ‹‹ —^"
-                                                            ,"Žw “± ˆõ ‹‹ —^"};
+        private static string[] s_GroupTitle = new string[] {"•›’S“–ŽÒ�U•ª",
+                                                            "Žw “± ˆõ �U •ª",
+                                                            "’S“–ŽÒ‹‹—^�·Šz"};
         #endregion
+
+        #region •\Ž¦’†ƒf�[ƒ^ƒ^ƒCƒv’è‹`
+        /// <summary>
+        /// •\Ž¦’†ƒf�[ƒ^ƒ^ƒCƒv’è‹`
+        /// </summary>
+        private enum DispDataTypeCode
+        {
+            /// <summary>
+            /// ‘SŽÐ•”��•ÊŒv
+            /// </summary>
+            AllTotal = 0,
+            /// <summary>
+            /// •\Ž¦’†•”��•Ê
+            /// </summary>
+            Department,
+
+        }
         #endregion
 
+        #region •\Ž¦ƒJƒ‰ƒ€ƒ^ƒCƒgƒ‹
+        /// <summary>
+        /// •\Ž¦ƒJƒ‰ƒ€ƒ^ƒCƒgƒ‹
+        /// </summary>
+        private string[] GridColumnHeader = new string[] { "•”�@�@�@��", "’S�@“–�@ŽÒ" };
+        #endregion
+
+        #region Ž©ƒvƒ�ƒZƒX‚Ì”Ô�†
+        /// <summary>
+        /// Ž©ƒvƒ�ƒZƒX‚Ì”Ô�†
+        /// </summary>
+        private static int s_CurrentProcessNo = (int)ClsExcute.ProcessExecuteNo.DepartmentExpenssList;
+        #endregion
+
+        #endregion
+
         #region •Ï�”
         /// <summary>
         /// �‰ŠúŽžƒtƒ‰ƒO
@@ -195,6 +225,7 @@
         /// </summary>
         private int m_GridWidthSize = 0;
         #endregion
+
         #endregion
 
         #region ƒvƒ�ƒpƒeƒB
@@ -241,6 +272,9 @@
         /// <param name="e"></param>
         private void FrmDepExpenssList_FormClosing(object sender, FormClosingEventArgs e)
         {
+            // ƒtƒH�[ƒ€‚ªClose‚³‚ê‚Ä‚¢‚È‚¯‚ê‚ÎƒNƒ��[ƒY‚·‚é
+            TerminatingProcess();
+
             if (m_CloseingProcessOff) return;
 
             // ‘Oƒvƒ�ƒZƒX‚É–ß‚é
@@ -265,23 +299,6 @@
         }
         #endregion
 
-        #region ‘I‘ðƒ{ƒ^ƒ“
-        /// <summary>
-        /// �HŽ–‘I‘ðƒ{ƒ^ƒ“‰Ÿ‰º
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void btnDataSelect_Click(object sender, EventArgs e)
-        {
-            // ƒf�[ƒ^‚ª‚È‚¢�ê�‡‚Í”²‚¯‚é
-            if (dgvMaster.RowCount == 0) return;
-            if (CommonMotions.chkCellBlank(dgvMaster.CurrentRow.Cells[(int)DispColumn.DepartmentName].Value)) return;
-
-            // Še�ˆ—�‹N“®
-            SubProcessExecute(CommonMotions.cnvIntFromStringCode(dgvMaster.CurrentRow.Cells[(int)DispColumn.DepartmentCode].Value.ToString(), "-"));
-        }
-        #endregion
-
         #region ƒtƒH�[ƒ€ƒ��[ƒh
         /// <summary>
         /// �‰ŠúƒtƒH�[ƒ€ƒ��[ƒh
@@ -292,7 +309,8 @@
         {
 
             // ƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
-            SetInitPeriod();
+            SetcmbPeriod();
+            SetcmbDepartment();
 
             // ƒOƒŠƒbƒh�‰Šú�Ý’è
             SetDisplayObject();
@@ -319,11 +337,20 @@
 
             // ƒf�[ƒ^‚ª‚È‚¢�ê�‡‚Í”²‚¯‚é
             if (dgv.RowCount == 0) return;
-            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.DepartmentCode].Value)) return;
-            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.DepartmentName].Value)) return;
+            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.SelectionCode].Value)) return;
+            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.SelectionName].Value)) return;
 
-            // Še�ˆ—�‹N“®
-            SubProcessExecute(CommonMotions.cnvIntFromStringCode(CurRow.Cells[(int)DispColumn.DepartmentCode].Value.ToString(), "-"));
+            int DepartmentCode = GetDepartmentCode();
+            if (DepartmentCode == 0)
+            {
+                int DepCode = CommonMotions.cnvInt(CurRow.Cells[(int)DispColumn.SelectionCode].Value);
+                cmbDepartment.SelectedValue = DepCode;
+            }
+            else
+            {
+                // �HŽ–�Ú�×‘ä’ ˆê——•\Ž¦
+                SubProcessExecute(CommonMotions.cnvIntFromStringCode(CurRow.Cells[(int)DispColumn.SelectionCode].Value.ToString(), "-"));
+            }
         }
         #endregion
 
@@ -422,7 +449,7 @@
                     dTotal += CommonMotions.cnvDouble(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value);
                     if (CommonMotions.chkNumeric(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value)) NumericCnt++;
                 }
-                if (DataCnt == 0 || dTotal == 0 || NumericCnt == 0) return;
+                if (DataCnt <= 1 || dTotal == 0 || NumericCnt == 0) return;
                 string strTotal = CommonMotions.cnvTruncate(dTotal).ToString("#,#");
                 if (dTotal - System.Math.Floor(dTotal) != 0) strTotal = dTotal.ToString("#,#.00");
 
@@ -454,8 +481,8 @@
 
             // ƒf�[ƒ^‚ª‚È‚¢�ê�‡‚Í”²‚¯‚é
             if (dgv.RowCount == 0) return;
-            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.DepartmentCode].Value) &&
-                CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.DepartmentName].Value))
+            if (CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.SelectionCode].Value) &&
+                CommonMotions.chkCellBlank(CurRow.Cells[(int)DispColumn.SelectionName].Value))
             {
                 return;
             }
@@ -462,7 +489,7 @@
             else
             {
                 // �‡Œv�s‚Í�ˆ—�‚µ‚È‚¢
-                string strWork = CommonMotions.cnvString(CurRow.Cells[(int)DispColumn.DepartmentName].Value);
+                string strWork = CommonMotions.cnvString(CurRow.Cells[(int)DispColumn.SelectionName].Value);
                 bool bTitle = false;
                 foreach (string strTitle in s_TotalTitleArray)
                 {
@@ -510,5 +537,18 @@
         }
         #endregion
 
+        #region •”��•Ï�X
+        /// <summary>
+        /// •”��•Ï�X
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void cmbDepartment_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (m_initDataLoad) return;
+            // ƒf�[ƒ^•\Ž¦
+            DataDisplay();
+        }
+        #endregion
     }
 }
\ No newline at end of file
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.designer.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.designer.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.designer.cs	(revision 18)
@@ -30,7 +30,7 @@
         {
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
@@ -41,10 +41,36 @@
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
             this.btnEnd = new System.Windows.Forms.Button();
             this.label1 = new System.Windows.Forms.Label();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.pnlPayroll = new System.Windows.Forms.Panel();
+            this.lblTotalCalcValue2 = new System.Windows.Forms.Label();
+            this.label23 = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
+            this.lblTotalCalcValue1 = new System.Windows.Forms.Label();
+            this.label19 = new System.Windows.Forms.Label();
+            this.lblPlusorMinus2 = new System.Windows.Forms.Label();
+            this.label16 = new System.Windows.Forms.Label();
+            this.lblPlusorMinus1 = new System.Windows.Forms.Label();
+            this.lblTotalCalcValue = new System.Windows.Forms.Label();
+            this.label12 = new System.Windows.Forms.Label();
+            this.label22 = new System.Windows.Forms.Label();
+            this.lblTotalValue2 = new System.Windows.Forms.Label();
+            this.label14 = new System.Windows.Forms.Label();
+            this.lblCalcValue2 = new System.Windows.Forms.Label();
+            this.label20 = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.lblCalcValue3 = new System.Windows.Forms.Label();
+            this.lblTotalValue = new System.Windows.Forms.Label();
+            this.label17 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.lblPayroll = new System.Windows.Forms.Label();
+            this.label15 = new System.Windows.Forms.Label();
+            this.lblCalcValue1 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.cmbDepartment = new System.Windows.Forms.ComboBox();
+            this.label5 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.numUDConstPro = new System.Windows.Forms.NumericUpDown();
             this.label4 = new System.Windows.Forms.Label();
@@ -61,9 +87,9 @@
             this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.groupBox1.SuspendLayout();
+            this.pnlPayroll.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.numUDConstPro)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.dgvMaster)).BeginInit();
             this.SuspendLayout();
@@ -99,6 +125,9 @@
             // 
             this.groupBox1.Anchor = System.Windows.Forms.AnchorStyles.Top;
             this.groupBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
+            this.groupBox1.Controls.Add(this.pnlPayroll);
+            this.groupBox1.Controls.Add(this.cmbDepartment);
+            this.groupBox1.Controls.Add(this.label5);
             this.groupBox1.Controls.Add(this.label2);
             this.groupBox1.Controls.Add(this.numUDConstPro);
             this.groupBox1.Controls.Add(this.label4);
@@ -106,10 +135,372 @@
             this.groupBox1.ForeColor = System.Drawing.Color.White;
             this.groupBox1.Location = new System.Drawing.Point(5, 40);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(1330, 45);
+            this.groupBox1.Size = new System.Drawing.Size(1330, 124);
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabStop = false;
             // 
+            // pnlPayroll
+            // 
+            this.pnlPayroll.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.pnlPayroll.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.pnlPayroll.Controls.Add(this.lblTotalCalcValue2);
+            this.pnlPayroll.Controls.Add(this.label23);
+            this.pnlPayroll.Controls.Add(this.label11);
+            this.pnlPayroll.Controls.Add(this.lblTotalCalcValue1);
+            this.pnlPayroll.Controls.Add(this.label19);
+            this.pnlPayroll.Controls.Add(this.lblPlusorMinus2);
+            this.pnlPayroll.Controls.Add(this.label16);
+            this.pnlPayroll.Controls.Add(this.lblPlusorMinus1);
+            this.pnlPayroll.Controls.Add(this.lblTotalCalcValue);
+            this.pnlPayroll.Controls.Add(this.label12);
+            this.pnlPayroll.Controls.Add(this.label22);
+            this.pnlPayroll.Controls.Add(this.lblTotalValue2);
+            this.pnlPayroll.Controls.Add(this.label14);
+            this.pnlPayroll.Controls.Add(this.lblCalcValue2);
+            this.pnlPayroll.Controls.Add(this.label20);
+            this.pnlPayroll.Controls.Add(this.label13);
+            this.pnlPayroll.Controls.Add(this.lblCalcValue3);
+            this.pnlPayroll.Controls.Add(this.lblTotalValue);
+            this.pnlPayroll.Controls.Add(this.label17);
+            this.pnlPayroll.Controls.Add(this.label6);
+            this.pnlPayroll.Controls.Add(this.lblPayroll);
+            this.pnlPayroll.Controls.Add(this.label15);
+            this.pnlPayroll.Controls.Add(this.lblCalcValue1);
+            this.pnlPayroll.Controls.Add(this.label9);
+            this.pnlPayroll.Location = new System.Drawing.Point(5, 36);
+            this.pnlPayroll.Name = "pnlPayroll";
+            this.pnlPayroll.Size = new System.Drawing.Size(1320, 84);
+            this.pnlPayroll.TabIndex = 46;
+            // 
+            // lblTotalCalcValue2
+            // 
+            this.lblTotalCalcValue2.BackColor = System.Drawing.Color.White;
+            this.lblTotalCalcValue2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblTotalCalcValue2.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblTotalCalcValue2.ForeColor = System.Drawing.Color.Black;
+            this.lblTotalCalcValue2.Location = new System.Drawing.Point(643, 53);
+            this.lblTotalCalcValue2.Name = "lblTotalCalcValue2";
+            this.lblTotalCalcValue2.Size = new System.Drawing.Size(140, 25);
+            this.lblTotalCalcValue2.TabIndex = 52;
+            this.lblTotalCalcValue2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label23
+            // 
+            this.label23.BackColor = System.Drawing.Color.LightSalmon;
+            this.label23.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label23.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label23.ForeColor = System.Drawing.Color.White;
+            this.label23.Location = new System.Drawing.Point(533, 53);
+            this.label23.Name = "label23";
+            this.label23.Size = new System.Drawing.Size(110, 25);
+            this.label23.TabIndex = 51;
+            this.label23.Text = "å½“æœŸç´”åˆ©ç›Š";
+            this.label23.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.label11.Font = new System.Drawing.Font("Myriad Web Pro", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label11.ForeColor = System.Drawing.Color.Black;
+            this.label11.Location = new System.Drawing.Point(807, 25);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(42, 31);
+            this.label11.TabIndex = 48;
+            this.label11.Text = "ï¼�";
+            this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblTotalCalcValue1
+            // 
+            this.lblTotalCalcValue1.BackColor = System.Drawing.Color.White;
+            this.lblTotalCalcValue1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblTotalCalcValue1.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblTotalCalcValue1.ForeColor = System.Drawing.Color.Black;
+            this.lblTotalCalcValue1.Location = new System.Drawing.Point(983, 28);
+            this.lblTotalCalcValue1.Name = "lblTotalCalcValue1";
+            this.lblTotalCalcValue1.Size = new System.Drawing.Size(140, 25);
+            this.lblTotalCalcValue1.TabIndex = 50;
+            this.lblTotalCalcValue1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label19
+            // 
+            this.label19.BackColor = System.Drawing.Color.LightSalmon;
+            this.label19.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label19.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label19.ForeColor = System.Drawing.Color.White;
+            this.label19.Location = new System.Drawing.Point(873, 28);
+            this.label19.Name = "label19";
+            this.label19.Size = new System.Drawing.Size(110, 25);
+            this.label19.TabIndex = 49;
+            this.label19.Text = "å½“æœŸç´”åˆ©ç›Š";
+            this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblPlusorMinus2
+            // 
+            this.lblPlusorMinus2.AutoSize = true;
+            this.lblPlusorMinus2.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.lblPlusorMinus2.Font = new System.Drawing.Font("Myriad Web Pro", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblPlusorMinus2.ForeColor = System.Drawing.Color.Black;
+            this.lblPlusorMinus2.Location = new System.Drawing.Point(471, 52);
+            this.lblPlusorMinus2.Name = "lblPlusorMinus2";
+            this.lblPlusorMinus2.Size = new System.Drawing.Size(35, 27);
+            this.lblPlusorMinus2.TabIndex = 47;
+            this.lblPlusorMinus2.Text = "ï¼‹";
+            this.lblPlusorMinus2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.label16.Font = new System.Drawing.Font("Myriad Web Pro", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label16.ForeColor = System.Drawing.Color.Black;
+            this.label16.Location = new System.Drawing.Point(807, 50);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(42, 31);
+            this.label16.TabIndex = 31;
+            this.label16.Text = "ï¼�";
+            this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblPlusorMinus1
+            // 
+            this.lblPlusorMinus1.AutoSize = true;
+            this.lblPlusorMinus1.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.lblPlusorMinus1.Font = new System.Drawing.Font("Myriad Web Pro", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblPlusorMinus1.ForeColor = System.Drawing.Color.Black;
+            this.lblPlusorMinus1.Location = new System.Drawing.Point(471, 27);
+            this.lblPlusorMinus1.Name = "lblPlusorMinus1";
+            this.lblPlusorMinus1.Size = new System.Drawing.Size(35, 27);
+            this.lblPlusorMinus1.TabIndex = 31;
+            this.lblPlusorMinus1.Text = "ï¼‹";
+            this.lblPlusorMinus1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblTotalCalcValue
+            // 
+            this.lblTotalCalcValue.BackColor = System.Drawing.Color.White;
+            this.lblTotalCalcValue.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblTotalCalcValue.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblTotalCalcValue.ForeColor = System.Drawing.Color.Black;
+            this.lblTotalCalcValue.Location = new System.Drawing.Point(983, 53);
+            this.lblTotalCalcValue.Name = "lblTotalCalcValue";
+            this.lblTotalCalcValue.Size = new System.Drawing.Size(140, 25);
+            this.lblTotalCalcValue.TabIndex = 33;
+            this.lblTotalCalcValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.label12.Font = new System.Drawing.Font("Myriad Web Pro", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label12.ForeColor = System.Drawing.Color.Black;
+            this.label12.Location = new System.Drawing.Point(471, 2);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(35, 27);
+            this.label12.TabIndex = 2;
+            this.label12.Text = "ï¼�";
+            this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label22
+            // 
+            this.label22.BackColor = System.Drawing.Color.Navy;
+            this.label22.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label22.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label22.ForeColor = System.Drawing.Color.Yellow;
+            this.label22.Location = new System.Drawing.Point(873, 53);
+            this.label22.Name = "label22";
+            this.label22.Size = new System.Drawing.Size(110, 25);
+            this.label22.TabIndex = 32;
+            this.label22.Text = "å½“æœŸæš«å®šç´”åˆ©ç›Š";
+            this.label22.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblTotalValue2
+            // 
+            this.lblTotalValue2.BackColor = System.Drawing.Color.White;
+            this.lblTotalValue2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblTotalValue2.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblTotalValue2.ForeColor = System.Drawing.Color.Black;
+            this.lblTotalValue2.Location = new System.Drawing.Point(643, 28);
+            this.lblTotalValue2.Name = "lblTotalValue2";
+            this.lblTotalValue2.Size = new System.Drawing.Size(140, 25);
+            this.lblTotalValue2.TabIndex = 33;
+            this.lblTotalValue2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label14
+            // 
+            this.label14.BackColor = System.Drawing.Color.DarkSeaGreen;
+            this.label14.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label14.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label14.ForeColor = System.Drawing.Color.DarkRed;
+            this.label14.Location = new System.Drawing.Point(533, 28);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(110, 25);
+            this.label14.TabIndex = 32;
+            this.label14.Text = "çµŒé�Žçµ¦ä¸Žå·®é¡�";
+            this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblCalcValue2
+            // 
+            this.lblCalcValue2.BackColor = System.Drawing.Color.White;
+            this.lblCalcValue2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCalcValue2.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblCalcValue2.ForeColor = System.Drawing.Color.Black;
+            this.lblCalcValue2.Location = new System.Drawing.Point(303, 28);
+            this.lblCalcValue2.Name = "lblCalcValue2";
+            this.lblCalcValue2.Size = new System.Drawing.Size(140, 25);
+            this.lblCalcValue2.TabIndex = 46;
+            this.lblCalcValue2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label20
+            // 
+            this.label20.BackColor = System.Drawing.Color.DarkOrange;
+            this.label20.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label20.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label20.ForeColor = System.Drawing.Color.White;
+            this.label20.Location = new System.Drawing.Point(193, 28);
+            this.label20.Name = "label20";
+            this.label20.Size = new System.Drawing.Size(110, 25);
+            this.label20.TabIndex = 11;
+            this.label20.Text = "æŒ¯åˆ†æ¸ˆç´”åˆ©ç›Š";
+            this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.BackColor = System.Drawing.Color.PaleGoldenrod;
+            this.label13.Font = new System.Drawing.Font("Myriad Web Pro", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label13.ForeColor = System.Drawing.Color.Black;
+            this.label13.Location = new System.Drawing.Point(807, 0);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(42, 31);
+            this.label13.TabIndex = 3;
+            this.label13.Text = "ï¼�";
+            this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblCalcValue3
+            // 
+            this.lblCalcValue3.BackColor = System.Drawing.Color.White;
+            this.lblCalcValue3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCalcValue3.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblCalcValue3.ForeColor = System.Drawing.Color.Black;
+            this.lblCalcValue3.Location = new System.Drawing.Point(303, 53);
+            this.lblCalcValue3.Name = "lblCalcValue3";
+            this.lblCalcValue3.Size = new System.Drawing.Size(140, 25);
+            this.lblCalcValue3.TabIndex = 7;
+            this.lblCalcValue3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // lblTotalValue
+            // 
+            this.lblTotalValue.BackColor = System.Drawing.Color.White;
+            this.lblTotalValue.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblTotalValue.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblTotalValue.ForeColor = System.Drawing.Color.Black;
+            this.lblTotalValue.Location = new System.Drawing.Point(983, 3);
+            this.lblTotalValue.Name = "lblTotalValue";
+            this.lblTotalValue.Size = new System.Drawing.Size(140, 25);
+            this.lblTotalValue.TabIndex = 5;
+            this.lblTotalValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label17
+            // 
+            this.label17.BackColor = System.Drawing.Color.Green;
+            this.label17.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label17.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label17.ForeColor = System.Drawing.Color.White;
+            this.label17.Location = new System.Drawing.Point(193, 53);
+            this.label17.Name = "label17";
+            this.label17.Size = new System.Drawing.Size(110, 25);
+            this.label17.TabIndex = 6;
+            this.label17.Text = "æœªæŒ¯åˆ†ç´”åˆ©ç›Š";
+            this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label6
+            // 
+            this.label6.BackColor = System.Drawing.Color.Black;
+            this.label6.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label6.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label6.ForeColor = System.Drawing.Color.White;
+            this.label6.Location = new System.Drawing.Point(533, 3);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(110, 25);
+            this.label6.TabIndex = 0;
+            this.label6.Text = "å½“æœŸçµŒé�Žçµ¦ä¸Ž";
+            this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblPayroll
+            // 
+            this.lblPayroll.BackColor = System.Drawing.Color.White;
+            this.lblPayroll.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblPayroll.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblPayroll.ForeColor = System.Drawing.Color.Black;
+            this.lblPayroll.Location = new System.Drawing.Point(643, 3);
+            this.lblPayroll.Name = "lblPayroll";
+            this.lblPayroll.Size = new System.Drawing.Size(140, 25);
+            this.lblPayroll.TabIndex = 0;
+            this.lblPayroll.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label15
+            // 
+            this.label15.BackColor = System.Drawing.Color.DarkSeaGreen;
+            this.label15.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label15.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label15.ForeColor = System.Drawing.Color.DarkRed;
+            this.label15.Location = new System.Drawing.Point(873, 3);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(110, 25);
+            this.label15.TabIndex = 4;
+            this.label15.Text = "çµŒé�Žçµ¦ä¸Žå·®é¡�";
+            this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblCalcValue1
+            // 
+            this.lblCalcValue1.BackColor = System.Drawing.Color.White;
+            this.lblCalcValue1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCalcValue1.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblCalcValue1.ForeColor = System.Drawing.Color.Black;
+            this.lblCalcValue1.Location = new System.Drawing.Point(303, 3);
+            this.lblCalcValue1.Name = "lblCalcValue1";
+            this.lblCalcValue1.Size = new System.Drawing.Size(140, 25);
+            this.lblCalcValue1.TabIndex = 1;
+            this.lblCalcValue1.Text = "-999,999,999";
+            this.lblCalcValue1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label9
+            // 
+            this.label9.BackColor = System.Drawing.Color.Blue;
+            this.label9.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label9.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label9.ForeColor = System.Drawing.Color.White;
+            this.label9.Location = new System.Drawing.Point(193, 3);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(110, 25);
+            this.label9.TabIndex = 0;
+            this.label9.Text = "æŒ¯åˆ†æ¸ˆçµ¦ä¸Ž";
+            this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // cmbDepartment
+            // 
+            this.cmbDepartment.BackColor = System.Drawing.Color.White;
+            this.cmbDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cmbDepartment.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.cmbDepartment.FormattingEnabled = true;
+            this.cmbDepartment.Location = new System.Drawing.Point(408, 11);
+            this.cmbDepartment.Name = "cmbDepartment";
+            this.cmbDepartment.Size = new System.Drawing.Size(200, 23);
+            this.cmbDepartment.TabIndex = 41;
+            this.cmbDepartment.SelectedIndexChanged += new System.EventHandler(this.cmbDepartment_SelectedIndexChanged);
+            // 
+            // label5
+            // 
+            this.label5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label5.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label5.ForeColor = System.Drawing.Color.Black;
+            this.label5.Location = new System.Drawing.Point(280, 10);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(120, 25);
+            this.label5.TabIndex = 42;
+            this.label5.Text = "æ‹…å½“éƒ¨ç½²";
+            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
             // label2
             // 
             this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
@@ -116,7 +507,7 @@
             this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.label2.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.label2.ForeColor = System.Drawing.Color.Black;
-            this.label2.Location = new System.Drawing.Point(6, 14);
+            this.label2.Location = new System.Drawing.Point(6, 10);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(120, 25);
             this.label2.TabIndex = 38;
@@ -128,7 +519,7 @@
             this.numUDConstPro.BackColor = System.Drawing.Color.White;
             this.numUDConstPro.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.numUDConstPro.ForeColor = System.Drawing.Color.Black;
-            this.numUDConstPro.Location = new System.Drawing.Point(159, 15);
+            this.numUDConstPro.Location = new System.Drawing.Point(159, 11);
             this.numUDConstPro.Name = "numUDConstPro";
             this.numUDConstPro.ReadOnly = true;
             this.numUDConstPro.Size = new System.Drawing.Size(80, 23);
@@ -140,7 +531,7 @@
             // 
             this.label4.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.label4.ForeColor = System.Drawing.Color.Black;
-            this.label4.Location = new System.Drawing.Point(239, 18);
+            this.label4.Location = new System.Drawing.Point(239, 14);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(25, 16);
             this.label4.TabIndex = 0;
@@ -151,7 +542,7 @@
             // 
             this.label7.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.label7.ForeColor = System.Drawing.Color.Black;
-            this.label7.Location = new System.Drawing.Point(134, 18);
+            this.label7.Location = new System.Drawing.Point(134, 14);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(25, 16);
             this.label7.TabIndex = 0;
@@ -211,18 +602,17 @@
             this.Column8,
             this.Column9,
             this.Column10,
-            this.Column2,
             this.Column12});
-            dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle14.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle14.SelectionBackColor = System.Drawing.Color.LightSeaGreen;
-            dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.dgvMaster.DefaultCellStyle = dataGridViewCellStyle14;
+            dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle13.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle13.SelectionBackColor = System.Drawing.Color.LightSeaGreen;
+            dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.dgvMaster.DefaultCellStyle = dataGridViewCellStyle13;
             this.dgvMaster.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
-            this.dgvMaster.Location = new System.Drawing.Point(5, 93);
+            this.dgvMaster.Location = new System.Drawing.Point(5, 168);
             this.dgvMaster.Name = "dgvMaster";
             this.dgvMaster.RowHeadersVisible = false;
             this.dgvMaster.RowHeadersWidth = 20;
@@ -229,7 +619,7 @@
             this.dgvMaster.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
             this.dgvMaster.RowTemplate.Height = 21;
             this.dgvMaster.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
-            this.dgvMaster.Size = new System.Drawing.Size(1330, 520);
+            this.dgvMaster.Size = new System.Drawing.Size(1330, 446);
             this.dgvMaster.TabIndex = 5;
             this.dgvMaster.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvMaster_CellDoubleClick);
             this.dgvMaster.SelectionChanged += new System.EventHandler(this.dgvMaster_SelectionChanged);
@@ -241,7 +631,7 @@
             dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
             this.Column3.DefaultCellStyle = dataGridViewCellStyle3;
             this.Column3.Frozen = true;
-            this.Column3.HeaderText = "éƒ¨ç½²ã‚³ãƒ¼ãƒ‰";
+            this.Column3.HeaderText = "ã‚³ãƒ¼ãƒ‰";
             this.Column3.Name = "Column3";
             this.Column3.ReadOnly = true;
             this.Column3.Resizable = System.Windows.Forms.DataGridViewTriState.False;
@@ -297,7 +687,7 @@
             this.Column6.ReadOnly = true;
             this.Column6.Resizable = System.Windows.Forms.DataGridViewTriState.False;
             this.Column6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.Column6.Width = 120;
+            this.Column6.Width = 140;
             // 
             // Column7
             // 
@@ -310,7 +700,7 @@
             this.Column7.ReadOnly = true;
             this.Column7.Resizable = System.Windows.Forms.DataGridViewTriState.False;
             this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.Column7.Width = 120;
+            this.Column7.Width = 140;
             // 
             // Column8
             // 
@@ -323,7 +713,7 @@
             this.Column8.ReadOnly = true;
             this.Column8.Resizable = System.Windows.Forms.DataGridViewTriState.False;
             this.Column8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.Column8.Width = 120;
+            this.Column8.Width = 140;
             // 
             // Column9
             // 
@@ -336,7 +726,7 @@
             this.Column9.ReadOnly = true;
             this.Column9.Resizable = System.Windows.Forms.DataGridViewTriState.False;
             this.Column9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.Column9.Width = 120;
+            this.Column9.Width = 140;
             // 
             // Column10
             // 
@@ -349,26 +739,13 @@
             this.Column10.ReadOnly = true;
             this.Column10.Resizable = System.Windows.Forms.DataGridViewTriState.False;
             this.Column10.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.Column10.Width = 120;
+            this.Column10.Width = 140;
             // 
-            // Column2
+            // Column12
             // 
             dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            dataGridViewCellStyle12.Font = new System.Drawing.Font("ï¼­ï¼³ ï¼°æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.Column2.DefaultCellStyle = dataGridViewCellStyle12;
-            this.Column2.Frozen = true;
-            this.Column2.HeaderText = "çµ¦ä¸Žé¡�";
-            this.Column2.Name = "Column2";
-            this.Column2.ReadOnly = true;
-            this.Column2.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.Column2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.Column2.Width = 120;
-            // 
-            // Column12
-            // 
-            dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            dataGridViewCellStyle13.Font = new System.Drawing.Font("ï¼­ï¼³ ï¼°æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold);
-            this.Column12.DefaultCellStyle = dataGridViewCellStyle13;
+            dataGridViewCellStyle12.Font = new System.Drawing.Font("ï¼­ï¼³ ï¼°æ˜Žæœ�", 9F, System.Drawing.FontStyle.Bold);
+            this.Column12.DefaultCellStyle = dataGridViewCellStyle12;
             this.Column12.Frozen = true;
             this.Column12.HeaderText = "ç´”åˆ©ç›Š";
             this.Column12.Name = "Column12";
@@ -375,7 +752,7 @@
             this.Column12.ReadOnly = true;
             this.Column12.Resizable = System.Windows.Forms.DataGridViewTriState.False;
             this.Column12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.Column12.Width = 120;
+            this.Column12.Width = 140;
             // 
             // FrmDepExpenssList
             // 
@@ -402,6 +779,8 @@
             this.SizeChanged += new System.EventHandler(this.FrmDepExpenssList_SizeChanged);
             this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmDepExpenssList_KeyDown);
             this.groupBox1.ResumeLayout(false);
+            this.pnlPayroll.ResumeLayout(false);
+            this.pnlPayroll.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.numUDConstPro)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.dgvMaster)).EndInit();
             this.ResumeLayout(false);
@@ -421,6 +800,8 @@
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label lblCellTotal;
         private System.Windows.Forms.ProgressBar ProgressBar;
+        private System.Windows.Forms.ComboBox cmbDepartment;
+        private System.Windows.Forms.Label label5;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column14;
@@ -430,7 +811,31 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column8;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column9;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column10;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
+        private System.Windows.Forms.Panel pnlPayroll;
+        private System.Windows.Forms.Label lblTotalCalcValue2;
+        private System.Windows.Forms.Label label23;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Label lblTotalCalcValue1;
+        private System.Windows.Forms.Label label19;
+        private System.Windows.Forms.Label lblPlusorMinus2;
+        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.Label lblPlusorMinus1;
+        private System.Windows.Forms.Label lblTotalCalcValue;
+        private System.Windows.Forms.Label label12;
+        private System.Windows.Forms.Label label22;
+        private System.Windows.Forms.Label lblTotalValue2;
+        private System.Windows.Forms.Label label14;
+        private System.Windows.Forms.Label lblCalcValue2;
+        private System.Windows.Forms.Label label20;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Label lblCalcValue3;
+        private System.Windows.Forms.Label lblTotalValue;
+        private System.Windows.Forms.Label label17;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label lblPayroll;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.Label lblCalcValue1;
+        private System.Windows.Forms.Label label9;
     }
 }
\ No newline at end of file
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.resx
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.resx	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.resx	(revision 18)
@@ -144,9 +144,6 @@
   <metadata name="Column10.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="Column12.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssListAuxiliary.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssListAuxiliary.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssListAuxiliary.cs	(revision 18)
@@ -68,43 +68,160 @@
         /// <summary>
         /// �HŽ–ˆê——‚æ‚è‹N“®‚·‚éƒvƒ�ƒZƒX‘I‘ð�ˆ—�
         /// </summary>
-        /// <param name="para_ConstructionCode"></param>
-        private void SubProcessExecute(int para_ConstructionCode = 0)
+        /// <param name="para_PersonCode"></param>
+        private void SubProcessExecute(int para_PersonCode = 0)
         {
             try
             {
-                int NowPoint = ClsExcute.GetNowProcessPoint();
-                // Œ»�Ý�Ý’è’lƒNƒŠƒA
-                ClsExcute.ClearSaveParameter(NowPoint);
-                // ----- ‰æ–Ê�î•ñ‘Þ”ð
-                // ŒŸ�õ”N
-                ClsExcute.ProcControlPara[NowPoint].StringSaveParameter.Add(numUDConstPro.Value.ToString());
-                // ƒ\�[ƒg�ó‘Ô
-                if (dgvMaster.SortedColumn != null)
+                Point po = this.DesktopLocation; ;
+                bool ReloadFlg = false;
+
+                int ProcessNo = (int)ClsExcute.ProcessExecuteNo.ConstructionLedgerList;
+                // ƒtƒH�[ƒ€‚ª‚ ‚ê‚Î�Å‘O–Ê‚Ö
+                FrmConstructionLedgerList frm = (FrmConstructionLedgerList)ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle;
+                // •\Ž¦’S“–ŽÒ‚ª“¯‚¶‚È‚ç‚Î�ˆ—�‚µ‚È‚¢
+                if (frm != null)
                 {
-                    ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add((int)dgvMaster.SortedColumn.Index);
-                    ClsExcute.ProcControlPara[NowPoint].IntSaveParameter.Add((int)dgvMaster.SortOrder);
+                    if (frm.NowPersonCode == para_PersonCode)
+                    {
+                        frm.Activate();
+                        return;
+                    }
+
+                    ReloadFlg = true;
+                    po = frm.DesktopLocation;
+                    // ƒtƒH�[ƒ€‚ðƒNƒ��[ƒY‚·‚é
+                    TerminatingProcess();
                 }
 
-                // ŽŸ‹N“®ƒvƒ�ƒZƒXƒZƒbƒg
-                NowPoint = ClsExcute.NextProcess((int)(int)ClsExcute.ProcessExecuteNo.ConstructionLedger);
-                // ‘I‘ð�HŽ–”Ô�†ƒZƒbƒg
-                ClsExcute.ProcControlPara[NowPoint].IntExecParameter.Add(para_ConstructionCode);
+                // �HŽ–�Ú�×‘ä’ ˆê——
+                int NowPoint = ClsExcute.NextProcess((int)ClsExcute.ProcessExecuteNo.ConstructionLedgerList);
+
+                // �HŽ–ˆê——‚©‚ç•\Ž¦‚ð�s‚¤‚½‚ß‹N“®ƒvƒ�ƒZƒX‚Íƒpƒ‰ƒ��[ƒ^‚Ì1‚Â–Ú‚ÉƒZƒbƒg‚·‚é�B
+                // �HŽ–�Ú�×‘ä’ “ü—Í
+                ClsExcute.ProcControlPara[NowPoint].IntExecParameter.Add((int)ClsExcute.ProcessExecuteNo.ConstructionLedger);
+                ClsExcute.ProcControlPara[NowPoint].BoolExecParameter.Add(false);
+
+                // �HŽ–�Ú�×‘ä’ ˆê——•\Ž¦
+                frm = new FrmConstructionLedgerList();
+                ClsExcute.SubFormHandleList[ProcessNo].ProcessNo = s_CurrentProcessNo;
+                ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle = (Form)frm;
+
+                // ŽŸ‹N“®ƒvƒ�ƒZƒXƒZƒbƒg�i�HŽ–�Ú�×‘ä’ �j
+                frm.ExecuteFlg = (int)ClsExcute.ProcessExecuteNo.ConstructionLedger;
+
+                // �‰Šú‘I‘ð–³‚µƒtƒ‰ƒO
+                frm.FirstStartFlg = false;
+
+                // �‰Šú‘I‘ð”N“x
+                frm.FirstStartPeriod = (int)numUDConstPro.Value;
+
+                // �‰Šú‘I‘ð•”��ƒR�[ƒh
+                int DepartmentCode = GetDepartmentCode();
+                frm.FirstStartDepartmentCode = DepartmentCode;
+
+                // �‰Šú‘I‘ð’S“–ŽÒƒR�[ƒh
+                frm.FirstStartPersonCode = para_PersonCode;
+
+                frm.ShowInTaskbar = true;
+
+                // ƒNƒ��[ƒXƒhƒnƒ“ƒhƒ‰‚ð‚±‚¿‚ç‚Å’è‹`‚·‚é
+                frm.FormClosed += new FormClosedEventHandler(FrmConstructionLedgerListClosed);
+                frm.Show();
+
+                // •\Ž¦ˆÊ’u•Ï�X
+                Point parentPO = frm.Location;
+                if (ReloadFlg)
+                {
+                    frm.DesktopLocation = po;
+                }
+                else
+                {
+                    parentPO.X += 50;
+                    parentPO.Y += 50;
+                    frm.Location = parentPO;
+                }
+
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
             }
-            finally
+        }
+        #endregion
+
+        #region �HŽ–�î•ñ“ü—Í‚ÌƒNƒ��[ƒY‚ðŽæ“¾‚·‚é
+        /// <summary>
+        /// �HŽ–�î•ñ“ü—Í‚ÌƒNƒ��[ƒY‚ðŽæ“¾‚·‚é
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void FrmConstructionLedgerListClosed(object sender, FormClosedEventArgs e)
+        {
+            try
             {
-                // ƒNƒ��[ƒY�ˆ—�‚ðOFF‚É‚·‚é�B
-                m_CloseingProcessOff = true;
-                // ‰æ–ÊƒNƒ��[ƒY
-                this.Close();
+                int ProcessNo = (int)ClsExcute.ProcessExecuteNo.ConstructionLedgerList;
+                FrmConstructionLedgerList frm = (FrmConstructionLedgerList)ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle;
+
+                // ƒnƒ“ƒhƒ‹ƒNƒŠƒA
+                ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle.Dispose();
+                ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle = null;
+                ClsExcute.SubFormHandleList[ProcessNo].ProcessNo = (int)ClsExcute.ProcessExecuteNo.MainMenu;
+
+                // ‹N“®ƒpƒ‰ƒ�ƒ^ƒNƒŠƒA
+                int NowPoint = ClsExcute.GetNowProcessPoint();
+                ClsExcute.ClearExecParameter(NowPoint);
+                ClsExcute.ClearSaveParameter(NowPoint);
+
+                this.Activate();
             }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
         }
         #endregion
 
+        #region �I—¹Žž�ˆ—�
+        /// <summary>
+        /// �I—¹ŽžƒTƒuƒtƒH�[ƒ€ƒNƒ��[ƒY
+        /// </summary>
+        private void TerminatingProcess()
+        {
+            try
+            {
+                // ƒtƒH�[ƒ€‚ªClose‚³‚ê‚Ä‚¢‚È‚¯‚ê‚ÎƒNƒ��[ƒY‚·‚é
+                for (int i = 0; i < ClsExcute.SubFormHandleList.Length; i++)
+                {
+                    PreserveSubFormHandle Handle = ClsExcute.SubFormHandleList[i];
+
+                    // Ž©•ª‚ª‹N“®‚µ‚½‚à‚ÌˆÈŠO‚Í�ˆ—�‚µ‚È‚¢
+                    if (Handle.ProcessNo != s_CurrentProcessNo) continue;
+
+                    // Ž©•ª‚Í�ˆ—�‚µ‚È‚¢
+                    if (i == s_CurrentProcessNo)
+                    {
+                        ClsExcute.SubFormHandleList[i].SubFormHandle = null;
+                        ClsExcute.SubFormHandleList[i].ProcessNo = (int)ClsExcute.ProcessExecuteNo.MainMenu;
+                        continue;
+                    }
+
+                    // ‹N“®‚³‚ê‚Ä–³‚¯‚ê‚Î�ˆ—�‚µ‚È‚¢
+                    if (Handle.SubFormHandle == null) continue;
+
+                    // ‰æ–ÊƒNƒ��[ƒY
+                    Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
+
+                }
+            }
+            catch (System.Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
         #region ŒŸ�õSQL‚ÌƒZƒLƒ…ƒŠƒeƒB”»’è•”•ª‚ð�ì�¬‚·‚é
         /// <summary>
         /// ŒŸ�õSQL‚ÌƒZƒLƒ…ƒŠƒeƒB”»’è•”•ª‚ð�ì�¬‚·‚é
@@ -161,61 +278,6 @@
         }
         #endregion
 
-        #region ‚c‚aŽæ“¾�‡”Ô
-        /// <summary>
-        /// ‚c‚aŽæ“¾�‡”Ô
-        /// </summary>
-        private enum DBGetData
-        {
-            DepartmentCode = 0,
-            DepartmentString,
-            DisplayOrder,
-            OrdersDecisionprice,
-            CompanyExpenses,
-            DepartmentExpenses,
-            SalesExpenses,
-            TotalPayment,
-            GrossProfit,
-            Allowance,
-            NetProfit,
-        }
-        #endregion
-
-        #region ƒf�[ƒ^Žæ“¾SQL�ì�¬
-        /// <summary>
-        /// •\Ž¦—pƒf�[ƒ^Žæ“¾SQL�ì�¬
-        /// </summary>
-        private void CreateInitSQL(ref string strSQL)
-        {
-            try
-            {
-                // SQL‚ÉƒAƒNƒZƒX�§ŒÀ‚ð‚©‚¯‚é
-                List<string> strSecurity = new List<string>();
-                CreateSecuritySQL(ref strSecurity);
-
-                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
-                // ----- ‚r‚p‚k�ì�¬
-                // ‘¶�Ý�Ú�×‘ä’ ƒf�[ƒ^ŒŸ�õ
-                strSQL = "(SELECT C.DEPARTMENTCODE, D.DEPARTMENTSTRING, D.DISPLAYORDER,";
-                strSQL += " SUM(A.ORDERSDECISIONPRICE), SUM(A.COMPANYEXPENSES), SUM(A.DEPARTMENTEXPENSES), SUM(A.SALESEXPENSES),";
-                strSQL += " SUM(A.TOTALPAYMENT), SUM(A.GROSSPROFIT), SUM(A.ALLOWANCE), SUM(A.NETPROFIT)";
-                strSQL += " FROM CONSTRUCTIONLEDGER A, CONSTRUCTIONBASEINFO B, PERSONINCHARGEMASTER C, DEPARTMENTMASTER D";
-                strSQL += " WHERE A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
-                strSQL += string.Format(" AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
-                strSQL += " AND B.CONSTRUCTIONPERSONCODE = C.PERSONCODE";
-                strSQL += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
-                strSQL += string.Format(" AND B.TyingFlg != {0}", (int)CommonDefine.BaseInfoTyingFlg.Tying);
-                strSQL += " AND C.DEPARTMENTCODE = D.DEPARTMENTCODE";
-                strSQL += " GROUP BY C.DEPARTMENTCODE, D.DEPARTMENTSTRING, D.DISPLAYORDER)";
-                strSQL += " ORDER BY 3 ASC";
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", ex.Message, strSQL);
-            }
-        }
-        #endregion
-
         #region ƒOƒŠƒbƒh�sƒf�[ƒ^ƒZƒbƒg
         /// <summary>
         /// ƒOƒŠƒbƒh�sƒf�[ƒ^ƒZƒbƒg
@@ -225,7 +287,10 @@
         /// <param name="TotalArea"></param>
         /// <param name="initFlg"></param>
         /// <param name="StatusFlg"></param>
-        private void GridDataSet(object[] objwrk, ref int ino, ref int[] TotalArea, ref bool initFlg, ref int StatusFlg)
+        private void GridDataSet(object[] objwrk, ref int ino, ref int[] TotalArea, ref bool initFlg, ref int StatusFlg,
+                                    List<int> DepInPerArray, List<int> PersonCDArray,
+                                    List<DateTime> dtStartArray, List<DateTime> dtCompArray, List<int> SalaryArray,
+                                    DateTime dtDefaultStart, DateTime dtDefaultEnd)
         {
             try
             {
@@ -239,8 +304,101 @@
                 {
                     wrkArray[i] = CommonMotions.cnvInt(objwrk[i]);
                 }
+                // ------ •”��ƒR�[ƒh�E’S“–ŽÒƒR�[ƒhŽæ“¾
+                int DepartmentCode = 0;
+                int PersonCode = 0;
+                if (GetDepartmentCode() == 0)
+                {   // �Ý’è•”��‚ª–³‚¯‚ê‚Îƒf�[ƒ^‚©‚ç“Ç‚Ý�ž‚Þ
+                    DepartmentCode = CommonMotions.cnvInt(objwrk[(int)DBGetData.DepartmentCode]);
+                }
+                else
+                {   // •”��‚ª‚ ‚ê‚Î’S“–ŽÒƒR�[ƒh‚ðƒf�[ƒ^‚æ‚èŽæ“¾‚·‚é
+                    DepartmentCode = GetDepartmentCode();
+                    PersonCode = CommonMotions.cnvInt(objwrk[(int)DBGetData.DepartmentCode]);
+                }
+                // ------------------------------------------------------------------------------------------
 
 
+                // ------ Œo”ï�E�U•ª�lŒ�”ïŽæ“¾
+                int ArrayCount = Common.CommonDefine.CostDataNoString.Length;
+                int[] CostValue2 = new int[ArrayCount];
+                int TotalSalary = 0;
+                int OnSalary = 0;
+                int NetIncome = 0;
+                int NonSalary = 0;
+
+                if (PersonCode == 0)
+                {
+                    for (int i = 0; i < PersonCDArray.Count; i++)
+                    {
+                        if (DepInPerArray[i] != DepartmentCode) continue;
+                        // ŠJŽn�E�I—¹“ú‚ª–³‚¢�ê�‡‚ÍƒfƒtƒHƒ‹ƒg‚ÌŠúŽñ�EŠú––‚ðŽg—p‚·‚é
+                        if (dtStartArray[i] == DateTime.MinValue || dtStartArray[i] == DateTime.MaxValue) dtStartArray[i] = dtDefaultStart;
+                        if (dtCompArray[i] == DateTime.MinValue || dtCompArray[i] == DateTime.MaxValue) dtCompArray[i] = dtDefaultEnd;
+
+                        // Œo”ïŽæ“¾
+                        GetPersonExpensesCostValue(PersonCDArray[i], dtStartArray[i], dtCompArray[i], ref CostValue2);
+
+                        // ‹‹—^—Ý�ÏŽæ“¾
+                        int workSalary = CalcElapsedSalary(dtStartArray[i], dtCompArray[i], PersonCDArray[i], SalaryArray[i]);
+                        // —ÝŒv‰ÁŽZ
+                        if (workSalary > 0) TotalSalary += workSalary;
+                    }
+
+                    // �U•ª‹‹—^‹àŠz�E�ƒ—˜‰v‹àŠz�E‘e—˜‰v‹àŠzŽæ“¾
+                    ProfitGeneral(DepartmentCode, PersonCode, ref OnSalary, ref  NetIncome, ref  NonSalary);
+                }
+                else
+                {
+                    int PersonCount = -1;
+                    for (int i = 0; i < PersonCDArray.Count; i++)
+                    {
+                        // ŠJŽn�E�I—¹“ú‚ª–³‚¢�ê�‡‚ÍƒfƒtƒHƒ‹ƒg‚ÌŠúŽñ�EŠú––‚ðŽg—p‚·‚é
+                        if (dtStartArray[i] == DateTime.MinValue || dtStartArray[i] == DateTime.MaxValue) dtStartArray[i] = dtDefaultStart;
+                        if (dtCompArray[i] == DateTime.MinValue || dtCompArray[i] == DateTime.MaxValue) dtCompArray[i] = dtDefaultEnd;
+
+                        // “¯‚¶’S“–ŽÒƒR�[ƒh‚ð’T‚·
+                        if (PersonCode == PersonCDArray[i])
+                        {
+                            PersonCount = i;
+                            break;
+                        }
+                    }
+                    if (PersonCount < 0) return;
+                    // Œo”ïŽæ“¾
+                    GetPersonExpensesCostValue(PersonCDArray[PersonCount], dtStartArray[PersonCount], dtCompArray[PersonCount], ref CostValue2);
+
+                    // ‹‹—^—Ý�ÏŽæ“¾
+                    TotalSalary = CalcElapsedSalary(dtStartArray[PersonCount], dtCompArray[PersonCount], PersonCDArray[PersonCount], SalaryArray[PersonCount]);
+
+                    // �U•ª‹‹—^‹àŠz�E�ƒ—˜‰v‹àŠz�E‘e—˜‰v‹àŠzŽæ“¾
+                    ProfitGeneral(DepartmentCode, PersonCode, ref OnSalary, ref  NetIncome, ref  NonSalary);
+                }
+                // ‰ÁŽZ
+                for (int i = 0; i < CostValue2.Length; i++)
+                {
+                    wrkArray[(int)DBGetData.TotalPayment] += CostValue2[i];         // ‘�Žx•¥Šz+�w“ü•i
+                    wrkArray[(int)DBGetData.GrossProfit] -= CostValue2[i];          // ‘e—˜‰v-�w“ü•i
+                    wrkArray[(int)DBGetData.NetProfit] -= CostValue2[i];            // �ƒ—˜‰v-�w“ü•i
+                }
+                int TotalValue = OnSalary - TotalSalary;
+                wrkArray[(int)DBGetData.GrossProfit] += TotalValue;                 // ‘e—˜‰v+�U•ª‹‹—^�·Šz
+                wrkArray[(int)DBGetData.NetProfit] += TotalValue;                   // �ƒ—˜‰v+�U•ª‹‹—^�·Šz
+                // ------------------------------------------------------------------------------------------
+
+                // ------ �U•ª‹‹—^‚ðŽæ“¾‚·‚é
+                int[] CostValue3 = new int[2];
+
+                // �U•ª‹àŠz‚ðŽæ“¾‚·‚é
+                GetPersonAuxiliaryCostValue(DepartmentCode, PersonCode, ref CostValue3);
+                // ‰ÁŽZ
+                for (int i = 0; i < CostValue3.Length; i++)
+                {
+                    wrkArray[(int)DBGetData.GrossProfit] += CostValue3[i];          // ‘e—˜‰v
+                    wrkArray[(int)DBGetData.NetProfit] += CostValue3[i];            // �ƒ—˜‰v
+                }
+                // ------------------------------------------------------------------------------------------
+
                 dgv.Rows.Add(objwrk[(int)DBGetData.DepartmentCode],
                                     ino++,
                                     CommonMotions.cnvString(objwrk[(int)DBGetData.DepartmentString]),
@@ -250,7 +408,6 @@
                                     wrkArray[(int)DBGetData.SalesExpenses].ToString("#,0"),
                                     wrkArray[(int)DBGetData.TotalPayment].ToString("#,0"),
                                     wrkArray[(int)DBGetData.GrossProfit].ToString("#,0"),
-                                    wrkArray[(int)DBGetData.Allowance].ToString("#,0"),
                                     wrkArray[(int)DBGetData.NetProfit].ToString("#,0")
                             );
 
@@ -260,7 +417,6 @@
                 TotalArea[(int)DispColumn.SalesExpenses] += wrkArray[(int)DBGetData.SalesExpenses];
                 TotalArea[(int)DispColumn.TotalPayment] += wrkArray[(int)DBGetData.TotalPayment];
                 TotalArea[(int)DispColumn.GrossProfit] += wrkArray[(int)DBGetData.GrossProfit];
-                TotalArea[(int)DispColumn.Allowance] += wrkArray[(int)DBGetData.Allowance];
                 TotalArea[(int)DispColumn.NetProfit] += wrkArray[(int)DBGetData.NetProfit];
             }
             catch (Exception ex)
@@ -270,117 +426,6 @@
         }
         #endregion
 
-        #region ƒf�[ƒ^•\Ž¦�ˆ—�
-        /// <summary>
-        /// ˆê——ƒf�[ƒ^•\Ž¦�ˆ—�
-        /// </summary>
-        private void DataDisplay()
-        {
-            IOConstructionLedger LedgerDB = new IOConstructionLedger();
-            DataGridView dgv = dgvMaster;
-            ProgressBar prgber = ProgressBar;
-            try
-            {
-                dgv.SuspendLayout();
-
-                dgv.Rows.Clear();
-                // ƒvƒ�ƒOƒŒƒXƒo�[‚Ì�‰Šú‰»
-                prgber.Visible = true;
-                prgber.Minimum = 0;
-                prgber.Maximum = 10;
-                prgber.Value = 0;
-
-                string strSQL = "";
-                // SQL�ì�¬
-                CreateInitSQL(ref strSQL);
-
-                ArrayList arData = new ArrayList();
-                string FlgString = string.Empty;
-                // �HŽ–�Ú�×‘ä’ Žæ“¾
-                if (!LedgerDB.ExecuteReader(strSQL, ref arData)) return;
-
-                // “Ç�žŽžƒf�[ƒ^ƒJƒEƒ“ƒgŽæ“¾
-                m_initDataCount = arData.Count;
-                if (arData.Count == 0) return;
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Maximum = arData.Count + 2;
-                prgber.Value++;
-                prgber.Update();
-
-                // �‡ŒvƒGƒŠƒA
-                int TotalColCnt = Enum.GetNames(typeof(DispColumn)).Length;
-                int[] TotalArea = new int[TotalColCnt];
-                Array.Clear(TotalArea, 0, TotalArea.Length);
-
-                // ƒf�[ƒ^•\Ž¦
-                int ino = 1;
-                int StatusFlg = -1;
-                bool initFlg = true;
-                string strStatus = string.Empty;
-                // ----- Ž{�H’†ƒf�[ƒ^•\Ž¦
-                foreach (object[] objwrk in arData)
-                {
-                    // ƒOƒŠƒbƒh‚Öƒf�[ƒ^•\Ž¦
-                    GridDataSet(objwrk, ref ino, ref TotalArea, ref initFlg, ref StatusFlg);
-
-                    // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                    prgber.Value++;
-                    prgber.Update();
-                }
-
-                // ----- �‡Œv•\Ž¦
-                if (arData.Count != 0)
-                {
-                    dgv.Rows.Add();       // ‹ó�s
-
-                    // �‡Œv�s•\Ž¦
-                    int TotalRow = dgv.Rows.Add(1);
-                    dgv.Rows[TotalRow].Cells[(int)DispColumn.DepartmentName].Value = s_TotalTitleArray[(int)RowTitleNum.AllTotal];
-                    // �s‚Ì�F‚ð•Ï‚¦‚é
-                    SetRowColor(dgv.Rows[TotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
-
-                    // �”’l•\Ž¦
-                    for (int i = (int)DispColumn.OrdersDecisionPrice; i <= TotalColCnt; i++)
-                    {
-                        dgv.Rows[TotalRow].Cells[i].Value = TotalArea[i].ToString("#,0");
-                    }
-                    dgv.Rows.Add();       // ‹ó�s
-                }
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value++;
-                prgber.Update();
-
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-            finally
-            {
-                // ƒf�[ƒ^‚ª‘½‚­‚È‚ê‚Îƒ\�[ƒg‚Å‚«‚é
-                if (CommonDefine.s_MaxInitLineCount < dgv.RowCount)
-                {
-                    foreach (DataGridViewColumn wrkCol in dgv.Columns)
-                        wrkCol.SortMode = DataGridViewColumnSortMode.Automatic;
-                }
-                else
-                {
-                    dgv.RowCount += (CommonDefine.s_MaxInitLineCount - m_initDataCount);
-                }
-
-                LedgerDB.close(); LedgerDB = null;
-                dgv.ResumeLayout();
-
-                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
-                prgber.Value = prgber.Maximum;
-                prgber.Update();
-                prgber.Visible = false;
-            }
-        }
-        #endregion
-
         #region �‰ŠúŽžƒf�[ƒ^Žæ“¾
         /// <summary>
         /// �‰ŠúŽžƒf�[ƒ^Žæ“¾
@@ -413,7 +458,7 @@
         /// <summary>
         /// Ž–‹ÆŠú�‰ŠúƒZƒbƒg
         /// </summary>
-        private void SetInitPeriod()
+        private void SetcmbPeriod()
         {
             try
             {
@@ -438,6 +483,87 @@
         }
         #endregion
 
+        #region •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX‚ðƒZƒbƒg‚·‚é
+        /// <summary>
+        /// •”��ƒRƒ“ƒ{ƒ{ƒbƒNƒX‚Ö•¶Žš‚ðƒZƒbƒg‚·‚é
+        /// </summary>
+        private bool SetcmbDepartment()
+        {
+            IOMDepartment depDB = new IOMDepartment();
+            try
+            {
+                m_initDataLoad = true;
+
+                cmbDepartment.DataSource = null;
+                cmbDepartment.Items.Clear();
+                cmbDepartment.Text = "";
+
+                string strSQL = string.Empty;
+                // •”��ƒ}ƒXƒ^‚ðŒŸ�õ‚·‚é
+                strSQL = "SELECT A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER, COUNT(*)";
+                strSQL += " FROM DEPARTMENTMASTER A, PERSONINCHARGEMASTER B, CONSTRUCTIONBASEINFO C , CONSTRUCTIONLEDGERDETAIL D";
+                strSQL += " WHERE A.DELETEFLG = 0";
+                strSQL += " AND A.DEPARTMENTCODE = B.DEPARTMENTCODE";
+                strSQL += " AND B.PERSONCODE = C.CONSTRUCTIONPERSONCODE";
+                strSQL += " AND D.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
+                strSQL += " GROUP BY A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER";
+                strSQL += " ORDER BY A.DISPLAYORDER ASC";
+
+                // •”��ƒ}ƒXƒ^“Ç�ž
+                ArrayList arList = new ArrayList();
+                if (!depDB.ExecuteReader(strSQL, ref arList)) return false;
+
+                List<KeyValuePair<int, string>> ConstructionDataList = new List<KeyValuePair<int, string>>();
+                ConstructionDataList.Add(new KeyValuePair<int, string>(0, ""));
+
+                foreach (object[] work in arList)
+                {
+                    KeyValuePair<int, string> keyval = new KeyValuePair<int, string>(CommonMotions.cnvInt(work[0])
+                                                                                    , CommonMotions.cnvString(work[1]));
+
+                    ConstructionDataList.Add(keyval);
+                }
+
+                // ƒRƒ“ƒ{ƒ{ƒbƒNƒX�‰Šú•\Ž¦
+                ComboBoxAction.InitDataSetCombBox(cmbDepartment, ConstructionDataList);
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
+            }
+            finally
+            {
+                depDB.close(); depDB = null;
+                m_initDataLoad = false;
+            }
+        }
+        #endregion
+
+        #region •”��ƒRƒ“ƒ{‚æ‚è’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
+        /// <summary>
+        /// •”��ƒRƒ“ƒ{‚æ‚è’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
+        /// </summary>
+        /// <returns></returns>
+        private int GetDepartmentCode()
+        {
+            try
+            {
+                // •\Ž¦‚³‚ê‚Ä‚¢‚È‚¢�ê�‡‚Í‘I‘ð–³
+                //if (!cmbDepartment.Visible) return 0;
+
+                return CommonMotions.cnvInt(cmbDepartment.SelectedValue);
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}", ex.Message);
+                return 0;
+            }
+        }
+        #endregion
+
         #region ‰æ–ÊƒTƒCƒY•Ï�XŽž‚ÌƒZƒ‹ƒTƒCƒY•Ï�X
         /// <summary>
         /// ‰æ–ÊƒTƒCƒY•Ï�XŽž‚ÌƒZƒ‹ƒTƒCƒY•Ï�X
@@ -579,7 +705,7 @@
         /// </summary>
         /// <param name="dtStart"></param>
         /// <param name="dtEnd"></param>
-        private void CreateDefaultStartAndEndDate(ref DateTime dtStart,ref DateTime dtEnd)
+        private void CreateDefaultStartAndEndDate(ref DateTime dtStart, ref DateTime dtEnd)
         {
             try
             {
@@ -596,289 +722,224 @@
                 CommonMotions.GetBeginningMonthDay(bPeriod, ref month, ref day);
                 dtStart = new DateTime(iYear, month, day);
                 dtEnd = dtStart.AddYears(1).AddDays(-1);     // �I—¹‚Í�{1”N�|1“ú
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-        }
-        #endregion
 
-        #region �HŽ–�î•ñ‚æ‚è‚ÌŠúŽñ“ú�EŠú––“ú‚ð‹�‚ß‚é
-        /// <summary>
-        /// �HŽ–�î•ñ‚æ‚è‚ÌŠúŽñ“ú�EŠú––“ú‚ð‹�‚ß‚é
-        /// </summary>
-        /// <param name="dtStart"></param>
-        /// <param name="dtEnd"></param>
-        private void CreateConstStartAndEndDate(ref DateTime dtStart, ref DateTime dtEnd, int PersonCode = 0)
-        {
-            IOConstructionBaseInfo BaseDB = new IOConstructionBaseInfo();
-            try
-            {
-                string strSQL = "SELECT MIN(B.CONSTRUCTIONPERIODSTART) ,MAX(B.CONSTRUCTIONPERIODEND)";
-                strSQL += " FROM CONSTRUCTIONLEDGER A, CONSTRUCTIONBASEINFO B";
-                strSQL += " WHERE A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
-                strSQL += string.Format(" AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
-                if (PersonCode != 0) strSQL += string.Format(" AND B.CONSTRSUBPERSONCODE = {0}", PersonCode);
-                strSQL += " AND TO_CHAR(B.CONSTRUCTIONPERIODSTART,'YYYY/MM/DD') != '0001/01/01'";
-                strSQL += " AND TO_CHAR(B.CONSTRUCTIONPERIODEND,'YYYY/MM/DD') != '0001/01/01'";
-                ArrayList arList = new ArrayList();
-                if (!BaseDB.ExecuteReader(strSQL, ref arList)) return;
+                // �¡Šú‚Ì�ê�‡‚Í�¡“ú‚Ì“ú•t‚Ü‚Å‚ðŒvŽZ‚·‚é
+                if (CommonMotions.cnvInt(numUDConstPro.Value) == CommonMotions.SystemMasterData.BusinessPeriod) dtEnd = DateTime.Today;
 
-                object[] objList = (object[])arList[0];
-
-                dtStart = CommonMotions.cnvDate(objList[0]);
-                dtEnd = CommonMotions.cnvDate(objList[2]);
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
             }
-            finally
-            {
-                BaseDB.close(); BaseDB = null;
-            }
         }
         #endregion
 
-        #region �HŽ–‚É‘®‚µ‚Ä‚¢‚È‚¢Œo”ï‚ð•\Ž¦‚·‚é
+        #region ŠúŠÔƒf�[ƒ^Žæ“¾�‡
         /// <summary>
-        /// �HŽ–‚É‘®‚µ‚Ä‚¢‚È‚¢Œo”ï‚ð•\Ž¦‚·‚é
+        /// ŠúŠÔƒf�[ƒ^Žæ“¾�‡
         /// </summary>
-        private int SetOtherCost()
+        private enum GetPersonTerm
         {
-            try
-            {
-                //// •”��ƒR�[ƒhŽæ“¾
-                //int DepartmentCode = GetDepartmentCode();
-                //// ’S“–ŽÒƒR�[ƒhŽæ“¾
-                //int PersonCode = GetConstructionPersonCode();
-
-                //// “–ŠúŠúŽñ“ú�EŠú––“ú‚ðŽæ“¾
-                //DateTime dtDefaultStart = DateTime.MinValue;
-                //DateTime dtDefaultEnd = DateTime.MinValue;
-                //CreateDefaultStartAndEndDate(ref dtDefaultStart, ref dtDefaultEnd);
-
-                //int ArrayCount = Common.CommonDefine.CostDataNoString.Length;
-                //int[] CostValue = new int[ArrayCount];
-                //// •\Ž¦ƒGƒŠƒAƒNƒŠƒA
-                //Array.Clear(CostValue, 0, CostValue.Length);
-
-                //// ’S“–ŽÒ‚ªƒZƒbƒg‚³‚ê‚Ä‚¢‚ê‚Î’S“–ŽÒ�AˆÈŠO‚Í‘Î�Û‘S‚Ä‚ð�WŒv‚·‚é
-                //if (PersonCode != 0)
-                //{
-                //    // ’S“–ŽÒ‚ª‘I‘ð‚³‚ê‚Ä‚¢‚ê‚Î‚»‚ÌŒo”ï‚ðŽæ“¾‚·‚é
-                //    GetPersonExpensesCostValue(PersonCode, dtDefaultStart, dtDefaultEnd, ref CostValue);
-                //}
-                //else
-                //{
-                //    // ’S“–‚ª‘I‘ð‚³‚ê‚Ä‚¢‚È‚¯‚ê‚Î�‡Œv‚ð�WŒv‚·‚é
-                //    List<int> PersonArrsy = new List<int>(); ;
-                //    if (GetPersonInDepartment(DepartmentCode, ref PersonArrsy) == 0) return 0;
-                //    int[] OneCost = new int[ArrayCount];
-                //    for (int ii = 0; ii < PersonArrsy.Count; ii++)
-                //    {
-                //        // �WŒvƒGƒŠƒAƒNƒŠƒA
-                //        Array.Clear(OneCost, 0, OneCost.Length);
-
-                //        // Œo”ïŽæ“¾
-                //        GetPersonExpensesCostValue(PersonArrsy[ii], dtDefaultStart, dtDefaultEnd, ref OneCost);
-                //        // �WŒv
-                //        for (int iii = 0; iii < CostValue.Length; iii++)
-                //        {
-                //            CostValue[iii] += OneCost[iii];
-                //        }
-                //    }
-                //}
-
-                //// ----- Œo”ï‚Ì�WŒv
-                //DataGridView dgv = dgvMaster;
-                //int SumData = 0;
-                //for (int i = 1; i < CommonDefine.CostDataNoString.Length; i++)
-                //{
-                //    // �s�ì�¬
-                //    int RowCnt = dgv.Rows.Add(1);
-                //    // Œo”ï–¼�Ì
-                //    dgv.Rows[RowCnt].Cells[(int)DispColumn.ConstructionName].Value = CommonDefine.CostDataNoString[i];
-                //    // ‹àŠzƒZƒbƒg
-                //    dgv.Rows[RowCnt].Cells[(int)DispColumn.OrdersDecisionPrice].Value = CostValue[i].ToString("#,0");
-                //    SumData += CostValue[i];
-                //}
-
-                //dgv.Rows.Add();       // ‹ó�s
-                //// ----- Œo”ï‚ÌŒv‚ð•\Ž¦‚·‚é
-                //// �s�ì�¬
-                //int ExpensesCnt = dgv.Rows.Add(1);
-                //// Œo”ï–¼�Ì
-                //dgv.Rows[ExpensesCnt].Cells[(int)DispColumn.ConstructionName].Value = s_TotalTitleArray[(int)RowTitleNum.Expenses];
-                //// ‹àŠzƒZƒbƒg
-                //dgv.Rows[ExpensesCnt].Cells[(int)DispColumn.OrdersDecisionPrice].Value = SumData.ToString("#,0");
-                //// �s‚Ì�F‚ð•Ï‚¦‚é
-                //SetRowColor(dgv.Rows[ExpensesCnt], s_RowTotalBackColor, s_RowTotalForeColor);
-
-                return 0;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return 0;
-            }
+            DepartmentCode = 0,
+            /// <summary>
+            /// ’S“–ŽÒƒR�[ƒh
+            /// </summary>
+            PersonCode,
+            /// <summary>
+            /// ’S“–ŽÒ–¼
+            /// </summary>
+            PersonName,
+            /// <summary>
+            /// •\Ž¦�‡
+            /// </summary>
+            Displayorder,
+            /// <summary>
+            /// ŒŽŠz‹‹—^
+            /// </summary>
+            MonthlySalary,
+            /// <summary>
+            /// ’S“–ŽÒŒ_–ñ�HŠúŠJŽn
+            /// </summary>
+            MainStart1,
+            /// <summary>
+            /// ’S“–ŽÒŒ_–ñ�HŠú‰„’·ŠJŽn
+            /// </summary>
+            MainStart2,
+            /// <summary>
+            /// •›’S“–ŽÒŒ_–ñ�HŠúŠJŽn
+            /// </summary>
+            AssistStart1,
+            /// <summary>
+            /// •›’S“–ŽÒŒ_–ñ�HŠú‰„’·ŠJŽn
+            /// </summary>
+            AssistStart2,
+            /// <summary>
+            /// Žw“±ˆõŒ_–ñ�HŠúŠJŽn
+            /// </summary>
+            InstStart1,
+            /// <summary>
+            /// Žw“±ˆõŒ_–ñ�HŠú‰„’·ŠJŽn
+            /// </summary>
+            InstStart2,
+            /// <summary>
+            /// ’S“–ŽÒŒ_–ñ�HŠú�I—¹
+            /// </summary>
+            MainEnd1,
+            /// <summary>
+            /// ’S“–ŽÒŒ_–ñ�HŠú‰„’·�I—¹
+            /// </summary>
+            MainEnd2,
+            /// <summary>
+            /// •›’S“–ŽÒŒ_–ñ�HŠú�I—¹
+            /// </summary>
+            AssistEnd1,
+            /// <summary>
+            /// •›’S“–ŽÒŒ_–ñ�HŠú‰„’·�I—¹
+            /// </summary>
+            AssistEnd2,
+            /// <summary>
+            /// Žw“±ˆõŒ_–ñ�HŠú�I—¹
+            /// </summary>
+            InstEnd1,
+            /// <summary>
+            /// Žw“±ˆõŒ_–ñ�HŠú‰„’·�I—¹
+            /// </summary>
+            InstEnd2,
+            /// <summary>
+            /// ’S“–ŽÒ‹àŠz�WŒv
+            /// </summary>
+            MainSumAmount,
+            /// <summary>
+            /// •›’S“–ŽÒ‹àŠz�WŒv
+            /// </summary>
+            AssistSumAmount,
+            /// <summary>
+            /// Žw“±ˆõ‹àŠz�WŒv
+            /// </summary>
+            InstSumAmount,
+            /// <summary>
+            /// ’S“–ŽÒƒf�[ƒ^Œ��”
+            /// </summary>
+            MainDataCount,
+            /// <summary>
+            /// •›’S“–ŽÒƒf�[ƒ^Œ��”
+            /// </summary>
+            AssistDataCmount,
+            /// <summary>
+            /// Žw“±ˆõƒf�[ƒ^Œ��”
+            /// </summary>
+            InstDataCmount,
         }
         #endregion
 
-        #region •›’S“–ŽÒ�^Žw“±ˆõ‚Ì‹‹—^‚ðŽæ“¾‚·‚é
+        #region •”��“à‚Ì’S“–ŽÒƒR�[ƒh‚ðˆê——‚Å•Ô‚·
         /// <summary>
-        /// •›’S“–ŽÒ�^Žw“±ˆõ‚Ì‹‹—^‚ðŽæ“¾‚·‚é
+        /// •”��“à‚Ì’S“–ŽÒƒR�[ƒh‚ðˆê——‚Å•Ô‚·
         /// </summary>
-        private int SetAuxiliaryCost()
+        /// <param name="DepartmentCode">•”��ƒR�[ƒh</param>
+        /// <param name="PersonCode">’S“–ŽÒƒR�[ƒhˆê——</param>
+        /// <returns>ƒf�[ƒ^Œ��”</returns>
+        private int GetPersonInDepartment(ref List<int> DepartmentList, ref List<int> PersonCode,
+                                            ref List<DateTime> dtStart, ref List<DateTime> dtComp,
+                                            ref List<int> MonthSalary)
         {
+            IOMPersonInCharge PersonDB = new IOMPersonInCharge();
             try
             {
-                //// •”��ƒR�[ƒhŽæ“¾
-                //int DepartmentCode = GetDepartmentCode();
-                //// ’S“–ŽÒƒR�[ƒhŽæ“¾
-                //int PersonCode = GetConstructionPersonCode();
+                int DepartmentCode = GetDepartmentCode();
+                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
 
-                //int[] CostValue = new int[2];
-                //// •\Ž¦ƒGƒŠƒAƒNƒŠƒA
-                //Array.Clear(CostValue, 0, CostValue.Length);
+                string strSQL = "SELECT P.DEPARTMENTCODE, P.PERSONCODE, P.PERSONNAME, P.DISPLAYORDER, P.MonthlySalary,";
+                strSQL += "  MIN(C.CONSTRUCTIONPERIODSTART) M1, MIN(C.CONSTRUCTIONPERIODSTART2) M2";
+                strSQL += " ,MIN(D.CONSTRUCTIONPERIODSTART) S1, MIN(D.CONSTRUCTIONPERIODSTART2) S2";
+                strSQL += " ,MIN(E.CONSTRUCTIONPERIODSTART) I1, MIN(E.CONSTRUCTIONPERIODSTART2) I2";
+                strSQL += " ,MAX(C.CONSTRUCTIONPERIODEND) M3, MAX(C.CONSTRUCTIONPERIODEND2) M4";
+                strSQL += " ,MAX(D.CONSTRUCTIONPERIODEND) S3, MAX(D.CONSTRUCTIONPERIODEND2) S4";
+                strSQL += " ,MAX(E.CONSTRUCTIONPERIODEND) I3, MAX(E.CONSTRUCTIONPERIODEND2) I4";
+                strSQL += " ,SUM(C2.EXECUTIONAMOUNT) M5, SUM(D2.EXECUTIONAMOUNT) S5, SUM(E2.EXECUTIONAMOUNT) I5";
+                strSQL += " ,COUNT(C2.EXECUTIONAMOUNT) M6, COUNT(D2.EXECUTIONAMOUNT) S6, COUNT(E2.EXECUTIONAMOUNT) I6";
+                strSQL += " FROM PERSONINCHARGEMASTER P";
+                
+                // �HŽ–’S“–ŽÒ‚Ìƒf�[ƒ^Žæ“¾
+                strSQL += " LEFT JOIN CONSTRUCTIONBASEINFO C ON C.CONSTRUCTIONPERSONCODE = P.PERSONCODE";
+                strSQL += string.Format(" AND C.CONSTRUCTIONSTATUSFLG <> {0}", NotOrder);
+                strSQL += string.Format(" AND C.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " LEFT JOIN CONSTRUCTIONLEDGERDETAIL C2 ON C2.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND C2.GROUPCOUNT = {0}",(int)FrmConstructionLedger.DataGroup.Payroll);
 
-                //DateTime dtStart = DateTime.MinValue;
-                //DateTime dtEnd = DateTime.MinValue;
-                //// ’S“–ŽÒ‚ªƒZƒbƒg‚³‚ê‚Ä‚¢‚ê‚Î’S“–ŽÒ�AˆÈŠO‚Í‘Î�Û‘S‚Ä‚ð�WŒv‚·‚é
-                //if (PersonCode != 0)
-                //{
-                //    // ’S“–ŽÒ‚ª‘I‘ð‚³‚ê‚Ä‚¢‚ê‚Î‚»‚ÌŒo”ï‚ðŽæ“¾‚·‚é
-                //    GetPersonAuxiliaryCostValue(PersonCode, ref CostValue);
-                //}
-                //else
-                //{
-                //    // ’S“–‚ª‘I‘ð‚³‚ê‚Ä‚¢‚È‚¯‚ê‚Î�‡Œv‚ð�WŒv‚·‚é
-                //    List<int> PersonArrsy = new List<int>(); ;
-                //    if (GetPersonInDepartment(DepartmentCode, ref PersonArrsy) == 0) return 0;
-                //    int[] OneCost = new int[2];
-                //    for (int i = 0; i < PersonArrsy.Count; i++)
-                //    {
-                //        // �WŒvƒGƒŠƒAƒNƒŠƒA
-                //        Array.Clear(OneCost, 0, OneCost.Length);
+                // �HŽ–•›’S“–ŽÒ‚Ìƒf�[ƒ^Žæ“¾
+                strSQL += " LEFT JOIN CONSTRUCTIONBASEINFO D ON D.CONSTRSUBPERSONCODE = P.PERSONCODE";
+                strSQL += string.Format(" AND D.CONSTRUCTIONSTATUSFLG <> {0}", NotOrder);
+                strSQL += string.Format(" AND D.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " LEFT JOIN CONSTRUCTIONLEDGERDETAIL D2 ON D2.CONSTRUCTIONCODE = D.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND D2.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Assistant);
 
-                //        // Œo”ïŽæ“¾
-                //        GetPersonAuxiliaryCostValue(PersonArrsy[i], ref OneCost);
-                //        // �WŒv
-                //        for (int ix = 0; ix < CostValue.Length; ix++)
-                //        {
-                //            CostValue[ix] += OneCost[ix];
-                //        }
-                //    }
-                //}
+                // �HŽ–Žw“±ˆõ‚Ìƒf�[ƒ^Žæ“¾
+                strSQL += " LEFT JOIN CONSTRUCTIONBASEINFO E ON E.CONSTRUCTIONINSTRUCTOR = P.PERSONCODE";
+                strSQL += string.Format(" AND E.CONSTRUCTIONSTATUSFLG <> {0}", NotOrder);
+                strSQL += string.Format(" AND E.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " LEFT JOIN CONSTRUCTIONLEDGERDETAIL E2 ON E2.CONSTRUCTIONCODE = E.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND E2.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Instructor);
 
-                //// ----- •â�•�U•ª‚Ì�WŒv
-                //DataGridView dgv = dgvMaster;
+                strSQL += " WHERE P.DELETEFLG = 0";
+                strSQL += string.Format(" AND P.LEDGERFLG = {0}", (int)CommonDefine.PersonLedgerDivNo.CalcTarget);
+                // �HŽ–‘ä’ ƒf�[ƒ^‚Ì•”��‚¾‚¯‚ª‘Î�Û
+                strSQL += " AND P.DEPARTMENTCODE IN";
+                strSQL += " (SELECT DEPARTMENTCODE FROM (SELECT A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER, COUNT(*) CNT";
+                strSQL += " FROM DEPARTMENTMASTER A, PERSONINCHARGEMASTER B, CONSTRUCTIONBASEINFO C , CONSTRUCTIONLEDGERDETAIL D";
+                strSQL += " WHERE A.DELETEFLG = 0";
+                strSQL += " AND A.DEPARTMENTCODE = B.DEPARTMENTCODE";
+                strSQL += " AND (B.PERSONCODE = C.CONSTRUCTIONPERSONCODE OR B.PERSONCODE = C.CONSTRUCTIONINSTRUCTOR OR B.PERSONCODE = C.CONSTRSUBPERSONCODE)";
+                strSQL += " AND D.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
+                strSQL += " GROUP BY A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER))";
 
-                //int SumData = 0;
-                //for (int i = 0; i < CostValue.Length; i++)
-                //{
-                //    // �s�ì�¬
-                //    int RowCnt = dgv.Rows.Add(1);
-                //    // Œo”ï–¼�Ì
-                //    dgv.Rows[RowCnt].Cells[(int)DispColumn.ConstructionName].Value = s_GroupTitle[i];
-                //    // ‹àŠzƒZƒbƒg
-                //    dgv.Rows[RowCnt].Cells[(int)DispColumn.OrdersDecisionPrice].Value = CostValue[i].ToString("#,0");
-                //    SumData += CostValue[i];
-                //}
+                // 16ŠúŒÀ’èƒŠƒtƒH�[ƒ€‚ÍŒ_–ñŽÐˆõ‚à’Ç‰Á‚·‚é
+                if (numUDConstPro.Value <= 16 && DepartmentCode != 9)
+                {
+                    strSQL += string.Format(" AND P.EMPLOYEECLASSFLG = {0}", (int)CommonDefine.EmployeeClassFlg.Regular);
+                }
+                if (DepartmentCode != 0)
+                    strSQL += string.Format(" AND P.DEPARTMENTCODE = {0}", DepartmentCode);
+                strSQL += " GROUP BY P.DEPARTMENTCODE, P.PERSONCODE, P.PERSONNAME, P.DISPLAYORDER, P.MonthlySalary";
+                strSQL += " ORDER BY P.DISPLAYORDER";
 
+                ArrayList arList = new ArrayList();
+                if (!PersonDB.ExecuteReader(strSQL, ref arList)) return 0;
 
-                //dgv.Rows.Add();       // ‹ó�s
-                //// ----- •â�•�U•ª‚ÌŒv‚ð•\Ž¦‚·‚é
-                //// �s�ì�¬
-                //int AuxiliaryCnt = dgv.Rows.Add(1);
-                //// Œo”ï–¼�Ì
-                //dgv.Rows[AuxiliaryCnt].Cells[(int)DispColumn.ConstructionName].Value = s_TotalTitleArray[(int)RowTitleNum.Auxiliary];
-                //// ‹àŠzƒZƒbƒg
-                //dgv.Rows[AuxiliaryCnt].Cells[(int)DispColumn.OrdersDecisionPrice].Value = SumData.ToString("#,0");
-                //// �s‚Ì�F‚ð•Ï‚¦‚é
-                //SetRowColor(dgv.Rows[AuxiliaryCnt], s_RowTotalBackColor, s_RowTotalForeColor);
+                // “–ŠúŠúŽñ“ú�EŠú––“ú‚ðŽæ“¾
+                DateTime dtDefaultStart = DateTime.MinValue;
+                DateTime dtDefaultEnd = DateTime.MinValue;
+                CreateDefaultStartAndEndDate(ref dtDefaultStart, ref dtDefaultEnd);
 
-                return 0;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return 0;
-            }
-        }
-        #endregion
+                DateTime stDate = dtDefaultStart;
+                DateTime edDate = dtDefaultEnd;
+                foreach (object[] objRec in arList)
+                {
+                    // •”��ƒR�[ƒh‚ðŽæ“¾‚·‚é
+                    int Department = CommonMotions.cnvInt(objRec[(int)GetPersonTerm.DepartmentCode]);
+                    // ’S“–ŽÒƒR�[ƒh‚ðŽæ“¾‚·‚é
+                    int Person = CommonMotions.cnvInt(objRec[(int)GetPersonTerm.PersonCode]);
 
-        #region ’S“–ŽÒ–ˆ‚ÌŽw’èŠú‚Ì�HŽ–ŠJŽn“ú‚ðŽæ“¾‚·‚é
-        /// <summary>
-        /// ’S“–ŽÒ–ˆ‚ÌŽw’èŠú‚Ì�HŽ–ŠJŽn“ú‚ðŽæ“¾‚·‚é
-        /// </summary>
-        /// <returns></returns>
-        private DateTime GetConstructionDate(int PersonCode, bool bStart = true)
-        {
-            IOConstructionBaseInfo BaseDB = new IOConstructionBaseInfo();
-            try
-            {
-                // ‹ó‚Ì�ê�‡‚Íƒ�ƒOƒCƒ“ƒ†�[ƒU�[
-                if (PersonCode == 0) PersonCode = CommonMotions.LoginUserData.PersonCode;
+                    DateTime wrkDate = DateTime.MinValue;
+                    // �Å�¬‚ÌŠJŽn“ú‚ðŽæ“¾‚·‚é
+                    stDate = dtDefaultStart;
+                    wrkDate = CommonMotions.cnvDate(objRec[(int)GetPersonTerm.MainStart1]).Date;
+                    if (wrkDate != DateTime.MinValue && wrkDate < stDate) stDate = wrkDate;
+                    wrkDate = CommonMotions.cnvDate(objRec[(int)GetPersonTerm.MainStart2]).Date;
+                    if (wrkDate != DateTime.MinValue && wrkDate < stDate) stDate = wrkDate;
 
-                // ŠJŽn“úŽæ“¾
-                string strSQL = string.Empty;
-                strSQL = "SELECT A.CONSTRUCTIONPERSONCODE, MIN(B.CONSTRUCTIONSTART) FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBUDGET B";
-                // �I—¹Žw’è‚Í�I—¹‚ÌMAX‚É•Ï�X
-                if (!bStart) strSQL = strSQL.Replace("MIN(B.CONSTRUCTIONSTART)", "MAX(B.CONSTRUCTIONEND)");
+                    // �Å‘å‚Ì�I—¹“ú‚ðŽæ“¾‚·‚é
+                    edDate = dtDefaultEnd;
+                    // ŒŽŠz‹‹—^‚ðŽæ“¾‚·‚é
+                    int Salary = CommonMotions.cnvInt(objRec[(int)GetPersonTerm.MonthlySalary]);
 
-                strSQL += string.Format(" WHERE A.CONSTRUCTIONPERSONCODE = {0}", PersonCode);
-                strSQL += string.Format("  AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
-                strSQL += " AND A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE GROUP BY A.CONSTRUCTIONPERSONCODE";
-                ArrayList ArrayList = new ArrayList();
-                if (!BaseDB.ExecuteReader(strSQL, ref ArrayList)) return DateTime.MinValue;
-                if (ArrayList.Count == 0) return DateTime.MinValue;
-
-                object[] objRec = (object[])ArrayList[0];
-
-                return CommonMotions.cnvDate(objRec[1]);
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return DateTime.MinValue;
-            }
-            finally
-            {
-                BaseDB.close(); BaseDB = null;
-            }
-        }
-        #endregion
-
-        #region •”��“à‚Ì’S“–ŽÒƒR�[ƒh‚ðˆê——‚Å•Ô‚·
-        /// <summary>
-        /// •”��“à‚Ì’S“–ŽÒƒR�[ƒh‚ðˆê——‚Å•Ô‚·
-        /// </summary>
-        /// <param name="DepartmentCode">•”��ƒR�[ƒh</param>
-        /// <param name="PersonCode">’S“–ŽÒƒR�[ƒhˆê——</param>
-        /// <returns>ƒf�[ƒ^Œ��”</returns>
-        private int GetPersonInDepartment(int DepartmentCode,ref List<int> PersonCode)
-        {
-            IOMPersonInCharge PersonDB = new IOMPersonInCharge();
-            try
-            {
-                string strSQL = string.Format(" WHERE (PERSONCODE IN (SELECT SALESPERSONCODE FROM CONSTRUCTIONBASEINFO WHERE CONSTRUCTIONPERIOD = {0})", numUDConstPro.Value);
-                strSQL += string.Format(" OR PERSONCODE IN (SELECT CONSTRUCTIONPERSONCODE FROM CONSTRUCTIONBASEINFO WHERE CONSTRUCTIONPERIOD = {0})", numUDConstPro.Value);
-                strSQL += string.Format(" OR PERSONCODE IN (SELECT CONSTRSUBPERSONCODE FROM CONSTRUCTIONBASEINFO WHERE CONSTRUCTIONPERIOD = {0})", numUDConstPro.Value);
-                strSQL += string.Format(" OR PERSONCODE IN (SELECT CONSTRUCTIONINSTRUCTOR FROM CONSTRUCTIONBASEINFO WHERE CONSTRUCTIONPERIOD = {0}))", numUDConstPro.Value);
-                strSQL += " AND EMPLOYEECLASSFLG = 1";
-                if (DepartmentCode != 0)
-                    strSQL += string.Format(" AND DEPARTMENTCODE = {0}", DepartmentCode);
-                strSQL += " ORDER BY DISPLAYORDER ";
-                List<PersonInChargeMaster> PersonList = new List<PersonInChargeMaster>();
-                if (!PersonDB.SelectAction(strSQL, ref PersonList)) return 0;
-
-                foreach (PersonInChargeMaster wrkRec in PersonList)
-                {
-                    PersonCode.Add(wrkRec.PersonCode);
+                    DepartmentList.Add(Department);     // •”��ƒR�[ƒh
+                    PersonCode.Add(Person);             // ’S“–ŽÒƒR�[ƒh
+                    dtStart.Add(stDate);                // ŠJŽn“ú
+                    dtComp.Add(edDate);                 // �I—¹“ú
+                    MonthSalary.Add(Salary);            // ‹‹—^‹àŠz
                 }
-                return PersonCode.Count;
+                return arList.Count;
             }
             catch (Exception ex)
             {
@@ -923,7 +984,7 @@
                     {
                         if (CommonMotions.cnvInt(wrkobj[1]) == i)
                         {
-                            CostValue[i] = CommonMotions.cnvInt(wrkobj[2]);
+                            CostValue[i] += CommonMotions.cnvInt(wrkobj[2]);
                             break;
                         }
                     }
@@ -940,27 +1001,50 @@
         }
         #endregion
 
-        #region ’S“–ŽÒ–ˆ‚Ì•â�•�U•ª‚ðŽæ“¾‚·‚é
+        #region •”��–ˆ‚Ì•â�•�U•ª‚ðŽæ“¾‚·‚é
         /// <summary>
-        /// ’S“–ŽÒ–ˆ‚Ì•â�•�U•ª‚ðŽæ“¾‚·‚é
+        /// •”��–ˆ‚Ì•â�•�U•ª‚ðŽæ“¾‚·‚é
         /// </summary>
-        /// <param name="PersonCode"></param>
+        /// <param name="PersonCDArray"></param>
         /// <param name="CostValue"></param>
-        private void GetPersonAuxiliaryCostValue(int PersonCode, ref int[] CostValue)
+        private void GetPersonAuxiliaryCostValue(int DepartmentCode, int PersonCode, ref int[] CostValue)
         {
             IOConstructionLedgerDetail DetailDB = new IOConstructionLedgerDetail();
             try
             {
+                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
+
                 // �HŽ–�Ú�×‘ä’ ƒf�[ƒ^‚æ‚è•â�•�U•ª‚ðŽæ“¾‚·‚é
-                string strSQL = "SELECT A.COMPANYCODE, A.GROUPCOUNT, SUM(A.EXECUTIONAMOUNT)";
-                strSQL += " FROM CONSTRUCTIONLEDGERDETAIL A, CONSTRUCTIONBASEINFO B";
-                strSQL += string.Format(" WHERE (A.GROUPCOUNT = {0} OR A.GROUPCOUNT = {1})"
-                                        , (int)FrmConstructionLedger.DataGroup.Assistant, (int)FrmConstructionLedger.DataGroup.Instructor);
-                strSQL += string.Format(" AND A.COMPANYCODE = {0}", PersonCode);
-                strSQL += " AND A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
-                strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
-                strSQL += " GROUP BY A.COMPANYCODE, A.GROUPCOUNT";
-                strSQL += " ORDER BY A.COMPANYCODE, A.GROUPCOUNT";
+                string strSQL = "SELECT A.CONSTRUCTIONPERIOD, P.GROUPCOUNT, SUM(P.EXECUTIONAMOUNT)";
+                strSQL += " FROM CONSTRUCTIONLEDGERDETAIL P, CONSTRUCTIONBASEINFO A";
+                strSQL += string.Format(" WHERE P.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Instructor);
+                
+                strSQL += " AND P.COMPANYCODE IN (SELECT PERSONCODE FROM PERSONINCHARGEMASTER WHERE DELETEFLG = 0";
+                if (DepartmentCode != 0) strSQL += string.Format(" AND DEPARTMENTCODE = {0}", DepartmentCode);
+                if (PersonCode != 0) strSQL += string.Format(" AND PERSONCODE = {0}", PersonCode);
+
+                strSQL += " )";
+                
+                strSQL += " AND P.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND A.CONSTRUCTIONSTATUSFLG <> {0}", NotOrder);
+                strSQL += string.Format(" AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " GROUP BY A.CONSTRUCTIONPERIOD, P.GROUPCOUNT";
+
+                strSQL += " UNION";
+                strSQL += " SELECT A.CONSTRUCTIONPERIOD, P.GROUPCOUNT, SUM(P.EXECUTIONAMOUNT)";
+                strSQL += " FROM CONSTRUCTIONLEDGERDETAIL P, CONSTRUCTIONBASEINFO A";
+                strSQL += string.Format(" WHERE P.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Assistant);
+
+                strSQL += " AND P.COMPANYCODE IN (SELECT PERSONCODE FROM PERSONINCHARGEMASTER WHERE DELETEFLG = 0";
+                if (DepartmentCode != 0) strSQL += string.Format(" AND DEPARTMENTCODE = {0}", DepartmentCode);
+                if (PersonCode != 0) strSQL += string.Format(" AND PERSONCODE = {0}", PersonCode);
+
+                strSQL += " )";
+                strSQL += " AND P.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND A.CONSTRUCTIONSTATUSFLG <> {0}", NotOrder);
+                strSQL += string.Format(" AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += " GROUP BY A.CONSTRUCTIONPERIOD, P.GROUPCOUNT";
+
                 ArrayList arList = new ArrayList();
                 if (!DetailDB.ExecuteReader(strSQL, ref arList)) return;
 
@@ -988,191 +1072,522 @@
         }
         #endregion
 
-        #region ‹‹—^ƒf�[ƒ^•\Ž¦”»’è
+        #region �HŽ–�Ú�×‘ä’ ‚æ‚è�U•ª‹‹—^‹àŠz�E‘e—˜‰v‚ðŽæ“¾‚·‚é
         /// <summary>
-        /// ‹‹—^ƒf�[ƒ^•\Ž¦”»’è
+        /// �HŽ–�Ú�×‘ä’ ‚æ‚è�U•ª‹‹—^‹àŠz�E‘e—˜‰v‚ðŽæ“¾‚·‚é
         /// </summary>
-        /// <returns></returns>
-        private bool SalaryDisplay()
+        /// <param name="OnSalary">�U•ª‹‹—^‹àŠz</param>
+        /// <param name="NetIncome">�ƒ—˜‰v‹àŠz</param>
+        /// <param name="NonSalary">‘e—˜‰v‹àŠz</param>
+        private void ProfitGeneral(int DepartmentCode, int PersonCode, ref int OnSalary, ref int NetIncome, ref int NonSalary)
         {
-            IOMPersonInCharge personDB = new IOMPersonInCharge();
+            IOConstructionLedger LedgerlDB = new IOConstructionLedger();
             try
             {
-                //bool bRet = false;
+                // •”��ƒR�[ƒhŽæ“¾
+                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
 
-                //// ‚Ü‚¸ƒf�[ƒ^”ñ•\Ž¦
-                //pnlPayroll.Visible = false;
+                // �U•ª‹‹—^‹àŠzŽæ“¾
+                //string strSQL = "SELECT SUM(E.PAYMENTAMOUNT) FROM CONSTRUCTIONLEDGER P, CONSTRUCTIONBASEINFO B, CONSTRUCTIONLEDGERDETAIL C, PERSONINCHARGEMASTER D, CONSTRUCTIONLEDGEREXCUTE E";
+                string strSQL = "SELECT SUM(C.EXECUTIONAMOUNT) FROM CONSTRUCTIONLEDGER P, CONSTRUCTIONBASEINFO B, CONSTRUCTIONLEDGERDETAIL C, PERSONINCHARGEMASTER D";
+                // �U•ª–³‚Å‚Í–³‚¢
+                strSQL += " WHERE P.CONSTRUCTIONCODE IN (SELECT A.CONSTRUCTIONCODE FROM CONSTRUCTIONLEDGERDETAIL A";
+                strSQL += string.Format(" WHERE A.GROUPCOUNT = {0} AND A.OPERATINGFLG = {1} AND (A.SALARYFLG = {2} OR A.SALARYFLG = {3}))"
+                                        , (int)FrmConstructionLedger.DataGroup.Payroll
+                                        , (int)CommonDefine.SalaryOperateKind.Oparateing
+                                        , (int)CommonDefine.SalaryDevision.All
+                                        , (int)CommonDefine.SalaryDevision.DaysInput);
 
-                //// ƒRƒ“ƒ{ƒ{ƒbƒNƒX‚æ‚è‘I‘ð’S“–ŽÒ‚ðŽæ“¾‚·‚é
-                //int PersonCode = GetConstructionPersonCode();
-                //if (!cmbConstructionPerson.Visible) PersonCode = CommonMotions.LoginUserData.PersonCode;
+                strSQL += " AND P.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
+                strSQL += " AND C.CONSTRUCTIONCODE = P.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND C.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.Payroll);
+                strSQL += string.Format(" AND C.OPERATINGFLG = {0}", (int)CommonDefine.SalaryOperateKind.Oparateing);
+                //strSQL += " AND E.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
+                //strSQL += " AND E.GROUPCOUNT = C.GROUPCOUNT";
+                //strSQL += " AND E.LINECOUNT = C.LINECOUNT";
+                strSQL += " AND D.PERSONCODE = B.CONSTRUCTIONPERSONCODE";
+                if (DepartmentCode != 0) strSQL += string.Format(" AND D.DEPARTMENTCODE = {0}", DepartmentCode);
+                if (PersonCode != 0) strSQL += string.Format(" AND D.PERSONCODE = {0}", PersonCode);
 
-                //// ƒZƒLƒ…ƒŠƒeƒBƒŒƒxƒ‹Žæ“¾
-                //int SecLevel1 = CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.PresidentAuthority].Key;
-                //int SecLevel2 = CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SupervisorAuthority].Key;
-                //int SecLevel3 = CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.SuperiorAuthority].Key;
-                //// ƒVƒXƒeƒ€Œ ŒÀ‚É‚æ‚Á‚Äƒf�[ƒ^ƒAƒNƒZƒX‚É�§ŒÀ‚ª‚ ‚é
-                //if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.AdminSecurityManagement)
-                //{
-                //    // ƒVƒXƒeƒ€ŠÇ—�ŽÒ�i‚·‚×‚Ä‘Î�Û�j
-                //    bRet = true;
-                //}
-                //else if (CommonMotions.LoginUserData.SecurityManagement == SecLevel1)
-                //{
-                //    // �Å�‚‹@–§ŠÇ—�ŽÒ�i‚·‚×‚Ä‘Î�Û�j
-                //    bRet = true;
-                //}
-                //else if (CommonMotions.LoginUserData.SecurityManagement == SecLevel2)
-                //{
-                //    // “�Š‡‹@–§ŠÇ—�ŽÒ�i‹@”\�§ŒÀ�j
-                //    bRet = true;
-                //}
-                //else if (CommonMotions.LoginUserData.SecurityManagement == SecLevel3)
-                //{
-                //    // �Š‘®’·
-                //    bRet = true;
-                //}
-                //else
-                //{
-                //    // ˆê”Êƒ†�[ƒU�[‚ÍŽ©•ª‚Ì‹‹—^‚ªŒ©‚¦‚é
-                //    if (CommonMotions.LoginUserData.PersonCode == PersonCode)
-                //        bRet = true;
-                //    else
-                //        bRet = false;
-                //}
-                //// ƒf�[ƒ^•\Ž¦
-                //pnlPayroll.Visible = bRet;
+                ArrayList arList = new ArrayList();
+                if (!LedgerlDB.ExecuteReader(strSQL, ref arList)) return;
+                object[] objSalary = (object[])arList[0];
+                OnSalary = CommonMotions.cnvInt(objSalary[0]);
 
-                //// —ÌˆæƒNƒŠƒA
-                //ClearSalary();
+                // �U•ª�Ï‚Ý•ª�ƒ—˜‰vŽæ“¾
+                strSQL = "SELECT SUM(P.NETPROFIT) FROM CONSTRUCTIONLEDGER P, CONSTRUCTIONBASEINFO B, PERSONINCHARGEMASTER D";
+                // �U•ª�Ï‚Ý•ª�ƒ—˜‰v
+                strSQL += " WHERE P.CONSTRUCTIONCODE IN (SELECT A.CONSTRUCTIONCODE  FROM CONSTRUCTIONLEDGERDETAIL A";
+                strSQL += string.Format(" WHERE A.GROUPCOUNT = {0} AND A.OPERATINGFLG = {1} AND (A.SALARYFLG = {2} OR A.SALARYFLG = {3}))"
+                                        , (int)FrmConstructionLedger.DataGroup.Payroll
+                                        , (int)CommonDefine.SalaryOperateKind.Oparateing
+                                        , (int)CommonDefine.SalaryDevision.All
+                                        , (int)CommonDefine.SalaryDevision.DaysInput);
+                
+                strSQL += " AND P.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
+                strSQL += " AND D.PERSONCODE = B.CONSTRUCTIONPERSONCODE";
+                if (DepartmentCode != 0) strSQL += string.Format(" AND D.DEPARTMENTCODE = {0}", DepartmentCode);
 
-                return true;
+                ArrayList arList2 = new ArrayList();
+                if (!LedgerlDB.ExecuteReader(strSQL, ref arList2)) return;
+                object[] objNetIncome = (object[])arList2[0];
+                NetIncome = CommonMotions.cnvInt(objNetIncome[0]);
+
+                // �U•ª–³‚µ•ª�ƒ—˜‰vŽæ“¾
+                strSQL = "SELECT SUM(P.NETPROFIT) FROM CONSTRUCTIONLEDGER P, CONSTRUCTIONBASEINFO B, PERSONINCHARGEMASTER D";
+                // �U•ª�Ï‚Ý•ª�ƒ—˜‰v
+                strSQL += " WHERE P.CONSTRUCTIONCODE NOT IN (SELECT A.CONSTRUCTIONCODE  FROM CONSTRUCTIONLEDGERDETAIL A";
+                strSQL += string.Format(" WHERE A.GROUPCOUNT = {0} AND A.OPERATINGFLG = {1} AND (A.SALARYFLG = {2} OR A.SALARYFLG = {3}))"
+                                        , (int)FrmConstructionLedger.DataGroup.Payroll
+                                        , (int)CommonDefine.SalaryOperateKind.Oparateing
+                                        , (int)CommonDefine.SalaryDevision.All
+                                        , (int)CommonDefine.SalaryDevision.DaysInput);
+
+                strSQL += " AND P.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
+                strSQL += " AND D.PERSONCODE = B.CONSTRUCTIONPERSONCODE";
+                if (DepartmentCode != 0) strSQL += string.Format(" AND D.DEPARTMENTCODE = {0}", DepartmentCode);
+
+                ArrayList arList3 = new ArrayList();
+                if (!LedgerlDB.ExecuteReader(strSQL, ref arList3)) return;
+                object[] objNonSalary = (object[])arList3[0];
+                NonSalary = CommonMotions.cnvInt(objNonSalary[0]);
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
             }
             finally
             {
-                personDB.close(); personDB = null;
+                LedgerlDB.close(); LedgerlDB = null;
             }
         }
-        #endregion
+        #endregion 
 
-        #region Œo‰ß‹‹—^‚ðŒvŽZ‚·‚é
+        #region ˆê——ƒf�[ƒ^•\Ž¦�ˆ—�
         /// <summary>
-        /// Œo‰ß‹‹—^‚ðŒvŽZ‚·‚é
+        /// ˆê——ƒf�[ƒ^•\Ž¦�ˆ—�
         /// </summary>
-        /// <param name="dtStart"></param>
-        /// <param name="PersonCode"></param>
-        /// <returns></returns>
-        private int CalcElapsedSalary(DateTime dtStart, int PersonCode)
+        private void DataDisplay()
         {
+            IOConstructionLedger LedgerDB = new IOConstructionLedger();
+            DataGridView dgv = dgvMaster;
+            ProgressBar prgber = ProgressBar;
             try
             {
-                // ‰Ò“­“ú�”‚ðŽæ“¾‚·‚é
-                int WorkingDay = ClsCalendar.CalcOperatingDaysCount(dtStart, DateTime.Now);
+                dgv.SuspendLayout();
+                dgv.Rows.Clear();
 
-                // Œo‰ßŒŽ�”Žæ“¾
-                double dmounth = CommonMotions.DiffMounthTimes(dtStart, DateTime.Now);
+                // ƒvƒ�ƒOƒŒƒXƒo�[‚Ì�‰Šú‰»
+                prgber.Visible = true;
+                prgber.Minimum = 0;
+                prgber.Maximum = 10;
+                prgber.Value = 0;
 
-                // ‹‹—^—Ý�ÏŽæ“¾
-                int MonthlyPay = GetPersonMonthlySalary(PersonCode);
-                double DayPay = CommonMotions.cnvRound((double)MonthlyPay / CommonDefine.s_ManHourUnitMonth);
+
+                // ----- ’S“–ŽÒ–ˆ‚ÌŽw’èŠú‚ÌŠJŽn�E�I—¹”NŒŽ“ú‚ðŽæ“¾‚·‚é
+                List<int> DepInPerArray = new List<int>();
+                List<int> PersonCDArray = new List<int>();
+                List<DateTime> dtStartArray = new List<DateTime>();
+                List<DateTime> dtCompArray = new List<DateTime>();
+                List<int> SalaryArray = new List<int>();
+                GetPersonInDepartment(ref DepInPerArray, ref PersonCDArray, ref dtStartArray, ref dtCompArray, ref SalaryArray);
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
                 
-                return CommonMotions.cnvRound(WorkingDay * DayPay);
+                // ƒfƒtƒHƒ‹ƒgŠJŽn�E�I—¹‚ðŽæ“¾‚·‚é
+                DateTime dtDefaultStart = DateTime.MinValue;
+                DateTime dtDefaultEnd = DateTime.MinValue;
+                CreateDefaultStartAndEndDate(ref dtDefaultStart, ref dtDefaultEnd);
+
+
+                // ----- Œo‰ß‹‹—^•\Ž¦�iƒwƒbƒ_�[‚É•\Ž¦�j
+                SetPayrollData(PersonCDArray, dtStartArray, dtCompArray, SalaryArray);
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // •\Ž¦ƒ^ƒCƒv‚ÌŽæ“¾
+                int DispType = 0;
+                if (CommonMotions.cnvInt(cmbDepartment.SelectedValue) == 0) DispType = (int)DispDataTypeCode.AllTotal;
+                else DispType = (int)DispDataTypeCode.Department;
+                
+                // SQL�ì�¬
+                string strSQL = string.Empty;
+                switch (DispType)
+                {
+                    case (int)DispDataTypeCode.AllTotal:
+                        CreateInitSQLType1(ref strSQL);
+                        break;
+                 
+                    case (int)DispDataTypeCode.Department:
+                        CreateInitSQLType2(ref strSQL);
+                        break;
+                }
+
+                ArrayList arData = new ArrayList();
+                // ----- �HŽ–�Ú�×‘ä’ Žæ“¾
+                if (!LedgerDB.ExecuteReader(strSQL, ref arData)) return;
+
+                // “Ç�žŽžƒf�[ƒ^ƒJƒEƒ“ƒgŽæ“¾
+                m_initDataCount = arData.Count;
+                if (arData.Count == 0) return;
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // �‡ŒvƒGƒŠƒA
+                int TotalColCnt = Enum.GetNames(typeof(DispColumn)).Length;
+                int[] TotalArea = new int[TotalColCnt];
+                Array.Clear(TotalArea, 0, TotalArea.Length);
+
+                // ƒf�[ƒ^•\Ž¦
+                int ino = 1;
+                int StatusFlg = -1;
+                bool initFlg = true;
+                string strStatus = string.Empty;
+               // ----- Ž{�H’†ƒf�[ƒ^•\Ž¦
+                foreach (object[] objwrk in arData)
+                {
+                    // ƒOƒŠƒbƒh‚Öƒf�[ƒ^•\Ž¦
+                    GridDataSet(objwrk, ref ino, ref TotalArea, ref initFlg, ref StatusFlg,
+                                DepInPerArray, PersonCDArray, dtStartArray, dtCompArray, SalaryArray,
+                                dtDefaultStart, dtDefaultEnd);
+                }
+
+                dgv.Columns[(int)DispColumn.SelectionName].HeaderText = GridColumnHeader[DispType];
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                int depcode = GetDepartmentCode();
+                // ----- �‡Œv•\Ž¦
+                if (arData.Count != 0 && depcode != 0)
+                {
+                    //dgv.Rows.Add();       // ‹ó�s
+
+                    // �‡Œv�s•\Ž¦
+                    int TotalRow = dgv.Rows.Add(1);
+                    dgv.Rows[TotalRow].Cells[(int)DispColumn.SelectionName].Value = s_TotalTitleArray[(int)RowTitleNum.Execution];
+                    // �s‚Ì�F‚ð•Ï‚¦‚é
+                    SetRowColor(dgv.Rows[TotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
+
+                    // �”’l•\Ž¦
+                    for (int i = (int)DispColumn.OrdersDecisionPrice; i <= (int)DispColumn.NetProfit; i++)
+                    {
+                        dgv.Rows[TotalRow].Cells[i].Value = TotalArea[i].ToString("#,0");
+                    }
+                }
+
+                dgv.Rows.Add();       // ‹ó�s
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value++;
+                prgber.Update();
+
+                // ----- ‘��‡Œv�s•\Ž¦
+                dgv.Rows.Add();       // ‹ó�s
+                int AllTotalRow = dgv.Rows.Add(1);
+                dgv.Rows[AllTotalRow].Cells[(int)DispColumn.SelectionName].Value = s_TotalTitleArray[(int)RowTitleNum.AllTotal];
+
+                // �s‚Ì�F‚ð•Ï‚¦‚é
+                SetRowColor(dgv.Rows[AllTotalRow], s_RowTotalBackColor, s_RowTotalForeColor);
+
+                // �”’l•\Ž¦
+                for (int i = (int)DispColumn.OrdersDecisionPrice; i <= (int)DispColumn.NetProfit; i++)
+                {
+                    dgv.Rows[AllTotalRow].Cells[i].Value = TotalArea[i].ToString("#,0");
+                }
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value = prgber.Maximum;
+                prgber.Update();
+
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return 0;
             }
+            finally
+            {
+                // ƒf�[ƒ^‚ª‘½‚­‚È‚ê‚Îƒ\�[ƒg‚Å‚«‚é
+                if (CommonDefine.s_MaxInitLineCount < dgv.RowCount)
+                {
+                    foreach (DataGridViewColumn wrkCol in dgv.Columns)
+                        wrkCol.SortMode = DataGridViewColumnSortMode.Automatic;
+                }
+                else
+                {
+                    dgv.RowCount += (CommonDefine.s_MaxInitLineCount - m_initDataCount);
+                }
+
+                LedgerDB.close(); LedgerDB = null;
+                dgv.ResumeLayout();
+
+                // ProgressBar‚Ì’l‚ð•Ï�X‚·‚é
+                prgber.Value = prgber.Maximum;
+                prgber.Update();
+                prgber.Visible = false;
+            }
         }
         #endregion
 
-        #region ’S“–ŽÒƒ}ƒXƒ^‚æ‚èŒŽŠz‹‹—^Žæ“¾
+        #region ‚c‚aŽæ“¾�‡”Ô
         /// <summary>
-        /// ’S“–ŽÒƒ}ƒXƒ^‚æ‚èŒŽŠz‹‹—^Žæ“¾
+        /// ‚c‚aŽæ“¾�‡”Ô
         /// </summary>
-        /// <param name="PersonCode"></param>
-        /// <returns></returns>
-        private int GetPersonMonthlySalary(int PersonCode)
+        private enum DBGetData
         {
-            IOMPersonInCharge PersonDB = new IOMPersonInCharge();
+            DepartmentCode = 0,
+            DepartmentString,
+            DisplayOrder,
+            OrdersDecisionprice,
+            CompanyExpenses,
+            DepartmentExpenses,
+            SalesExpenses,
+            TotalPayment,
+            GrossProfit,
+            NetProfit,
+        }
+        #endregion
+
+        #region ƒf�[ƒ^Žæ“¾SQL�ì�¬Type1
+        /// <summary>
+        /// •\Ž¦—pƒf�[ƒ^Žæ“¾SQL�ì�¬Type1
+        /// </summary>
+        private void CreateInitSQLType1(ref string strSQL)
+        {
             try
             {
-                if (PersonCode == 0) PersonCode = CommonMotions.LoginUserData.PersonCode;
-                string strSQL = PersonDB.CreatePrimarykeyString(PersonCode);
-                PersonInChargeMaster PersonRec = new PersonInChargeMaster();
-                PersonDB.SelectAction(strSQL, ref PersonRec);
-                
-                return CommonMotions.cnvRound(PersonRec.MonthlySalary);
+                // SQL‚ÉƒAƒNƒZƒX�§ŒÀ‚ð‚©‚¯‚é
+                List<string> strSecurity = new List<string>();
+                CreateSecuritySQL(ref strSecurity);
+
+                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
+                // ----- ‚r‚p‚k�ì�¬
+                // ‘¶�Ý�Ú�×‘ä’ ƒf�[ƒ^ŒŸ�õ
+                strSQL = "SELECT";
+
+                strSQL += " C.DEPARTMENTCODE";
+                strSQL += " ,D.DEPARTMENTSTRING";
+                strSQL += " ,D.DISPLAYORDER";
+                strSQL += " ,SUM(A.ORDERSDECISIONPRICE)";
+                strSQL += " ,SUM(A.COMPANYEXPENSES)";
+                strSQL += " ,SUM(A.DEPARTMENTEXPENSES)";
+                strSQL += " ,SUM(A.SALESEXPENSES)";
+                strSQL += " ,SUM(A.TOTALPAYMENT)";
+                strSQL += " ,SUM(A.GROSSPROFIT)";
+                strSQL += " ,SUM(A.NETPROFIT)";
+                strSQL += " FROM CONSTRUCTIONLEDGER A, CONSTRUCTIONBASEINFO B, PERSONINCHARGEMASTER C, DEPARTMENTMASTER D";
+                strSQL += " WHERE A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
+                strSQL += string.Format(" AND B.TyingFlg != {0}", (int)CommonDefine.BaseInfoTyingFlg.Tying);
+                strSQL += " AND B.CONSTRUCTIONPERSONCODE = C.PERSONCODE";
+                strSQL += " AND C.DEPARTMENTCODE = D.DEPARTMENTCODE";
+                strSQL += " GROUP BY  C.DEPARTMENTCODE, D.DEPARTMENTSTRING, D.DISPLAYORDER";
+                strSQL += " ORDER BY 3 ASC";
             }
             catch (Exception ex)
             {
-                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return 0;
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", ex.Message, strSQL);
             }
-            finally
+        }
+        #endregion
+
+        #region ƒf�[ƒ^Žæ“¾SQL�ì�¬Type2
+        /// <summary>
+        /// ƒf�[ƒ^Žæ“¾SQL�ì�¬Type2(•”��‚²‚Æ‚Ìˆê——ƒf�[ƒ^)
+        /// </summary>
+        private void CreateInitSQLType2(ref string strSQL)
+        {
+            try
             {
-                PersonDB.close(); PersonDB = null;
+                // SQL‚ÉƒAƒNƒZƒX�§ŒÀ‚ð‚©‚¯‚é
+                List<string> strSecurity = new List<string>();
+                CreateSecuritySQL(ref strSecurity);
+
+                int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("”ñ Žó ’�")).Key;
+                int DepCode = CommonMotions.cnvInt(cmbDepartment.SelectedValue);
+                // ----- ‚r‚p‚k�ì�¬
+                // ‘¶�Ý�Ú�×‘ä’ ƒf�[ƒ^ŒŸ�õ
+                strSQL = "SELECT";
+                
+                strSQL += " Person.PERSONCODE";
+                strSQL += ", Person.PERSONNAME";
+                strSQL += ", Person.DISPLAYORDER";
+                strSQL += ", SUM(Data.ORDERSDECISIONPRICE)";
+                strSQL += ", SUM(Data.COMPANYEXPENSES)";
+                strSQL += ", SUM(Data.DEPARTMENTEXPENSES)";
+                strSQL += ", SUM(Data.SALESEXPENSES)";
+                strSQL += ", SUM(Data.TOTALPAYMENT)";
+                strSQL += ", SUM(Data.GROSSPROFIT)";
+                strSQL += ", SUM(Data.NETPROFIT)";
+                strSQL += ", Person.EMPLOYEECLASSFLG";
+
+                strSQL += " FROM DEPARTMENTMASTER Main, PERSONINCHARGEMASTER Person";
+                
+                strSQL += " LEFT JOIN CONSTRUCTIONBASEINFO Base";
+                strSQL += " ON (Base.CONSTRUCTIONPERSONCODE = Person.PERSONCODE)";
+                //strSQL += " OR Base.CONSTRSUBPERSONCODE = Person.PERSONCODE";
+                //strSQL += " OR Base.CONSTRUCTIONINSTRUCTOR = Person.PERSONCODE)";
+                
+                strSQL += " LEFT JOIN CONSTRUCTIONLEDGER Data";
+                strSQL += " ON Data.CONSTRUCTIONCODE = Base.CONSTRUCTIONCODE";
+                strSQL += string.Format(" AND Base.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
+                strSQL += string.Format(" AND Base.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
+                strSQL += string.Format(" AND Base.TyingFlg != {0}", (int)CommonDefine.BaseInfoTyingFlg.Tying);
+
+                strSQL += " WHERE Main.DELETEFLG = 0";
+                strSQL += string.Format(" AND Main.DEPARTMENTCODE = {0}", DepCode);
+                strSQL += " AND Person.DEPARTMENTCODE = Main.DEPARTMENTCODE";
+                //strSQL += " AND Person.PERSONCODE = Base.CONSTRUCTIONPERSONCODE";
+                strSQL += " AND Person.DELETEFLG = 0";
+                // 16ŠúŒÀ’èƒŠƒtƒH�[ƒ€‚ÍŒ_–ñŽÐˆõ‚à’Ç‰Á‚·‚é
+                if (numUDConstPro.Value <= 16 && DepCode != 9)
+                {
+                    strSQL += string.Format(" AND Person.EMPLOYEECLASSFLG = {0}", (int)CommonDefine.EmployeeClassFlg.Regular);
+                }
+                strSQL += " GROUP BY Person.DISPLAYORDER, Person.PERSONCODE, Person.PERSONNAME, Person.EMPLOYEECLASSFLG";
+                // 16ŠúŒÀ’èƒŠƒtƒH�[ƒ€‚ÍŒ_–ñŽÐˆõ‚ðƒ\�[ƒg�ðŒ�‚Ö’Ç‰Á‚·‚é
+                if (numUDConstPro.Value <= 16 && DepCode != 9)
+                {
+                    strSQL += " ORDER BY 3 ASC";
+                }
+                else
+                {
+                    strSQL += " ORDER BY 11, 3 ASC";
+                }
             }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", ex.Message, strSQL);
+            }
         }
         #endregion
 
-        #region �HŽ–—\ŽZ�‘‚æ‚è�U•ª‹‹—^‹àŠz�E‘e—˜‰v‚ðŽæ“¾‚·‚é
+        #region �¡Šú‚ÌŒo‰ß‹‹—^‚ð•\Ž¦‚·‚é
         /// <summary>
-        /// �HŽ–—\ŽZ�‘‚æ‚è�U•ª‹‹—^‹àŠz�E‘e—˜‰v‚ðŽæ“¾‚·‚é
+        /// �¡Šú‚ÌŒo‰ß‹‹—^‚ð•\Ž¦‚·‚é
         /// </summary>
-        /// <returns></returns>
-        private int GetPersonBudgetDetail(int PersonCode, int GroupNo)
+        /// <param name="PersonCDArray"></param>
+        /// <param name="dtStartArray"></param>
+        /// <param name="dtCompArray"></param>
+        /// <param name="SalaryArray"></param>
+        private void SetPayrollData(List<int> PersonCDArray, List<DateTime> dtStartArray, List<DateTime> dtCompArray, List<int> SalaryArray)
         {
-            IOConstructionBudgetDetail DetailDB = new IOConstructionBudgetDetail();
             try
             {
-                if (PersonCode == 0) PersonCode = CommonMotions.LoginUserData.PersonCode;
+                // •”��ƒR�[ƒhŽæ“¾
+                int DepartmentCode = GetDepartmentCode();
 
-                string strSQL = "SELECT A.CONSTRUCTIONPERSONCODE, SUM(C.EXECUTIONAMOUNT)";
-                strSQL += " FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBUDGET B, CONSTRUCTIONBUDGETDETAIL C ";
-                strSQL += string.Format(" WHERE A.CONSTRUCTIONPERSONCODE = {0}", PersonCode);
-                strSQL += string.Format(" AND A.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
-                strSQL += " AND A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
-                
-                switch(GroupNo)
+                // “–ŠúŠúŽñ“ú�EŠú––“ú‚ðŽæ“¾
+                DateTime dtDefaultStart = DateTime.MinValue;
+                DateTime dtDefaultEnd = DateTime.MinValue;
+                CreateDefaultStartAndEndDate(ref dtDefaultStart, ref dtDefaultEnd);
+
+                int TotalSalary = 0;        // ‹‹—^—Ý�ÏŽæ“¾
+                int OnSalary = 0;           // �U•ª‹‹—^‹àŠzŽæ“¾
+                int NetIncome = 0;          // �ƒ—˜‰v‹àŠzŽæ“¾
+                int NonSalary = 0;          // ‘e—˜‰v‹àŠzŽæ“¾
+
+                DateTime dtStart = DateTime.MinValue;
+                DateTime dtEnd = DateTime.MinValue;
+                // ‹‹—^‚ð�WŒv‚·‚é
+                for (int i = 0; i < PersonCDArray.Count; i++)
                 {
-                    case (int)FrmConstructionBudget.DataGroup.PayrollExpenses:     // ‹‹—^Œo”ï
-                    case (int)FrmConstructionBudget.DataGroup.NetIncome:           // �ƒ—˜‰v
-                    strSQL += string.Format(" AND B.SALARYFLG != {0}", (int)CommonDefine.SalaryDevision.Noting);
-                        break;
-                    case (int)FrmConstructionBudget.DataGroup.GrossProfit:         // ‘e—˜‰v
-                        strSQL += string.Format(" AND B.SALARYFLG = {0}", (int)CommonDefine.SalaryDevision.Noting);
-                        break;
+                    // ŠJŽn“úŽæ“¾
+                    dtStart = dtStartArray[i];
+                    // ƒf�[ƒ^‚ª–³‚¢�ê�‡‚ÍŠúŽñ“ú‚ðƒZƒbƒg‚·‚é
+                    if (dtStart == DateTime.MinValue) dtStart = dtDefaultStart;
+                    // �I—¹“úŽæ“¾
+                    dtEnd = dtCompArray[i];
+                    if (dtEnd == DateTime.MinValue) dtEnd = dtDefaultEnd;
+
+                    // ‹‹—^—Ý�ÏŽæ“¾
+                    int workSalary = CalcElapsedSalary(dtStart, dtEnd, PersonCDArray[i], SalaryArray[i]);
+                    // —ÝŒv‰ÁŽZ
+                    if (workSalary > 0) TotalSalary += workSalary;
+
                 }
-                    
-                strSQL += " AND B.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
 
-                strSQL += string.Format(" AND C.GROUPCOUNT = {0}", GroupNo);
+                // �U•ª‹‹—^‹àŠz�E�ƒ—˜‰v‹àŠz�E‘e—˜‰v‹àŠzŽæ“¾
+                ProfitGeneral(DepartmentCode, 0, ref OnSalary, ref  NetIncome, ref  NonSalary);
 
-                strSQL += " GROUP BY A.CONSTRUCTIONPERSONCODE";
+                // �U•ª‹‹—^‹àŠz•\Ž¦
+                lblCalcValue1.Text = OnSalary.ToString("#,0");
 
-                ArrayList ArrayList = new ArrayList();
-                if (!DetailDB.ExecuteReader(strSQL, ref ArrayList) || ArrayList.Count == 0) return 0;
-                object[] objRec = (object[])ArrayList[0];
+                // ‹‹—^—Ý�Ï•\Ž¦
+                lblPayroll.Text = TotalSalary.ToString("#,0");
 
-                return CommonMotions.cnvInt(objRec[1]);
+                // ‹‹—^�·ŠzŒvŽZ�E•\Ž¦
+                int TotalValue = OnSalary - TotalSalary;
+                lblTotalValue.Text = TotalValue.ToString("#,0");
+                lblTotalValue2.Text = TotalValue.ToString("#,0");
+
+                // �ƒ—˜‰v‹àŠz•\Ž¦
+                lblCalcValue2.Text = NetIncome.ToString("#,0");
+
+                // “–Šú�ƒ—˜‰vŒvŽZ
+                int CalcTotal1 = NetIncome + TotalValue;
+                lblTotalCalcValue1.Text = CalcTotal1.ToString("#,0");
+                lblTotalCalcValue2.Text = CalcTotal1.ToString("#,0");
+
+                // ‘e—˜‰v‹àŠzŽæ“¾
+                lblCalcValue3.Text = NonSalary.ToString("#,0");
+
+                // “–Šú�ƒ—˜‰vŒvŽZ
+                int CalcTotal = NonSalary + CalcTotal1;
+                lblTotalCalcValue.Text = CalcTotal.ToString("#,0");
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
-                return 0;
             }
-            finally
+        }
+        #endregion
+
+        #region Œo‰ß‹‹—^‚ðŒvŽZ‚·‚é
+        /// <summary>
+        /// Œo‰ß‹‹—^‚ðŒvŽZ‚·‚é
+        /// </summary>
+        /// <param name="dtStart"></param>
+        /// <param name="PersonCode"></param>
+        /// <returns></returns>
+        private int CalcElapsedSalary(DateTime dtStart, DateTime dtLast, int PersonCode, int Salary)
+        {
+            try
             {
-                DetailDB.close(); DetailDB = null;
+                // ‰Ò“­“ú�”‚ðŽæ“¾‚·‚é
+                int WorkingDay = ClsCalendar.CalcPassedDaysCount(dtStart, dtLast);
+
+                // ‹‹—^Žæ“¾
+                int MonthlyPay = CommonMotions.cnvRound(Salary * CommonDefine.s_SalaryCorrection);
+
+                // “ú“–ŒvŽZ
+                double daylySalary = CommonMotions.cnvRound(MonthlyPay / CommonDefine.s_ManHourUnitMonth);
+
+                // Œo‰ß‹‹—^ŒvŽZ
+                int RetSalary =CommonMotions.cnvRound(WorkingDay * daylySalary);
+
+                return RetSalary;
             }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+                return 0;
+            }
         }
         #endregion
-
     }
 }
\ No newline at end of file
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/FrmEstimateBudget.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/FrmEstimateBudget.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/FrmEstimateBudget.cs	(revision 18)
@@ -726,7 +726,7 @@
                     dTotal += CommonMotions.cnvDouble(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value);
                     if (CommonMotions.chkNumeric(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value)) NumericCnt++;
                 }
-                if (DataCnt == 0 || dTotal == 0 || NumericCnt == 0) return;
+                if (DataCnt <= 1 || dTotal == 0 || NumericCnt == 0) return;
                 string strTotal = CommonMotions.cnvTruncate(dTotal).ToString("#,#");
                 if (dTotal - System.Math.Floor(dTotal) != 0) strTotal = dTotal.ToString("#,#.00");
 
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/ProcessControl.cs	(revision 18)
@@ -202,6 +202,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.cs	(revision 18)
@@ -1412,9 +1412,13 @@
                     
                     if (m_EntryPage[TabCnt].Cotegory == CommonDefine.TabCotegory.Component)         // �\�¬ƒ^ƒu‚Í“ü—Í‹ÖŽ~‚ª‚ ‚é
                     {   // “ü—Í‰Â”\‚Å‚Í–³‚¯‚ê‚Î�ˆ—�‚µ‚È‚¢
-                        //DataGridView dgv = m_EntryPage[TabCnt].EntryDGV;
                         int iInput = CommonMotions.cnvInt(dgv.CurrentRow.Cells[(int)GridComponentColumn.InputFlg].Value);
-                        if (iInput == (int)CommonDefine.DirectInput.Protect) return;
+                        if (iInput == (int)CommonDefine.DirectInput.Protect)
+                        {
+                            if (MessageBox.Show("‘I‘ð‚Å‚«‚Ü‚¹‚ñ�A‰ºˆÊ‚É“ü—Íƒ^ƒu‚ª‚È‚¢‚©Šm”F‚µ‚Ä‚­‚¾‚³‚¢�B", "“ü—ÍŠm”F"
+                                , MessageBoxButtons.OK, MessageBoxIcon.Warning) != DialogResult.Yes) return;
+                            return;
+                        }
                     }
                     if (dgv.ReadOnly) return;                                                       // ƒOƒŠƒbƒh‚²‚Æ�‘�ž‚Ý‹ÖŽ~‚Í�ˆ—��I—¹
 
@@ -1637,7 +1641,7 @@
                     dTotal += CommonMotions.cnvDouble(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value);
                     if (CommonMotions.chkNumeric(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value)) NumericCnt++;
                 }
-                if (DataCnt == 0 || dTotal == 0 || NumericCnt == 0) return;
+                if (DataCnt <= 1 || dTotal == 0 || NumericCnt == 0) return;
                 string strTotal = CommonMotions.cnvTruncate(dTotal).ToString("#,#");
                 if (dTotal - System.Math.Floor(dTotal) != 0) strTotal = dTotal.ToString("#,#.00");
 
@@ -1992,18 +1996,40 @@
         /// <param name="e"></param>
         private void btnSubConstructor_Click(object sender, EventArgs e)
         {
-            // ‘I‘ðƒ^ƒuƒJƒEƒ“ƒgŽæ“¾
-            int TabCnt = TabCollections.SelectedIndex;
+            try
+            {
+                // ‘I‘ðƒ^ƒuƒJƒEƒ“ƒgŽæ“¾
+                int TabCnt = TabCollections.SelectedIndex;
 
-            DataGridView dgv = m_EntryPage[TabCnt].EntryDGV;
+                DataGridView dgv = m_EntryPage[TabCnt].EntryDGV;
 
-            // ‘I‘ðƒZƒ‹Žæ“¾
-            DataGridViewCell c = dgv.SelectedCells[0];
-            // ‹¦—Í‰ïŽÐ—ñˆÈŠO‚Í�ˆ—�‚µ‚È‚¢
-            if (c.ColumnIndex != (int)GridItemColumn.SubConstractorName) return;
+                // ‘I‘ðƒZƒ‹Žæ“¾
+                DataGridViewCell c = dgv.SelectedCells[0];
+                
+                // ‹¦—Í‰ïŽÐ—ñˆÈŠO‚Í�ˆ—�‚µ‚È‚¢
+                if (c.ColumnIndex != (int)GridItemColumn.SubConstractorName) return;
+                
+                // �\�¬ƒ^ƒu‚Í“ü—Í‹ÖŽ~‚ª‚ ‚é
+                if (m_EntryPage[TabCnt].Cotegory == CommonDefine.TabCotegory.Component)
+                {
+                    int CurRow = c.RowIndex;
 
-            // ‹¦—Í‰ïŽÐ‘I‘ð
-            ShowSubConstructorDiag(TabCnt);
+                    int iInput = CommonMotions.cnvInt(dgv.Rows[CurRow].Cells[(int)GridComponentColumn.InputFlg].Value);
+                    if (iInput == (int)CommonDefine.DirectInput.Protect)
+                    {
+                        if (MessageBox.Show("‘I‘ð‚Å‚«‚Ü‚¹‚ñ�A‰ºˆÊ‚É“ü—Íƒ^ƒu‚ª‚È‚¢‚©Šm”F‚µ‚Ä‚­‚¾‚³‚¢�B", "“ü—ÍŠm”F"
+                            , MessageBoxButtons.OK, MessageBoxIcon.Warning) != DialogResult.Yes) return;
+                        return;
+                    }
+                }
+
+                // ‹¦—Í‰ïŽÐ‘I‘ð
+                ShowSubConstructorDiag(TabCnt);
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ƒVƒXƒeƒ€ƒGƒ‰�[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
         }
         #endregion
     }
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/ProcessControl.cs	(revision 18)
@@ -202,6 +202,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimatePrint/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimatePrint/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimatePrint/ProcessControl.cs	(revision 18)
@@ -202,6 +202,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Proceedings/FrmProceedings.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Proceedings/FrmProceedings.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Proceedings/FrmProceedings.cs	(revision 18)
@@ -1144,7 +1144,7 @@
                     dTotal += CommonMotions.cnvDouble(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value);
                     if (CommonMotions.chkNumeric(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value)) NumericCnt++;
                 }
-                if (DataCnt == 0 || dTotal == 0 || NumericCnt == 0) return;
+                if (DataCnt <= 1 || dTotal == 0 || NumericCnt == 0) return;
                 string strTotal = CommonMotions.cnvTruncate(dTotal).ToString("#,#");
                 if (dTotal - System.Math.Floor(dTotal) != 0) strTotal = dTotal.ToString("#,#.00");
 
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Proceedings/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Proceedings/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Proceedings/ProcessControl.cs	(revision 18)
@@ -209,6 +209,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/ProcessControl.cs	(revision 18)
@@ -202,6 +202,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderPrint/ProcessControl.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderPrint/ProcessControl.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderPrint/ProcessControl.cs	(revision 18)
@@ -202,6 +202,7 @@
 
                     // ç”»é�¢ã‚¯ãƒ­ãƒ¼ã‚º
                     Handle.SubFormHandle.Close();
+                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
                 }
             }
             catch (System.Exception ex)
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/TAndPCosts/FrmTAndPCosts.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/TAndPCosts/FrmTAndPCosts.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/TAndPCosts/FrmTAndPCosts.cs	(revision 18)
@@ -986,7 +986,7 @@
                     dTotal += CommonMotions.cnvDouble(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value);
                     if (CommonMotions.chkNumeric(dgv.Rows[c.RowIndex].Cells[c.ColumnIndex].Value)) NumericCnt++;
                 }
-                if (DataCnt == 0 || dTotal == 0 || NumericCnt == 0) return;
+                if (DataCnt <= 1 || dTotal == 0 || NumericCnt == 0) return;
                 string strTotal = CommonMotions.cnvTruncate(dTotal).ToString("#,#");
                 if (dTotal - System.Math.Floor(dTotal) != 0) strTotal = dTotal.ToString("#,#.00");
 
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/Master/AlwaysEmployment/AlwaysEmployment.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/Master/AlwaysEmployment/AlwaysEmployment.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/Master/AlwaysEmployment/AlwaysEmployment.cs	(revision 18)
@@ -83,6 +83,7 @@
             DisplayString,
             Qualification,
             SealPrintName,
+            LedgerFlg,
             EditMode,
         }
 
@@ -91,6 +92,11 @@
         /// </summary>
         private static string EditModeStringNew = "æ–°è¦�";
         private static string EditModeStringEdit = "ä¿®æ­£";
+
+        /// <summary>
+        /// å·¥äº‹è©³ç´°å�°å¸³è¨ˆç®—å¯¾è±¡å��ç§°
+        /// </summary>
+        private string[] PersonLedgerDivNoName = new string[] { "è¨ˆç®—å¯¾è±¡å¤–", "è¨ˆç®—å¯¾è±¡" };
         #endregion
 
         #region å¤‰æ•°
@@ -126,7 +132,7 @@
         /// </summary>
         private bool m_PasswordInputFlg = false;
 
-        private Control[] m_dispControl = new Control[14];
+        private Control[] m_dispControl;
         /// <summary>
         /// çµ‚äº†ãƒœã‚¿ãƒ³æŠ¼ä¸‹ãƒ•ãƒ©ã‚°
         /// </summary>
@@ -170,7 +176,7 @@
         }
         #endregion
 
-        #region ã‚¤ãƒ™ãƒ³ãƒˆãƒ¡ã‚½ãƒƒãƒ‰
+        #region Ã—ãƒœã‚¿ãƒ³æŠ¼ä¸‹å‡¦ç�†
         /// <summary>
         /// Ã—ãƒœã‚¿ãƒ³æŠ¼ä¸‹å‡¦ç�†
         /// </summary>
@@ -191,6 +197,9 @@
             // å‰�ãƒ—ãƒ­ã‚»ã‚¹ã�«æˆ»ã‚‹
             ClsExcute.BackProcess();
         }
+        #endregion
+
+        #region çµ‚äº†ãƒœã‚¿ãƒ³ã‚¯ãƒªãƒƒã‚¯
         /// <summary>
         /// çµ‚äº†ãƒœã‚¿ãƒ³ã‚¯ãƒªãƒƒã‚¯
         /// </summary>
@@ -200,7 +209,9 @@
         {
             this.Close();
         }
+        #endregion
 
+        #region åˆ�æœŸãƒ•ã‚©ãƒ¼ãƒ ãƒ­ãƒ¼ãƒ‰
         /// <summary>
         /// åˆ�æœŸãƒ•ã‚©ãƒ¼ãƒ ãƒ­ãƒ¼ãƒ‰
         /// </summary>
@@ -226,7 +237,9 @@
 
             m_bEventStop = false;
         }
+        #endregion
 
+        #region ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰å€¤å¤‰æ›´ãƒ•ãƒ©ã‚°
         /// <summary>
         /// ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰å€¤å¤‰æ›´ãƒ•ãƒ©ã‚°
         /// </summary>
@@ -236,7 +249,9 @@
         {
             m_bChengeAns = true;
         }
+        #endregion
 
+        #region ç™»éŒ²ãƒœã‚¿ãƒ³æŠ¼ä¸‹
         /// <summary>
         /// ç™»éŒ²ãƒœã‚¿ãƒ³æŠ¼ä¸‹
         /// </summary>
@@ -283,7 +298,9 @@
                 logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
             }
         }
+        #endregion
 
+        #region å‰Šé™¤ãƒœã‚¿ãƒ³æŠ¼ä¸‹
         /// <summary>
         /// å‰Šé™¤ãƒœã‚¿ãƒ³æŠ¼ä¸‹
         /// </summary>
@@ -346,7 +363,9 @@
                 picDB.close(); picDB = null;
             }
         }
+        #endregion
 
+        #region é–‹å§‹å¹´æœˆæ—¥å…¥åŠ›å¾Œå‡¦ç�†
         /// <summary>
         /// é–‹å§‹å¹´æœˆæ—¥å…¥åŠ›å¾Œå‡¦ç�†
         /// </summary>
@@ -391,7 +410,9 @@
                 m_dispControl[(int)Dispcount.PassWord].Text = m_dispControl[(int)Dispcount.PersonCode].Text;
             }
         }
+        #endregion
 
+        #region Entryã‚­ãƒ¼ã�§ã�®ç§»å‹•å‡¦ç�†
         /// <summary>
         /// Entryã‚­ãƒ¼ã�§ã�®ç§»å‹•å‡¦ç�†
         /// </summary>
@@ -412,7 +433,9 @@
                 e.SuppressKeyPress = true;
             }
         }
+        #endregion
 
+        #region è¡Œé�¸æŠžæ™‚å‡¦ç�†
         /// <summary>
         /// è¡Œé�¸æŠžæ™‚å‡¦ç�†
         /// </summary>
@@ -463,6 +486,9 @@
                 logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
             }
         }
+        #endregion
+
+        #region ã‚°ãƒªãƒƒãƒ‰é�¸æŠžå‡¦ç�†
         /// <summary>
         /// ã‚°ãƒªãƒƒãƒ‰é�¸æŠžå‡¦ç�†
         /// </summary>
@@ -473,7 +499,9 @@
             // è¡Œé�¸æŠžæ™‚å‡¦ç�†
             DataSelectRow();
         }
+        #endregion
 
+        #region é�¸æŠžãƒœã‚¿ãƒ³æŠ¼ä¸‹
         /// <summary>
         /// é�¸æŠžãƒœã‚¿ãƒ³æŠ¼ä¸‹
         /// </summary>
@@ -484,8 +512,11 @@
             // è¡Œé�¸æŠžæ™‚å‡¦ç�†
             DataSelectRow();
         }
+        #endregion
+
+        #region è¡Œè¿½åŠ ãƒœã‚¿ãƒ³æŠ¼ä¸‹
         /// <summary>
-        /// è¿½åŠ 
+        /// è¡Œè¿½åŠ ãƒœã‚¿ãƒ³æŠ¼ä¸‹
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
@@ -503,7 +534,9 @@
             // ãƒ•ã‚©ãƒ¼ã‚«ã‚¹ã‚»ãƒƒãƒˆ
             m_dispControl[(int)Dispcount.PersonName].Focus();
         }
+        #endregion
 
+        #region ã‚¢ãƒƒãƒ—ã‚­ãƒ¼æŠ¼ä¸‹
         /// <summary>
         /// ã‚¢ãƒƒãƒ—ã‚­ãƒ¼æŠ¼ä¸‹
         /// </summary>
@@ -523,7 +556,9 @@
                 logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
             }
         }
+        #endregion
 
+        #region ãƒ€ã‚¦ãƒ³ã‚­ãƒ¼æŠ¼ä¸‹å‡¦ç�†
         /// <summary>
         /// ãƒ€ã‚¦ãƒ³ã‚­ãƒ¼æŠ¼ä¸‹å‡¦ç�†
         /// </summary>
@@ -543,7 +578,9 @@
                 logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
             }
         }
+        #endregion
 
+        #region æ©Ÿå¯†åŒºåˆ†é�¸æŠž
         /// <summary>
         /// æ©Ÿå¯†åŒºåˆ†é�¸æŠž
         /// </summary>
@@ -567,6 +604,9 @@
                 btnBackColor.Visible = true;
             }
         }
+        #endregion
+
+        #region é‡‘é¡�å…¥åŠ›å¾Œå‡¦ç�†
         /// <summary>
         /// é‡‘é¡�å…¥åŠ›å¾Œå‡¦ç�†
         /// </summary>
@@ -585,7 +625,7 @@
         }
         #endregion
 
-        #region ãƒ—ãƒ©ã‚¤ãƒ™ãƒ¼ãƒˆãƒ¡ã‚½ãƒƒãƒ‰
+        #region åˆ�æœŸæ™‚ãƒ‡ãƒ¼ã‚¿å�–å¾—
         /// <summary>
         /// åˆ�æœŸæ™‚ãƒ‡ãƒ¼ã‚¿å�–å¾—
         /// </summary>
@@ -647,7 +687,9 @@
                 picDB.close(); picDB = null;
             }
         }
+        #endregion
 
+        #region æ›´æ–°ãƒ‡ãƒ¼ã‚¿è¡¨ç¤ºå‡¦ç�†
         /// <summary>
         /// æ›´æ–°ãƒ‡ãƒ¼ã‚¿è¡¨ç¤ºå‡¦ç�†
         /// </summary>
@@ -705,6 +747,8 @@
                 ((ComboBox)m_dispControl[(int)Dispcount.Department]).SelectedValue = picList.DepartmentCode;
                 m_bEventStop = false;
 
+                ((ComboBox)m_dispControl[(int)Dispcount.LedgerFlg]).SelectedValue = picList.LedgerFlg;
+
                 m_dispControl[(int)Dispcount.DisplayString].Text = picList.DisplayString;
                 m_dispControl[(int)Dispcount.Qualification].Text = picList.Qualification;
                 m_dispControl[(int)Dispcount.SealPrintName].Text = picList.SealPrintName;
@@ -726,7 +770,9 @@
                 picDB.close(); picDB = null;
             }
         }
+        #endregion
 
+        #region ç”»é�¢ãƒ­ãƒƒã‚¯
         /// <summary>
         /// ç”»é�¢ãƒ­ãƒƒã‚¯
         /// </summary>
@@ -739,7 +785,9 @@
                     wrk.Enabled = bctrl;
             }
         }
+        #endregion
 
+        #region ç”»é�¢ã‚¯ãƒªã‚¢
         /// <summary>
         /// ç”»é�¢ã‚¯ãƒªã‚¢
         /// </summary>
@@ -766,10 +814,13 @@
             // ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸå‡¦ç�†
             SetSecurityManagementCombBox();
             SetDepartmentCombBox();
+            SetCalcLedgerCombBox();
 
             m_bChengeAns = false;
         }
+        #endregion
 
+        #region ç”»é�¢é …ç›®ã�®ãƒ�ã‚§ãƒƒã‚¯
         /// <summary>
         /// ç”»é�¢é …ç›®ã�®ãƒ�ã‚§ãƒƒã‚¯
         /// </summary>
@@ -848,7 +899,9 @@
                 return false;
             }
         }
+        #endregion
 
+        #region ç™»éŒ²æœˆã�®æœ€å¤§å€¤æ‹…å½“è€…ã‚³ãƒ¼ãƒ‰ã‚’å�–å¾—ã�™ã‚‹
         /// <summary>
         /// ç™»éŒ²æœˆã�®æœ€å¤§å€¤æ‹…å½“è€…ã‚³ãƒ¼ãƒ‰ã‚’å�–å¾—ã�™ã‚‹
         /// </summary>
@@ -879,7 +932,9 @@
             }
             return iRet;
         }
+        #endregion
 
+        #region æ‹…å½“è€…ãƒžã‚¹ã‚¿ç™»éŒ²
         /// <summary>
         /// æ‹…å½“è€…ãƒžã‚¹ã‚¿ç™»éŒ²
         /// </summary>
@@ -945,6 +1000,10 @@
                 if (m_dispControl[(int)Dispcount.SecurityManagement].Text.Length != 0)
                     work.SecurityManagement = CommonMotions.cnvInt(((ComboBox)m_dispControl[(int)Dispcount.SecurityManagement]).SelectedValue.ToString());
 
+                // å·¥äº‹è©³ç´°å�°å¸³
+                if (m_dispControl[(int)Dispcount.LedgerFlg].Text.Length != 0)
+                    work.LedgerFlg = CommonMotions.cnvInt(((ComboBox)m_dispControl[(int)Dispcount.LedgerFlg]).SelectedValue.ToString());
+
                 // ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸èƒŒæ™¯è‰²
                 if (m_dispControl[(int)Dispcount.MessageColor].Visible)
                 {
@@ -1033,12 +1092,17 @@
                 picDB.close(); picDB = null;
             }
         }
+        #endregion
 
+        #region è¡¨ç¤ºã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆã�®å�–å¾—
         /// <summary>
         /// è¡¨ç¤ºã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆã�®å�–å¾—
         /// </summary>
         private void SetDisplayObject()
         {
+            int DspCtrlCnt = Enum.GetNames(typeof(Dispcount)).Length;
+            m_dispControl = new Control[DspCtrlCnt];
+
             m_dispControl[(int)Dispcount.PersonCode] = lblPersonCode;
             m_dispControl[(int)Dispcount.PersonName] = txtInput1;
             m_dispControl[(int)Dispcount.StartDate] = txtInput2;
@@ -1052,9 +1116,13 @@
             m_dispControl[(int)Dispcount.DisplayString] = txtInput5;
             m_dispControl[(int)Dispcount.Qualification] = txtInput8;
             m_dispControl[(int)Dispcount.SealPrintName] = txtInput9;
+            m_dispControl[(int)Dispcount.LedgerFlg] = cmbLedgerFlg;
 
             m_dispControl[(int)Dispcount.EditMode] = lblEditMode;
         }
+        #endregion
+
+        #region æ©Ÿå¯†åŒºåˆ†ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸè¡¨ç¤ºå‡¦ç�†
         /// <summary>
         /// æ©Ÿå¯†åŒºåˆ†ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸè¡¨ç¤ºå‡¦ç�†
         /// </summary>
@@ -1092,6 +1160,9 @@
                 m_bEventStop = false;
             }
         }
+        #endregion
+
+        #region éƒ¨ç½²ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸè¡¨ç¤ºå‡¦ç�†
         /// <summary>
         /// éƒ¨ç½²ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸè¡¨ç¤ºå‡¦ç�†
         /// </summary>
@@ -1136,6 +1207,45 @@
         }
         #endregion
 
+        #region å·¥äº‹è©³ç´°å�°å¸³è¨ˆç®—å¯¾è±¡ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸè¡¨ç¤ºå‡¦ç�†
+        /// <summary>
+        /// å·¥äº‹è©³ç´°å�°å¸³è¨ˆç®—å¯¾è±¡ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸè¡¨ç¤ºå‡¦ç�†
+        /// </summary>
+        private void SetCalcLedgerCombBox()
+        {
+            m_bEventStop = true;
+            try
+            {
+                // ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹ã‚¯ãƒªã‚¢
+                cmbLedgerFlg.DataSource = null;
+                cmbLedgerFlg.Items.Clear();
+
+                // é�¸æŠžé …ç›®ã‚¯ãƒªã‚¢
+                cmbLedgerFlg.Text = "";
+
+                //ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹ã�®ãƒ‡ãƒ¼ã‚¿ã‚’ã‚»ãƒƒãƒˆã�™ã‚‹
+
+                List<KeyValuePair<int, string>> DataList = new List<KeyValuePair<int, string>>();
+                for (int i = 0; i < PersonLedgerDivNoName.Length; i++)
+                {
+                    KeyValuePair<int, string> keyval = new KeyValuePair<int, string>(i, PersonLedgerDivNoName[i]);
+
+                    DataList.Add(keyval);
+                }
+                // ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸè¡¨ç¤º
+                ComboBoxAction.InitDataSetCombBox(cmbLedgerFlg, DataList);
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                m_bEventStop = false;
+            }
+        }
+        #endregion
+
         #region è‰²é�¸æŠžãƒœã‚¿ãƒ³
         /// <summary>
         /// è‰²é�¸æŠžãƒœã‚¿ãƒ³å¤‰æ›´
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/Master/AlwaysEmployment/AlwaysEmployment.designer.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/Master/AlwaysEmployment/AlwaysEmployment.designer.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/Master/AlwaysEmployment/AlwaysEmployment.designer.cs	(revision 18)
@@ -30,16 +30,18 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
             this.btnDataEntry = new System.Windows.Forms.Button();
             this.btnEnd = new System.Windows.Forms.Button();
             this.label1 = new System.Windows.Forms.Label();
             this.btnDataDelete = new System.Windows.Forms.Button();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.cmbLedgerFlg = new System.Windows.Forms.ComboBox();
             this.btnBackColor = new System.Windows.Forms.Button();
+            this.label16 = new System.Windows.Forms.Label();
             this.lblMessageColor = new System.Windows.Forms.Label();
             this.lblPersonCode = new System.Windows.Forms.Label();
             this.lblPersonLabel = new System.Windows.Forms.Label();
@@ -143,7 +145,9 @@
             this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
             this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 27F));
             this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 48F));
+            this.tableLayoutPanel1.Controls.Add(this.cmbLedgerFlg, 1, 13);
             this.tableLayoutPanel1.Controls.Add(this.btnBackColor, 2, 8);
+            this.tableLayoutPanel1.Controls.Add(this.label16, 0, 13);
             this.tableLayoutPanel1.Controls.Add(this.lblMessageColor, 1, 8);
             this.tableLayoutPanel1.Controls.Add(this.lblPersonCode, 1, 0);
             this.tableLayoutPanel1.Controls.Add(this.lblPersonLabel, 0, 0);
@@ -174,7 +178,7 @@
             this.tableLayoutPanel1.Controls.Add(this.label15, 0, 8);
             this.tableLayoutPanel1.Location = new System.Drawing.Point(600, 100);
             this.tableLayoutPanel1.Name = "tableLayoutPanel1";
-            this.tableLayoutPanel1.RowCount = 13;
+            this.tableLayoutPanel1.RowCount = 14;
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
@@ -188,10 +192,22 @@
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
-            this.tableLayoutPanel1.Size = new System.Drawing.Size(610, 455);
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(610, 490);
             this.tableLayoutPanel1.TabIndex = 0;
             // 
+            // cmbLedgerFlg
+            // 
+            this.cmbLedgerFlg.Anchor = System.Windows.Forms.AnchorStyles.Left;
+            this.tableLayoutPanel1.SetColumnSpan(this.cmbLedgerFlg, 2);
+            this.cmbLedgerFlg.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cmbLedgerFlg.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.cmbLedgerFlg.FormattingEnabled = true;
+            this.cmbLedgerFlg.Location = new System.Drawing.Point(155, 462);
+            this.cmbLedgerFlg.Name = "cmbLedgerFlg";
+            this.cmbLedgerFlg.Size = new System.Drawing.Size(300, 24);
+            this.cmbLedgerFlg.TabIndex = 31;
+            // 
             // btnBackColor
             // 
             this.btnBackColor.Anchor = System.Windows.Forms.AnchorStyles.Left;
@@ -207,6 +223,19 @@
             this.btnBackColor.Visible = false;
             this.btnBackColor.Click += new System.EventHandler(this.btnBackColor_Click);
             // 
+            // label16
+            // 
+            this.label16.Anchor = System.Windows.Forms.AnchorStyles.Left;
+            this.label16.BackColor = System.Drawing.Color.Aquamarine;
+            this.label16.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label16.ForeColor = System.Drawing.Color.Black;
+            this.label16.Location = new System.Drawing.Point(3, 460);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(144, 25);
+            this.label16.TabIndex = 32;
+            this.label16.Text = "å�°å¸³è¨ˆç®—å¯¾è±¡";
+            this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
             // lblMessageColor
             // 
             this.lblMessageColor.Anchor = System.Windows.Forms.AnchorStyles.Left;
@@ -636,14 +665,14 @@
             this.dgvMaster.AllowUserToResizeRows = false;
             this.dgvMaster.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
             this.dgvMaster.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle5.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
-            dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.dgvMaster.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle1.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
+            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.dgvMaster.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
             this.dgvMaster.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
             this.dgvMaster.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.Column1,
@@ -667,9 +696,9 @@
             // 
             // Column1
             // 
-            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            dataGridViewCellStyle6.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.Column1.DefaultCellStyle = dataGridViewCellStyle6;
+            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            dataGridViewCellStyle2.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.Column1.DefaultCellStyle = dataGridViewCellStyle2;
             this.Column1.Frozen = true;
             this.Column1.HeaderText = "â„–";
             this.Column1.Name = "Column1";
@@ -679,8 +708,8 @@
             // 
             // Column2
             // 
-            dataGridViewCellStyle7.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.Column2.DefaultCellStyle = dataGridViewCellStyle7;
+            dataGridViewCellStyle3.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.Column2.DefaultCellStyle = dataGridViewCellStyle3;
             this.Column2.Frozen = true;
             this.Column2.HeaderText = "å¤–æ³¨è€…ã‚³ãƒ¼ãƒ‰";
             this.Column2.Name = "Column2";
@@ -690,9 +719,9 @@
             // 
             // Column3
             // 
-            dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle8.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.Column3.DefaultCellStyle = dataGridViewCellStyle8;
+            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle4.Font = new System.Drawing.Font("ï¼­ï¼³ æ˜Žæœ�", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.Column3.DefaultCellStyle = dataGridViewCellStyle4;
             this.Column3.HeaderText = "å¤–ã€€æ³¨ã€€è€…ã€€å��";
             this.Column3.Name = "Column3";
             this.Column3.ReadOnly = true;
@@ -810,5 +839,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
+        private System.Windows.Forms.ComboBox cmbLedgerFlg;
+        private System.Windows.Forms.Label label16;
     }
 }
\ No newline at end of file
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/Master/PersonInCharge/FrmPersonInCharge.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/Master/PersonInCharge/FrmPersonInCharge.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/Master/PersonInCharge/FrmPersonInCharge.cs	(revision 18)
@@ -84,6 +84,7 @@
             DisplayString,
             Qualification,
             SealPrintName,
+            LedgerFlg,
             EditMode,
         }
 
@@ -92,6 +93,11 @@
         /// </summary>
         private static string EditModeStringNew = "æ–°è¦�";
         private static string EditModeStringEdit = "ä¿®æ­£";
+
+        /// <summary>
+        /// å·¥äº‹è©³ç´°å�°å¸³è¨ˆç®—å¯¾è±¡å��ç§°
+        /// </summary>
+        private string[] PersonLedgerDivNoName = new string[] { "è¨ˆç®—å¯¾è±¡å¤–", "è¨ˆç®—å¯¾è±¡" };
         #endregion
 
         #region å¤‰æ•°
@@ -127,7 +133,7 @@
         /// </summary>
         private bool m_PasswordInputFlg = false;
 
-        private Control[] m_dispControl = new Control[14];
+        private Control[] m_dispControl;
         /// <summary>
         /// çµ‚äº†ãƒœã‚¿ãƒ³æŠ¼ä¸‹ãƒ•ãƒ©ã‚°
         /// </summary>
@@ -744,6 +750,8 @@
                 ((ComboBox)m_dispControl[(int)Dispcount.Department]).SelectedValue = picList.DepartmentCode;
                 m_bEventStop = false;
 
+                ((ComboBox)m_dispControl[(int)Dispcount.LedgerFlg]).SelectedValue = picList.LedgerFlg;
+
                 m_dispControl[(int)Dispcount.DisplayString].Text = picList.DisplayString;
                 m_dispControl[(int)Dispcount.Qualification].Text = picList.Qualification;
                 m_dispControl[(int)Dispcount.SealPrintName].Text = picList.SealPrintName;
@@ -810,6 +818,7 @@
             // ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸå‡¦ç�†
             SetSecurityManagementCombBox();
             SetDepartmentCombBox();
+            SetCalcLedgerCombBox();
 
             m_bChengeAns = false;
         }
@@ -996,6 +1005,10 @@
                 if (m_dispControl[(int)Dispcount.SecurityManagement].Text.Length != 0)
                     work.SecurityManagement = CommonMotions.cnvInt(((ComboBox)m_dispControl[(int)Dispcount.SecurityManagement]).SelectedValue.ToString());
 
+                // å·¥äº‹è©³ç´°å�°å¸³
+                if (m_dispControl[(int)Dispcount.LedgerFlg].Text.Length != 0)
+                    work.LedgerFlg = CommonMotions.cnvInt(((ComboBox)m_dispControl[(int)Dispcount.LedgerFlg]).SelectedValue.ToString());
+
                 // ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸èƒŒæ™¯è‰²
                 if (m_dispControl[(int)Dispcount.MessageColor].Visible)
                 {
@@ -1093,6 +1106,9 @@
         /// </summary>
         private void SetDisplayObject()
         {
+            int DspCtrlCnt = Enum.GetNames(typeof(Dispcount)).Length;
+            m_dispControl = new Control[DspCtrlCnt];
+
             m_dispControl[(int)Dispcount.PersonCode] = lblPersonCode;
             m_dispControl[(int)Dispcount.PersonName] = txtInput1;
             m_dispControl[(int)Dispcount.StartDate] = txtInput2;
@@ -1106,6 +1122,7 @@
             m_dispControl[(int)Dispcount.DisplayString] = txtInput5;
             m_dispControl[(int)Dispcount.Qualification] = txtInput8;
             m_dispControl[(int)Dispcount.SealPrintName] = txtInput9;
+            m_dispControl[(int)Dispcount.LedgerFlg] = cmbLedgerFlg;
 
             m_dispControl[(int)Dispcount.EditMode] = lblEditMode;
         }
@@ -1197,6 +1214,45 @@
         }
         #endregion
 
+        #region å·¥äº‹è©³ç´°å�°å¸³è¨ˆç®—å¯¾è±¡ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸè¡¨ç¤ºå‡¦ç�†
+        /// <summary>
+        /// å·¥äº‹è©³ç´°å�°å¸³è¨ˆç®—å¯¾è±¡ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸè¡¨ç¤ºå‡¦ç�†
+        /// </summary>
+        private void SetCalcLedgerCombBox()
+        {
+            m_bEventStop = true;
+            try
+            {
+                // ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹ã‚¯ãƒªã‚¢
+                cmbLedgerFlg.DataSource = null;
+                cmbLedgerFlg.Items.Clear();
+
+                // é�¸æŠžé …ç›®ã‚¯ãƒªã‚¢
+                cmbLedgerFlg.Text = "";
+
+                //ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹ã�®ãƒ‡ãƒ¼ã‚¿ã‚’ã‚»ãƒƒãƒˆã�™ã‚‹
+
+                List<KeyValuePair<int, string>> DataList = new List<KeyValuePair<int, string>>();
+                for (int i = 0; i < PersonLedgerDivNoName.Length; i++)
+                {
+                    KeyValuePair<int, string> keyval = new KeyValuePair<int, string>(i, PersonLedgerDivNoName[i]);
+
+                    DataList.Add(keyval);
+                }
+                // ã‚³ãƒ³ãƒœãƒœãƒƒã‚¯ã‚¹åˆ�æœŸè¡¨ç¤º
+                ComboBoxAction.InitDataSetCombBox(cmbLedgerFlg, DataList);
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼ï¼š{0}ï¼š{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                m_bEventStop = false;
+            }
+        }
+        #endregion
+
         #region è‰²é�¸æŠžãƒœã‚¿ãƒ³
         /// <summary>
         /// è‰²é�¸æŠžãƒœã‚¿ãƒ³å¤‰æ›´
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/Master/PersonInCharge/FrmPersonInCharge.designer.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/Master/PersonInCharge/FrmPersonInCharge.designer.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/Master/PersonInCharge/FrmPersonInCharge.designer.cs	(revision 18)
@@ -39,6 +39,7 @@
             this.label1 = new System.Windows.Forms.Label();
             this.btnDataDelete = new System.Windows.Forms.Button();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.cmbLedgerFlg = new System.Windows.Forms.ComboBox();
             this.btnBackColor = new System.Windows.Forms.Button();
             this.lblMessageColor = new System.Windows.Forms.Label();
             this.lblPersonCode = new System.Windows.Forms.Label();
@@ -68,6 +69,7 @@
             this.label14 = new System.Windows.Forms.Label();
             this.txtInput9 = new System.Windows.Forms.TextBox();
             this.label15 = new System.Windows.Forms.Label();
+            this.label16 = new System.Windows.Forms.Label();
             this.lblEditMode = new System.Windows.Forms.Label();
             this.btnDataSelect = new System.Windows.Forms.Button();
             this.btnDataLineEntry = new System.Windows.Forms.Button();
@@ -143,6 +145,7 @@
             this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
             this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 27F));
             this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 48F));
+            this.tableLayoutPanel1.Controls.Add(this.cmbLedgerFlg, 1, 13);
             this.tableLayoutPanel1.Controls.Add(this.btnBackColor, 2, 8);
             this.tableLayoutPanel1.Controls.Add(this.lblMessageColor, 1, 8);
             this.tableLayoutPanel1.Controls.Add(this.lblPersonCode, 1, 0);
@@ -172,9 +175,10 @@
             this.tableLayoutPanel1.Controls.Add(this.label14, 0, 12);
             this.tableLayoutPanel1.Controls.Add(this.txtInput9, 1, 12);
             this.tableLayoutPanel1.Controls.Add(this.label15, 0, 8);
+            this.tableLayoutPanel1.Controls.Add(this.label16, 0, 13);
             this.tableLayoutPanel1.Location = new System.Drawing.Point(600, 100);
             this.tableLayoutPanel1.Name = "tableLayoutPanel1";
-            this.tableLayoutPanel1.RowCount = 13;
+            this.tableLayoutPanel1.RowCount = 14;
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
@@ -188,10 +192,22 @@
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
-            this.tableLayoutPanel1.Size = new System.Drawing.Size(610, 455);
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(610, 490);
             this.tableLayoutPanel1.TabIndex = 0;
             // 
+            // cmbLedgerFlg
+            // 
+            this.cmbLedgerFlg.Anchor = System.Windows.Forms.AnchorStyles.Left;
+            this.tableLayoutPanel1.SetColumnSpan(this.cmbLedgerFlg, 2);
+            this.cmbLedgerFlg.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cmbLedgerFlg.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.cmbLedgerFlg.FormattingEnabled = true;
+            this.cmbLedgerFlg.Location = new System.Drawing.Point(155, 462);
+            this.cmbLedgerFlg.Name = "cmbLedgerFlg";
+            this.cmbLedgerFlg.Size = new System.Drawing.Size(300, 24);
+            this.cmbLedgerFlg.TabIndex = 16;
+            // 
             // btnBackColor
             // 
             this.btnBackColor.Anchor = System.Windows.Forms.AnchorStyles.Left;
@@ -567,6 +583,19 @@
             this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             this.label15.Visible = false;
             // 
+            // label16
+            // 
+            this.label16.Anchor = System.Windows.Forms.AnchorStyles.Left;
+            this.label16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
+            this.label16.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label16.ForeColor = System.Drawing.Color.Black;
+            this.label16.Location = new System.Drawing.Point(3, 460);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(144, 25);
+            this.label16.TabIndex = 30;
+            this.label16.Text = "å�°å¸³è¨ˆç®—å¯¾è±¡";
+            this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
             // lblEditMode
             // 
             this.lblEditMode.BackColor = System.Drawing.Color.White;
@@ -810,5 +839,7 @@
         private System.Windows.Forms.Label label15;
         private System.Windows.Forms.Label lblMessageColor;
         private System.Windows.Forms.Button btnBackColor;
+        private System.Windows.Forms.ComboBox cmbLedgerFlg;
+        private System.Windows.Forms.Label label16;
     }
 }
\ No newline at end of file
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/Master/SubContractor/FrmSubContractor.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/Master/SubContractor/FrmSubContractor.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/Master/SubContractor/FrmSubContractor.cs	(revision 18)
@@ -526,7 +526,7 @@
             m_CompanyCode = CommonMotions.cnvInt(dgvMaster.CurrentRow.Cells[(int)DispListColumn.CompanyCode].Value);
 
             // ã‚¯ãƒªã‚¢
-            ClearDisplay();
+            ClearDisplay(true);
 
             // ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ãƒ­ãƒƒã‚¯è§£é™¤
             ControlLock();
@@ -580,7 +580,7 @@
             {
                 m_CompanyCode = 0;
                 // ã‚¯ãƒªã‚¢
-                ClearDisplay();
+                ClearDisplay(true);
 
                 // ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ãƒ­ãƒƒã‚¯è§£é™¤
                 ControlLock();
@@ -1305,7 +1305,7 @@
             try
             {
                 // ç”»é�¢ã‚¯ãƒªã‚¢
-                ClearDisplay();
+                ClearDisplay(true);
 
                 // æ–°è¦�æ™‚ã�¯è¡¨ç¤ºã�—ã�ªã�„
                 if (m_CompanyCode == 0) return;
@@ -1421,7 +1421,7 @@
         /// <summary>
         /// ç”»é�¢ã‚¯ãƒªã‚¢
         /// </summary>
-        private void ClearDisplay()
+        private void ClearDisplay(bool EdiDataDisp = false)
         {
             foreach (Control wrk in m_dispControl)
             {
@@ -1460,7 +1460,9 @@
                 lblCompanyCode.Visible = true;
                 lblCompanyCodelabel.Visible = true;
             }
-
+            // ãƒ‡ãƒ¼ã‚¿ä¿®æ­£æ™‚ã�¯ã‚¯ãƒªã‚¢ã�—ã�ªã�„
+            if (EdiDataDisp) return;
+            
             cmbItemType.SelectedIndex = -1;
             cmbJapaneseSyllabary.SelectedIndex = -1;
             cmbLabour.SelectedIndex = -1;
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.Designer.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.Designer.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.Designer.cs	(revision 18)
@@ -6208,7 +6208,7 @@
             this.tblLayoutMaster.Controls.Add(this.btnMaster_24, 0, 16);
             this.tblLayoutMaster.Controls.Add(this.btnMaster_25, 2, 16);
             this.tblLayoutMaster.Controls.Add(this.btnMaster_26, 4, 16);
-            this.tblLayoutMaster.Location = new System.Drawing.Point(75, 0);
+            this.tblLayoutMaster.Location = new System.Drawing.Point(41, 0);
             this.tblLayoutMaster.Name = "tblLayoutMaster";
             this.tblLayoutMaster.RowCount = 17;
             this.tblLayoutMaster.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 44F));
@@ -6228,7 +6228,7 @@
             this.tblLayoutMaster.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 44F));
             this.tblLayoutMaster.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 44F));
             this.tblLayoutMaster.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 44F));
-            this.tblLayoutMaster.Size = new System.Drawing.Size(978, 748);
+            this.tblLayoutMaster.Size = new System.Drawing.Size(1080, 748);
             this.tblLayoutMaster.TabIndex = 14;
             this.tblLayoutMaster.MouseEnter += new System.EventHandler(this.tblLayoutMaster_MouseEnter);
             // 
@@ -6240,7 +6240,7 @@
             this.btnMaster_00.Location = new System.Drawing.Point(4, 3);
             this.btnMaster_00.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_00.Name = "btnMaster_00";
-            this.btnMaster_00.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_00.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_00.TabIndex = 0;
             this.btnMaster_00.Text = "ä¼šç¤¾æƒ…å ±ç™»éŒ²";
             this.btnMaster_00.UseVisualStyleBackColor = true;
@@ -6251,10 +6251,10 @@
             this.btnMaster_06.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_06.Location = new System.Drawing.Point(345, 3);
+            this.btnMaster_06.Location = new System.Drawing.Point(382, 3);
             this.btnMaster_06.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_06.Name = "btnMaster_06";
-            this.btnMaster_06.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_06.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_06.TabIndex = 9;
             this.btnMaster_06.Text = "éƒ¨ç½²ç™»éŒ²";
             this.btnMaster_06.UseVisualStyleBackColor = true;
@@ -6265,10 +6265,10 @@
             this.btnMaster_10.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_10.Location = new System.Drawing.Point(345, 355);
+            this.btnMaster_10.Location = new System.Drawing.Point(382, 355);
             this.btnMaster_10.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_10.Name = "btnMaster_10";
-            this.btnMaster_10.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_10.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_10.TabIndex = 13;
             this.btnMaster_10.Text = "æ³•äººæ ¼ç™»éŒ²";
             this.btnMaster_10.UseVisualStyleBackColor = true;
@@ -6279,10 +6279,10 @@
             this.btnMaster_09.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_09.Location = new System.Drawing.Point(345, 267);
+            this.btnMaster_09.Location = new System.Drawing.Point(382, 267);
             this.btnMaster_09.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_09.Name = "btnMaster_09";
-            this.btnMaster_09.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_09.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_09.TabIndex = 12;
             this.btnMaster_09.Text = "è»Šã€€ä¸¡ã€€ç™»ã€€éŒ²";
             this.btnMaster_09.UseVisualStyleBackColor = true;
@@ -6293,10 +6293,10 @@
             this.btnMaster_08.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_08.Location = new System.Drawing.Point(345, 179);
+            this.btnMaster_08.Location = new System.Drawing.Point(382, 179);
             this.btnMaster_08.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_08.Name = "btnMaster_08";
-            this.btnMaster_08.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_08.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_08.TabIndex = 11;
             this.btnMaster_08.Text = "å¤–æ³¨æ‰±ã�„ï¼ˆå¸¸é›‡å·¥ï¼‰ç™»éŒ²";
             this.btnMaster_08.UseVisualStyleBackColor = true;
@@ -6307,10 +6307,10 @@
             this.btnMaster_07.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_07.Location = new System.Drawing.Point(345, 91);
+            this.btnMaster_07.Location = new System.Drawing.Point(382, 91);
             this.btnMaster_07.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_07.Name = "btnMaster_07";
-            this.btnMaster_07.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_07.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_07.TabIndex = 10;
             this.btnMaster_07.Text = "æ‹…å½“è€…ç™»éŒ²";
             this.btnMaster_07.UseVisualStyleBackColor = true;
@@ -6321,10 +6321,10 @@
             this.btnMaster_12.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_12.Location = new System.Drawing.Point(686, 3);
+            this.btnMaster_12.Location = new System.Drawing.Point(760, 3);
             this.btnMaster_12.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_12.Name = "btnMaster_12";
-            this.btnMaster_12.Size = new System.Drawing.Size(288, 38);
+            this.btnMaster_12.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_12.TabIndex = 18;
             this.btnMaster_12.Text = "å�”åŠ›ä¼šç¤¾ç™»éŒ²";
             this.btnMaster_12.UseVisualStyleBackColor = true;
@@ -6335,10 +6335,10 @@
             this.btnMaster_13.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_13.Location = new System.Drawing.Point(686, 91);
+            this.btnMaster_13.Location = new System.Drawing.Point(760, 91);
             this.btnMaster_13.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_13.Name = "btnMaster_13";
-            this.btnMaster_13.Size = new System.Drawing.Size(288, 38);
+            this.btnMaster_13.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_13.TabIndex = 18;
             this.btnMaster_13.Text = "å�”åŠ›ä¼šç¤¾å·¥ç¨®ç™»éŒ²";
             this.btnMaster_13.UseVisualStyleBackColor = true;
@@ -6349,10 +6349,10 @@
             this.btnMaster_14.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_14.Location = new System.Drawing.Point(686, 179);
+            this.btnMaster_14.Location = new System.Drawing.Point(760, 179);
             this.btnMaster_14.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_14.Name = "btnMaster_14";
-            this.btnMaster_14.Size = new System.Drawing.Size(288, 38);
+            this.btnMaster_14.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_14.TabIndex = 20;
             this.btnMaster_14.Text = "å�”åŠ›ä¼šç¤¾è�·ç¨®ç™»éŒ²";
             this.btnMaster_14.UseVisualStyleBackColor = true;
@@ -6363,10 +6363,10 @@
             this.btnMaster_15.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_15.Location = new System.Drawing.Point(686, 267);
+            this.btnMaster_15.Location = new System.Drawing.Point(760, 267);
             this.btnMaster_15.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_15.Name = "btnMaster_15";
-            this.btnMaster_15.Size = new System.Drawing.Size(288, 38);
+            this.btnMaster_15.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_15.TabIndex = 21;
             this.btnMaster_15.UseVisualStyleBackColor = true;
             this.btnMaster_15.Click += new System.EventHandler(this.btnMaster_Click);
@@ -6376,10 +6376,10 @@
             this.btnMaster_16.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_16.Location = new System.Drawing.Point(686, 355);
+            this.btnMaster_16.Location = new System.Drawing.Point(760, 355);
             this.btnMaster_16.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_16.Name = "btnMaster_16";
-            this.btnMaster_16.Size = new System.Drawing.Size(288, 38);
+            this.btnMaster_16.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_16.TabIndex = 22;
             this.btnMaster_16.Text = "ç©�ç®—å�˜ä½�ç™»éŒ²";
             this.btnMaster_16.UseVisualStyleBackColor = true;
@@ -6390,10 +6390,10 @@
             this.btnMaster_11.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_11.Location = new System.Drawing.Point(345, 443);
+            this.btnMaster_11.Location = new System.Drawing.Point(382, 443);
             this.btnMaster_11.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_11.Name = "btnMaster_11";
-            this.btnMaster_11.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_11.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_11.TabIndex = 14;
             this.btnMaster_11.Text = "ç™ºæ³¨è€…åŒºåˆ†ç™»éŒ²";
             this.btnMaster_11.UseVisualStyleBackColor = true;
@@ -6404,10 +6404,10 @@
             this.btnMaster_17.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_17.Location = new System.Drawing.Point(686, 443);
+            this.btnMaster_17.Location = new System.Drawing.Point(760, 443);
             this.btnMaster_17.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_17.Name = "btnMaster_17";
-            this.btnMaster_17.Size = new System.Drawing.Size(288, 38);
+            this.btnMaster_17.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_17.TabIndex = 23;
             this.btnMaster_17.Text = "ç©�ç®—å¤§é …ç›®ç™»éŒ²";
             this.btnMaster_17.UseVisualStyleBackColor = true;
@@ -6421,7 +6421,7 @@
             this.btnMaster_05.Location = new System.Drawing.Point(4, 443);
             this.btnMaster_05.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_05.Name = "btnMaster_05";
-            this.btnMaster_05.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_05.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_05.TabIndex = 5;
             this.btnMaster_05.Text = "æœŸã€€é™�ã€€ç™»ã€€éŒ²";
             this.btnMaster_05.UseVisualStyleBackColor = true;
@@ -6435,7 +6435,7 @@
             this.btnMaster_04.Location = new System.Drawing.Point(4, 355);
             this.btnMaster_04.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_04.Name = "btnMaster_04";
-            this.btnMaster_04.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_04.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_04.TabIndex = 4;
             this.btnMaster_04.Text = "ä¼šç¤¾ä¼‘æ—¥ç™»éŒ²";
             this.btnMaster_04.UseVisualStyleBackColor = true;
@@ -6449,7 +6449,7 @@
             this.btnMaster_03.Location = new System.Drawing.Point(4, 267);
             this.btnMaster_03.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_03.Name = "btnMaster_03";
-            this.btnMaster_03.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_03.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_03.TabIndex = 3;
             this.btnMaster_03.UseVisualStyleBackColor = true;
             this.btnMaster_03.Click += new System.EventHandler(this.btnMaster_Click);
@@ -6462,7 +6462,7 @@
             this.btnMaster_02.Location = new System.Drawing.Point(4, 179);
             this.btnMaster_02.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_02.Name = "btnMaster_02";
-            this.btnMaster_02.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_02.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_02.TabIndex = 2;
             this.btnMaster_02.Text = "å·¥äº‹çµŒè²»å��ç§°ç™»éŒ²";
             this.btnMaster_02.UseVisualStyleBackColor = true;
@@ -6476,7 +6476,7 @@
             this.btnMaster_01.Location = new System.Drawing.Point(4, 91);
             this.btnMaster_01.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_01.Name = "btnMaster_01";
-            this.btnMaster_01.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_01.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_01.TabIndex = 1;
             this.btnMaster_01.Text = "å·¥äº‹ç¨®åˆ¥ç™»éŒ²";
             this.btnMaster_01.UseVisualStyleBackColor = true;
@@ -6490,7 +6490,7 @@
             this.btnMaster_18.Location = new System.Drawing.Point(4, 531);
             this.btnMaster_18.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_18.Name = "btnMaster_18";
-            this.btnMaster_18.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_18.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_18.TabIndex = 6;
             this.btnMaster_18.UseVisualStyleBackColor = true;
             this.btnMaster_18.Click += new System.EventHandler(this.btnMaster_Click);
@@ -6500,10 +6500,10 @@
             this.btnMaster_19.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_19.Location = new System.Drawing.Point(345, 531);
+            this.btnMaster_19.Location = new System.Drawing.Point(382, 531);
             this.btnMaster_19.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_19.Name = "btnMaster_19";
-            this.btnMaster_19.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_19.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_19.TabIndex = 15;
             this.btnMaster_19.Text = "ç™ºæ³¨è€…ç™»éŒ²";
             this.btnMaster_19.UseVisualStyleBackColor = true;
@@ -6514,10 +6514,10 @@
             this.btnMaster_20.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_20.Location = new System.Drawing.Point(686, 531);
+            this.btnMaster_20.Location = new System.Drawing.Point(760, 531);
             this.btnMaster_20.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_20.Name = "btnMaster_20";
-            this.btnMaster_20.Size = new System.Drawing.Size(288, 38);
+            this.btnMaster_20.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_20.TabIndex = 24;
             this.btnMaster_20.Text = "ç©�ç®—å¤§ãƒ»ä¸­é …ç›®é–¢é€£ç™»éŒ²";
             this.btnMaster_20.UseVisualStyleBackColor = true;
@@ -6531,7 +6531,7 @@
             this.btnMaster_21.Location = new System.Drawing.Point(4, 619);
             this.btnMaster_21.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_21.Name = "btnMaster_21";
-            this.btnMaster_21.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_21.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_21.TabIndex = 7;
             this.btnMaster_21.Text = "å£²ä¸Šã‚°ãƒ©ãƒ•ãƒ‡ãƒ¼ã‚¿å…¥åŠ›";
             this.btnMaster_21.UseVisualStyleBackColor = true;
@@ -6542,10 +6542,10 @@
             this.btnMaster_22.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_22.Location = new System.Drawing.Point(345, 619);
+            this.btnMaster_22.Location = new System.Drawing.Point(382, 619);
             this.btnMaster_22.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_22.Name = "btnMaster_22";
-            this.btnMaster_22.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_22.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_22.TabIndex = 16;
             this.btnMaster_22.Text = "è³¼å…¥å…ˆç™»éŒ²";
             this.btnMaster_22.UseVisualStyleBackColor = true;
@@ -6556,10 +6556,10 @@
             this.btnMaster_23.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_23.Location = new System.Drawing.Point(686, 619);
+            this.btnMaster_23.Location = new System.Drawing.Point(760, 619);
             this.btnMaster_23.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_23.Name = "btnMaster_23";
-            this.btnMaster_23.Size = new System.Drawing.Size(288, 38);
+            this.btnMaster_23.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_23.TabIndex = 25;
             this.btnMaster_23.Text = "ç©�ç®—ä¸­é …ç›®ç™»éŒ²";
             this.btnMaster_23.UseVisualStyleBackColor = true;
@@ -6573,8 +6573,9 @@
             this.btnMaster_24.Location = new System.Drawing.Point(4, 707);
             this.btnMaster_24.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_24.Name = "btnMaster_24";
-            this.btnMaster_24.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_24.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_24.TabIndex = 8;
+            this.btnMaster_24.Text = "éƒ¨ç½²åˆ¥å·¥äº‹å�°å¸³ã�¾ã�¨ã‚�ä¸€è¦§";
             this.btnMaster_24.UseVisualStyleBackColor = true;
             this.btnMaster_24.Click += new System.EventHandler(this.btnMaster_Click);
             // 
@@ -6583,10 +6584,10 @@
             this.btnMaster_25.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_25.Location = new System.Drawing.Point(345, 707);
+            this.btnMaster_25.Location = new System.Drawing.Point(382, 707);
             this.btnMaster_25.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_25.Name = "btnMaster_25";
-            this.btnMaster_25.Size = new System.Drawing.Size(285, 38);
+            this.btnMaster_25.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_25.TabIndex = 17;
             this.btnMaster_25.Text = "æ‰¿èª�çµŒè·¯ç™»éŒ²";
             this.btnMaster_25.UseVisualStyleBackColor = true;
@@ -6597,10 +6598,10 @@
             this.btnMaster_26.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnMaster_26.Location = new System.Drawing.Point(686, 707);
+            this.btnMaster_26.Location = new System.Drawing.Point(760, 707);
             this.btnMaster_26.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.btnMaster_26.Name = "btnMaster_26";
-            this.btnMaster_26.Size = new System.Drawing.Size(288, 38);
+            this.btnMaster_26.Size = new System.Drawing.Size(316, 38);
             this.btnMaster_26.TabIndex = 26;
             this.btnMaster_26.Text = "ç©�ç®—å°�é …ç›®ç™»éŒ²";
             this.btnMaster_26.UseVisualStyleBackColor = true;
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.cs	(revision 18)
@@ -619,9 +619,9 @@
         }
         #endregion
 
-        #region åˆ�æœŸè¡¨ç¤º
+        #region ãƒ•ã‚©ãƒ¼ãƒ ãƒ­ãƒ¼ãƒ‰åˆ�æœŸè¡¨ç¤º
         /// <summary>
-        /// åˆ�æœŸè¡¨ç¤º
+        /// ãƒ•ã‚©ãƒ¼ãƒ ãƒ­ãƒ¼ãƒ‰åˆ�æœŸè¡¨ç¤º
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
@@ -630,8 +630,7 @@
             try
             {
                 // ---- åˆ�å›žèµ·å‹•ãƒ�ã‚§ãƒƒã‚¯(æ¯Žæ—¥æœ€åˆ�ã�«èµ·å‹•ã�™ã‚‹äººã�Œãƒ‡ãƒ¼ã‚¿ãƒ�ã‚§ãƒƒã‚¯ã�™ã‚‹)
-                ClsSystemOnceExecute CheckProc = new ClsSystemOnceExecute();
-                CheckProc.FirstExecute();
+                CommonMotions.CheckProc.FirstExecute();
 
                 // ã‚¨ãƒ©ãƒ¼ãƒ­ã‚°ãƒ•ã‚¡ã‚¤ãƒ«å‰Šé™¤
                 ClsCleanUp.CleanLogFile();
@@ -1828,15 +1827,24 @@
                     ClsExcute.ProcControlPara[NowPoint].BoolExecParameter.Add(false);
                 }
                 else if (btnKey.Name == "btnConstruction01")
-                {
-                    // ----- èµ·å‹•ãƒ—ãƒ­ã‚»ã‚¹è¨­å®š
-                    // å·¥äº‹è©³ç´°å�°å¸³ä¸€è¦§
-                    int NowPoint = ClsExcute.NextProcess((int)ClsExcute.ProcessExecuteNo.ConstructionLedgerList);
+                {   // ã‚·ã‚¹ãƒ†ãƒ ç®¡ç�†è€…ãƒ»æœ€é«˜è²¬ä»»è€…
+                    if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.AdminSecurityManagement ||
+                        CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.PresidentAuthority].Key)
+                    {
+                        // éƒ¨ç½²åˆ¥å�°å¸³ã�¾ã�¨ã‚�ä¸€è¦§
+                        int NowPoint = ClsExcute.NextProcess((int)ClsExcute.ProcessExecuteNo.DepartmentExpenssList);
+                    }
+                    else
+                    {   // çµ±æ‹¬è²¬ä»»è€…ãƒ»æ‰€å±žé•·ãƒ»ä¸€èˆ¬ãƒ¦ãƒ¼ã‚¶ãƒ¼
+                        // ----- èµ·å‹•ãƒ—ãƒ­ã‚»ã‚¹è¨­å®š
+                        // å·¥äº‹è©³ç´°å�°å¸³ä¸€è¦§
+                        int NowPoint = ClsExcute.NextProcess((int)ClsExcute.ProcessExecuteNo.ConstructionLedgerList);
 
-                    // å·¥äº‹ä¸€è¦§ã�‹ã‚‰è¡¨ç¤ºã‚’è¡Œã�†ã�Ÿã‚�èµ·å‹•ãƒ—ãƒ­ã‚»ã‚¹ã�¯ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã�®1ã�¤ç›®ã�«ã‚»ãƒƒãƒˆã�™ã‚‹ã€‚
-                    // å·¥äº‹è©³ç´°å�°å¸³å…¥åŠ›
-                    ClsExcute.ProcControlPara[NowPoint].IntExecParameter.Add((int)ClsExcute.ProcessExecuteNo.ConstructionLedger);
-                    ClsExcute.ProcControlPara[NowPoint].BoolExecParameter.Add(false);
+                        // å·¥äº‹ä¸€è¦§ã�‹ã‚‰è¡¨ç¤ºã‚’è¡Œã�†ã�Ÿã‚�èµ·å‹•ãƒ—ãƒ­ã‚»ã‚¹ã�¯ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã�®1ã�¤ç›®ã�«ã‚»ãƒƒãƒˆã�™ã‚‹ã€‚
+                        // å·¥äº‹è©³ç´°å�°å¸³å…¥åŠ›
+                        ClsExcute.ProcControlPara[NowPoint].IntExecParameter.Add((int)ClsExcute.ProcessExecuteNo.ConstructionLedger);
+                        ClsExcute.ProcControlPara[NowPoint].BoolExecParameter.Add(false);
+                    }
                 }
                 else if (btnKey.Name == "btnConstruction02")
                 {
@@ -2088,7 +2096,7 @@
                 }
                 else if (btnKey.Name == "btnMaster_24")
                 {
-                    // ãƒ†ã‚¹ãƒˆçš„ã�«å�°å¸³ã‚’è¡¨ç¤ºã�™ã‚‹
+                    // éƒ¨ç½²åˆ¥å�°å¸³ã�¾ã�¨ã‚�ä¸€è¦§
                     int NowPoint = ClsExcute.NextProcess((int)ClsExcute.ProcessExecuteNo.DepartmentExpenssList);
                 }
                 //---- 2åˆ—ç›®
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.resx
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.resx	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.resx	(revision 18)
@@ -466,6 +466,6 @@
     <value>118, 7</value>
   </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>30</value>
+    <value>42</value>
   </metadata>
 </root>
\ No newline at end of file
Index: trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenuAuxiliary.cs
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenuAuxiliary.cs	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenuAuxiliary.cs	(revision 18)
@@ -1529,7 +1529,7 @@
         /// <param name="dgv"></param>
         /// <param name="rowcnt"></param>
         /// <param name="objwrk"></param>
-        private void DispErrorSubmittedDateRow(DataGridViewEX dgv, DataGridViewRow wrkRow, ConstructionBaseInfo wrkRec, ClsSystemOnceExecute ChkProc)
+        private void DispErrorSubmittedDateRow(DataGridViewEX dgv, DataGridViewRow wrkRow, ConstructionBaseInfo wrkRec)
         {
             try
             {
@@ -1536,7 +1536,7 @@
                 string sBackColor = string.Empty;
                 string sForeColor = string.Empty;
                 string sErrMsg = string.Empty;
-                if (ChkProc.ConstructionStatusCheck(wrkRec, DateTime.Now, ref sErrMsg, ref sBackColor, ref sForeColor, false)) return;
+                if (CommonMotions.CheckProc.ConstructionStatusCheck(wrkRec, DateTime.Now, ref sErrMsg, ref sBackColor, ref sForeColor, false)) return;
 
                 wrkRow.Cells[4].Style.BackColor = CommonMotions.getBackForeColor(sBackColor, CommonDefine.PalceOfColor.BackColor);
                 wrkRow.Cells[4].Style.ForeColor = CommonMotions.getBackForeColor(sForeColor, CommonDefine.PalceOfColor.ForeColor);
@@ -1577,7 +1577,6 @@
         /// </summary>
         private void DispSalesInProjects()
         {
-            ClsSystemOnceExecute ChkProc = new ClsSystemOnceExecute();
             IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
             DataGridViewEX dgv = dgvSalesInProjects;
             try
@@ -1685,7 +1684,7 @@
 
                     // ã‚¨ãƒ©ãƒ¼è¡Œã�«è‰²ã‚’ä»˜ã�‘ã‚‹
                     DataGridViewRow row = dgv.Rows[LineCnt];
-                    DispErrorSubmittedDateRow(dgv, row, BaseRec, ChkProc);
+                    DispErrorSubmittedDateRow(dgv, row, BaseRec);
                     iLineCnt++;
 
                     // æ‰¿èª�çŠ¶æ…‹ã�«è‰²ã‚’ä»˜ã�‘ã‚‹
@@ -1725,7 +1724,6 @@
 
                 // ã‚°ãƒªãƒƒãƒ‰ã‚½ãƒ¼ãƒˆå®Ÿè¡Œ
                 GridSortExcute(dgv);
-                ChkProc = null;
                 cbiDB.close(); cbiDB = null;
                 dgv.ResumeLayout();
             }
@@ -1765,7 +1763,6 @@
         /// </summary>
         private void DispTenders()
         {
-            ClsSystemOnceExecute ChkProc = new ClsSystemOnceExecute();
             IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
             DataGridViewEX dgv = dgvTenders;
             try
@@ -1867,7 +1864,7 @@
 
                     // ã‚¨ãƒ©ãƒ¼è¡Œã�«è‰²ã‚’ä»˜ã�‘ã‚‹
                     DataGridViewRow row = dgv.Rows[LineCnt];
-                    DispErrorSubmittedDateRow(dgv, row, BaseRec, ChkProc);
+                    DispErrorSubmittedDateRow(dgv, row, BaseRec);
                     iLineCnt++;
 
                     // æ‰¿èª�çŠ¶æ…‹ã�«è‰²ã‚’ä»˜ã�‘ã‚‹
@@ -1904,7 +1901,6 @@
 
                 // ã‚°ãƒªãƒƒãƒ‰ã‚½ãƒ¼ãƒˆå®Ÿè¡Œ
                 GridSortExcute(dgv);
-                ChkProc = null;
                 cbiDB.close(); cbiDB = null;
                 dgv.ResumeLayout();
             }
@@ -1944,7 +1940,6 @@
         /// </summary>
         private void DispBudgetUpProjects()
         {
-            ClsSystemOnceExecute ChkProc = new ClsSystemOnceExecute();
             IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
             DataGridViewEX dgv = dgvBudgetUp;
             try
@@ -2046,7 +2041,7 @@
 
                     // ã‚¨ãƒ©ãƒ¼è¡Œã�«è‰²ã‚’ä»˜ã�‘ã‚‹
                     DataGridViewRow row = dgv.Rows[LineCnt];
-                    DispErrorSubmittedDateRow(dgv, row, BaseRec, ChkProc);
+                    DispErrorSubmittedDateRow(dgv, row, BaseRec);
                     iLineCnt++;
 
                     // æ‰¿èª�çŠ¶æ…‹ã�«è‰²ã‚’ä»˜ã�‘ã‚‹
@@ -2084,7 +2079,6 @@
                 // ã‚°ãƒªãƒƒãƒ‰ã‚½ãƒ¼ãƒˆå®Ÿè¡Œ
                 GridSortExcute(dgv);
 
-                ChkProc = null;
                 cbiDB.close(); cbiDB = null;
                 dgv.ResumeLayout();
             }
@@ -2146,7 +2140,6 @@
         /// </summary>
         private void DispConstructionProjects()
         {
-            ClsSystemOnceExecute ChkProc = new ClsSystemOnceExecute();
             IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
             IOMDepartment dmDB = new IOMDepartment();
             DataGridViewEX dgv = dgvConstructionProjects;
@@ -2301,7 +2294,7 @@
 
                     // ã‚¨ãƒ©ãƒ¼è¡Œã�«è‰²ã‚’ä»˜ã�‘ã‚‹
                     DataGridViewRow row = dgv.Rows[LineCnt];
-                    DispErrorSubmittedDateRow(dgv, row, wrkRec, ChkProc);
+                    DispErrorSubmittedDateRow(dgv, row, wrkRec);
                     iLineCnt++;
 
                     // æ‰¿èª�çŠ¶æ…‹ã�«è‰²ã‚’ä»˜ã�‘ã‚‹
@@ -2408,7 +2401,6 @@
                 // ã‚°ãƒªãƒƒãƒ‰ã‚½ãƒ¼ãƒˆå®Ÿè¡Œ
                 GridSortExcute(dgv);
 
-                ChkProc = null;
                 cbiDB.close(); cbiDB = null;
                 dmDB.close(); dmDB = null;
                 dgv.ResumeLayout();
@@ -2616,7 +2608,6 @@
         /// </summary>
         private void DispFluctuationProjects()
         {
-            ClsSystemOnceExecute ChkProc = new ClsSystemOnceExecute();
             IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
             IOMDepartment dmDB = new IOMDepartment();
             DataGridViewEX dgv = dgvFluctuationProjects;
@@ -2772,7 +2763,7 @@
 
                     // ã‚¨ãƒ©ãƒ¼è¡Œã�«è‰²ã‚’ä»˜ã�‘ã‚‹
                     DataGridViewRow row = dgv.Rows[LineCnt];
-                    DispErrorSubmittedDateRow(dgv, row, wrkRec, ChkProc);
+                    DispErrorSubmittedDateRow(dgv, row, wrkRec);
                     iLineCnt++;
 
                     // æ‰¿èª�çŠ¶æ…‹ã�«è‰²ã‚’ä»˜ã�‘ã‚‹
@@ -2812,7 +2803,6 @@
                 // ã‚°ãƒªãƒƒãƒ‰ã‚½ãƒ¼ãƒˆå®Ÿè¡Œ
                 GridSortExcute(dgv);
 
-                ChkProc = null;
                 cbiDB.close(); cbiDB = null;
                 dmDB.close(); dmDB = null;
                 dgv.ResumeLayout();
@@ -3151,7 +3141,6 @@
         /// </summary>
         private void DispCompletionOfConstruction()
         {
-            ClsSystemOnceExecute ChkProc = new ClsSystemOnceExecute();
             IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
             IOMPersonInCharge picDB = new IOMPersonInCharge();
             try
@@ -3262,7 +3251,7 @@
 
                     // ã‚¨ãƒ©ãƒ¼è¡Œã�«è‰²ã‚’ä»˜ã�‘ã‚‹
                     DataGridViewRow row = dgvCompletionOfConstruction.Rows[LineCnt];
-                    DispErrorSubmittedDateRow(dgvCompletionOfConstruction, row, wrkRec, ChkProc);
+                    DispErrorSubmittedDateRow(dgvCompletionOfConstruction, row, wrkRec);
                     iLineCnt++;
 
                     // ProgressBarã�®å€¤ã‚’å¤‰æ›´ã�™ã‚‹
@@ -3313,7 +3302,6 @@
 
                 cbiDB.close(); cbiDB = null;
                 picDB.close(); picDB = null;
-                ChkProc = null;
             }
         }
         #endregion
@@ -4976,11 +4964,12 @@
 
                     // ----- ãƒžã‚¤ãƒ«ã‚¹ãƒˆãƒ¼ãƒ³æ—¥ï¼ˆå�—æ³¨æ—¥ãƒ»é–‹å§‹äºˆå®šæ—¥ãƒ»çµ‚äº†æ—¥ã‚’è¡¨ç¤ºã�™ã‚‹ï¼‰
                     DateTime BarStoneDate1 = DateTime.Parse(wrkRec[(int)ReadStaffDate.OrderDate].ToString());                           // å�—æ³¨æ—¥
-                    //DateTime BarStoneDate2 = DateTime.Parse(wrkRec[(int)ReadStaffDate.OrderStartingDate].ToString());                 // é–‹å§‹äºˆå®šæ—¥
-                    //DateTime BarStoneDate3 = DateTime.Parse(wrkRec[(int)ReadStaffDate.OrderCompletionDate].ToString());               // å®Œäº†äºˆå®šæ—¥
-                    DateTime BarStoneDate2 = BarStartDate;                                                                              // é–‹å§‹äºˆå®šæ—¥
-                    DateTime BarStoneDate3 = BarEndDate;                                                                                // å®Œäº†äºˆå®šæ—¥
-                    BarChartDrowing4(CalenderStartDate, CalenderLastDate, BarStoneDate1, BarStoneDate2, BarStoneDate3, LineCnt + 5);
+                    DateTime BarStoneDate2 = DateTime.Parse(wrkRec[(int)ReadStaffDate.OrderStartingDate].ToString());                   // é–‹å§‹äºˆå®šæ—¥
+                    DateTime BarStoneDate3 = DateTime.Parse(wrkRec[(int)ReadStaffDate.OrderCompletionDate].ToString());                 // å®Œäº†äºˆå®šæ—¥
+                    DateTime BarStoneDate4 = BarEndDate;                                                                                // æ–½å·¥å®Œäº†äºˆå®šæ—¥
+                    //DateTime BarStoneDate2 = BarStartDate;                                                                            // é–‹å§‹äºˆå®šæ—¥
+                    //DateTime BarStoneDate3 = BarEndDate;                                                                              // å®Œäº†äºˆå®šæ—¥
+                    BarChartDrowing4(CalenderStartDate, CalenderLastDate, BarStoneDate1, BarStoneDate2, BarStoneDate3, BarStoneDate4, LineCnt + 5);
 
                     LineCnt += 7;
                 }
@@ -5234,7 +5223,7 @@
         /// <param name="BarEndDate"></param>
         /// <param name="LineCnt"></param>
         private void BarChartDrowing4(DateTime CalenderStartDate, DateTime CalenderEndDate,
-                                        DateTime MilestoneDate1, DateTime MilestoneDate2, DateTime MilestoneDate3,
+                                        DateTime MilestoneDate1, DateTime MilestoneDate2, DateTime MilestoneDate3, DateTime MilestoneDate4,
                                         int LineCnt)
         {
             try
@@ -5297,20 +5286,33 @@
                 while (true)
                 {
 
-                    if (CalcCompleteDate.Date == DateTime.MinValue.Date) break;
+                    //if (CalcCompleteDate.Date == DateTime.MinValue.Date) break;
+                    //// ç¯„å›²å¤–ã�¯å‡¦ç�†ã�—ã�ªã�„
+                    //if (CalcCompleteDate.Date < CalenderStartDate.Date) break;
+                    //if (CalenderEndDate.Date < CalcCompleteDate.Date) break;
+
+                    //int StartCnt = 0;
+                    //if (CalenderStartDate.Date <= CalcCompleteDate.Date)
+                    //{
+                    //    TimeSpan ts = CalcCompleteDate.Date - CalenderStartDate.Date;
+                    //    // çµ‚äº†æ—¥ã�¯å½“æ™‚ã�«ã�™ã‚‹ã�Ÿã‚�-1ã�™ã‚‹
+                    //    StartCnt = ts.Days - 1;
+                    //}
+
+                    if (MilestoneDate3.Date == DateTime.MinValue.Date) break;
                     // ç¯„å›²å¤–ã�¯å‡¦ç�†ã�—ã�ªã�„
-                    if (CalcCompleteDate.Date < CalenderStartDate.Date) break;
-                    if (CalenderEndDate.Date < CalcCompleteDate.Date) break;
+                    if (MilestoneDate3.Date < CalenderStartDate.Date) break;
+                    if (CalenderEndDate.Date < MilestoneDate3.Date) break;
 
                     int StartCnt = 0;
-                    if (CalenderStartDate.Date <= CalcCompleteDate.Date)
+                    if (CalenderStartDate.Date <= MilestoneDate3.Date)
                     {
-                        TimeSpan ts = CalcCompleteDate.Date - CalenderStartDate.Date;
-                        // çµ‚äº†æ—¥ã�¯å½“æ™‚ã�«ã�™ã‚‹ã�Ÿã‚�-1ã�™ã‚‹
-                        StartCnt = ts.Days - 1;
+                        TimeSpan ts = MilestoneDate3.Date - CalenderStartDate.Date;
+                        StartCnt = ts.Days;
                     }
-                    string strTip = string.Format("æ–½å·¥å®Œäº†äºˆå®šæ—¥:{0}", CalcCompleteDate.Date.ToShortDateString());
 
+                    string strTip = string.Format("æ–½å·¥å®Œäº†äºˆå®šæ—¥:{0}", MilestoneDate3.Date.ToShortDateString());
+
                     int icellcnt = (int)StaffAssignmentGridCount.Days1 + StartCnt;
                     dgvStaffAssignment.Rows[LineCnt].Cells[icellcnt].Style.BackColor = Color.RosyBrown;
                     dgvStaffAssignment.Rows[LineCnt].Cells[icellcnt].ToolTipText = strTip;
@@ -5321,18 +5323,18 @@
                 // å·¥äº‹å®Œäº†äºˆå®šæ—¥
                 while (true)
                 {
-                    if (MilestoneDate3.Date == DateTime.MinValue.Date) break;
+                    if (MilestoneDate4.Date == DateTime.MinValue.Date) break;
                     // ç¯„å›²å¤–ã�¯å‡¦ç�†ã�—ã�ªã�„
-                    if (MilestoneDate3.Date < CalenderStartDate.Date) break;
-                    if (CalenderEndDate.Date < MilestoneDate3.Date) break;
+                    if (MilestoneDate4.Date < CalenderStartDate.Date) break;
+                    if (CalenderEndDate.Date < MilestoneDate4.Date) break;
 
                     int StartCnt = 0;
-                    if (CalenderStartDate.Date <= MilestoneDate3.Date)
+                    if (CalenderStartDate.Date <= MilestoneDate4.Date)
                     {
-                        TimeSpan ts = MilestoneDate3.Date - CalenderStartDate.Date;
+                        TimeSpan ts = MilestoneDate4.Date - CalenderStartDate.Date;
                         StartCnt = ts.Days;
                     }
-                    string strTip = string.Format("å·¥äº‹å®Œäº†äºˆå®šæ—¥:{0}", MilestoneDate3.Date.ToShortDateString());
+                    string strTip = string.Format("å·¥äº‹å®Œäº†äºˆå®šæ—¥:{0}", MilestoneDate4.Date.ToShortDateString());
 
                     int icellcnt = (int)StaffAssignmentGridCount.Days1 + StartCnt;
                     dgvStaffAssignment.Rows[LineCnt].Cells[icellcnt].Style.BackColor = Color.Black;
Index: trunk/src/ProcessManagement/ProcessManagement/ProcessManagement.csproj
===================================================================
--- trunk/src/ProcessManagement/ProcessManagement/ProcessManagement.csproj	(revision 17)
+++ trunk/src/ProcessManagement/ProcessManagement/ProcessManagement.csproj	(revision 18)
@@ -418,6 +418,12 @@
     <Compile Include="Forms\Master\Suppliers\FrmSuppliers.designer.cs">
       <DependentUpon>FrmSuppliers.cs</DependentUpon>
     </Compile>
+    <Compile Include="Forms\SubForms\FrmPriceOfBudget.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Forms\SubForms\FrmPriceOfBudget.Designer.cs">
+      <DependentUpon>FrmPriceOfBudget.cs</DependentUpon>
+    </Compile>
     <Compile Include="Forms\SubForms\FrmNumberOfWorkers.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -949,6 +955,9 @@
     <EmbeddedResource Include="Forms\Master\Suppliers\FrmSuppliers.resx">
       <DependentUpon>FrmSuppliers.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Forms\SubForms\FrmPriceOfBudget.resx">
+      <DependentUpon>FrmPriceOfBudget.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Forms\SubForms\FrmNumberOfWorkers.resx">
       <DependentUpon>FrmNumberOfWorkers.cs</DependentUpon>
     </EmbeddedResource>
Index: trunk/src/ProcessManagement/ProcessManagement.v12.suo
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
