Index: branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs	(revision 123)
@@ -14,11 +14,11 @@
         /// <summary>
         /// 本体バージョン
         /// </summary>
-        public static int s_SystemVersion = 26;
+        public static int s_SystemVersion = 27;
 
         /// <summary>
         /// コピー・環境バージョン
         /// </summary>
-        public static int s_UpDateCopyVersion = 1;
+        public static int s_UpDateCopyVersion = 2;
     }
 }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentDataDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentDataDetail.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentDataDetail.cs	(revision 123)
@@ -256,28 +256,27 @@
             try
             {
                 // データ取得
-                wrk.CompanyCode = int.Parse(objwrk[(int)NameColumn.CompanyCode].ToString());
-                wrk.TargetDate = int.Parse(objwrk[(int)NameColumn.TargetDate].ToString());
-                wrk.SeqNo = int.Parse(objwrk[(int)NameColumn.SeqNo].ToString());
-                wrk.LineCount = int.Parse(objwrk[(int)NameColumn.LineCount].ToString());
-                wrk.BillPrice = long.Parse(objwrk[(int)NameColumn.BillPrice].ToString());
-                wrk.DiscountPrice = long.Parse(objwrk[(int)NameColumn.DiscountPrice].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.CompanyCode])) wrk.CompanyCode = int.Parse(objwrk[(int)NameColumn.CompanyCode].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.TargetDate])) wrk.TargetDate = int.Parse(objwrk[(int)NameColumn.TargetDate].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.SeqNo])) wrk.SeqNo = int.Parse(objwrk[(int)NameColumn.SeqNo].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.LineCount])) wrk.LineCount = int.Parse(objwrk[(int)NameColumn.LineCount].ToString());
 
-                wrk.OffsetPrice = long.Parse(objwrk[(int)NameColumn.OffsetPrice].ToString());
-                wrk.NextCoPrice = long.Parse(objwrk[(int)NameColumn.NextCoPrice].ToString());
-                wrk.HighwPrice = long.Parse(objwrk[(int)NameColumn.HighwPrice].ToString());
-                wrk.HardwPrice = long.Parse(objwrk[(int)NameColumn.HardwPrice].ToString());
-                wrk.IndsWasteTax = long.Parse(objwrk[(int)NameColumn.IndsWasteTax].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.BillPrice])) wrk.BillPrice = long.Parse(objwrk[(int)NameColumn.BillPrice].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.DiscountPrice])) wrk.DiscountPrice = long.Parse(objwrk[(int)NameColumn.DiscountPrice].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.OffsetPrice])) wrk.OffsetPrice = long.Parse(objwrk[(int)NameColumn.OffsetPrice].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.NextCoPrice])) wrk.NextCoPrice = long.Parse(objwrk[(int)NameColumn.NextCoPrice].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.HighwPrice])) wrk.HighwPrice = long.Parse(objwrk[(int)NameColumn.HighwPrice].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.HardwPrice])) wrk.HardwPrice = long.Parse(objwrk[(int)NameColumn.HardwPrice].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.IndsWasteTax])) wrk.IndsWasteTax = long.Parse(objwrk[(int)NameColumn.IndsWasteTax].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.CnstrPrice])) wrk.CnstrPrice = long.Parse(objwrk[(int)NameColumn.CnstrPrice].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.CnstrPriceExist])) wrk.CnstrPriceExist = int.Parse(objwrk[(int)NameColumn.CnstrPriceExist].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.ApprovalPersonCode])) wrk.ApprovalPersonCode = int.Parse(objwrk[(int)NameColumn.ApprovalPersonCode].ToString());
 
-                wrk.CnstrPrice = long.Parse(objwrk[(int)NameColumn.CnstrPrice].ToString());
-                wrk.CnstrPriceExist = int.Parse(objwrk[(int)NameColumn.CnstrPriceExist].ToString());
-                wrk.ApprovalPersonCode = int.Parse(objwrk[(int)NameColumn.ApprovalPersonCode].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.ApprovalDate])) wrk.ApprovalDate = DateTime.Parse(objwrk[(int)NameColumn.ApprovalDate].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.ApprovalEndFlg])) wrk.ApprovalEndFlg = int.Parse(objwrk[(int)NameColumn.ApprovalEndFlg].ToString());
 
-                wrk.ApprovalDate = DateTime.Parse(objwrk[(int)NameColumn.ApprovalDate].ToString());
-                wrk.ApprovalEndFlg = int.Parse(objwrk[(int)NameColumn.ApprovalEndFlg].ToString());
-
-                wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString());
-                wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.EntryDate])) wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString());
+                if (!CommonMotions.chkCellBlank(objwrk[(int)NameColumn.UpdateDate])) wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString());
             }
             catch (MySqlException myex)
             {
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReserveEntry/FrmMaterialReserveEntry.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReserveEntry/FrmMaterialReserveEntry.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReserveEntry/FrmMaterialReserveEntry.cs	(revision 123)
@@ -303,6 +303,7 @@
 
             }
         }
+
         /// <summary>
         /// 終了ボタン押下
         /// </summary>
@@ -320,6 +321,12 @@
         /// <param name="e"></param>
         private void FrmMaterialReserveEntry_Load(object sender, EventArgs e)
         {
+            // 工事情報が選択されていない時
+            if (this.ConstructionCode == 0)
+            {
+                this.Close();
+                return;
+            }
 
             // ロックを実行する為
             try
@@ -356,7 +363,6 @@
             // *-----* 処理移動ボタン設定 *-----*
             CreateProcessContextMenu(m_SubForm);
             // *-----* 処理移動ボタン設定 *-----*
-
         }
 
         /// <summary>
@@ -383,6 +389,7 @@
                     r.Cells[(int)DispColumn.DisplayOrder].Value = "0";
             }
         }
+
         /// <summary>
         /// 行追加ボタン押下
         /// </summary>
@@ -1703,7 +1710,5 @@
         }
     #endregion
 
-
-
     }
 }
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReturnEntry/FrmMaterialReturnEntry.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReturnEntry/FrmMaterialReturnEntry.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReturnEntry/FrmMaterialReturnEntry.cs	(revision 123)
@@ -24,7 +24,7 @@
 using ProcessManagement.Forms.CustomControls;
 using ProcessManagement.Forms.ControlsAction;
 
-//*------------------------ 単位マスタメンテ画面 ----------------------*
+//*------------------------ 資材返却画面 ----------------------*
 //  2015/07/14  Ver1.0.0.0      Create Source           
 //
 //
@@ -209,6 +209,7 @@
             // 前プロセスに戻る
             ClsExcute.BackProcess();
         }
+
         /// <summary>
         /// 終了ボタン押下
         /// </summary>
@@ -226,6 +227,13 @@
         /// <param name="e"></param>
         private void FrmMaterialReturnEntry_Load(object sender, EventArgs e)
         {
+            // 工事情報が選択されていない時
+            if (this.ConstructionCode == 0)
+            {
+                this.Close();
+                return;
+            }
+
             // 初期表示
             InitDataLoad();
 
@@ -273,6 +281,7 @@
                     r.Cells[(int)DispColumn.DisplayOrder].Value = "0";
             }
         }
+
         /// <summary>
         /// 行追加ボタン押下
         /// </summary>
@@ -448,7 +457,6 @@
             }
         }
 
-
         /// <summary>
         /// セルクリック
         /// </summary>
@@ -586,7 +594,7 @@
                 logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
                 return false;
             }
-      }
+        }
 
         /// <summary>
         /// データ登録
@@ -1019,8 +1027,5 @@
 
         #endregion
 
-
-
-
     }
 }
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/FrmSelectRegField.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/FrmSelectRegField.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/FrmSelectRegField.cs	(revision 123)
@@ -377,7 +377,7 @@
                 }
 
                 // 空文字も無視
-                if (dgv1[tcol, trow].Value == string.Empty)
+                if (dgv1[tcol, trow].Value.ToString() == string.Empty)
                 {
                     return;
                 }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInput/FrmRequestInput.Designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInput/FrmRequestInput.Designer.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInput/FrmRequestInput.Designer.cs	(revision 123)
@@ -28,47 +28,29 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle43 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle44 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle45 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle46 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle47 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle48 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle49 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle50 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle51 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle52 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle53 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle54 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle55 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle56 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle57 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle58 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle59 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle60 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle61 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle62 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle63 = 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();
+            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 dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
+            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();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
             this.label3 = new System.Windows.Forms.Label();
             this.dgv1 = new System.Windows.Forms.DataGridView();
-            this.label2 = new System.Windows.Forms.Label();
-            this.btnEntry = new System.Windows.Forms.Button();
-            this.btnEnd = new System.Windows.Forms.Button();
-            this.btnAdd = new System.Windows.Forms.Button();
-            this.btnOtherProc = new System.Windows.Forms.Button();
-            this.lblStatus = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
-            this.cbReqMonth = new System.Windows.Forms.ComboBox();
-            this.label5 = new System.Windows.Forms.Label();
-            this.lblReqOrder = new System.Windows.Forms.Label();
-            this.btnApproval = new System.Windows.Forms.Button();
-            this.txtOrderer = new System.Windows.Forms.TextBox();
-            this.button1 = new System.Windows.Forms.Button();
-            this.pnlNormal = new System.Windows.Forms.Panel();
-            this.pnlApproval = new System.Windows.Forms.Panel();
-            this.btnDeny = new System.Windows.Forms.Button();
-            this.btnPend = new System.Windows.Forms.Button();
-            this.btnAgree = new System.Windows.Forms.Button();
             this.col001 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.col002 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.col003 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -94,6 +76,24 @@
             this.col23 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.col098 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.col99 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.label2 = new System.Windows.Forms.Label();
+            this.btnEntry = new System.Windows.Forms.Button();
+            this.btnEnd = new System.Windows.Forms.Button();
+            this.btnAdd = new System.Windows.Forms.Button();
+            this.btnOtherProc = new System.Windows.Forms.Button();
+            this.lblStatus = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.cbReqMonth = new System.Windows.Forms.ComboBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.lblReqOrder = new System.Windows.Forms.Label();
+            this.btnApproval = new System.Windows.Forms.Button();
+            this.txtOrderer = new System.Windows.Forms.TextBox();
+            this.button1 = new System.Windows.Forms.Button();
+            this.pnlNormal = new System.Windows.Forms.Panel();
+            this.pnlApproval = new System.Windows.Forms.Panel();
+            this.btnDeny = new System.Windows.Forms.Button();
+            this.btnPend = new System.Windows.Forms.Button();
+            this.btnAgree = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.dgv1)).BeginInit();
             this.pnlNormal.SuspendLayout();
             this.pnlApproval.SuspendLayout();
@@ -153,217 +153,6 @@
             this.dgv1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dgv1_CellValidating);
             this.dgv1.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgv1_CellValueChanged);
             // 
-            // label2
-            // 
-            this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
-            this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.label2.CausesValidation = false;
-            this.label2.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label2.Location = new System.Drawing.Point(12, 63);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(100, 25);
-            this.label2.TabIndex = 2;
-            this.label2.Text = "請求先";
-            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // btnEntry
-            // 
-            this.btnEntry.BackColor = System.Drawing.Color.GreenYellow;
-            this.btnEntry.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnEntry.ForeColor = System.Drawing.Color.Black;
-            this.btnEntry.Location = new System.Drawing.Point(1071, 585);
-            this.btnEntry.Name = "btnEntry";
-            this.btnEntry.Size = new System.Drawing.Size(120, 28);
-            this.btnEntry.TabIndex = 13;
-            this.btnEntry.Text = "登　録";
-            this.btnEntry.UseVisualStyleBackColor = false;
-            this.btnEntry.Click += new System.EventHandler(this.btnEntry_Click);
-            // 
-            // btnEnd
-            // 
-            this.btnEnd.BackColor = System.Drawing.Color.Magenta;
-            this.btnEnd.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnEnd.ForeColor = System.Drawing.Color.Black;
-            this.btnEnd.Location = new System.Drawing.Point(1197, 585);
-            this.btnEnd.Name = "btnEnd";
-            this.btnEnd.Size = new System.Drawing.Size(120, 28);
-            this.btnEnd.TabIndex = 14;
-            this.btnEnd.Text = "終　了";
-            this.btnEnd.UseVisualStyleBackColor = false;
-            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
-            // 
-            // btnAdd
-            // 
-            this.btnAdd.BackColor = System.Drawing.Color.Orange;
-            this.btnAdd.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnAdd.ForeColor = System.Drawing.Color.Black;
-            this.btnAdd.Location = new System.Drawing.Point(158, 585);
-            this.btnAdd.Name = "btnAdd";
-            this.btnAdd.Size = new System.Drawing.Size(120, 28);
-            this.btnAdd.TabIndex = 12;
-            this.btnAdd.Text = "回数追加";
-            this.btnAdd.UseVisualStyleBackColor = false;
-            this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
-            // 
-            // btnOtherProc
-            // 
-            this.btnOtherProc.BackColor = System.Drawing.Color.Lime;
-            this.btnOtherProc.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnOtherProc.ForeColor = System.Drawing.Color.Black;
-            this.btnOtherProc.Location = new System.Drawing.Point(12, 585);
-            this.btnOtherProc.Name = "btnOtherProc";
-            this.btnOtherProc.Size = new System.Drawing.Size(140, 28);
-            this.btnOtherProc.TabIndex = 11;
-            this.btnOtherProc.Text = "他の画面へ";
-            this.btnOtherProc.UseVisualStyleBackColor = false;
-            this.btnOtherProc.Click += new System.EventHandler(this.btnOtherProc_Click);
-            // 
-            // lblStatus
-            // 
-            this.lblStatus.BackColor = System.Drawing.Color.GreenYellow;
-            this.lblStatus.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.lblStatus.Location = new System.Drawing.Point(132, 25);
-            this.lblStatus.Name = "lblStatus";
-            this.lblStatus.Size = new System.Drawing.Size(35, 16);
-            this.lblStatus.TabIndex = 1;
-            this.lblStatus.Text = "請求準備";
-            this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            this.lblStatus.Visible = false;
-            // 
-            // label4
-            // 
-            this.label4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
-            this.label4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.label4.CausesValidation = false;
-            this.label4.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label4.Location = new System.Drawing.Point(594, 64);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(100, 25);
-            this.label4.TabIndex = 4;
-            this.label4.Text = "請求月";
-            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // cbReqMonth
-            // 
-            this.cbReqMonth.BackColor = System.Drawing.Color.White;
-            this.cbReqMonth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cbReqMonth.FormattingEnabled = true;
-            this.cbReqMonth.Location = new System.Drawing.Point(699, 64);
-            this.cbReqMonth.Name = "cbReqMonth";
-            this.cbReqMonth.Size = new System.Drawing.Size(109, 24);
-            this.cbReqMonth.TabIndex = 5;
-            // 
-            // label5
-            // 
-            this.label5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
-            this.label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.label5.CausesValidation = false;
-            this.label5.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label5.Location = new System.Drawing.Point(819, 64);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(100, 25);
-            this.label5.TabIndex = 6;
-            this.label5.Text = "請求回数";
-            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // lblReqOrder
-            // 
-            this.lblReqOrder.BackColor = System.Drawing.Color.White;
-            this.lblReqOrder.Location = new System.Drawing.Point(924, 64);
-            this.lblReqOrder.Name = "lblReqOrder";
-            this.lblReqOrder.Size = new System.Drawing.Size(85, 24);
-            this.lblReqOrder.TabIndex = 7;
-            this.lblReqOrder.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // btnApproval
-            // 
-            this.btnApproval.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
-            this.btnApproval.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnApproval.Location = new System.Drawing.Point(2, 6);
-            this.btnApproval.Name = "btnApproval";
-            this.btnApproval.Size = new System.Drawing.Size(130, 27);
-            this.btnApproval.TabIndex = 0;
-            this.btnApproval.Text = "請求書申請";
-            this.btnApproval.UseVisualStyleBackColor = false;
-            this.btnApproval.Click += new System.EventHandler(this.btnApproval_Click);
-            // 
-            // txtOrderer
-            // 
-            this.txtOrderer.BackColor = System.Drawing.Color.White;
-            this.txtOrderer.Location = new System.Drawing.Point(117, 65);
-            this.txtOrderer.Name = "txtOrderer";
-            this.txtOrderer.ReadOnly = true;
-            this.txtOrderer.Size = new System.Drawing.Size(470, 23);
-            this.txtOrderer.TabIndex = 3;
-            this.txtOrderer.TextChanged += new System.EventHandler(this.txtOrderer_TextChanged);
-            this.txtOrderer.Validating += new System.ComponentModel.CancelEventHandler(this.txtOrderer_Validating);
-            // 
-            // button1
-            // 
-            this.button1.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.button1.Location = new System.Drawing.Point(1271, 25);
-            this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(45, 23);
-            this.button1.TabIndex = 15;
-            this.button1.Text = "･･･";
-            this.button1.UseVisualStyleBackColor = true;
-            this.button1.Click += new System.EventHandler(this.button1_Click_1);
-            // 
-            // pnlNormal
-            // 
-            this.pnlNormal.Controls.Add(this.btnApproval);
-            this.pnlNormal.Location = new System.Drawing.Point(1014, 56);
-            this.pnlNormal.Name = "pnlNormal";
-            this.pnlNormal.Size = new System.Drawing.Size(136, 36);
-            this.pnlNormal.TabIndex = 8;
-            // 
-            // pnlApproval
-            // 
-            this.pnlApproval.Controls.Add(this.btnDeny);
-            this.pnlApproval.Controls.Add(this.btnPend);
-            this.pnlApproval.Controls.Add(this.btnAgree);
-            this.pnlApproval.Location = new System.Drawing.Point(1014, 56);
-            this.pnlApproval.Name = "pnlApproval";
-            this.pnlApproval.Size = new System.Drawing.Size(254, 36);
-            this.pnlApproval.TabIndex = 9;
-            this.pnlApproval.Visible = false;
-            // 
-            // btnDeny
-            // 
-            this.btnDeny.BackColor = System.Drawing.Color.Red;
-            this.btnDeny.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnDeny.Location = new System.Drawing.Point(169, 5);
-            this.btnDeny.Name = "btnDeny";
-            this.btnDeny.Size = new System.Drawing.Size(80, 27);
-            this.btnDeny.TabIndex = 2;
-            this.btnDeny.Text = "不承認";
-            this.btnDeny.UseVisualStyleBackColor = false;
-            this.btnDeny.Click += new System.EventHandler(this.btnDeny_Click);
-            // 
-            // btnPend
-            // 
-            this.btnPend.BackColor = System.Drawing.Color.Yellow;
-            this.btnPend.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnPend.Location = new System.Drawing.Point(86, 5);
-            this.btnPend.Name = "btnPend";
-            this.btnPend.Size = new System.Drawing.Size(80, 27);
-            this.btnPend.TabIndex = 1;
-            this.btnPend.Text = "保留";
-            this.btnPend.UseVisualStyleBackColor = false;
-            this.btnPend.Click += new System.EventHandler(this.btnPend_Click);
-            // 
-            // btnAgree
-            // 
-            this.btnAgree.BackColor = System.Drawing.Color.Lime;
-            this.btnAgree.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnAgree.Location = new System.Drawing.Point(3, 5);
-            this.btnAgree.Name = "btnAgree";
-            this.btnAgree.Size = new System.Drawing.Size(80, 27);
-            this.btnAgree.TabIndex = 0;
-            this.btnAgree.Text = "承認";
-            this.btnAgree.UseVisualStyleBackColor = false;
-            this.btnAgree.Click += new System.EventHandler(this.btnAgree_Click);
-            // 
             // col001
             // 
             this.col001.Frozen = true;
@@ -390,9 +179,9 @@
             // col004
             // 
             this.col004.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            dataGridViewCellStyle43.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            dataGridViewCellStyle43.BackColor = System.Drawing.SystemColors.Control;
-            this.col004.DefaultCellStyle = dataGridViewCellStyle43;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
+            this.col004.DefaultCellStyle = dataGridViewCellStyle1;
             this.col004.Frozen = true;
             this.col004.HeaderText = "";
             this.col004.Name = "col004";
@@ -403,8 +192,8 @@
             // 
             // col005
             // 
-            dataGridViewCellStyle44.BackColor = System.Drawing.Color.White;
-            this.col005.DefaultCellStyle = dataGridViewCellStyle44;
+            dataGridViewCellStyle2.BackColor = System.Drawing.Color.White;
+            this.col005.DefaultCellStyle = dataGridViewCellStyle2;
             this.col005.Frozen = true;
             this.col005.HeaderText = "";
             this.col005.Name = "col005";
@@ -415,9 +204,9 @@
             // 
             // col006
             // 
-            dataGridViewCellStyle45.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            dataGridViewCellStyle45.BackColor = System.Drawing.Color.White;
-            this.col006.DefaultCellStyle = dataGridViewCellStyle45;
+            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            dataGridViewCellStyle3.BackColor = System.Drawing.Color.White;
+            this.col006.DefaultCellStyle = dataGridViewCellStyle3;
             this.col006.Frozen = true;
             this.col006.HeaderText = "受注金額";
             this.col006.Name = "col006";
@@ -427,9 +216,9 @@
             // 
             // col007
             // 
-            dataGridViewCellStyle46.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            dataGridViewCellStyle46.BackColor = System.Drawing.SystemColors.Control;
-            this.col007.DefaultCellStyle = dataGridViewCellStyle46;
+            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
+            this.col007.DefaultCellStyle = dataGridViewCellStyle4;
             this.col007.Frozen = true;
             this.col007.HeaderText = "";
             this.col007.Name = "col007";
@@ -439,8 +228,8 @@
             // 
             // col008
             // 
-            dataGridViewCellStyle47.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col008.DefaultCellStyle = dataGridViewCellStyle47;
+            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col008.DefaultCellStyle = dataGridViewCellStyle5;
             this.col008.FillWeight = 120F;
             this.col008.Frozen = true;
             this.col008.HeaderText = "合計";
@@ -451,8 +240,8 @@
             // 
             // col009
             // 
-            dataGridViewCellStyle48.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col009.DefaultCellStyle = dataGridViewCellStyle48;
+            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col009.DefaultCellStyle = dataGridViewCellStyle6;
             this.col009.HeaderText = "1回目";
             this.col009.Name = "col009";
             this.col009.ReadOnly = true;
@@ -461,8 +250,8 @@
             // 
             // col010
             // 
-            dataGridViewCellStyle49.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col010.DefaultCellStyle = dataGridViewCellStyle49;
+            dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col010.DefaultCellStyle = dataGridViewCellStyle7;
             this.col010.HeaderText = "2回目";
             this.col010.Name = "col010";
             this.col010.ReadOnly = true;
@@ -471,8 +260,8 @@
             // 
             // col011
             // 
-            dataGridViewCellStyle50.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col011.DefaultCellStyle = dataGridViewCellStyle50;
+            dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col011.DefaultCellStyle = dataGridViewCellStyle8;
             this.col011.HeaderText = "3回目";
             this.col011.Name = "col011";
             this.col011.ReadOnly = true;
@@ -481,8 +270,8 @@
             // 
             // col12
             // 
-            dataGridViewCellStyle51.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col12.DefaultCellStyle = dataGridViewCellStyle51;
+            dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col12.DefaultCellStyle = dataGridViewCellStyle9;
             this.col12.HeaderText = "4回目";
             this.col12.Name = "col12";
             this.col12.ReadOnly = true;
@@ -492,8 +281,8 @@
             // 
             // col13
             // 
-            dataGridViewCellStyle52.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col13.DefaultCellStyle = dataGridViewCellStyle52;
+            dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col13.DefaultCellStyle = dataGridViewCellStyle10;
             this.col13.HeaderText = "5回目";
             this.col13.Name = "col13";
             this.col13.ReadOnly = true;
@@ -503,8 +292,8 @@
             // 
             // col14
             // 
-            dataGridViewCellStyle53.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col14.DefaultCellStyle = dataGridViewCellStyle53;
+            dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col14.DefaultCellStyle = dataGridViewCellStyle11;
             this.col14.HeaderText = "6回目";
             this.col14.Name = "col14";
             this.col14.ReadOnly = true;
@@ -514,8 +303,8 @@
             // 
             // col15
             // 
-            dataGridViewCellStyle54.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col15.DefaultCellStyle = dataGridViewCellStyle54;
+            dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col15.DefaultCellStyle = dataGridViewCellStyle12;
             this.col15.HeaderText = "7回目";
             this.col15.Name = "col15";
             this.col15.ReadOnly = true;
@@ -525,8 +314,8 @@
             // 
             // col16
             // 
-            dataGridViewCellStyle55.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col16.DefaultCellStyle = dataGridViewCellStyle55;
+            dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col16.DefaultCellStyle = dataGridViewCellStyle13;
             this.col16.HeaderText = "8回目";
             this.col16.Name = "col16";
             this.col16.ReadOnly = true;
@@ -536,8 +325,8 @@
             // 
             // col17
             // 
-            dataGridViewCellStyle56.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col17.DefaultCellStyle = dataGridViewCellStyle56;
+            dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col17.DefaultCellStyle = dataGridViewCellStyle14;
             this.col17.HeaderText = "9回目";
             this.col17.Name = "col17";
             this.col17.ReadOnly = true;
@@ -547,8 +336,8 @@
             // 
             // col18
             // 
-            dataGridViewCellStyle57.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col18.DefaultCellStyle = dataGridViewCellStyle57;
+            dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col18.DefaultCellStyle = dataGridViewCellStyle15;
             this.col18.HeaderText = "10回目";
             this.col18.Name = "col18";
             this.col18.ReadOnly = true;
@@ -558,8 +347,8 @@
             // 
             // col19
             // 
-            dataGridViewCellStyle58.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col19.DefaultCellStyle = dataGridViewCellStyle58;
+            dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col19.DefaultCellStyle = dataGridViewCellStyle16;
             this.col19.HeaderText = "11回目";
             this.col19.Name = "col19";
             this.col19.ReadOnly = true;
@@ -569,8 +358,8 @@
             // 
             // col20
             // 
-            dataGridViewCellStyle59.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col20.DefaultCellStyle = dataGridViewCellStyle59;
+            dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col20.DefaultCellStyle = dataGridViewCellStyle17;
             this.col20.HeaderText = "12回目";
             this.col20.Name = "col20";
             this.col20.ReadOnly = true;
@@ -580,8 +369,8 @@
             // 
             // col21
             // 
-            dataGridViewCellStyle60.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col21.DefaultCellStyle = dataGridViewCellStyle60;
+            dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col21.DefaultCellStyle = dataGridViewCellStyle18;
             this.col21.HeaderText = "13回目";
             this.col21.Name = "col21";
             this.col21.ReadOnly = true;
@@ -591,8 +380,8 @@
             // 
             // col22
             // 
-            dataGridViewCellStyle61.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col22.DefaultCellStyle = dataGridViewCellStyle61;
+            dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col22.DefaultCellStyle = dataGridViewCellStyle19;
             this.col22.HeaderText = "14回目";
             this.col22.Name = "col22";
             this.col22.ReadOnly = true;
@@ -602,8 +391,8 @@
             // 
             // col23
             // 
-            dataGridViewCellStyle62.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col23.DefaultCellStyle = dataGridViewCellStyle62;
+            dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col23.DefaultCellStyle = dataGridViewCellStyle20;
             this.col23.HeaderText = "15回目";
             this.col23.Name = "col23";
             this.col23.ReadOnly = true;
@@ -613,8 +402,8 @@
             // 
             // col098
             // 
-            dataGridViewCellStyle63.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
-            this.col098.DefaultCellStyle = dataGridViewCellStyle63;
+            dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+            this.col098.DefaultCellStyle = dataGridViewCellStyle21;
             this.col098.HeaderText = "残り";
             this.col098.Name = "col098";
             this.col098.ReadOnly = true;
@@ -631,6 +420,219 @@
             this.col99.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.col99.Width = 240;
             // 
+            // label2
+            // 
+            this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
+            this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label2.CausesValidation = false;
+            this.label2.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label2.Location = new System.Drawing.Point(12, 63);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(100, 25);
+            this.label2.TabIndex = 2;
+            this.label2.Text = "請求先";
+            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // btnEntry
+            // 
+            this.btnEntry.BackColor = System.Drawing.Color.GreenYellow;
+            this.btnEntry.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnEntry.ForeColor = System.Drawing.Color.Black;
+            this.btnEntry.Location = new System.Drawing.Point(1071, 585);
+            this.btnEntry.Name = "btnEntry";
+            this.btnEntry.Size = new System.Drawing.Size(120, 28);
+            this.btnEntry.TabIndex = 13;
+            this.btnEntry.Text = "登　録";
+            this.btnEntry.UseVisualStyleBackColor = false;
+            this.btnEntry.Click += new System.EventHandler(this.btnEntry_Click);
+            // 
+            // btnEnd
+            // 
+            this.btnEnd.BackColor = System.Drawing.Color.Magenta;
+            this.btnEnd.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnEnd.ForeColor = System.Drawing.Color.Black;
+            this.btnEnd.Location = new System.Drawing.Point(1197, 585);
+            this.btnEnd.Name = "btnEnd";
+            this.btnEnd.Size = new System.Drawing.Size(120, 28);
+            this.btnEnd.TabIndex = 14;
+            this.btnEnd.Text = "終　了";
+            this.btnEnd.UseVisualStyleBackColor = false;
+            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
+            // 
+            // btnAdd
+            // 
+            this.btnAdd.BackColor = System.Drawing.Color.Orange;
+            this.btnAdd.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnAdd.ForeColor = System.Drawing.Color.Black;
+            this.btnAdd.Location = new System.Drawing.Point(158, 585);
+            this.btnAdd.Name = "btnAdd";
+            this.btnAdd.Size = new System.Drawing.Size(120, 28);
+            this.btnAdd.TabIndex = 12;
+            this.btnAdd.Text = "回数追加";
+            this.btnAdd.UseVisualStyleBackColor = false;
+            this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
+            // 
+            // btnOtherProc
+            // 
+            this.btnOtherProc.BackColor = System.Drawing.Color.Lime;
+            this.btnOtherProc.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnOtherProc.ForeColor = System.Drawing.Color.Black;
+            this.btnOtherProc.Location = new System.Drawing.Point(12, 585);
+            this.btnOtherProc.Name = "btnOtherProc";
+            this.btnOtherProc.Size = new System.Drawing.Size(140, 28);
+            this.btnOtherProc.TabIndex = 11;
+            this.btnOtherProc.Text = "他の画面へ";
+            this.btnOtherProc.UseVisualStyleBackColor = false;
+            this.btnOtherProc.Click += new System.EventHandler(this.btnOtherProc_Click);
+            // 
+            // lblStatus
+            // 
+            this.lblStatus.BackColor = System.Drawing.Color.GreenYellow;
+            this.lblStatus.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblStatus.Location = new System.Drawing.Point(132, 25);
+            this.lblStatus.Name = "lblStatus";
+            this.lblStatus.Size = new System.Drawing.Size(35, 16);
+            this.lblStatus.TabIndex = 1;
+            this.lblStatus.Text = "請求準備";
+            this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            this.lblStatus.Visible = false;
+            // 
+            // label4
+            // 
+            this.label4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
+            this.label4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label4.CausesValidation = false;
+            this.label4.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label4.Location = new System.Drawing.Point(594, 64);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(100, 25);
+            this.label4.TabIndex = 4;
+            this.label4.Text = "請求月";
+            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // cbReqMonth
+            // 
+            this.cbReqMonth.BackColor = System.Drawing.Color.White;
+            this.cbReqMonth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cbReqMonth.FormattingEnabled = true;
+            this.cbReqMonth.Location = new System.Drawing.Point(699, 64);
+            this.cbReqMonth.Name = "cbReqMonth";
+            this.cbReqMonth.Size = new System.Drawing.Size(109, 24);
+            this.cbReqMonth.TabIndex = 5;
+            // 
+            // label5
+            // 
+            this.label5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
+            this.label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label5.CausesValidation = false;
+            this.label5.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label5.Location = new System.Drawing.Point(819, 64);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(100, 25);
+            this.label5.TabIndex = 6;
+            this.label5.Text = "請求回数";
+            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblReqOrder
+            // 
+            this.lblReqOrder.BackColor = System.Drawing.Color.White;
+            this.lblReqOrder.Location = new System.Drawing.Point(924, 64);
+            this.lblReqOrder.Name = "lblReqOrder";
+            this.lblReqOrder.Size = new System.Drawing.Size(85, 24);
+            this.lblReqOrder.TabIndex = 7;
+            this.lblReqOrder.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // btnApproval
+            // 
+            this.btnApproval.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
+            this.btnApproval.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnApproval.Location = new System.Drawing.Point(2, 6);
+            this.btnApproval.Name = "btnApproval";
+            this.btnApproval.Size = new System.Drawing.Size(130, 27);
+            this.btnApproval.TabIndex = 0;
+            this.btnApproval.Text = "請求書申請";
+            this.btnApproval.UseVisualStyleBackColor = false;
+            this.btnApproval.Click += new System.EventHandler(this.btnApproval_Click);
+            // 
+            // txtOrderer
+            // 
+            this.txtOrderer.BackColor = System.Drawing.Color.White;
+            this.txtOrderer.ImeMode = System.Windows.Forms.ImeMode.On;
+            this.txtOrderer.Location = new System.Drawing.Point(117, 65);
+            this.txtOrderer.Name = "txtOrderer";
+            this.txtOrderer.ReadOnly = true;
+            this.txtOrderer.Size = new System.Drawing.Size(470, 23);
+            this.txtOrderer.TabIndex = 3;
+            this.txtOrderer.TextChanged += new System.EventHandler(this.txtOrderer_TextChanged);
+            this.txtOrderer.Validating += new System.ComponentModel.CancelEventHandler(this.txtOrderer_Validating);
+            // 
+            // button1
+            // 
+            this.button1.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.button1.Location = new System.Drawing.Point(1271, 25);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(45, 23);
+            this.button1.TabIndex = 15;
+            this.button1.Text = "･･･";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Visible = false;
+            this.button1.Click += new System.EventHandler(this.button1_Click_1);
+            // 
+            // pnlNormal
+            // 
+            this.pnlNormal.Controls.Add(this.btnApproval);
+            this.pnlNormal.Location = new System.Drawing.Point(1014, 56);
+            this.pnlNormal.Name = "pnlNormal";
+            this.pnlNormal.Size = new System.Drawing.Size(136, 36);
+            this.pnlNormal.TabIndex = 8;
+            // 
+            // pnlApproval
+            // 
+            this.pnlApproval.Controls.Add(this.btnDeny);
+            this.pnlApproval.Controls.Add(this.btnPend);
+            this.pnlApproval.Controls.Add(this.btnAgree);
+            this.pnlApproval.Location = new System.Drawing.Point(1014, 56);
+            this.pnlApproval.Name = "pnlApproval";
+            this.pnlApproval.Size = new System.Drawing.Size(254, 36);
+            this.pnlApproval.TabIndex = 9;
+            this.pnlApproval.Visible = false;
+            // 
+            // btnDeny
+            // 
+            this.btnDeny.BackColor = System.Drawing.Color.Red;
+            this.btnDeny.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnDeny.Location = new System.Drawing.Point(169, 5);
+            this.btnDeny.Name = "btnDeny";
+            this.btnDeny.Size = new System.Drawing.Size(80, 27);
+            this.btnDeny.TabIndex = 2;
+            this.btnDeny.Text = "不承認";
+            this.btnDeny.UseVisualStyleBackColor = false;
+            this.btnDeny.Click += new System.EventHandler(this.btnDeny_Click);
+            // 
+            // btnPend
+            // 
+            this.btnPend.BackColor = System.Drawing.Color.Yellow;
+            this.btnPend.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnPend.Location = new System.Drawing.Point(86, 5);
+            this.btnPend.Name = "btnPend";
+            this.btnPend.Size = new System.Drawing.Size(80, 27);
+            this.btnPend.TabIndex = 1;
+            this.btnPend.Text = "保留";
+            this.btnPend.UseVisualStyleBackColor = false;
+            this.btnPend.Click += new System.EventHandler(this.btnPend_Click);
+            // 
+            // btnAgree
+            // 
+            this.btnAgree.BackColor = System.Drawing.Color.Lime;
+            this.btnAgree.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnAgree.Location = new System.Drawing.Point(3, 5);
+            this.btnAgree.Name = "btnAgree";
+            this.btnAgree.Size = new System.Drawing.Size(80, 27);
+            this.btnAgree.TabIndex = 0;
+            this.btnAgree.Text = "承認";
+            this.btnAgree.UseVisualStyleBackColor = false;
+            this.btnAgree.Click += new System.EventHandler(this.btnAgree_Click);
+            // 
             // FrmRequestInput
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInput/FrmRequestInput.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInput/FrmRequestInput.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInput/FrmRequestInput.cs	(revision 123)
@@ -456,8 +456,18 @@
 
                 // 文字色は一律黒
                 dgv1[tcol, trow].Style.ForeColor = Color.Black;
+
+                // 金額系入力時にIMEモードをオフにする
+                dgv1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+
             }
+            else
+            {
+                // コメント入力時にIMEモードをオンにする
+                dgv1.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
 
+            }
+
             this.dgv1.CellBeginEdit += dgv1_CellBeginEdit;
         }
 
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SalesConfirm/FrmSalesConfirm.Designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SalesConfirm/FrmSalesConfirm.Designer.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SalesConfirm/FrmSalesConfirm.Designer.cs	(revision 123)
@@ -71,7 +71,6 @@
             this.comboBox2 = new System.Windows.Forms.ComboBox();
             this.label2 = new System.Windows.Forms.Label();
             this.dgvMaster = new System.Windows.Forms.DataGridView();
-            this.btnEnd = new System.Windows.Forms.Button();
             this.EditStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.No = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.OrderersDivision = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -149,6 +148,7 @@
             this.ApprovalAuthority_10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ApprovalDate_10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ApprovalOrder_10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.btnEnd = new System.Windows.Forms.Button();
             this.panel1.SuspendLayout();
             this.groupBoxEx1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
@@ -462,20 +462,6 @@
             this.dgvMaster.Size = new System.Drawing.Size(1399, 474);
             this.dgvMaster.TabIndex = 7;
             // 
-            // btnEnd
-            // 
-            this.btnEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnEnd.BackColor = System.Drawing.Color.Magenta;
-            this.btnEnd.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnEnd.ForeColor = System.Drawing.Color.Black;
-            this.btnEnd.Location = new System.Drawing.Point(1287, 597);
-            this.btnEnd.Name = "btnEnd";
-            this.btnEnd.Size = new System.Drawing.Size(120, 30);
-            this.btnEnd.TabIndex = 20;
-            this.btnEnd.Text = "終　了";
-            this.btnEnd.UseVisualStyleBackColor = false;
-            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
-            // 
             // EditStatus
             // 
             dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
@@ -1031,6 +1017,20 @@
             this.ApprovalOrder_10.Name = "ApprovalOrder_10";
             this.ApprovalOrder_10.Visible = false;
             // 
+            // btnEnd
+            // 
+            this.btnEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnEnd.BackColor = System.Drawing.Color.Magenta;
+            this.btnEnd.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnEnd.ForeColor = System.Drawing.Color.Black;
+            this.btnEnd.Location = new System.Drawing.Point(1287, 597);
+            this.btnEnd.Name = "btnEnd";
+            this.btnEnd.Size = new System.Drawing.Size(120, 30);
+            this.btnEnd.TabIndex = 20;
+            this.btnEnd.Text = "終　了";
+            this.btnEnd.UseVisualStyleBackColor = false;
+            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
+            // 
             // FrmSalesConfirm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 15F);
@@ -1044,7 +1044,8 @@
             this.Font = new System.Drawing.Font("ＭＳ 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "FrmSalesConfirm";
-            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmSelectPayment_FormClosing);
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmSalesConfirm_FormClosing);
             this.Load += new System.EventHandler(this.FrmSalesConfirm_Load);
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SalesConfirm/FrmSalesConfirm.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SalesConfirm/FrmSalesConfirm.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SalesConfirm/FrmSalesConfirm.cs	(revision 123)
@@ -31,11 +31,14 @@
 {
     public partial class FrmSalesConfirm : Form
     {
+        #region 使用定義
         /// <summary>
         /// ロガー
         /// </summary>
         private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+        #endregion
 
+        #region 定数
         /// <summary>
         /// 承認状態
         /// </summary>
@@ -180,7 +183,6 @@
             ConstrSubPersonCode,
             ConstructionInstructor,
             DetailNo,
-            //ReqConstructionName,
             DetailString,
             ApprovalPersonName1,
             ApprovalPerson1,
@@ -236,15 +238,6 @@
         }
 
         /// <summary>
-        /// 請求先キー
-        /// </summary>
-        private class OrderersKey
-        {
-            public int OrderersDivision;
-            public int OrderersCode;
-        }
-
-        /// <summary>
         /// 入金請求先情報
         /// </summary>
         private class DepositOrderer
@@ -370,7 +363,6 @@
             public int OrderNo;
             public string ConstructionName;
             public string ConstructionNameRow;
-            //public string PaymentSchedule;
             public string BillCreationDate;
             public long BillPrice;
             public long TaxPrice;
@@ -432,12 +424,9 @@
 
         private List<DepositOrderer> depositOrderers;
 
-        /// <summary>編集フラグ</summary>
-        private bool isDirty = false;
+        ///// <summary>編集前のセルの内容</summary>
+        //private string oldCellValue = "";
 
-        /// <summary>編集前のセルの内容</summary>
-        private string oldCellValue = "";
-
         /// <summary>データ表示の対象営業期</summary>
         private int m_Select_TargetBusinessPeriod = 0;
 
@@ -450,13 +439,7 @@
         /// <summary>データ表示の対象担当者</summary>
         private int m_Select_TargetPerson = 0;
 
-        /// <summary>終了ボタン押下フラグ</summary>
-        private bool m_CloseingProcessOff = false;
-
-        /// <summary>データ表示の対象期間</summary>
-        private int m_TargetPeriod = 2;
-
-        // ユーザー情報
+        /// <summary> ユーザー情報</summary>
         private ClsSecurityPermission.UserInfo m_UserInfo = new ClsSecurityPermission.UserInfo()
         {
             m_Type = CommonDefine.SecurityRankPos.NormalAuthority,
@@ -464,12 +447,15 @@
             m_SecRange = ClsSecurityPermission.SecRangeType.InCharge
         };
 
-        // 部署コンボボックス用リスト
+        /// <summary> 部署コンボボックス用リスト</summary>
         public List<KeyValuePair<int, String>> listDepartment = new List<KeyValuePair<int, String>>();
 
-        // 担当者コンボボックス用リスト
+        /// <summary> 担当者コンボボックス用リスト</summary>
         public List<KeyValuePair<int, String>> listPerson = new List<KeyValuePair<int, String>>();
 
+        #endregion
+
+        #region コンストラクタ
         /// <summary>
         /// コンストラクタ
         /// </summary>
@@ -477,7 +463,9 @@
         {
             InitializeComponent();
         }
+        #endregion
 
+        #region フォームロード
         /// <summary>
         /// フォームロードイベント
         /// </summary>
@@ -487,25 +475,7 @@
         {
             try
             {
-                // 対象月コンボBOX設定
-                //IODepositData IoDd = new IODepositData();
-                //string now = DateTime.UtcNow.ToString("yyyy/MM");
-                //List<DepositData> lstDd = new List<DepositData>();
-                //List<string> lstDate = new List<string>();
 
-                //IoDd.SelectAction(" group by TargetDate order by TargetDate desc", ref lstDd);
-
-                //foreach (DepositData DdInfo in lstDd)
-                //{
-                //    lstDate.Add(DdInfo.TargetDate.Insert(4, "/"));
-                //}
-                //if (lstDate.IndexOf(now) < 0)
-                //{
-                //    lstDate.Insert(0, now);
-                //}
-
-                //comboBox1.Items.AddRange(lstDate.ToArray());
-
                 //////////////////////////////////////////////////////////////////////////////
                 // ■画面表示時のイベントを停止
                 //////////////////////////////////////////////////////////////////////////////
@@ -527,12 +497,12 @@
 
                 CommonMotions.GetPeriodYear(ref minval, ref maxval);
 
-                // 最大営業期（現在の営業期）
+                // 最大営業期
                 numericUpDown2.Maximum = maxval;
-                // 最小営業期（現在の営業期-過去年数）
+                // 最小営業期
                 numericUpDown2.Minimum = minval;
-                // 初期値は最大営業期
-                numericUpDown2.Value = maxval;
+                // 初期値は現在の営業期
+                numericUpDown2.Value = CommonMotions.SystemMasterData.BusinessPeriod;
 
 
                 // 対象月
@@ -593,8 +563,42 @@
                 numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown2_ValueChanged);
             }
         }
+        #endregion
 
+        #region フォームクローズ
         /// <summary>
+        /// フォームクローズイベント
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void FrmSalesConfirm_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            try
+            {
+                //if (m_CloseingProcessOff) return;
+
+                //if (isDirty)
+                //{
+                //    if (MessageBox.Show("データに変更があります、登録せずに終了してよろしいですか？。", "終了確認"
+                //                    , MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
+                //    {
+                //        e.Cancel = true;
+                //        return;
+                //    }
+                //}
+
+                // 前プロセスに戻る
+                ClsExcute.BackProcess();
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region 部署情報取得
+        /// <summary>
         /// 部署情報取得
         /// </summary>
         /// <param name="sender"></param>
@@ -626,6 +630,8 @@
         /// <param name="e"></param>
         private ArrayList getDepartmentListQuery(int iPersonCode)
         {
+            var depDb = new IODepositData();
+
             try
             {
                 var sql = new StringBuilder();
@@ -654,7 +660,6 @@
                 sql.Append("ORDER BY  ");
                 sql.Append("DEPM.DisplayOrder ASC");                                          // 部署マスタ．表示順（昇順）
 
-                var depDb = new IODepositData();
                 var data = new ArrayList();
                 if (!depDb.ExecuteReader(sql.ToString(), ref data)) return new ArrayList();
                 return data;
@@ -664,9 +669,16 @@
                 logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
                 return new ArrayList();
             }
+            finally
+            {
+                depDb.close();
+                depDb = null;
+            }
 
         }
+        #endregion
 
+        #region 担当者情報取得
         /// <summary>
         /// 担当者情報取得
         /// </summary>
@@ -699,6 +711,8 @@
         /// <param name="e"></param>
         private ArrayList getPersonListQuery(int iDepartmentCode)
         {
+            var depDb = new IODepositData();
+
             try
             {
                 var sql = new StringBuilder();
@@ -725,7 +739,6 @@
                 sql.Append("ORDER BY  ");
                 sql.Append("PERIM.DisplayOrder ASC");                                          // 部署マスタ．表示順（昇順）
 
-                var depDb = new IODepositData();
                 var data = new ArrayList();
                 if (!depDb.ExecuteReader(sql.ToString(), ref data)) return new ArrayList();
                 return data;
@@ -735,779 +748,62 @@
                 logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
                 return new ArrayList();
             }
-
-        }
-
-        /// <summary>
-        /// 発注者追加ボタン押下時のイベント
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void btnAddCmp_Click(object sender, EventArgs e)
-        {
-            try
-            {
-                ResetTargetDate();
-                var f = new FrmSelectRequest(FrmSelectRequest.OpenMode.AddCmp);
-                f.FormClosed += new FormClosedEventHandler(NotifyAddCmp_FormClosed);
-                f.ShowDialog(this);
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-        }
-
-        /// <summary>
-        /// 発注者削除ボタン押下時のイベント
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void btnDelCmp_Click(object sender, EventArgs e)
-        {
-            try
-            {
-                ResetTargetDate();
-                if (dgvMaster.RowCount <= 0)
-                    return;
-                var depositOrderer = FindDepositOrderer(dgvMaster.CurrentCell.RowIndex);
-                if (depositOrderer.DepositDetails.Count > 0)
-                {
-                    MessageBox.Show("すでに現場が登録されているため、削除できません。", "削除エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                    return;
-                }
-                // 保存前のものは削除する
-                if (depositOrderer.Added)
-                    depositOrderers.Remove(depositOrderer);
-                // 保存済みのものは削除フラグを付与
-                else
-                    depositOrderer.Deleted = true;
-                RemoveDepositOrdererRows(depositOrderer);
-                isDirty = true;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-        }
-
-        /// <summary>
-        /// 現場追加ボタン押下時のイベント
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void btnAddFld_Click(object sender, EventArgs e)
-        {
-            try
-            {
-                ResetTargetDate();
-                if (dgvMaster.RowCount <= 0)
-                    return;
-                // 現場が不明の場合のみ追加可能
-                if (!IsUnknownRow(dgvMaster.CurrentCell.RowIndex))
-                {
-                    MessageBox.Show("不明以外の行が選択されています。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                    return;
-                }
-                var depositOrderer = FindDepositOrderer(dgvMaster.CurrentCell.RowIndex);
-                var f = new FrmSelectRegField();
-                f.m_OrderersDivision = depositOrderer.OrderersDivision;
-                f.m_OrderersCode = depositOrderer.OrderersCode;
-                foreach (var depositDetail in depositOrderer.VisibleDepositDetails)
-                {
-                    f.m_lstMyField.Add(new FrmSelectRegField.MyFieldData()
-                    {
-                        OrderersDivision = depositOrderer.OrderersDivision,
-                        OrderersCode = depositOrderer.OrderersCode,
-                        RequestNo = depositDetail.RequestNo,
-                        OrderNo = depositDetail.OrderNo,
-                        ConstructionName = depositDetail.ConstructionName,
-                        ConstructionName_Raw = depositDetail.ConstructionNameRow,
-                        BillCreationDate = depositDetail.BillCreationDate,
-                        BillPrice = depositDetail.BillPrice,
-                        TaxPrice = depositDetail.TaxPrice,
-                        DepositAmount = depositDetail.DepositAmount,
-                        PersonCode = depositDetail.ApprovalPersonCode,
-                        DeleteFlg = false,
-                        ReadOnly = depositDetail.IsApprovedByStaff,
-                    });
-                }
-                // 不明行を渡す必要がある
-                var unknownIndex = DetectUnknownIndex(dgvMaster.CurrentCell.RowIndex);
-                var unknownCell = dgvMaster.Rows[unknownIndex].Cells;
-                f.m_lstMyField.Add(new FrmSelectRegField.MyFieldData()
-                {
-                    OrderersDivision = depositOrderer.OrderersDivision,
-                    OrderersCode = depositOrderer.OrderersCode,
-                    ConstructionName = CommonMotions.cnvString(unknownCell[(int)DispColumn.ConstructionName].Value),
-                    ConstructionName_Raw = CommonMotions.cnvString(unknownCell[(int)DispColumn.ConstructionName_Raw].Value),
-                    DepositAmount = CommonMotions.cnvLong(unknownCell[(int)DispColumn.DepositAmount].Value),
-                    ReadOnly = true,
-                });
-                f.FormClosed += new FormClosedEventHandler(NotifyAddFld_FormClosed);
-                f.ShowDialog(this);
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-        }
-
-        /// <summary>
-        /// 表示ボタン押下時のイベント
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void btnShow_Click(object sender, EventArgs e)
-        {
-            try
-            {
-                if (isDirty)
-                {
-                    if (MessageBox.Show("データに変更があります、登録せずに対象を変更してよろしいですか？。", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
-                    {
-                        return;
-                    }
-                }
-                dgvMaster.CellDoubleClick -= DataGridView_DoubleCellClick;
-                dgvMaster.CellEnter -= DataGridView_CellEnter;
-                dgvMaster.CellValueChanged -= DataGridView_CellValueChanged;
-                // グリッド表示
-                DisplayData();
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
             finally
             {
-                dgvMaster.CellDoubleClick += DataGridView_DoubleCellClick;
-                dgvMaster.CellEnter += DataGridView_CellEnter;
-                dgvMaster.CellValueChanged += DataGridView_CellValueChanged;
+                depDb.close();
+                depDb = null;
             }
-        }
 
-        /// <summary>
-        /// ×ボタン押下時のイベント
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void FrmSelectPayment_FormClosing(object sender, FormClosingEventArgs e)
-        {
-            try
-            {
-                if (m_CloseingProcessOff) return;
-
-                if (isDirty)
-                {
-                    if (MessageBox.Show("データに変更があります、登録せずに終了してよろしいですか？。", "終了確認"
-                                    , MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
-                    {
-                        e.Cancel = true;
-                        return;
-                    }
-                }
-
-                // 前プロセスに戻る
-                ClsExcute.BackProcess();
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
         }
+        #endregion
 
+        #region 入金請求先一覧表示
         /// <summary>
-        /// 終了ボタンクリック時のイベント
+        /// データを表示する。
         /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void btnEnd_Click(object sender, EventArgs e)
+        private void DisplayData()
         {
             try
             {
-                if (isDirty && MessageBox.Show("データに変更があります、登録せずに終了してよろしいですか？。", "終了確認", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
-                    return;
+                ///////////////////////////////////////////////////////////////////////////////////////
+                // 表示条件の取得
+                ///////////////////////////////////////////////////////////////////////////////////////
 
-                // 前プロセスに戻る
-                ClsExcute.BackProcess();
+                //　営業期
+                m_Select_TargetBusinessPeriod = CommonMotions.cnvInt(numericUpDown2.Value);
 
-                // クローズ処理をOFFにする。
-                m_CloseingProcessOff = true;
-
-                Close();
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-        }
-
-        /// <summary>
-        /// 登録ボタンクリック時のイベント
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void Registration_Click(object sender, EventArgs e)
-        {
-            dgvMaster.CellDoubleClick -= DataGridView_DoubleCellClick;
-            dgvMaster.CellEnter -= DataGridView_CellEnter;
-            dgvMaster.CellValueChanged -= DataGridView_CellValueChanged;
-            var ioDepositData = new IODepositData();
-            var ioDepositDataDetail = new IODepositDataDetail();
-            var ioDepositApprovalInfo = new IODepositApprovalInfo();
-            var ioRequestHead = new IORequestHead();
-            try
-            {
-                ResetTargetDate();
-                if (MessageBox.Show("表示中のデータを登録します。", "登録確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
-                    return;
-                if (!isDirty)
-                    return;
-                // 入力内容をチェック
-                foreach (var depositOrderer in depositOrderers)
+                //　対象月（月指定が選択されているかつ空白以外の場合のみ）
+                if (radioButton2.Checked && !CommonMotions.cnvInt(comboBox1.SelectedItem).Equals("　"))
                 {
-                    foreach (var deposit in depositOrderer.VisibleDeposits)
-                    {
-                        // 入金日入力済みで入金金額が入力されていない
-                        if (!string.IsNullOrEmpty(deposit.DepositDate)
-                            && !deposit.DepositAmountCash.HasValue
-                            && !deposit.DepositAmountBill.HasValue)
-                        {
-                            MessageBox.Show("入金日が登録されている行に入金金額が入力されていません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                            return;
-                        }
-                        // 入金金額入力済みで入金日が入力されていない
-                        if (string.IsNullOrEmpty(deposit.DepositDate)
-                            && (deposit.DepositAmountCash.HasValue
-                            || deposit.DepositAmountBill.HasValue))
-                        {
-                            MessageBox.Show("入金金額が登録されている行に入金日が入力されていません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                            return;
-                        }
-                    }
+                    m_Select_TargetDate = CommonMotions.cnvInt(comboBox1.SelectedItem);
                 }
-
-                ioDepositData.connect();
-                ioDepositData.beginTran();
-                ioDepositDataDetail.connect();
-                ioDepositDataDetail.beginTran();
-                ioDepositApprovalInfo.connect();
-                ioDepositApprovalInfo.beginTran();
-                ioRequestHead.connect();
-                ioRequestHead.beginTran();
-
-                // 登録処理
-                foreach (var depositOrderer in depositOrderers)
+                else
                 {
-                    // 入金データの登録
-                    foreach (var deposit in depositOrderer.Deposits)
-                    {
-                        // 削除処理
-                        if (deposit.Deleted)
-                        {
-                            var sql = String.Format(" where OrderersDivision = {0} and OrderersCode = {1} and TargetDate = {2} and SeqNo = {3} ",
-                                depositOrderer.OrderersDivision, depositOrderer.OrderersCode, m_Select_TargetDate, deposit.SeqNo);
-                            if (!ioDepositData.DeleteAction(sql))
-                                throw new Exception();
-                            continue;
-                        }
-                        var depositData = new DepositData()
-                        {
-                            OrderersDivision = depositOrderer.OrderersDivision,
-                            OrderersCode = depositOrderer.OrderersCode,
-                            TargetDate = m_Select_TargetDate.ToString(),
-                            SeqNo = deposit.SeqNo,
-                            DepositDate = DateTime.Parse(deposit.DepositDate),
-                            DepositAmountCash = deposit.DepositAmountCash.GetValueOrDefault(0),
-                            DepositAmountBill = deposit.DepositAmountBill.GetValueOrDefault(0),
-                        };
-                        // 登録処理
-                        if (deposit.Added)
-                        {
-                            if (!ioDepositData.InsertAction(depositData))
-                                throw new Exception();
-                        }
-                        // 更新処理
-                        else if (deposit.Editted)
-                        {
-                            var sql = String.Format(" where OrderersDivision = {0} and OrderersCode = {1} and TargetDate = {2} and SeqNo = {3} ",
-                                depositData.OrderersDivision, depositData.OrderersCode, depositData.TargetDate, depositData.SeqNo);
-                            if (!ioDepositData.UpdateAction(sql, depositData))
-                                throw new Exception();
-                        }
-                    }
-                    // 入金明細データの登録
-                    foreach (var depositDetail in depositOrderer.DepositDetails)
-                    {
-                        // 削除処理
-                        if (depositDetail.Deleted)
-                        {
-                            var sql = String.Format(" where OrderersDivision = {0} and OrderersCode = {1} and TargetDate = {2} and SeqNo = {3} and LineCount = {4} ",
-                                depositOrderer.OrderersDivision, depositOrderer.OrderersCode, m_Select_TargetDate, depositDetail.SeqNo, depositDetail.LineCount);
-                            if (!ioDepositDataDetail.DeleteAction(sql))
-                                throw new Exception();
-                            // 入金確認承認データもあわせて削除
-                            if (!ioDepositApprovalInfo.DeleteAction(sql))
-                                throw new Exception();
-                            // 入金明細データを削除した場合は、対応する請求合計データを割当未とする
-                            //sql = string.Format(" where RequestNo = {0} and OrderNo = {1} ",
-                            //    depositDetail.RequestNo, depositDetail.OrderNo);
-                            //var lstRtd = new List<RequestTotalData>();
-                            //if (!ioRequestTotalData.SelectAction(sql, ref lstRtd))
-                            //    throw new Exception();
-                            //foreach (var rtd in lstRtd)
-                            //{
-                            //    rtd.AssignedFlg = false;
-                            //    if (!ioRequestTotalData.UpdateAction("", rtd))
-                            //        throw new Exception();
-                            //}
-                            continue;
-                        }
-                        var depositDataDetail = new DepositDataDetail()
-                        {
-                            OrderersDivision = depositOrderer.OrderersDivision,
-                            OrderersCode = depositOrderer.OrderersCode,
-                            TargetDate = m_Select_TargetDate.ToString(),
-                            SeqNo = depositDetail.SeqNo,
-                            LineCount = depositDetail.LineCount,
-                            RequestNo = depositDetail.RequestNo,
-                            OrderNo = depositDetail.OrderNo,
-                            DepositAmount = depositDetail.DepositAmount,
-                            DiscountAmount = depositDetail.DiscountAmount,
-                            CnstrPrice = depositDetail.CnstrPrice,
-                            Fees = depositDetail.Fees,
-                            OtherAdjustments = depositDetail.OtherAdjustments,
-                            CarryAmount = depositDetail.CarryAmount,
-                            ApprovalPersonCode = depositDetail.ApprovalPersonCode,
-                        };
-                        var approvalDate = new DateTime(2000, 1, 1);
-                        if (DateTime.TryParse(depositDetail.ApprovalDate, out approvalDate))
-                        {
-                            depositDataDetail.ApprovalDate = approvalDate;
-                        }
-
-                        // 登録処理
-                        if (depositDetail.Added)
-                        {
-                            if (!ioDepositDataDetail.InsertAction(depositDataDetail))
-                                throw new Exception();
-                            // 入金明細データを追加した場合は、対応する請求合計データを割当済みとする
-                            //var sql = string.Format(" where RequestNo = {0} and OrderNo = {1} ",
-                            //    depositDataDetail.RequestNo, depositDataDetail.OrderNo);
-                            //var lstRtd = new List<RequestTotalData>();
-                            //if (!ioRequestTotalData.SelectAction(sql, ref lstRtd))
-                            //    throw new Exception();
-                            //foreach (var rtd in lstRtd)
-                            //{
-                            //    rtd.AssignedFlg = true;
-                            //    if (!ioRequestTotalData.UpdateAction("", rtd))
-                            //        throw new Exception();
-                            //}
-                            // 入金確認承認データの登録
-                            foreach (var approval in depositDetail.DepositApprovals)
-                            {
-                                var da = new DepositApprovalInfo()
-                                {
-                                    OrderersDivision = depositOrderer.OrderersDivision,
-                                    OrderersCode = depositOrderer.OrderersCode,
-                                    TargetDate = m_Select_TargetDate.ToString(),
-                                    SeqNo = depositDetail.SeqNo,
-                                    LineCount = depositDetail.LineCount,
-                                    ApprovalNo = approval.ApprovalNo,
-                                    ApprovalPerson = approval.ApprovalPerson,
-                                    ApprovalPersonName = approval.ApprovalPersonName,
-                                    ApprovalAuthority = approval.ApprovalAuthority,
-                                };
-                                DateTime ad = new DateTime(2000, 1, 1);
-                                if (DateTime.TryParse(approval.ApprovalDate, out ad))
-                                {
-                                    da.ApprovalDate = ad;
-                                }
-                                if (!ioDepositApprovalInfo.InsertAction(da))
-                                    throw new Exception();
-                            }
-                        }
-                        // 更新処理
-                        else
-                        {
-                            if (depositDetail.Editted)
-                            {
-                                if (!ioDepositDataDetail.UpdateAction("", depositDataDetail))
-                                    throw new Exception();
-                            }
-                            // 入金確認承認データの更新
-                            foreach (var approval in depositDetail.DepositApprovals)
-                            {
-                                if (approval.Editted)
-                                {
-                                    var da = new DepositApprovalInfo()
-                                    {
-                                        OrderersDivision = depositOrderer.OrderersDivision,
-                                        OrderersCode = depositOrderer.OrderersCode,
-                                        TargetDate = m_Select_TargetDate.ToString(),
-                                        SeqNo = depositDetail.SeqNo,
-                                        LineCount = depositDetail.LineCount,
-                                        ApprovalNo = approval.ApprovalNo,
-                                        ApprovalPerson = approval.ApprovalPerson,
-                                        ApprovalPersonName = approval.ApprovalPersonName,
-                                        ApprovalAuthority = approval.ApprovalAuthority,
-                                    };
-                                    DateTime ad = new DateTime(2000, 1, 1);
-                                    if (DateTime.TryParse(approval.ApprovalDate, out ad))
-                                    {
-                                        da.ApprovalDate = ad;
-                                    }
-                                    var sql = string.Format(" where OrderersDivision = {0} and OrderersCode = {1} and TargetDate = {2} and SeqNo = {3} and LineCount = {4} and ApprovalNo = {5}",
-                                        da.OrderersDivision, da.OrderersCode, da.TargetDate, da.SeqNo, da.LineCount, da.ApprovalNo);
-                                    if (!ioDepositApprovalInfo.UpdateAction(sql, da))
-                                        throw new Exception();
-                                }
-                            }
-                        }
-                    }
+                    m_Select_TargetDate = 0;
                 }
 
-                ioDepositData.commit();
-                ioDepositDataDetail.commit();
-                ioDepositApprovalInfo.commit();
-                ioRequestHead.commit();
+                //　部署
+                m_Select_TargetDepartment = CommonMotions.cnvInt(comboBox2.SelectedValue);
 
-                // グリッド表示
-                DisplayData();
-            }
-            catch (Exception ex)
-            {
-                ioDepositData.rollback();
-                ioDepositDataDetail.rollback();
-                ioDepositApprovalInfo.rollback();
-                ioRequestHead.rollback();
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-            finally
-            {
-                dgvMaster.CellDoubleClick += DataGridView_DoubleCellClick;
-                dgvMaster.CellEnter += DataGridView_CellEnter;
-                dgvMaster.CellValueChanged += DataGridView_CellValueChanged;
-                ioDepositData.close();
-                ioDepositDataDetail.close();
-                ioDepositApprovalInfo.close();
-                ioRequestHead.close();
-            }
-        }
+                //  担当者
+                m_Select_TargetPerson = CommonMotions.cnvInt(comboBox3.SelectedValue); ;
 
-        /// <summary>
-        /// セルダブルクリックイベント
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void DataGridView_DoubleCellClick(object sender, DataGridViewCellEventArgs e)
-        {
-            dgvMaster.CellDoubleClick -= DataGridView_DoubleCellClick;
-            dgvMaster.CellEnter -= DataGridView_CellEnter;
-            dgvMaster.CellValueChanged -= DataGridView_CellValueChanged;
-            try
-            {
-                //// 承認セル以外は無視
-                //if ((e.ColumnIndex == (int)DispColumn.PersonName) ||
-                //    (e.ColumnIndex == (int)DispColumn.ApprovalName_1) ||
-                //    (e.ColumnIndex == (int)DispColumn.ApprovalName_2) ||
-                //    (e.ColumnIndex == (int)DispColumn.ApprovalName_3) ||
-                //    (e.ColumnIndex == (int)DispColumn.ApprovalName_4) ||
-                //    (e.ColumnIndex == (int)DispColumn.ApprovalName_5) ||
-                //    (e.ColumnIndex == (int)DispColumn.ApprovalName_6) ||
-                //    (e.ColumnIndex == (int)DispColumn.ApprovalName_7) ||
-                //    (e.ColumnIndex == (int)DispColumn.ApprovalName_8) ||
-                //    (e.ColumnIndex == (int)DispColumn.ApprovalName_9) ||
-                //    (e.ColumnIndex == (int)DispColumn.ApprovalName_10))
-                //{
-                //    var cells = dgvMaster.Rows[e.RowIndex].Cells;
-                //    // 自分以外のセルは編集不可
-                //    if (CommonMotions.cnvInt(dgvMaster[e.ColumnIndex + 1, e.RowIndex].Value) != CommonMotions.LoginUserData.PersonCode)
-                //        return;
-                //    var depositOrderer = FindDepositOrderer(e.RowIndex);
-                //    var depositDetail = depositOrderer.FindDepositDetailByLineCount(CommonMotions.cnvInt(cells[(int)DispColumn.LineCount].Value));
-                //    // 担当者承認
-                //    if (e.ColumnIndex == (int)DispColumn.PersonName)
-                //    {
-                //        // 現場が不明な場合は承認不可
-                //        if (IsUnknownRow(e.RowIndex))
-                //        {
-                //            MessageBox.Show("現場が選択されていません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                //            return;
-                //        }
-                //        // 上位が承認済みの場合は編集不可
-                //        if (!depositDetail.IsApprovedByApprover)
-                //        {
-                //            if (!depositDetail.IsApprovedByStaff)
-                //                depositDetail.ApprovalDate = DateTime.Now.ToString("yyyy-MM-dd");
-                //            else
-                //                depositDetail.ApprovalDate = "";
-                //            depositDetail.Editted = true;
-                //        }
-                //    }
-                //    else
-                //    {
-                //        if (depositDetail.DepositApprovals.Count == 0)
-                //            return;
-                //        // 承認者に含まれるか確認
-                //        var approvalIndex = depositDetail.DepositApprovals.FindIndex(a => a.ApprovalPerson == CommonMotions.LoginUserData.PersonCode);
-                //        if (approvalIndex < 0)
-                //            return;
-                //        // 最終承認以外の場合
-                //        if (approvalIndex != depositDetail.DepositApprovals.Count - 1)
-                //        {
-                //            // 下位の承認者が承認済みかつ上位の承認者が未承認
-                //            var lower = true;
-                //            var i = 0;
-                //            var enableEdit = true;
-                //            foreach (var a in depositDetail.DepositApprovals)
-                //            {
-                //                if (a.ApprovalPerson == CommonMotions.LoginUserData.PersonCode)
-                //                {
-                //                    lower = false;
-                //                    approvalIndex = i;
-                //                }
-                //                else
-                //                {
-                //                    if (lower)
-                //                    {
-                //                        if (a.ApprovalDate == "")
-                //                        {
-                //                            enableEdit = false;
-                //                            break;
-                //                        }
-                //                    }
-                //                    else
-                //                    {
-                //                        if (a.ApprovalDate != "")
-                //                        {
-                //                            enableEdit = false;
-                //                            break;
-                //                        }
-                //                    }
-                //                }
-                //                i++;
-                //            }
-                //            if (!enableEdit)
-                //            {
-                //                if (approvalIndex != 0 && depositDetail.DepositApprovals[approvalIndex - 1].ApprovalDate == "")
-                //                {
-                //                    MessageBox.Show("直前の承認が実施されていないため、承認できません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                //                }
-                //                return;
-                //            }
-                //        }
-                //        var approval = depositDetail.DepositApprovals.ElementAt(approvalIndex);
-                //        // 未承認 → 承認
-                //        if (approval.ApprovalDate == "")
-                //        {
-                //            if (CalculateDifference(depositOrderer) != 0)
-                //            {
-                //                // 差額の確認
-                //                if (MessageBox.Show("入金金額と調整金額が一致しませんが承認してよろしいですか？。", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
-                //                    return;
-                //            }
-                //            approval.ApprovalDate = DateTime.Now.ToString("yyyy-MM-dd");
-                //        }
-                //        // 承認 → 未承認
-                //        else
-                //        {
-                //            approval.ApprovalDate = "";
-                //        }
-                //        approval.Editted = true;
-                //    }
-                //    var headerIndex = DetectHeaderIndex(e.RowIndex);
-                //    UpdateDepositOrdererRows(depositOrderer, headerIndex);
-                //    isDirty = true;
-                //}
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-            finally
-            {
-                dgvMaster.CellDoubleClick += DataGridView_DoubleCellClick;
-                dgvMaster.CellEnter += DataGridView_CellEnter;
-                dgvMaster.CellValueChanged += DataGridView_CellValueChanged;
-            }
-        }
+                ///////////////////////////////////////////////////////////////////////////////////////////
+                // データの取得
+                ///////////////////////////////////////////////////////////////////////////////////////////
 
-        /// <summary>
-        /// セル編集開始時のイベント
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void DataGridView_CellEnter(object sender, DataGridViewCellEventArgs e)
-        {
-            try
-            {
-                //if (dgvMaster.RowCount == 0)
-                //    return;
-                //oldCellValue = CommonMotions.cnvString(dgvMaster[e.ColumnIndex, e.RowIndex].Value);
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-        }
+                depositOrderers = new List<DepositOrderer>();
+                dgvMaster.Rows.Clear();
 
-        /// <summary>
-        /// セル編集完了時のイベント
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void DataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e)
-        {
-            dgvMaster.CellDoubleClick -= DataGridView_DoubleCellClick;
-            dgvMaster.CellEnter -= DataGridView_CellEnter;
-            dgvMaster.CellValueChanged -= DataGridView_CellValueChanged;
-            try
-            {
-                //if (dgvMaster.RowCount == 0)
-                //    return;
-                //var cells = dgvMaster.Rows[e.RowIndex].Cells;
-                //var cellValue = CommonMotions.cnvString(cells[e.ColumnIndex].Value);
-                //if (oldCellValue == cellValue)
-                //    return;
-                //var key = GetOrderersKey(e.RowIndex);
-                //var depositOrderer = FindDepositOrderer(key.OrderersDivision, key.OrderersCode);
-                //// 入金情報を編集
-                //if (e.ColumnIndex == (int)DispColumn.DepositAmountCash
-                //    || e.ColumnIndex == (int)DispColumn.DepositAmountBill
-                //    || e.ColumnIndex == (int)DispColumn.DepositDate)
-                //{
-                //    var deposit = depositOrderer.FindDepositBySeqNo(CommonMotions.cnvInt(cells[(int)DispColumn.SeqNo].Value));
-                //    if (deposit == null)
-                //    {
-                //        deposit = new Deposit()
-                //        {
-                //            Added = true,
-                //            SeqNo = depositOrderer.GetNextSeqNo(),
-                //        };
-                //        depositOrderer.Deposits.Add(deposit);
-                //    }
-                //    switch (e.ColumnIndex)
-                //    {
-                //        case (int)DispColumn.DepositAmountCash:
-                //            if (cellValue != "")
-                //                deposit.DepositAmountCash = CommonMotions.cnvInt(cellValue);
-                //            else
-                //                deposit.DepositAmountCash = null;
-                //            break;
-                //        case (int)DispColumn.DepositAmountBill:
-                //            if (cellValue != "")
-                //                deposit.DepositAmountBill = CommonMotions.cnvInt(cellValue);
-                //            else
-                //                deposit.DepositAmountBill = null;
-                //            break;
-                //        case (int)DispColumn.DepositDate:
-                //            DateTime dt;
-                //            if (DateTime.TryParse(cellValue, out dt))
-                //                deposit.DepositDate = dt.ToString("yyyy/MM/dd");
-                //            else
-                //                deposit.DepositDate = "";
-                //            break;
-                //    }
-                //    if (string.IsNullOrEmpty(deposit.DepositDate)
-                //        && !deposit.DepositAmountCash.HasValue
-                //        && !deposit.DepositAmountBill.HasValue)
-                //        deposit.Deleted = true;
-                //    deposit.Editted = true;
-                //    if (deposit.CanRemove)
-                //        depositOrderer.Deposits.Remove(deposit);
-                //}
-                //// 入金明細金額を編集
-                //else if (e.ColumnIndex == (int)DispColumn.DepositAmount
-                //    || e.ColumnIndex == (int)DispColumn.DiscountAmount
-                //    || e.ColumnIndex == (int)DispColumn.CnstrPrice
-                //    || e.ColumnIndex == (int)DispColumn.Fees
-                //    || e.ColumnIndex == (int)DispColumn.OtherAdjustments
-                //    || e.ColumnIndex == (int)DispColumn.CarryAmount)
-                //{
-                //    var depositDetail = depositOrderer.FindDepositDetailByLineCount(CommonMotions.cnvInt(cells[(int)DispColumn.LineCount].Value));
-                //    var amount = CommonMotions.cnvInt(cellValue);
-                //    switch (e.ColumnIndex)
-                //    {
-                //        case (int)DispColumn.DepositAmount:
-                //            depositDetail.DepositAmount = amount;
-                //            break;
-                //        case (int)DispColumn.DiscountAmount:
-                //            depositDetail.DiscountAmount = amount;
-                //            break;
-                //        case (int)DispColumn.CnstrPrice:
-                //            depositDetail.CnstrPrice = amount;
-                //            break;
-                //        case (int)DispColumn.Fees:
-                //            depositDetail.Fees = amount;
-                //            break;
-                //        case (int)DispColumn.OtherAdjustments:
-                //            depositDetail.OtherAdjustments = amount;
-                //            break;
-                //        case (int)DispColumn.CarryAmount:
-                //            depositDetail.CarryAmount = amount;
-                //            break;
-                //    }
-                //    depositDetail.Editted = true;
-                //}
-                //var headerIndex = DetectHeaderIndex(e.RowIndex);
-                //UpdateDepositOrdererRows(depositOrderer, headerIndex);
-                //dgvMaster.CurrentCell = dgvMaster[e.ColumnIndex, e.RowIndex];
-                //isDirty = true;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-            finally
-            {
-                dgvMaster.CellDoubleClick += DataGridView_DoubleCellClick;
-                dgvMaster.CellEnter += DataGridView_CellEnter;
-                dgvMaster.CellValueChanged += DataGridView_CellValueChanged;
-            }
-        }
+                depositOrderers = SelectDepositOrderers();
 
-        /// <summary>
-        /// 発注者追加ダイアログクローズ通知
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void NotifyAddCmp_FormClosed(object sender, FormClosedEventArgs e)
-        {
-            try
-            {
-                dgvMaster.CellDoubleClick -= DataGridView_DoubleCellClick;
-                dgvMaster.CellEnter -= DataGridView_CellEnter;
-                dgvMaster.CellValueChanged -= DataGridView_CellValueChanged;
-                var f = (FrmSelectRequest)sender;
-                // 発注者追加あり
-                if (f.m_AddCmpData.isEdit)
+                // 請求先単位で設定を行う。
+                dgvMaster.SuspendLayout();
+                for (var i = (int)DispColumn.ApprovalName_1; i <= (int)DispColumn.ApprovalName_10; i += 5)
+                    dgvMaster.Columns[i].Visible = false;
+                foreach (var deposit in depositOrderers)
                 {
-                    foreach (var h in depositOrderers)
-                    {
-                        if (h.Deleted)
-                            continue;
-                        // 表示済みの発注者の場合は何もしない
-                        if (h.OrderersDivision == f.m_AddCmpData.OrderersDivision
-                            && h.OrderersCode == f.m_AddCmpData.OrderersCode)
-                        {
-                            return;
-                        }
-                    }
-                    // データに追加
-                    var depositOrderer = new DepositOrderer();
-                    depositOrderer.Added = true;
-                    if (depositOrderers.Count == 0)
-                        depositOrderer.No = 1;
-                    else
-                        depositOrderer.No = depositOrderers.Last().No + 1;
-                    depositOrderer.OrderersDivision = f.m_AddCmpData.OrderersDivision;
-                    depositOrderer.OrderersCode = f.m_AddCmpData.OrderersCode;
-                    depositOrderer.OrderersName = f.m_AddCmpData.OrderersName;
-                    depositOrderers.Add(depositOrderer);
-                    AddDepositOrdererRows(depositOrderer, dgvMaster.Rows.Count);
-                    isDirty = true;
+                    AddDepositOrdererRows(deposit, dgvMaster.RowCount);
                 }
             }
             catch (Exception ex)
@@ -1516,132 +812,20 @@
             }
             finally
             {
-                dgvMaster.CellDoubleClick += DataGridView_DoubleCellClick;
-                dgvMaster.CellEnter += DataGridView_CellEnter;
-                dgvMaster.CellValueChanged += DataGridView_CellValueChanged;
-            }
-        }
-
-        /// <summary>
-        /// 現場登録ダイアログクローズ通知
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void NotifyAddFld_FormClosed(object sender, FormClosedEventArgs e)
-        {
-            try
-            {
-                dgvMaster.CellDoubleClick -= DataGridView_DoubleCellClick;
-                dgvMaster.CellEnter -= DataGridView_CellEnter;
-                dgvMaster.CellValueChanged -= DataGridView_CellValueChanged;
-                var f = (FrmSelectRegField)sender;
-                if (f.EndButton != DialogResult.OK)
-                    return;
-                var headerIndex = DetectHeaderIndex(dgvMaster.CurrentRow.Index);
-                var depositOrderer = FindDepositOrderer(dgvMaster.CurrentRow.Index);
-                foreach (var item in f.m_lstMyField)
+                dgvMaster.ResumeLayout();
+                if (dgvMaster.Rows.Count > 0)
                 {
-                    if (item.ConstructionName == "不明" && item.ConstructionName_Raw == "")
-                        continue;
-                    // 担当データのみを対象とする
-                    if (item.PersonCode != CommonMotions.LoginUserData.PersonCode)
-                        continue;
-                    var depositDetail = depositOrderer.DepositDetails.Find(d =>
-                        d.ConstructionName == item.ConstructionName && d.ConstructionNameRow == item.ConstructionName_Raw
-                    );
-                    // 追加・更新
-                    if (!item.DeleteFlg)
-                    {
-                        // 追加
-                        if (depositDetail == null)
-                        {
-                            depositDetail = new DepositDetail()
-                            {
-                                Added = true,
-                                Visible = true,
-                                SeqNo = 1,
-                                LineCount = depositOrderer.GetNextLineCount(),
-                                RequestNo = item.RequestNo,
-                                OrderNo = item.OrderNo,
-                                ConstructionName = item.ConstructionName,
-                                ConstructionNameRow = item.ConstructionName_Raw,
-                                DepartmentCode = item.DepartmentCode,
-                                BillCreationDate = item.BillCreationDate,
-                                BillPrice = item.BillPrice,
-                                TaxPrice = item.TaxPrice,
-                                DepositAmount = item.DepositAmount,
-                                ApprovalPersonCode = item.PersonCode,
-                                ApprovalPersonName = CommonMotions.LoginUserData.SealPrintName,
-                                ApprovalDate = "",
-                            };
-                            var defaultApproves = new List<ApproveData>();
-                            if (!SelectDefaultApprove(depositDetail.DepartmentCode, ref defaultApproves))
-                                return;
-                            foreach (var approve in defaultApproves)
-                            {
-                                var da = new DepositApproval()
-                                {
-                                    Added = true,
-                                    ApprovalPersonName = approve.Value,
-                                    ApprovalPerson = approve.Key,
-                                    ApprovalDate = "",
-                                    ApprovalNo = approve.Order,
-                                };
-                                depositDetail.DepositApprovals.Add(da);
-                            }
-                            depositOrderer.DepositDetails.Add(depositDetail);
-                        }
-                        // 更新
-                        else
-                        {
-                            depositDetail.BillPrice = item.BillPrice;
-                            depositDetail.TaxPrice = item.TaxPrice;
-                            depositDetail.DepositAmount = item.DepositAmount;
-                        }
-                    }
-                    // 削除
-                    else
-                    {
-                        if (depositDetail != null)
-                        {
-                            if (depositDetail.Added)
-                            {
-                                // 未存在のデータは削除
-                                depositOrderer.DepositDetails.Remove(depositDetail);
-                            }
-                            else
-                            {
-                                // 存在するデータは削除フラグを立てる
-                                depositDetail.Deleted = true;
-                            }
-                        }
-                    }
+                    dgvMaster.FirstDisplayedScrollingRowIndex = 0;
+                    dgvMaster.FirstDisplayedScrollingColumnIndex = 1;
+                    dgvMaster.CurrentCell = dgvMaster[1, 0];
                 }
-                UpdateDepositOrdererRows(depositOrderer, headerIndex);
-                isDirty = true;
             }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-            finally
-            {
-                dgvMaster.CellDoubleClick += DataGridView_DoubleCellClick;
-                dgvMaster.CellEnter += DataGridView_CellEnter;
-                dgvMaster.CellValueChanged += DataGridView_CellValueChanged;
-            }
         }
+        #endregion
 
+        #region 入金請求先一覧作成
+        #region 入金請求先一覧作成
         /// <summary>
-        /// 対象月コンボボックスを表示時点の設定月に戻す。
-        /// </summary>
-        private void ResetTargetDate()
-        {
-            var selectedDate = m_Select_TargetDate.ToString().Insert(4, "/");
-            numericUpDown2.Value = CommonMotions.cnvInt(selectedDate);
-        }
-
-        /// <summary>
         /// 入金請求先一覧を取得する。
         /// </summary>
         /// <returns></returns>
@@ -1781,480 +965,10 @@
             }
             return data;
         }
+        #endregion
 
+        #region 業者行を追加する
         /// <summary>
-        /// 入金データを取得する。
-        /// </summary>
-        /// <returns></returns>
-        private ArrayList SelectDepositDataAll()
-        {
-            try
-            {
-                var sql = new StringBuilder();
-                //sql.Append("SELECT ");
-                //sql.Append("DEP.ORDERERSDIVISION ");
-                //sql.Append(",DEP.ORDERERSCODE ");
-                //sql.Append(",DEP.TARGETDATE ");
-                //sql.Append(",DEP.SEQNO ");
-                //sql.Append(",DATE_FORMAT(DEP.DEPOSITDATE,'%Y/%m/%d') AS DEPOSITDATE ");
-                //sql.Append(",DEP.DEPOSITAMOUNTCASH ");
-                //sql.Append(",DEP.DEPOSITAMOUNTBILL ");
-                //sql.Append(",ORD.CORPORATESTATUSNAME ");
-                //sql.Append(",ORD.CORPORATESTATUSPOINT ");
-                //sql.Append(",ORD.ORDERERSNAME1 ");
-                //sql.Append(",ORD.ORDERERSNAME2 ");
-                //sql.Append("FROM ");
-                //sql.Append("DEPOSITDATA DEP ");
-                //sql.Append("INNER JOIN DEPOSITDATADETAIL DTL ON ");
-                //sql.Append("DEP.ORDERERSDIVISION = DTL.ORDERERSDIVISION ");
-                //sql.Append("AND	DEP.ORDERERSCODE = DTL.ORDERERSCODE ");
-                //sql.Append("AND DEP.TARGETDATE = DTL.TARGETDATE ");
-                //sql.Append("AND DTL.SEQNO = 1 ");
-                //sql.Append("LEFT JOIN ORDERERSMASTER ORD ON ");
-                //sql.Append("DEP.ORDERERSDIVISION = ORD.ORDERCOTEGORY ");
-                //sql.Append("AND DEP.ORDERERSCODE = ORD.ORDERERSCODE ");
-                //sql.Append("WHERE ");
-                //sql.Append("DTL.REQUESTNO IS NOT NULL ");
-                //sql.Append("ORDER BY  ");
-                //sql.Append("ORD.DISPLAYORDER ASC,DEP.DEPOSITDATE DESC,DEP.SEQNO ASC ");
-
-                sql.Append("SELECT DISTINCT ");
-                sql.Append("DEP.ORDERERSDIVISION ");
-                sql.Append(",DEP.ORDERERSCODE ");
-                sql.Append(",DEP.TARGETDATE ");
-                sql.Append(",DEP.SEQNO ");
-                sql.Append(",DATE_FORMAT(DEP.DEPOSITDATE,'%Y/%m/%d') AS DEPOSITDATE ");
-                sql.Append(",DEP.DEPOSITAMOUNTCASH ");
-                sql.Append(",DEP.DEPOSITAMOUNTBILL ");
-                sql.Append(",ORD.CORPORATESTATUSNAME ");
-                sql.Append(",ORD.CORPORATESTATUSPOINT ");
-                sql.Append(",ORD.ORDERERSNAME1 ");
-                sql.Append(",ORD.ORDERERSNAME2 ");
-                sql.Append("FROM ");
-                sql.Append("DEPOSITDATA DEP ");
-                sql.Append("INNER JOIN DEPOSITDATADETAIL DTL ON ");
-                sql.Append("DEP.ORDERERSDIVISION = DTL.ORDERERSDIVISION ");
-                sql.Append("AND DEP.ORDERERSCODE = DTL.ORDERERSCODE ");
-                sql.Append("AND DEP.TARGETDATE = DTL.TARGETDATE ");
-                sql.Append("AND DTL.SEQNO = 1 ");
-
-                sql.Append("AND DTL.APPROVALENDFLG = 1 ");
-
-                /////////////////////////////////////////////////////////////////////////////
-                //　検索条件(動的)START
-                /////////////////////////////////////////////////////////////////////////////
-
-                // 営業期
-                sql.AppendFormat("AND DEP.BusinessPeriod = {0} ", m_Select_TargetBusinessPeriod);
-
-                // 対象月
-                if (!m_Select_TargetDate.Equals(0))
-                {
-                    sql.AppendFormat("AND SUBSTRING( DEP.TARGETDATE, 5 ) = {0} ", m_Select_TargetDate.ToString("00"));
-                }
-
-                // 担当者
-                if (!m_Select_TargetPerson.Equals(0))
-                {
-                    sql.AppendFormat("AND DTL.APPROVALPERSONCODE = {0} ", m_Select_TargetPerson);
-                }
-
-                // 部署
-                if (!m_Select_TargetDepartment.Equals(0))
-                {
-                    sql.Append("INNER JOIN personinchargemaster PERIM ");
-                    sql.Append("ON DTL.APPROVALPERSONCODE = PERIM.PersonCode ");
-                    sql.AppendFormat("AND PERIM.DepartmentCode = {0} ", m_Select_TargetDepartment);
-                }
-                /////////////////////////////////////////////////////////////////////////////
-                //　検索条件(動的)END
-                /////////////////////////////////////////////////////////////////////////////
-
-                //sql.Append("INNER JOIN( ");
-                //sql.Append("SELECT ");
-                //sql.Append("ORDERERSDIVISION ");
-                //sql.Append(",ORDERERSCODE");
-                //sql.Append(",SUM(DEPOSITAMOUNT) AS DEPOSITAMOUNT_SUM ");
-                //sql.Append("FROM ");
-                //sql.Append("depositdata ");
-                //sql.Append("GROUP BY ");
-                //sql.Append("ORDERERSDIVISION ");
-                //sql.Append(",ORDERERSCODE ");
-                //sql.Append(") AS AMOUNT ");
-                sql.Append("INNER JOIN( ");
-                sql.Append("SELECT ");
-                sql.Append("ORDERERSDIVISION ");
-                sql.Append(",ORDERERSCODE");
-                sql.Append(",SUM(DEPOSITAMOUNT) AS DEPOSITAMOUNT_SUM ");
-                sql.Append("FROM ");
-                sql.Append("DEPOSITDATADETAIL DTL ");
-                sql.Append("GROUP BY ");
-                sql.Append("ORDERERSDIVISION ");
-                sql.Append(",ORDERERSCODE ");
-                sql.Append(") AS AMOUNT ");
-                sql.Append("ON AMOUNT.ORDERERSDIVISION = DEP.ORDERERSDIVISION ");
-                sql.Append("AND AMOUNT.ORDERERSCODE = DEP.ORDERERSCODE ");
-                sql.Append("LEFT JOIN ORDERERSMASTER ORD ON ");
-                sql.Append("DEP.ORDERERSDIVISION = ORD.ORDERCOTEGORY ");
-                sql.Append("AND DEP.ORDERERSCODE = ORD.ORDERERSCODE ");
-                sql.Append("WHERE ");
-                sql.Append("DTL.REQUESTNO IS NOT NULL ");
-
-                sql.Append("ORDER BY  ");
-                sql.Append("AMOUNT.DEPOSITAMOUNT_SUM DESC, DEP.DEPOSITDATE DESC");
-
-                //sql.Append("select ");
-                //sql.Append("Dep.OrderersDivision, ");
-                //sql.Append("Dep.OrderersCode, ");
-                //sql.Append("Dep.TargetDate, ");
-                //sql.Append("Dep.SeqNo, ");
-                //sql.Append("DATE_FORMAT(Dep.DepositDate, '%Y/%m/%d') as DepositDate, ");
-                //sql.Append("Dep.DepositAmountCash, ");
-                //sql.Append("Dep.DepositAmountBill, ");
-                //sql.Append("OdrM.CorporateStatusName, ");
-                //sql.Append("OdrM.CorporateStatusPoint, ");
-                //sql.Append("OdrM.OrderersName1, ");
-                //sql.Append("OdrM.OrderersName2 ");
-                //sql.Append("from DepositData Dep ");
-                //sql.Append("left outer join OrderersMaster as OdrM ");
-                //sql.Append("on OdrM. OrderCotegory = Dep.OrderersDivision and OdrM.OrderersCode = Dep.OrderersCode ");
-                //sql.Append("order by OdrM.DisplayOrder asc, Dep.DepositDate desc, Dep.SeqNo asc");
-
-                var depDb = new IODepositData();
-                var data = new ArrayList();
-                if (!depDb.ExecuteReader(sql.ToString(), ref data)) return new ArrayList();
-                return data;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                return new ArrayList();
-            }
-        }
-
-        /// <summary>
-        /// 入金明細データを取得する。
-        /// </summary>
-        /// <param name="orderersDivision"></param>
-        /// <param name="orderersCode"></param>
-        /// <returns></returns>
-        //private ArrayList SelectDepositDetailData(int orderersDivision, int orderersCode, int targetDate)
-        private ArrayList SelectDepositDetailData(int orderersDivision, int orderersCode)
-        {
-            try
-            {
-                var sql = new StringBuilder();
-                //sql.Append("select ");
-                //sql.Append("DepD.OrderersDivision, ");
-                //sql.Append("DepD.OrderersCode, ");
-                //sql.Append("DepD.TargetDate, ");
-                //sql.Append("DepD.SeqNo, ");
-
-                //sql.Append("null as DepositDate, ");
-                //sql.Append("null, ");
-                //sql.Append("null, ");
-                //sql.Append("null, ");
-                //sql.Append("null, ");
-                //sql.Append("null, ");
-                //sql.Append("null, ");
-
-                //sql.Append("DepD.LineCount, ");
-                //sql.Append("ifnull(DepD.RequestNo, 0) as RequestNo, ");
-                //sql.Append("ifnull(DepD.OrderNo, 0) as OrderNo, ");
-                //sql.Append("DepD.DepositAmount, ");
-                //sql.Append("ifnull(DepD.DiscountAmount, 0) as DiscountAmount, ");
-                //sql.Append("ifnull(DepD.CnstrPrice, 0) as CnstrPrice, ");
-                //sql.Append("ifnull(DepD.Fees, 0) as Fees, ");
-                //sql.Append("ifnull(DepD.OtherAdjustments, 0) as OtherAdjustments, ");
-                //sql.Append("ifnull(DepD.CarryAmount, 0) as CarryAmount, ");
-                //sql.Append("ifnull(DepD.ApprovalPersonCode, 0) as ApprovalPersonCode, ");
-                //sql.Append("ifnull(DepD.ApprovalDate, 0) as ApprovalDate, ");
-                //sql.Append("DepD.ApprovalEndFlg, ");
-                //sql.Append("PicM.SealPrintName, ");
-                //sql.Append("PicM2.DepartmentCode, ");
-                ////sql.Append("DATE_FORMAT(ReqT.BillCreationDate, '%Y/%m/%d') as BillCreationDate, ");
-                //sql.Append("'' as BillCreationDate, ");
-                ////sql.Append("ReqT.BillPrice, ");
-                ////sql.Append("ReqT.TaxPrice, ");
-                //sql.Append("0, ");
-                //sql.Append("0, ");
-                //sql.Append("Cbi.ConstructionCode, ");
-                //sql.Append("Cbi.ConstructionPersonCode, ");
-                //sql.Append("Cbi.ConstrSubPersonCode, ");
-                //sql.Append("Cbi.ConstructionInstructor, ");
-                //sql.Append("CbiD.DetailNo, ");
-                //sql.Append("CbiD.DetailString ");
-                //sql.Append("from DepositDataDetail DepD ");
-                //sql.Append("inner join PersonInChargeMaster as PicM ");
-                //sql.Append("on PicM.PersonCode = DepD.ApprovalPersonCode ");
-                ///////////////////////////////////////////////////////////////////////////////
-                ////　検索条件(動的)START
-                ///////////////////////////////////////////////////////////////////////////////
-                //// 担当者
-                //if (!m_Select_TargetPerson.Equals(0))
-                //{
-                //    sql.AppendFormat("AND PicM.PersonCode = {0} ", m_Select_TargetPerson);
-                //}
-
-                //// 部署
-                //if (!m_Select_TargetDepartment.Equals(0))
-                //{
-                //    sql.AppendFormat("AND PicM.DepartmentCode = {0} ", m_Select_TargetDepartment);
-                //}
-
-                //sql.Append("inner join DEPOSITDATA Dep ");
-                //sql.Append("on DepD.ORDERERSDIVISION = Dep.ORDERERSDIVISION ");
-                //sql.Append("and DepD.ORDERERSCODE = Dep.ORDERERSCODE ");
-                //sql.Append("and DepD.TARGETDATE = Dep.TARGETDATE ");
-                //sql.Append("and DepD.SEQNO = Dep.SEQNO ");
-
-                //// 営業期
-                //sql.AppendFormat("AND Dep.BusinessPeriod = {0} ", m_Select_TargetBusinessPeriod);
-
-                //// 対象月
-                //if (!m_Select_TargetDate.Equals(0))
-                //{
-                //    sql.AppendFormat("AND SUBSTRING( Dep.TARGETDATE, 5 ) = {0} ", m_Select_TargetDate.ToString("00"));
-                //}
-                ///////////////////////////////////////////////////////////////////////////////
-                ////　検索条件(動的)END
-                ///////////////////////////////////////////////////////////////////////////////
-                ////sql.Append("left outer join RequestTotalData as ReqT on ReqT.RequestNo = DepD.RequestNo and ReqT.OrderNo = DepD.OrderNo ");
-                //sql.Append("left outer join ConstructionBaseInfo as Cbi on Cbi.ConstructionCode = ReqT.RequestNo ");
-                //sql.Append("left outer join ConstructionBaseInfoDetail as CbiD on CbiD.ConstructionCode = Cbi.ConstructionCode and CbiD.DetailNo = 2 ");
-                //sql.Append("left outer join ConstructionBaseInfo as Cbi2 on Cbi2.ConstructionCode = Cbi.ConstructionCode ");
-                //sql.Append("left outer join PersonInChargeMaster as PicM2 on PicM2.PersonCode = Cbi2.ConstructionPersonCode ");
-                //sql.Append("left outer join ApprovalMaster as Am on Am.DepartmentCode = PicM2.DepartmentCode and Am.ApprovalCode = 3 and Am.ApprovalAuthority = 1 ");
-                //sql.AppendFormat("where DepD.OrderersDivision = {0} and DepD.OrderersCode = {1} and DepD.RequestNo is not null ", orderersDivision, orderersCode);
-                //sql.Append("group by ");
-                //sql.Append("DepD.OrderersDivision, ");
-                //sql.Append("DepD.OrderersCode, ");
-                //sql.Append("DepD.TargetDate, ");
-                //sql.Append("DepD.SeqNo, ");
-                //sql.Append("DepD.LineCount, ");
-                //sql.Append("DepD.RequestNo, ");
-                //sql.Append("DepD.OrderNo, ");
-                //sql.Append("DepD.DepositAmount, ");
-                //sql.Append("DepD.DiscountAmount, ");
-                //sql.Append("DepD.CnstrPrice, ");
-                //sql.Append("DepD.Fees, ");
-                //sql.Append("DepD.OtherAdjustments, ");
-                //sql.Append("DepD.CarryAmount, ");
-                //sql.Append("DepD.ApprovalPersonCode, ");
-                //sql.Append("DepD.ApprovalDate, ");
-                //sql.Append("DepD.ApprovalEndFlg, ");
-                //sql.Append("PicM.SealPrintName, ");
-                //sql.Append("PicM2.DepartmentCode, ");
-                //sql.Append("ReqT.BillCreationDate, ");
-                //sql.Append("ReqT.BillPrice, ");
-                //sql.Append("ReqT.TaxPrice, ");
-                //sql.Append("Cbi.ConstructionCode, ");
-                //sql.Append("Cbi.ConstructionPersonCode, ");
-                //sql.Append("Cbi.ConstrSubPersonCode, ");
-                //sql.Append("Cbi.ConstructionInstructor, ");
-                //sql.Append("CbiD.DetailNo, ");
-                //sql.Append("CbiD.DetailString ");
-                //sql.Append("order by DepD.OrderersDivision, DepD.OrderersCode, DepD.SeqNo, DepD.LineCount, DepD.RequestNo desc, DepD.OrderNo desc ");
-                sql.Append("SELECT ");
-                sql.Append("DepD.OrderersDivision, ");
-                sql.Append("DepD.OrderersCode, ");
-                sql.Append("DepD.TargetDate, ");
-                sql.Append("DepD.SeqNo, ");
-
-                sql.Append("null as DepositDate, ");
-                sql.Append("null, ");
-                sql.Append("null, ");
-                sql.Append("null, ");
-                sql.Append("null, ");
-                sql.Append("null, ");
-                sql.Append("null, ");
-
-                sql.Append("DepD.LineCount, ");
-                sql.Append("ifnull(DepD.RequestNo, 0) as RequestNo, ");
-                sql.Append("ifnull(DepD.OrderNo, 0) as OrderNo, ");
-                sql.Append("DepD.DepositAmount, ");
-                sql.Append("ifnull(DepD.DiscountAmount, 0) as DiscountAmount, ");
-                sql.Append("ifnull(DepD.CnstrPrice, 0) as CnstrPrice, ");
-                sql.Append("ifnull(DepD.Fees, 0) as Fees, ");
-                sql.Append("ifnull(DepD.OtherAdjustments, 0) as OtherAdjustments, ");
-                sql.Append("ifnull(DepD.CarryAmount, 0) as CarryAmount, ");
-                sql.Append("ifnull(DepD.ApprovalPersonCode, 0) as ApprovalPersonCode, ");
-                sql.Append("ifnull(DepD.ApprovalDate, 0) as ApprovalDate, ");
-                sql.Append("DepD.ApprovalEndFlg, ");
-                sql.Append("PicM.SealPrintName, ");
-                sql.Append("0, ");                                  //sql.Append("PicM2.DepartmentCode, ");
-                sql.Append("'' as BillCreationDate, ");             //sql.Append("DATE_FORMAT(ReqT.BillCreationDate, '%Y/%m/%d') as BillCreationDate, ");
-                sql.Append("0, ");                                  //sql.Append("ReqT.BillPrice, ");
-                sql.Append("0, ");                                  //sql.Append("ReqT.TaxPrice, ");
-                sql.Append("0, ");                                  //sql.Append("Cbi.ConstructionCode, ");
-                sql.Append("0, ");                                  //sql.Append("Cbi.ConstructionPersonCode, ");
-                sql.Append("0, ");                                  //sql.Append("Cbi.ConstrSubPersonCode, ");
-                sql.Append("0, ");                                  //sql.Append("Cbi.ConstructionInstructor, ");
-                sql.Append("0, ");                                 //sql.Append("CbiD.DetailNo, ");
-                sql.Append("ReqH.ReqConstructionName as DetailString ");           //sql.Append("CbiD.DetailString ");
-                sql.Append("FROM ");
-                sql.Append("DepositDataDetail AS DepD ");
-                sql.Append("INNER JOIN PersonInChargeMaster AS PicM ");
-                sql.Append("ON PicM.PersonCode = DepD.ApprovalPersonCode ");
-                /////////////////////////////////////////////////////////////////////////////
-                //　検索条件(動的)START
-                /////////////////////////////////////////////////////////////////////////////
-                // 担当者
-                if (!m_Select_TargetPerson.Equals(0))
-                {
-                    sql.AppendFormat("AND PicM.PersonCode = {0} ", m_Select_TargetPerson);
-                }
-
-                // 部署
-                if (!m_Select_TargetDepartment.Equals(0))
-                {
-                    sql.AppendFormat("AND PicM.DepartmentCode = {0} ", m_Select_TargetDepartment);
-                }
-
-                sql.Append("INNER join DEPOSITDATA Dep ");
-                sql.Append("ON DepD.ORDERERSDIVISION = Dep.ORDERERSDIVISION ");
-                sql.Append("AND DepD.ORDERERSCODE = Dep.ORDERERSCODE ");
-                sql.Append("AND DepD.TARGETDATE = Dep.TARGETDATE ");
-                sql.Append("AND DepD.SEQNO = Dep.SEQNO ");
-
-                // 営業期
-                sql.AppendFormat("AND Dep.BusinessPeriod = {0} ", m_Select_TargetBusinessPeriod);
-
-                // 対象月
-                if (!m_Select_TargetDate.Equals(0))
-                {
-                    sql.AppendFormat("AND SUBSTRING( Dep.TARGETDATE, 5 ) = {0} ", m_Select_TargetDate.ToString("00"));
-                }
-                /////////////////////////////////////////////////////////////////////////////
-                //　検索条件(動的)END
-                /////////////////////////////////////////////////////////////////////////////
-                //sql.Append("left outer join RequestTotalData as ReqT on ReqT.RequestNo = DepD.RequestNo and ReqT.OrderNo = DepD.OrderNo ");
-                sql.Append("LEFT OUTER JOIN RequestHead AS ReqH ON DepD.RequestNo = ReqH.RequestNo ");
-                //sql.Append("left outer join ConstructionBaseInfo as Cbi on Cbi.ConstructionCode = ReqT.RequestNo ");
-                //sql.Append("left outer join ConstructionBaseInfoDetail as CbiD on CbiD.ConstructionCode = Cbi.ConstructionCode and CbiD.DetailNo = 2 ");
-                //sql.Append("left outer join ConstructionBaseInfo as Cbi2 on Cbi2.ConstructionCode = Cbi.ConstructionCode ");
-                //sql.Append("left outer join PersonInChargeMaster as PicM2 on PicM2.PersonCode = Cbi2.ConstructionPersonCode ");
-                //sql.Append("left outer join ApprovalMaster as Am on Am.DepartmentCode = PicM2.DepartmentCode and Am.ApprovalCode = 3 and Am.ApprovalAuthority = 1 ");
-                sql.Append("LEFT OUTER JOIN ApprovalMaster AS Am ON PicM.DepartmentCode = Am.DepartmentCode AND Am.ApprovalCode = 3 AND Am.ApprovalAuthority = 1 ");
-                sql.AppendFormat("WHERE DepD.OrderersDivision = {0} and DepD.OrderersCode = {1} and DepD.RequestNo IS NOT NULL ", orderersDivision, orderersCode);
-                sql.Append("GROUP BY ");
-                sql.Append("DepD.OrderersDivision, ");
-                sql.Append("DepD.OrderersCode, ");
-                sql.Append("DepD.TargetDate, ");
-                sql.Append("DepD.SeqNo, ");
-                sql.Append("DepD.LineCount, ");
-                sql.Append("DepD.RequestNo, ");
-                sql.Append("DepD.OrderNo, ");
-                sql.Append("DepD.DepositAmount, ");
-                sql.Append("DepD.DiscountAmount, ");
-                sql.Append("DepD.CnstrPrice, ");
-                sql.Append("DepD.Fees, ");
-                sql.Append("DepD.OtherAdjustments, ");
-                sql.Append("DepD.CarryAmount, ");
-                sql.Append("DepD.ApprovalPersonCode, ");
-                sql.Append("DepD.ApprovalDate, ");
-                sql.Append("DepD.ApprovalEndFlg, ");
-                sql.Append("PicM.SealPrintName, ");
-                sql.Append("ReqH.ReqConstructionName ");
-                //sql.Append("PicM2.DepartmentCode, ");
-                //sql.Append("ReqT.BillCreationDate, ");
-                //sql.Append("ReqT.BillPrice, ");
-                //sql.Append("ReqT.TaxPrice, ");
-                //sql.Append("Cbi.ConstructionCode, ");
-                //sql.Append("Cbi.ConstructionPersonCode, ");
-                //sql.Append("Cbi.ConstrSubPersonCode, ");
-                //sql.Append("Cbi.ConstructionInstructor, ");
-                //sql.Append("CbiD.DetailNo, ");
-                //sql.Append("CbiD.DetailString ");
-                sql.Append("ORDER BY DepD.OrderersDivision, DepD.OrderersCode, DepD.SeqNo, DepD.LineCount, DepD.RequestNo DESC, DepD.OrderNo DESC ");
-                var depDb = new IODepositData();
-                var data = new ArrayList();
-                if (!depDb.ExecuteReader(sql.ToString(), ref data)) return new ArrayList();
-                return data;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                return new ArrayList();
-            }
-        }
-
-        /// <summary>
-        /// 入金確認承認データより、承認者を取得する。
-        /// </summary>
-        /// <param name="orderersDivision"></param>
-        /// <param name="orderersCode"></param>
-        /// <param name="seqNo"></param>
-        /// <param name="lineCount"></param>
-        /// <param name="depositApprovals"></param>
-        /// <returns></returns>
-        private bool SelectApprove(int orderersDivision, int orderersCode, int seqNo, int lineCount, ref List<DepositApprovalInfo> depositApprovals)
-        {
-            IODepositApprovalInfo ioDai = new IODepositApprovalInfo();
-            try
-            {
-                var sql = string.Format(" where OrderersDivision = {0} and OrderersCode = {1} and TargetDate = {2} and SeqNo = {3} and LineCount = {4} order by ApprovalNo",
-                    orderersDivision, orderersCode, m_Select_TargetDate.ToString(), seqNo, lineCount);
-                if (!ioDai.SelectAction(sql, ref depositApprovals))
-                    return false;
-                return true;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
-            }
-            finally
-            {
-                ioDai = null;
-            }
-        }
-
-        /// <summary>
-        /// 業者行の内容を更新する。
-        /// </summary>
-        /// <param name="depositOrderer"></param>
-        /// <param name="position"></param>
-        private void UpdateDepositOrdererRows(DepositOrderer depositOrderer, int position)
-        {
-            dgvMaster.SuspendLayout();
-            var x = dgvMaster.FirstDisplayedScrollingColumnIndex;
-            var y = dgvMaster.FirstDisplayedScrollingRowIndex;
-            try
-            {
-                RemoveDepositOrdererRows(depositOrderer);
-                AddDepositOrdererRows(depositOrderer, position);
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-            finally
-            {
-                dgvMaster.FirstDisplayedScrollingColumnIndex = x;
-                dgvMaster.FirstDisplayedScrollingRowIndex = y;
-                dgvMaster.ResumeLayout();
-            }
-        }
-
-        /// <summary>
-        /// 業者行を削除する。
-        /// </summary>
-        /// <param name="depositOrderer"></param>
-        private void RemoveDepositOrdererRows(DepositOrderer depositOrderer)
-        {
-            for (var i = dgvMaster.RowCount - 1; i >= 0; i--)
-            {
-                var cells = dgvMaster.Rows[i].Cells;
-                if (CommonMotions.cnvInt(cells[(int)DispColumn.OrderersDivision].Value) == depositOrderer.OrderersDivision
-                    && CommonMotions.cnvInt(cells[(int)DispColumn.OrderersCode].Value) == depositOrderer.OrderersCode)
-                {
-                    dgvMaster.Rows.RemoveAt(i);
-                }
-            }
-        }
-
-        /// <summary>
         /// 業者行を追加する。
         /// </summary>
         /// <param name="depositOrderer"></param>
@@ -2276,12 +990,7 @@
                 ordererRow.Cells[(int)DispColumn.OrderersDivision].Value = depositOrderer.OrderersDivision;
                 ordererRow.Cells[(int)DispColumn.OrderersCode].Value = depositOrderer.OrderersCode;
                 ordererRow.Cells[(int)DispColumn.OrderersName].Value = depositOrderer.OrderersName;
-                if (depositOrderer.VisibleDepositDetails.Count == 0)
-                {
-                    ordererRow.Cells[(int)DispColumn.DepositDate].ReadOnly = false;
-                    ordererRow.Cells[(int)DispColumn.DepositAmountCash].ReadOnly = false;
-                    ordererRow.Cells[(int)DispColumn.DepositAmountBill].ReadOnly = false;
-                }
+
                 // 入金情報の表示
                 var index = 0;
                 foreach (var deposit in depositOrderer.VisibleDeposits)
@@ -2295,13 +1004,6 @@
                         SetPrice(row.Cells, (int)DispColumn.DepositAmountCash, deposit.DepositAmountCash.Value);
                     if (deposit.DepositAmountBill.HasValue)
                         SetPrice(row.Cells, (int)DispColumn.DepositAmountBill, deposit.DepositAmountBill.Value);
-                    // 編集設定
-                    if (CanEditDeposit(depositOrderer))
-                    {
-                        row.Cells[(int)DispColumn.DepositDate].ReadOnly = false;
-                        row.Cells[(int)DispColumn.DepositAmountCash].ReadOnly = false;
-                        row.Cells[(int)DispColumn.DepositAmountBill].ReadOnly = false;
-                    }
                     index++;
                 }
                 index = 0;
@@ -2343,18 +1045,8 @@
                         dgvMaster.Columns[j].Visible = true;
                         j += 5;
                     }
-                    if (CanEditDepositDetail(depositDetail))
-                    {
-                        row.Cells[(int)DispColumn.DepositAmount].ReadOnly = false;
-                        row.Cells[(int)DispColumn.DiscountAmount].ReadOnly = false;
-                        row.Cells[(int)DispColumn.CnstrPrice].ReadOnly = false;
-                        row.Cells[(int)DispColumn.Fees].ReadOnly = false;
-                        row.Cells[(int)DispColumn.OtherAdjustments].ReadOnly = false;
-                        row.Cells[(int)DispColumn.CarryAmount].ReadOnly = false;
-                    }
                     index++;
                 }
-                //AddUnknownRow(depositOrderer, position);
                 AddBlankRow(depositOrderer, position);
                 AddTotalRow(depositOrderer, position);
             }
@@ -2363,176 +1055,104 @@
                 logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
             }
         }
+        #endregion
 
-        /// <summary>
-        /// データを表示する。
-        /// </summary>
-        private void DisplayData()
-        {
-            try
-            {
-                //// 選択対象月の退避
-                //m_Select_TargetDate = CommonMotions.cnvInt(CommonMotions.cnvString(numericUpDown2.Value).Replace("/", ""));
-                //depositOrderers = new List<DepositOrderer>();
-                //dgvMaster.Rows.Clear();
-                //// データの取得
-                //depositOrderers = SelectDepositOrderers();
-                //// 請求先単位で設定を行う。
-                //dgvMaster.SuspendLayout();
-                //for (var i = (int)DispColumn.ApprovalName_1; i <= (int)DispColumn.ApprovalName_10; i += 5)
-                //    dgvMaster.Columns[i].Visible = false;
-                //foreach (var deposit in depositOrderers)
-                //{
-                //    AddDepositOrdererRows(deposit, dgvMaster.RowCount);
-                //}
-                //isDirty = false;
-                //ControlButton();
+        //#region 編集可否判定（入金データ）
+        //private bool CanEditDeposit(DepositOrderer depositOrderer)
+        //{
+        //    // 担当者の場合
+        //    if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.NormalAuthority)
+        //    {
+        //        // 承認済みなら編集不可
+        //        if (depositOrderer.HasApprovedByApprover)
+        //            return false;
+        //    }
+        //    // 所属長、統括者の場合
+        //    else if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.LimitedAuthority || m_UserInfo.m_Type == CommonDefine.SecurityRankPos.FreeAuthority)
+        //    {
+        //        if (depositOrderer.HasApprovedByLastApprover)
+        //            return false;
+        //    }
+        //    // 特別権限の場合
+        //    else if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.SpecialAuthority)
+        //    {
+        //        if (depositOrderer.HasApprovedByLastApprover)
+        //            return false;
+        //    }
+        //    return m_UserInfo.CanEditDeposit;
+        //}
+        //#endregion
 
-                ///////////////////////////////////////////////////////////////////////////////////////
-                // 表示条件の取得
-                ///////////////////////////////////////////////////////////////////////////////////////
+        #region 編集可否判定（入金明細データ）
+        #region 編集可否判定
+        //private bool CanEditDepositDetail(DepositDetail depositDetail)
+        //{
+        //    // 担当者の場合
+        //    if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.NormalAuthority)
+        //    {
+        //        // 承認済みなら編集不可
+        //        if (depositDetail.IsApprovedByStaff || depositDetail.IsApprovedByApprover)
+        //            return false;
+        //    }
+        //    // 所属長、統括者の場合
+        //    else if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.LimitedAuthority || m_UserInfo.m_Type == CommonDefine.SecurityRankPos.FreeAuthority)
+        //    {
+        //        // 上位の承認者でなければ編集不可
+        //        if (!IsUpperLevelApprover(depositDetail))
+        //            return false;
+        //    }
+        //    // 特別権限の場合
+        //    else if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.SpecialAuthority)
+        //    {
+        //        if (depositDetail.IsApprovedByLastApprover)
+        //            return false;
+        //    }
+        //    return m_UserInfo.CanEditDepositDetail;
+        //}
+        #endregion
 
-                //　営業期
-                m_Select_TargetBusinessPeriod = CommonMotions.cnvInt(numericUpDown2.Value);
+        #region 上位承認者存在チェック
+        //private bool IsUpperLevelApprover(DepositDetail depositDetail)
+        //{
+        //    if (depositDetail.DepositApprovals.Count == 0)
+        //        return true;
+        //    var lastApproverIndex = depositDetail.DepositApprovals.FindLastIndex(da => da.ApprovalDate != "");
+        //    var myIndex = depositDetail.DepositApprovals.FindLastIndex(da => da.ApprovalPerson == CommonMotions.LoginUserData.PersonCode);
+        //    return myIndex > lastApproverIndex;
+        //}
+        #endregion
+        #endregion
 
-                //　対象月（月指定が選択されているかつ空白以外の場合のみ）
-                if (radioButton2.Checked && !CommonMotions.cnvInt(comboBox1.SelectedItem).Equals("　"))
-                {
-                    m_Select_TargetDate = CommonMotions.cnvInt(comboBox1.SelectedItem);
-                }
-                else
-                {
-                    m_Select_TargetDate = 0;
-                }
-
-                //　部署
-                m_Select_TargetDepartment = CommonMotions.cnvInt(comboBox2.SelectedValue);
-
-                //  担当者
-                m_Select_TargetPerson = CommonMotions.cnvInt(comboBox3.SelectedValue); ;
-
-                ///////////////////////////////////////////////////////////////////////////////////////////
-                // データの取得
-                ///////////////////////////////////////////////////////////////////////////////////////////
-
-                depositOrderers = new List<DepositOrderer>();
-                dgvMaster.Rows.Clear();
-
-                depositOrderers = SelectDepositOrderers();
-
-                // 請求先単位で設定を行う。
-                dgvMaster.SuspendLayout();
-                for (var i = (int)DispColumn.ApprovalName_1; i <= (int)DispColumn.ApprovalName_10; i += 5)
-                    dgvMaster.Columns[i].Visible = false;
-                foreach (var deposit in depositOrderers)
-                {
-                    AddDepositOrdererRows(deposit, dgvMaster.RowCount);
-                }
-                isDirty = false;
-                ControlButton();
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-            }
-            finally
-            {
-                dgvMaster.ResumeLayout();
-                if (dgvMaster.Rows.Count > 0)
-                {
-                    dgvMaster.FirstDisplayedScrollingRowIndex = 0;
-                    dgvMaster.FirstDisplayedScrollingColumnIndex = 1;
-                    dgvMaster.CurrentCell = dgvMaster[1, 0];
-                }
-            }
-        }
-
+        #region 編集用空白行追加
         /// <summary>
-        /// 不明行かを判定する。
+        /// 編集用空白行追加
         /// </summary>
         /// <param name="index"></param>
-        /// <returns></returns>
-        private bool IsUnknownRow(int index)
+        private void AddBlankRow(DepositOrderer depositOrderer, int index)
         {
-            //            var cells = dgvMaster.Rows[index].Cells;
-            //            return CommonMotions.cnvString(cells[(int)DispColumn.ConstructionName].Value) == "不明"
-            //                && CommonMotions.cnvString(cells[(int)DispColumn.ConstructionName_Raw].Value) == "";
-            return false;
-        }
-
-        /// <summary>
-        /// 空白行かを判定する。
-        /// </summary>
-        /// <param name="index"></param>
-        /// <returns></returns>
-        private bool IsBlankRow(int index)
-        {
-            var cells = dgvMaster.Rows[index].Cells;
-            return CommonMotions.cnvString(cells[(int)DispColumn.SeqNo]) == ""
-                && CommonMotions.cnvString(cells[(int)DispColumn.LineCount]) == ""
-                && CommonMotions.cnvString(cells[(int)DispColumn.ConstructionName].Value) == ""
-                && CommonMotions.cnvString(cells[(int)DispColumn.ConstructionName_Raw].Value) == "";
-        }
-
-        /// <summary>
-        /// 不明行の設定を行う。
-        /// </summary>
-        /// <param name="index"></param>
-        private void AddUnknownRow(DepositOrderer depositOrderer, int index)
-        {
-            // 不明行金額の計算
-            long depositAmountCash = 0;
-            long depositAmountBill = 0;
-            foreach (var deposit in depositOrderer.Deposits)
+            var headerIndex = DetectHeaderIndex(index);
+            var headerCells = dgvMaster.Rows[headerIndex].Cells;
+            var blankIndex = dgvMaster.RowCount;
+            for (var i = headerIndex; i < dgvMaster.RowCount; i++)
             {
-                depositAmountCash += deposit.DepositAmountCash.GetValueOrDefault(0);
-                depositAmountBill += deposit.DepositAmountBill.GetValueOrDefault(0);
+                var cells = dgvMaster.Rows[i].Cells;
+                if (CommonMotions.cnvInt(headerCells[(int)DispColumn.OrderersDivision].Value) != CommonMotions.cnvInt(cells[(int)DispColumn.OrderersDivision].Value)
+                    || CommonMotions.cnvInt(headerCells[(int)DispColumn.OrderersCode].Value) != CommonMotions.cnvInt(cells[(int)DispColumn.OrderersCode].Value))
+                {
+                    blankIndex = i;
+                    break;
+                }
             }
-            long depositAmount = 0;
-            foreach (var depositDetail in depositOrderer.DepositDetails)
-            {
-                depositAmount += depositDetail.DepositAmount;
-            }
-            long unknownAmount = (depositAmountCash + depositAmountBill) - depositAmount;
-            if (unknownAmount <= 0)
-                return;
-            // 不明行は入金明細の一番下に作成する
-            var unknownIndex = index + depositOrderer.VisibleDepositDetails.Count;
-            // 入金明細が入金より多い場合は不明行を追加
-            if (depositOrderer.VisibleDepositDetails.Count >= depositOrderer.VisibleDeposits.Count)
-            {
-                dgvMaster.Rows.Insert(unknownIndex);
-                dgvMaster.Rows[unknownIndex].ReadOnly = true;
-            }
-            var row = dgvMaster.Rows[unknownIndex];
-            row.Cells[(int)DispColumn.OrderersDivision].Value = depositOrderer.OrderersDivision;
-            row.Cells[(int)DispColumn.OrderersCode].Value = depositOrderer.OrderersCode;
-            //row.Cells[(int)DispColumn.ConstructionName].Value = "不明";
-            // 編集設定
-            var readOnly = !CanEditDeposit(depositOrderer);
-            row.Cells[(int)DispColumn.DepositDate].ReadOnly = readOnly;
-            row.Cells[(int)DispColumn.DepositAmountCash].ReadOnly = readOnly;
-            row.Cells[(int)DispColumn.DepositAmountBill].ReadOnly = readOnly;
-            SetPrice(row.Cells, (int)DispColumn.DepositAmount, unknownAmount);
-        }
+            dgvMaster.Rows.Insert(blankIndex);
+            var row = dgvMaster.Rows[blankIndex];
+            row.ReadOnly = true;
+            row.Cells[(int)DispColumn.OrderersDivision].Value = headerCells[(int)DispColumn.OrderersDivision].Value;
+            row.Cells[(int)DispColumn.OrderersCode].Value = headerCells[(int)DispColumn.OrderersCode].Value;
 
-        private long CalculateDifference(DepositOrderer depositOrderer)
-        {
-            long depositAmountCash = 0;
-            long depositAmountBill = 0;
-            foreach (var deposit in depositOrderer.Deposits)
-            {
-                depositAmountCash += deposit.DepositAmountCash.GetValueOrDefault(0);
-                depositAmountBill += deposit.DepositAmountBill.GetValueOrDefault(0);
-            }
-            long depositAmount = 0;
-            foreach (var depositDetail in depositOrderer.DepositDetails)
-            {
-                depositAmount += depositDetail.DepositAmount;
-            }
-            return depositAmountCash + depositAmountBill - depositAmount;
         }
+        #endregion
 
+        #region 合計行の設定を行う
         /// <summary>
         /// 合計行の設定を行う。
         /// </summary>
@@ -2621,7 +1241,13 @@
             differentCells[(int)DispColumn.OrderersName].Value = "差額";
             SetPrice(differentCells, (int)DispColumn.DepositAmountCash, depositAmountCash + depositAmountBill - depositAmount);
         }
+        #endregion
 
+        #region ヘッダ制御
+        /// <summary>
+        /// ヘッダ制御
+        /// </summary>
+        /// <param name="index"></param>
         private int DetectHeaderIndex(int index)
         {
             for (var i = index; i >= 0; i--)
@@ -2633,35 +1259,31 @@
             }
             return 0;
         }
+        #endregion
 
-        private int DetectHeaderIndex(DepositOrderer depositOrderer)
-        {
-            for (var i = 0; i < dgvMaster.RowCount; i++)
-            {
-                var cells = dgvMaster.Rows[i].Cells;
-                if (CommonMotions.cnvInt(cells[(int)DispColumn.OrderersDivision]) == depositOrderer.OrderersDivision
-                    && CommonMotions.cnvInt(cells[(int)DispColumn.OrderersCode]) == depositOrderer.OrderersCode)
-                {
-                    return i;
-                }
-            }
-            return 0;
-        }
+        /// <summary>
+        /// ヘッダ制御②
+        /// </summary>
+        /// <param name="index"></param>
+        //private int DetectHeaderIndex(DepositOrderer depositOrderer)
+        //{
+        //    for (var i = 0; i < dgvMaster.RowCount; i++)
+        //    {
+        //        var cells = dgvMaster.Rows[i].Cells;
+        //        if (CommonMotions.cnvInt(cells[(int)DispColumn.OrderersDivision]) == depositOrderer.OrderersDivision
+        //            && CommonMotions.cnvInt(cells[(int)DispColumn.OrderersCode]) == depositOrderer.OrderersCode)
+        //        {
+        //            return i;
+        //        }
+        //    }
+        //    return 0;
+        //}
 
-        private int DetectUnknownIndex(int index)
-        {
-            var headerIndex = DetectHeaderIndex(index);
-            for (var i = headerIndex; i < dgvMaster.Rows.Count; i++)
-            {
-                var constructionName = CommonMotions.cnvString(dgvMaster.Rows[i].Cells[(int)DispColumn.ConstructionName].Value);
-                if (constructionName == "" || constructionName == "不明")
-                {
-                    return i;
-                }
-            }
-            return 0;
-        }
-
+        #region 金額フォーマット
+        /// <summary>
+        /// 金額フォーマット
+        /// </summary>
+        /// <param name="index"></param>
         private void SetPrice(DataGridViewCellCollection cells, int index, long price)
         {
             cells[index].Value = price.ToString("#,0");
@@ -2671,7 +1293,13 @@
                 cells[index].Style.ForeColor = Color.Red;
             }
         }
+        #endregion
 
+        #region 発注者名フォーマット
+        /// <summary>
+        /// 発注者名フォーマット
+        /// </summary>
+        /// <param name="index"></param>
         private string ToOrdererName(int corporateStatusPoint, string corporateStatusName, string orderersName1, string orderersName2)
         {
             // 発注者名１△発注者名２
@@ -2699,7 +1327,9 @@
             }
             return orderersName1 + corporateStatusName + orderersName2;
         }
+        #endregion
 
+        #region DataGridヘッダ色表示
         /// <summary>
         /// DataGridヘッダ色表示
         /// </summary>
@@ -2810,7 +1440,9 @@
                 }
             }
         }
+        #endregion
 
+        #region 表示権限チェック①
         /// <summary>
         /// 表示権限のチェックを実施する。
         /// </summary>
@@ -2857,7 +1489,9 @@
                 return false;
             }
         }
+        #endregion
 
+        #region 表示権限チェック②
         /// <summary>
         /// 表示権限のチェックを実施する。
         /// </summary>
@@ -2921,9 +1555,11 @@
                 return false;
             }
         }
+        #endregion
 
+        #region 担当未承認の承認者リスト取得
         /// <summary>
-        /// 担当未承認の承認者リスト
+        /// 担当未承認の承認者リスト取得
         /// </summary>
         /// <param name="departmentCode"></param>
         /// <param name="approves"></param>
@@ -2968,140 +1604,299 @@
                 IoAm = null;
             }
         }
+        #endregion
 
-        private bool CanEditDeposit(DepositOrderer depositOrderer)
+        #region 入金データ取得SQL
+        /// <summary>
+        /// 入金データを取得する。
+        /// </summary>
+        /// <returns></returns>
+        private ArrayList SelectDepositDataAll()
         {
-            // 担当者の場合
-            if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.NormalAuthority)
+            var depDb = new IODepositData();
+
+            try
             {
-                // 承認済みなら編集不可
-                if (depositOrderer.HasApprovedByApprover)
-                    return false;
-            }
-            // 所属長、統括者の場合
-            else if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.LimitedAuthority || m_UserInfo.m_Type == CommonDefine.SecurityRankPos.FreeAuthority)
-            {
-                if (depositOrderer.HasApprovedByLastApprover)
-                    return false;
-            }
-            // 特別権限の場合
-            else if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.SpecialAuthority)
-            {
-                if (depositOrderer.HasApprovedByLastApprover)
-                    return false;
-            }
-            return m_UserInfo.CanEditDeposit;
-        }
+                var sql = new StringBuilder();
+                sql.Append("SELECT DISTINCT ");
+                sql.Append("DEP.ORDERERSDIVISION ");
+                sql.Append(",DEP.ORDERERSCODE ");
+                sql.Append(",DEP.TARGETDATE ");
+                sql.Append(",DEP.SEQNO ");
+                sql.Append(",DATE_FORMAT(DEP.DEPOSITDATE,'%Y/%m/%d') AS DEPOSITDATE ");
+                sql.Append(",DEP.DEPOSITAMOUNTCASH ");
+                sql.Append(",DEP.DEPOSITAMOUNTBILL ");
+                sql.Append(",ORD.CORPORATESTATUSNAME ");
+                sql.Append(",ORD.CORPORATESTATUSPOINT ");
+                sql.Append(",ORD.ORDERERSNAME1 ");
+                sql.Append(",ORD.ORDERERSNAME2 ");
+                sql.Append("FROM ");
+                sql.Append("DEPOSITDATA DEP ");
+                sql.Append("INNER JOIN DEPOSITDATADETAIL DTL ON ");
+                sql.Append("DEP.ORDERERSDIVISION = DTL.ORDERERSDIVISION ");
+                sql.Append("AND DEP.ORDERERSCODE = DTL.ORDERERSCODE ");
+                sql.Append("AND DEP.TARGETDATE = DTL.TARGETDATE ");
+                sql.Append("AND DTL.SEQNO = 1 ");
 
-        private bool CanEditDepositDetail(DepositDetail depositDetail)
-        {
-            // 担当者の場合
-            if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.NormalAuthority)
-            {
-                // 承認済みなら編集不可
-                if (depositDetail.IsApprovedByStaff || depositDetail.IsApprovedByApprover)
-                    return false;
+                sql.Append("AND DTL.APPROVALENDFLG = 1 ");
+
+                /////////////////////////////////////////////////////////////////////////////
+                //　検索条件(動的)START
+                /////////////////////////////////////////////////////////////////////////////
+
+                // 営業期
+                sql.AppendFormat("AND DEP.BusinessPeriod = {0} ", m_Select_TargetBusinessPeriod);
+
+                // 対象月
+                if (!m_Select_TargetDate.Equals(0))
+                {
+                    sql.AppendFormat("AND SUBSTRING( DEP.TARGETDATE, 5 ) = {0} ", m_Select_TargetDate.ToString("00"));
+                }
+
+                // 担当者
+                if (!m_Select_TargetPerson.Equals(0))
+                {
+                    sql.AppendFormat("AND DTL.APPROVALPERSONCODE = {0} ", m_Select_TargetPerson);
+                }
+
+                // 部署
+                if (!m_Select_TargetDepartment.Equals(0))
+                {
+                    sql.Append("INNER JOIN personinchargemaster PERIM ");
+                    sql.Append("ON DTL.APPROVALPERSONCODE = PERIM.PersonCode ");
+                    sql.AppendFormat("AND PERIM.DepartmentCode = {0} ", m_Select_TargetDepartment);
+                }
+                /////////////////////////////////////////////////////////////////////////////
+                //　検索条件(動的)END
+                /////////////////////////////////////////////////////////////////////////////
+
+                sql.Append("INNER JOIN( ");
+                sql.Append("SELECT ");
+                sql.Append("ORDERERSDIVISION ");
+                sql.Append(",ORDERERSCODE");
+                sql.Append(",SUM(DEPOSITAMOUNT) AS DEPOSITAMOUNT_SUM ");
+                sql.Append("FROM ");
+                sql.Append("DEPOSITDATADETAIL DTL ");
+                sql.Append("GROUP BY ");
+                sql.Append("ORDERERSDIVISION ");
+                sql.Append(",ORDERERSCODE ");
+                sql.Append(") AS AMOUNT ");
+                sql.Append("ON AMOUNT.ORDERERSDIVISION = DEP.ORDERERSDIVISION ");
+                sql.Append("AND AMOUNT.ORDERERSCODE = DEP.ORDERERSCODE ");
+                sql.Append("LEFT JOIN ORDERERSMASTER ORD ON ");
+                sql.Append("DEP.ORDERERSDIVISION = ORD.ORDERCOTEGORY ");
+                sql.Append("AND DEP.ORDERERSCODE = ORD.ORDERERSCODE ");
+                sql.Append("WHERE ");
+                sql.Append("DTL.REQUESTNO IS NOT NULL ");
+
+                sql.Append("ORDER BY  ");
+                sql.Append("AMOUNT.DEPOSITAMOUNT_SUM DESC, DEP.DEPOSITDATE DESC");
+
+                var data = new ArrayList();
+                if (!depDb.ExecuteReader(sql.ToString(), ref data)) return new ArrayList();
+                return data;
             }
-            // 所属長、統括者の場合
-            else if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.LimitedAuthority || m_UserInfo.m_Type == CommonDefine.SecurityRankPos.FreeAuthority)
+            catch (Exception ex)
             {
-                // 上位の承認者でなければ編集不可
-                if (!IsUpperLevelApprover(depositDetail))
-                    return false;
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+                return new ArrayList();
             }
-            // 特別権限の場合
-            else if (m_UserInfo.m_Type == CommonDefine.SecurityRankPos.SpecialAuthority)
+            finally
             {
-                if (depositDetail.IsApprovedByLastApprover)
-                    return false;
+                depDb.close();
+                depDb = null;
             }
-            return m_UserInfo.CanEditDepositDetail;
         }
+        #endregion
 
-        private bool IsUpperLevelApprover(DepositDetail depositDetail)
-        {
-            if (depositDetail.DepositApprovals.Count == 0)
-                return true;
-            var lastApproverIndex = depositDetail.DepositApprovals.FindLastIndex(da => da.ApprovalDate != "");
-            var myIndex = depositDetail.DepositApprovals.FindLastIndex(da => da.ApprovalPerson == CommonMotions.LoginUserData.PersonCode);
-            return myIndex > lastApproverIndex;
-        }
-
+        #region 入金明細データ取得SQL
         /// <summary>
-        /// 編集用空白行追加
+        /// 入金明細データを取得する。
         /// </summary>
-        /// <param name="index"></param>
-        private void AddBlankRow(DepositOrderer depositOrderer, int index)
+        /// <param name="orderersDivision"></param>
+        /// <param name="orderersCode"></param>
+        /// <returns></returns>
+        //private ArrayList SelectDepositDetailData(int orderersDivision, int orderersCode, int targetDate)
+        private ArrayList SelectDepositDetailData(int orderersDivision, int orderersCode)
         {
-            var headerIndex = DetectHeaderIndex(index);
-            var headerCells = dgvMaster.Rows[headerIndex].Cells;
-            var blankIndex = dgvMaster.RowCount;
-            for (var i = headerIndex; i < dgvMaster.RowCount; i++)
+            var depDb = new IODepositData();
+
+            try
             {
-                var cells = dgvMaster.Rows[i].Cells;
-                if (CommonMotions.cnvInt(headerCells[(int)DispColumn.OrderersDivision].Value) != CommonMotions.cnvInt(cells[(int)DispColumn.OrderersDivision].Value)
-                    || CommonMotions.cnvInt(headerCells[(int)DispColumn.OrderersCode].Value) != CommonMotions.cnvInt(cells[(int)DispColumn.OrderersCode].Value))
+                var sql = new StringBuilder();
+                sql.Append("SELECT ");
+                sql.Append("DepD.OrderersDivision, ");
+                sql.Append("DepD.OrderersCode, ");
+                sql.Append("DepD.TargetDate, ");
+                sql.Append("DepD.SeqNo, ");
+
+                sql.Append("null as DepositDate, ");
+                sql.Append("null, ");
+                sql.Append("null, ");
+                sql.Append("null, ");
+                sql.Append("null, ");
+                sql.Append("null, ");
+                sql.Append("null, ");
+
+                sql.Append("DepD.LineCount, ");
+                sql.Append("ifnull(DepD.RequestNo, 0) as RequestNo, ");
+                sql.Append("ifnull(DepD.OrderNo, 0) as OrderNo, ");
+                sql.Append("DepD.DepositAmount, ");
+                sql.Append("ifnull(DepD.DiscountAmount, 0) as DiscountAmount, ");
+                sql.Append("ifnull(DepD.CnstrPrice, 0) as CnstrPrice, ");
+                sql.Append("ifnull(DepD.Fees, 0) as Fees, ");
+                sql.Append("ifnull(DepD.OtherAdjustments, 0) as OtherAdjustments, ");
+                sql.Append("ifnull(DepD.CarryAmount, 0) as CarryAmount, ");
+                sql.Append("ifnull(DepD.ApprovalPersonCode, 0) as ApprovalPersonCode, ");
+                sql.Append("ifnull(DepD.ApprovalDate, 0) as ApprovalDate, ");
+                sql.Append("DepD.ApprovalEndFlg, ");
+                sql.Append("PicM.SealPrintName, ");
+                sql.Append("0, ");                                  //sql.Append("PicM2.DepartmentCode, ");
+                sql.Append("'' as BillCreationDate, ");             //sql.Append("DATE_FORMAT(ReqT.BillCreationDate, '%Y/%m/%d') as BillCreationDate, ");
+                sql.Append("0, ");                                  //sql.Append("ReqT.BillPrice, ");
+                sql.Append("0, ");                                  //sql.Append("ReqT.TaxPrice, ");
+                sql.Append("0, ");                                  //sql.Append("Cbi.ConstructionCode, ");
+                sql.Append("0, ");                                  //sql.Append("Cbi.ConstructionPersonCode, ");
+                sql.Append("0, ");                                  //sql.Append("Cbi.ConstrSubPersonCode, ");
+                sql.Append("0, ");                                  //sql.Append("Cbi.ConstructionInstructor, ");
+                sql.Append("0, ");                                 //sql.Append("CbiD.DetailNo, ");
+                sql.Append("ReqH.ReqConstructionName as DetailString ");           //sql.Append("CbiD.DetailString ");
+                sql.Append("FROM ");
+                sql.Append("DepositDataDetail AS DepD ");
+                sql.Append("INNER JOIN PersonInChargeMaster AS PicM ");
+                sql.Append("ON PicM.PersonCode = DepD.ApprovalPersonCode ");
+                /////////////////////////////////////////////////////////////////////////////
+                //　検索条件(動的)START
+                /////////////////////////////////////////////////////////////////////////////
+                // 担当者
+                if (!m_Select_TargetPerson.Equals(0))
                 {
-                    blankIndex = i;
-                    break;
+                    sql.AppendFormat("AND PicM.PersonCode = {0} ", m_Select_TargetPerson);
                 }
-            }
-            dgvMaster.Rows.Insert(blankIndex);
-            var row = dgvMaster.Rows[blankIndex];
-            row.ReadOnly = true;
-            row.Cells[(int)DispColumn.OrderersDivision].Value = headerCells[(int)DispColumn.OrderersDivision].Value;
-            row.Cells[(int)DispColumn.OrderersCode].Value = headerCells[(int)DispColumn.OrderersCode].Value;
-            var readOnly = !CanEditDeposit(depositOrderer);
-            row.Cells[(int)DispColumn.DepositDate].ReadOnly = readOnly;
-            row.Cells[(int)DispColumn.DepositAmountCash].ReadOnly = readOnly;
-            row.Cells[(int)DispColumn.DepositAmountBill].ReadOnly = readOnly;
-        }
 
-        /// <summary>
-        /// ボタン制御
-        /// </summary>
-        private void ControlButton()
-        {
-        }
+                // 部署
+                if (!m_Select_TargetDepartment.Equals(0))
+                {
+                    sql.AppendFormat("AND PicM.DepartmentCode = {0} ", m_Select_TargetDepartment);
+                }
 
-        /// <summary>
-        /// 入金請求先情報を取得する。
-        /// </summary>
-        /// <param name="index"></param>
-        /// <returns></returns>
-        private DepositOrderer FindDepositOrderer(int index)
-        {
-            var cells = dgvMaster.Rows[index].Cells;
-            var orderersDivision = CommonMotions.cnvInt(cells[(int)DispColumn.OrderersDivision].Value);
-            var orderersCode = CommonMotions.cnvInt(cells[(int)DispColumn.OrderersCode].Value);
-            return FindDepositOrderer(orderersDivision, orderersCode);
+                sql.Append("INNER join DEPOSITDATA Dep ");
+                sql.Append("ON DepD.ORDERERSDIVISION = Dep.ORDERERSDIVISION ");
+                sql.Append("AND DepD.ORDERERSCODE = Dep.ORDERERSCODE ");
+                sql.Append("AND DepD.TARGETDATE = Dep.TARGETDATE ");
+                sql.Append("AND DepD.SEQNO = Dep.SEQNO ");
+
+                // 営業期
+                sql.AppendFormat("AND Dep.BusinessPeriod = {0} ", m_Select_TargetBusinessPeriod);
+
+                // 対象月
+                if (!m_Select_TargetDate.Equals(0))
+                {
+                    sql.AppendFormat("AND SUBSTRING( Dep.TARGETDATE, 5 ) = {0} ", m_Select_TargetDate.ToString("00"));
+                }
+                /////////////////////////////////////////////////////////////////////////////
+                //　検索条件(動的)END
+                /////////////////////////////////////////////////////////////////////////////
+                sql.Append("LEFT OUTER JOIN RequestHead AS ReqH ON DepD.RequestNo = ReqH.RequestNo ");
+                sql.Append("LEFT OUTER JOIN ApprovalMaster AS Am ON PicM.DepartmentCode = Am.DepartmentCode AND Am.ApprovalCode = 3 AND Am.ApprovalAuthority = 1 ");
+                sql.AppendFormat("WHERE DepD.OrderersDivision = {0} and DepD.OrderersCode = {1} and DepD.RequestNo IS NOT NULL ", orderersDivision, orderersCode);
+                sql.Append("GROUP BY ");
+                sql.Append("DepD.OrderersDivision, ");
+                sql.Append("DepD.OrderersCode, ");
+                sql.Append("DepD.TargetDate, ");
+                sql.Append("DepD.SeqNo, ");
+                sql.Append("DepD.LineCount, ");
+                sql.Append("DepD.RequestNo, ");
+                sql.Append("DepD.OrderNo, ");
+                sql.Append("DepD.DepositAmount, ");
+                sql.Append("DepD.DiscountAmount, ");
+                sql.Append("DepD.CnstrPrice, ");
+                sql.Append("DepD.Fees, ");
+                sql.Append("DepD.OtherAdjustments, ");
+                sql.Append("DepD.CarryAmount, ");
+                sql.Append("DepD.ApprovalPersonCode, ");
+                sql.Append("DepD.ApprovalDate, ");
+                sql.Append("DepD.ApprovalEndFlg, ");
+                sql.Append("PicM.SealPrintName, ");
+                sql.Append("ReqH.ReqConstructionName ");
+                sql.Append("ORDER BY DepD.OrderersDivision, DepD.OrderersCode, DepD.SeqNo, DepD.LineCount, DepD.RequestNo DESC, DepD.OrderNo DESC ");
+
+                var data = new ArrayList();
+                if (!depDb.ExecuteReader(sql.ToString(), ref data)) return new ArrayList();
+                return data;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+                return new ArrayList();
+            }
+            finally
+            {
+                depDb.close();
+                depDb = null;
+            }
         }
+        #endregion
 
+        #region 入金確認承認者取得
         /// <summary>
-        /// 入金請求先情報を取得する。
+        /// 入金確認承認データより、承認者を取得する。
         /// </summary>
         /// <param name="orderersDivision"></param>
         /// <param name="orderersCode"></param>
+        /// <param name="seqNo"></param>
+        /// <param name="lineCount"></param>
+        /// <param name="depositApprovals"></param>
         /// <returns></returns>
-        private DepositOrderer FindDepositOrderer(int orderersDivision, int orderersCode)
+        private bool SelectApprove(int orderersDivision, int orderersCode, int seqNo, int lineCount, ref List<DepositApprovalInfo> depositApprovals)
         {
-            return depositOrderers.Find(dh => !dh.Deleted && dh.OrderersDivision == orderersDivision && dh.OrderersCode == orderersCode);
+            IODepositApprovalInfo ioDai = new IODepositApprovalInfo();
+            try
+            {
+                var sql = string.Format(" where OrderersDivision = {0} and OrderersCode = {1} and TargetDate = {2} and SeqNo = {3} and LineCount = {4} order by ApprovalNo",
+                    orderersDivision, orderersCode, m_Select_TargetDate.ToString(), seqNo, lineCount);
+                if (!ioDai.SelectAction(sql, ref depositApprovals))
+                    return false;
+                return true;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
+            }
+            finally
+            {
+                ioDai = null;
+            }
         }
+        #endregion
+        #endregion
 
+        #region イベント
+
+        #region 終了ボタンクリック時のイベント
         /// <summary>
-        /// 対象の行の請求先キーを取得する。
+        /// 終了ボタンクリック時のイベント
         /// </summary>
-        /// <param name="index"></param>
-        /// <returns></returns>
-        private OrderersKey GetOrderersKey(int index)
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnEnd_Click(object sender, EventArgs e)
         {
-            var cells = dgvMaster.Rows[index].Cells;
-            return new OrderersKey()
+            try
             {
-                OrderersDivision = CommonMotions.cnvInt(cells[(int)DispColumn.OrderersDivision].Value),
-                OrderersCode = CommonMotions.cnvInt(cells[(int)DispColumn.OrderersCode].Value),
-            };
+                // 前プロセスに戻る
+                ClsExcute.BackProcess();
+
+                Close();
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
         }
+        #endregion
+
+        #region ラジオボタン（通年）選択時のイベント
         /// <summary>
         /// ラジオボタン（通年）選択時
         /// </summary>
@@ -3116,7 +1911,9 @@
                 DisplayData();
             }
         }
+        #endregion
 
+        #region ラジオボタン（月指定）選択時のイベント
         /// <summary>
         /// ラジオボタン（月指定）選択時
         /// </summary>
@@ -3126,7 +1923,9 @@
         {
             comboBox1.Enabled = true;
         }
+        #endregion
 
+        #region 表示条件．営業期設定時のイベント
         /// <summary>
         /// 表示条件．営業期設定時
         /// </summary>
@@ -3135,9 +1934,10 @@
         private void numericUpDown2_ValueChanged(object sender, EventArgs e)
         {
             DisplayData();
-
         }
+        #endregion
 
+        #region 表示条件．対象月設定時のイベント
         /// <summary>
         /// 表示条件．対象月設定時
         /// </summary>
@@ -3150,7 +1950,9 @@
                 DisplayData();
             }
         }
+        #endregion
 
+        #region 表示条件．部署設定時のイベント
         /// <summary>
         /// 表示条件．部署設定時
         /// </summary>
@@ -3158,8 +1960,6 @@
         /// <returns></returns>
         private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
         {
-
-
             // 担当者再取得
             comboBox3.SelectedIndexChanged -= new System.EventHandler(this.comboBox3_SelectedIndexChanged);
 
@@ -3170,10 +1970,10 @@
 
             // 一覧再取得
             DisplayData();
-
-
         }
+        #endregion
 
+        #region 表示条件．担当者設定時のイベント
         /// <summary>
         /// 表示条件．担当者設定時
         /// </summary>
@@ -3182,21 +1982,27 @@
         private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
         {
 
-            // 部署再取得
-            this.listDepartment = getDepartmentList(CommonMotions.cnvInt(comboBox3.SelectedValue));
+            // 選択した担当者を基に部署再取得
+            int iSelectedValue = CommonMotions.cnvInt(comboBox3.SelectedValue);
+            this.listDepartment = getDepartmentList(iSelectedValue);
 
-            comboBox2.SelectedIndexChanged -= new System.EventHandler(this.comboBox2_SelectedIndexChanged);
+            //担当者の部署にて、担当者コンボボックスの絞り込みを行う
+            //comboBox2.SelectedIndexChanged -= new System.EventHandler(this.comboBox2_SelectedIndexChanged);
 
             comboBox2.SelectedValue = listDepartment[1].Key;
 
-            comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
+            //絞り込み前に選択した担当者を担当者コンボボックスに表示する(部署の絞り込み発動防止)
+            comboBox3.SelectedIndexChanged -= new System.EventHandler(this.comboBox3_SelectedIndexChanged);
+            comboBox3.SelectedValue = iSelectedValue;
+            comboBox3.SelectedIndexChanged += new System.EventHandler(this.comboBox3_SelectedIndexChanged);
 
+            //comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
+
             // 一覧再取得
             DisplayData();
-
         }
+        #endregion
+        #endregion
 
-
-
     }
 }
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SelectPayment/FrmSelectPayment.Designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SelectPayment/FrmSelectPayment.Designer.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SelectPayment/FrmSelectPayment.Designer.cs	(revision 123)
@@ -61,11 +61,6 @@
             this.cbTargetMonth = new System.Windows.Forms.ComboBox();
             this.label2 = new System.Windows.Forms.Label();
             this.dgvMaster = new System.Windows.Forms.DataGridView();
-            this.btnAddCmp = new System.Windows.Forms.Button();
-            this.btnDelCmp = new System.Windows.Forms.Button();
-            this.btnAddFld = new System.Windows.Forms.Button();
-            this.Registration = new System.Windows.Forms.Button();
-            this.btnEnd = new System.Windows.Forms.Button();
             this.EditStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.No = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.OrderersDivision = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -143,6 +138,11 @@
             this.ApprovalAuthority_10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ApprovalDate_10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ApprovalOrder_10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.btnAddCmp = new System.Windows.Forms.Button();
+            this.btnDelCmp = new System.Windows.Forms.Button();
+            this.btnAddFld = new System.Windows.Forms.Button();
+            this.Registration = new System.Windows.Forms.Button();
+            this.btnEnd = new System.Windows.Forms.Button();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dgvMaster)).BeginInit();
             this.SuspendLayout();
@@ -325,77 +325,9 @@
             this.dgvMaster.RowTemplate.Height = 21;
             this.dgvMaster.Size = new System.Drawing.Size(1399, 474);
             this.dgvMaster.TabIndex = 2;
+            this.dgvMaster.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.dgvMaster_CellBeginEdit);
+            this.dgvMaster.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dgvMaster_CellValidating);
             // 
-            // btnAddCmp
-            // 
-            this.btnAddCmp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-            this.btnAddCmp.BackColor = System.Drawing.Color.Orange;
-            this.btnAddCmp.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnAddCmp.ForeColor = System.Drawing.Color.Black;
-            this.btnAddCmp.Location = new System.Drawing.Point(8, 597);
-            this.btnAddCmp.Name = "btnAddCmp";
-            this.btnAddCmp.Size = new System.Drawing.Size(120, 30);
-            this.btnAddCmp.TabIndex = 3;
-            this.btnAddCmp.Text = "発注者追加";
-            this.btnAddCmp.UseVisualStyleBackColor = false;
-            this.btnAddCmp.Click += new System.EventHandler(this.btnAddCmp_Click);
-            // 
-            // btnDelCmp
-            // 
-            this.btnDelCmp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-            this.btnDelCmp.BackColor = System.Drawing.Color.Red;
-            this.btnDelCmp.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnDelCmp.ForeColor = System.Drawing.Color.Black;
-            this.btnDelCmp.Location = new System.Drawing.Point(134, 597);
-            this.btnDelCmp.Name = "btnDelCmp";
-            this.btnDelCmp.Size = new System.Drawing.Size(120, 30);
-            this.btnDelCmp.TabIndex = 4;
-            this.btnDelCmp.Text = "発注者削除";
-            this.btnDelCmp.UseVisualStyleBackColor = false;
-            this.btnDelCmp.Click += new System.EventHandler(this.btnDelCmp_Click);
-            // 
-            // btnAddFld
-            // 
-            this.btnAddFld.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-            this.btnAddFld.BackColor = System.Drawing.Color.Aquamarine;
-            this.btnAddFld.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnAddFld.ForeColor = System.Drawing.Color.Black;
-            this.btnAddFld.Location = new System.Drawing.Point(260, 597);
-            this.btnAddFld.Name = "btnAddFld";
-            this.btnAddFld.Size = new System.Drawing.Size(120, 30);
-            this.btnAddFld.TabIndex = 5;
-            this.btnAddFld.Text = "現場追加";
-            this.btnAddFld.UseVisualStyleBackColor = false;
-            this.btnAddFld.Click += new System.EventHandler(this.btnAddFld_Click);
-            // 
-            // Registration
-            // 
-            this.Registration.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.Registration.BackColor = System.Drawing.Color.GreenYellow;
-            this.Registration.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.Registration.ForeColor = System.Drawing.Color.Black;
-            this.Registration.Location = new System.Drawing.Point(1161, 597);
-            this.Registration.Name = "Registration";
-            this.Registration.Size = new System.Drawing.Size(120, 30);
-            this.Registration.TabIndex = 6;
-            this.Registration.Text = "登　録";
-            this.Registration.UseVisualStyleBackColor = false;
-            this.Registration.Click += new System.EventHandler(this.Registration_Click);
-            // 
-            // btnEnd
-            // 
-            this.btnEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnEnd.BackColor = System.Drawing.Color.Magenta;
-            this.btnEnd.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnEnd.ForeColor = System.Drawing.Color.Black;
-            this.btnEnd.Location = new System.Drawing.Point(1287, 597);
-            this.btnEnd.Name = "btnEnd";
-            this.btnEnd.Size = new System.Drawing.Size(120, 30);
-            this.btnEnd.TabIndex = 7;
-            this.btnEnd.Text = "終　了";
-            this.btnEnd.UseVisualStyleBackColor = false;
-            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
-            // 
             // EditStatus
             // 
             this.EditStatus.Frozen = true;
@@ -960,6 +892,76 @@
             this.ApprovalOrder_10.Name = "ApprovalOrder_10";
             this.ApprovalOrder_10.Visible = false;
             // 
+            // btnAddCmp
+            // 
+            this.btnAddCmp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+            this.btnAddCmp.BackColor = System.Drawing.Color.Orange;
+            this.btnAddCmp.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnAddCmp.ForeColor = System.Drawing.Color.Black;
+            this.btnAddCmp.Location = new System.Drawing.Point(8, 597);
+            this.btnAddCmp.Name = "btnAddCmp";
+            this.btnAddCmp.Size = new System.Drawing.Size(120, 30);
+            this.btnAddCmp.TabIndex = 3;
+            this.btnAddCmp.Text = "発注者追加";
+            this.btnAddCmp.UseVisualStyleBackColor = false;
+            this.btnAddCmp.Click += new System.EventHandler(this.btnAddCmp_Click);
+            // 
+            // btnDelCmp
+            // 
+            this.btnDelCmp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+            this.btnDelCmp.BackColor = System.Drawing.Color.Red;
+            this.btnDelCmp.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnDelCmp.ForeColor = System.Drawing.Color.Black;
+            this.btnDelCmp.Location = new System.Drawing.Point(134, 597);
+            this.btnDelCmp.Name = "btnDelCmp";
+            this.btnDelCmp.Size = new System.Drawing.Size(120, 30);
+            this.btnDelCmp.TabIndex = 4;
+            this.btnDelCmp.Text = "発注者削除";
+            this.btnDelCmp.UseVisualStyleBackColor = false;
+            this.btnDelCmp.Click += new System.EventHandler(this.btnDelCmp_Click);
+            // 
+            // btnAddFld
+            // 
+            this.btnAddFld.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+            this.btnAddFld.BackColor = System.Drawing.Color.Aquamarine;
+            this.btnAddFld.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnAddFld.ForeColor = System.Drawing.Color.Black;
+            this.btnAddFld.Location = new System.Drawing.Point(260, 597);
+            this.btnAddFld.Name = "btnAddFld";
+            this.btnAddFld.Size = new System.Drawing.Size(120, 30);
+            this.btnAddFld.TabIndex = 5;
+            this.btnAddFld.Text = "現場追加";
+            this.btnAddFld.UseVisualStyleBackColor = false;
+            this.btnAddFld.Click += new System.EventHandler(this.btnAddFld_Click);
+            // 
+            // Registration
+            // 
+            this.Registration.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.Registration.BackColor = System.Drawing.Color.GreenYellow;
+            this.Registration.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.Registration.ForeColor = System.Drawing.Color.Black;
+            this.Registration.Location = new System.Drawing.Point(1161, 597);
+            this.Registration.Name = "Registration";
+            this.Registration.Size = new System.Drawing.Size(120, 30);
+            this.Registration.TabIndex = 6;
+            this.Registration.Text = "登　録";
+            this.Registration.UseVisualStyleBackColor = false;
+            this.Registration.Click += new System.EventHandler(this.Registration_Click);
+            // 
+            // btnEnd
+            // 
+            this.btnEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnEnd.BackColor = System.Drawing.Color.Magenta;
+            this.btnEnd.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnEnd.ForeColor = System.Drawing.Color.Black;
+            this.btnEnd.Location = new System.Drawing.Point(1287, 597);
+            this.btnEnd.Name = "btnEnd";
+            this.btnEnd.Size = new System.Drawing.Size(120, 30);
+            this.btnEnd.TabIndex = 7;
+            this.btnEnd.Text = "終　了";
+            this.btnEnd.UseVisualStyleBackColor = false;
+            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
+            // 
             // FrmSelectPayment
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 15F);
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SelectPayment/FrmSelectPayment.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SelectPayment/FrmSelectPayment.cs	(revision 122)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SelectPayment/FrmSelectPayment.cs	(revision 123)
@@ -226,6 +226,10 @@
             ApprovalAuthority10,
             ApprovalDate10
         }
+
+        private const long amount_max = 9999999999;             // 金額最大
+        private const long amount_min = -9999999999;            // 金額最小
+
         #endregion
 
         #region クラス定義
@@ -484,6 +488,12 @@
             m_GeneralAffairsFlg = 0,
             m_SecRange = ClsSecurityPermission.SecRangeType.InCharge
         };
+
+        /// <summary>
+        /// エラー行
+        /// </summary>
+        private List<int> m_lstErrorRow = new List<int>();
+
         #endregion
 
         #region コンストラクタ
@@ -950,8 +960,13 @@
                 ResetTargetDate();
                 if (MessageBox.Show("表示中のデータを登録します。", "登録確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                     return;
+
+                // エラー表示を一旦クリア
+                UnsetErrorDisp();
+
                 if (!isDirty)
                     return;
+
                 // 入力内容をチェック
                 foreach (var depositOrderer in depositOrderers)
                 {
@@ -962,7 +977,12 @@
                             && !deposit.DepositAmountCash.HasValue
                             && !deposit.DepositAmountBill.HasValue)
                         {
+                            // エラー表示
+                            int trow = GetRowIndexFromDeposit(depositOrderer, deposit);
+                            SetErrorDisp(trow, new List<int>() { (int)DispColumn.DepositAmountCash, (int)DispColumn.DepositAmountBill });
+
                             MessageBox.Show("入金日が登録されている行に入金金額が入力されていません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+
                             return;
                         }
                         // 入金金額入力済みで入金日が入力されていない
@@ -970,7 +990,12 @@
                             && (deposit.DepositAmountCash.HasValue
                             || deposit.DepositAmountBill.HasValue))
                         {
+                            // エラー表示
+                            int trow = GetRowIndexFromDeposit(depositOrderer, deposit);
+                            SetErrorDisp(trow, new List<int>() { (int)DispColumn.DepositDate });
+
                             MessageBox.Show("入金金額が登録されている行に入金日が入力されていません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+
                             return;
                         }
                     }
@@ -1009,7 +1034,7 @@
                             SeqNo = deposit.SeqNo,
                             BusinessPeriod = CommonMotions.SystemMasterData.BusinessPeriod,
                             DepositDate = DateTime.Parse(deposit.DepositDate),
-                            DepositAmount = deposit.DepositAmountCash.GetValueOrDefault(0) + deposit.DepositAmountBill.GetValueOrDefault(0), 
+                            DepositAmount = deposit.DepositAmountCash.GetValueOrDefault(0) + deposit.DepositAmountBill.GetValueOrDefault(0),
                             DepositAmountCash = deposit.DepositAmountCash.GetValueOrDefault(0),
                             DepositAmountBill = deposit.DepositAmountBill.GetValueOrDefault(0),
                         };
@@ -1023,11 +1048,11 @@
                             }
                             else
                             {
-                                    // 総務担当
-                                    if (m_UserInfo.m_GeneralAffairsFlg == 1)
-                                    {
-                                        MessageBoardEntry(depositOrderer);
-                                    }
+                                // 総務担当
+                                if (m_UserInfo.m_GeneralAffairsFlg == 1)
+                                {
+                                    MessageBoardEntry(depositOrderer);
+                                }
                             }
                         }
                         // 更新処理
@@ -1222,6 +1247,12 @@
             dgvMaster.CellValueChanged -= DataGridView_CellValueChanged;
             try
             {
+                // 行インデックスが不正な場合はスルー
+                if (e.RowIndex == -1)
+                {
+                    return;
+                }
+
                 // 承認セル以外は無視
                 if ((e.ColumnIndex == (int)DispColumn.PersonName) ||
                     (e.ColumnIndex == (int)DispColumn.ApprovalName_1) ||
@@ -1235,28 +1266,38 @@
                     (e.ColumnIndex == (int)DispColumn.ApprovalName_9) ||
                     (e.ColumnIndex == (int)DispColumn.ApprovalName_10))
                 {
+                    // エラー表示解除
+                    UnsetErrorDisp();
+
                     var cells = dgvMaster.Rows[e.RowIndex].Cells;
                     // 自分以外のセルは編集不可
                     if (CommonMotions.cnvInt(dgvMaster[e.ColumnIndex + 1, e.RowIndex].Value) != CommonMotions.LoginUserData.PersonCode)
                         return;
+
                     var depositOrderer = FindDepositOrderer(e.RowIndex);
                     var depositDetail = depositOrderer.FindDepositDetailByLineCount(CommonMotions.cnvInt(cells[(int)DispColumn.LineCount].Value));
                     // 担当者承認
                     if (e.ColumnIndex == (int)DispColumn.PersonName)
                     {
-                        // 現場が不明な場合は承認不可
-                        if (IsUnknownRow(e.RowIndex))
-                        {
-                            MessageBox.Show("現場が選択されていません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                            return;
-                        }
                         // 上位が承認済みの場合は編集不可
                         if (!depositDetail.IsApprovedByApprover)
                         {
-                            if (!depositDetail.IsApprovedByStaff)
+                            // 担当者承認金額チェック
+                            if (CheckStaffApproval(e.RowIndex, depositDetail) == false)
+                            {
+                                return;
+                            }
+
+                            // 未承認→承認の場合
+                            if (depositDetail.IsApprovedByStaff == false)
+                            {
                                 depositDetail.ApprovalDate = DateTime.Now.ToString("yyyy-MM-dd");
+                            }
                             else
+                            {
                                 depositDetail.ApprovalDate = "";
+                            }
+
                             depositDetail.Editted = true;
                         }
                     }
@@ -1264,10 +1305,19 @@
                     {
                         if (depositDetail.DepositApprovals.Count == 0)
                             return;
+
+                        // 担当者承認されていない場合はエラー
+                        if (depositDetail.IsApprovedByStaff == false)
+                        {
+                            MessageBox.Show("担当者の承認が実施されていないため、承認できません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                            return;
+                        }
+
                         // 承認者に含まれるか確認
                         var approvalIndex = depositDetail.DepositApprovals.FindIndex(a => a.ApprovalPerson == CommonMotions.LoginUserData.PersonCode);
                         if (approvalIndex < 0)
                             return;
+
                         // 最終承認以外の場合
                         if (approvalIndex != depositDetail.DepositApprovals.Count - 1)
                         {
@@ -1349,7 +1399,65 @@
         }
         #endregion
 
-        #region セル編集開始時のイベント
+        #region 担当者承認チェック
+        private bool CheckStaffApproval(int trow, DepositDetail depositDetail)
+        {
+            if (depositDetail.IsApprovedByStaff == true)
+            {
+                return true;
+            }
+
+            List<int> lst = new List<int>();
+
+            // 入金金額がマイナス
+            if (depositDetail.DepositAmount < 0)
+            {
+                lst.Add((int)DispColumn.DepositAmount);
+            }
+
+            // 値引金額がマイナス
+            if (depositDetail.DiscountAmount < 0)
+            {
+                lst.Add((int)DispColumn.DiscountAmount);
+            }
+
+            // 協力金がマイナス
+            if (depositDetail.CnstrPrice < 0)
+            {
+                lst.Add((int)DispColumn.CnstrPrice);
+            }
+
+            // 手数料がマイナス
+            if (depositDetail.Fees < 0)
+            {
+                lst.Add((int)DispColumn.Fees);
+            }
+
+            // その他調整額がマイナス
+            if (depositDetail.OtherAdjustments < 0)
+            {
+                lst.Add((int)DispColumn.OtherAdjustments);
+            }
+
+            // 次回繰越がマイナス
+            if (depositDetail.CarryAmount < 0)
+            {
+                lst.Add((int)DispColumn.CarryAmount);
+            }
+
+            if (lst.Count > 0)
+            {
+                if (MessageBox.Show("マイナスの金額が存在しますがこのまま進めてよろしいですか？。", "金額確認", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
+                {
+                    return false;
+                }
+            }
+
+            return true;
+        }
+        #endregion
+
+        #region セルフォーカス取得
         /// <summary>
         /// セル編集開始時のイベント
         /// </summary>
@@ -1362,6 +1470,7 @@
                 if (dgvMaster.RowCount == 0)
                     return;
                 oldCellValue = CommonMotions.cnvString(dgvMaster[e.ColumnIndex, e.RowIndex].Value);
+
             }
             catch (Exception ex)
             {
@@ -1391,11 +1500,26 @@
                     return;
                 var key = GetOrderersKey(e.RowIndex);
                 var depositOrderer = FindDepositOrderer(key.OrderersDivision, key.OrderersCode);
+
+                if ((e.ColumnIndex == (int)DispColumn.DepositAmount) ||
+                    (e.ColumnIndex == (int)DispColumn.DepositAmountCash) ||
+                    (e.ColumnIndex == (int)DispColumn.DepositAmountBill) ||
+                    (e.ColumnIndex == (int)DispColumn.DiscountAmount) ||
+                    (e.ColumnIndex == (int)DispColumn.CnstrPrice) ||
+                    (e.ColumnIndex == (int)DispColumn.Fees) ||
+                    (e.ColumnIndex == (int)DispColumn.OtherAdjustments) ||
+                    (e.ColumnIndex == (int)DispColumn.CarryAmount))
+                {
+                    long val = long.Parse(cellValue);
+                    SetPrice(cells, e.ColumnIndex, val);
+                }
+
                 // 入金情報を編集
                 if (e.ColumnIndex == (int)DispColumn.DepositAmountCash
                     || e.ColumnIndex == (int)DispColumn.DepositAmountBill
                     || e.ColumnIndex == (int)DispColumn.DepositDate)
                 {
+
                     var deposit = depositOrderer.FindDepositBySeqNo(CommonMotions.cnvInt(cells[(int)DispColumn.SeqNo].Value));
                     if (deposit == null)
                     {
@@ -1473,13 +1597,20 @@
                             depositDetail.CarryAmount = amount;
                             break;
                     }
-                    // 繰越金の調整が必要
+                    long RequestAmount = depositDetail.BillPrice + depositDetail.TaxPrice;
+
+                    // 繰越金以外を修正した場合、
                     if (bUpdateCarryAmount == true)
                     {
-                        long RequestAmount = depositDetail.BillPrice + depositDetail.TaxPrice;
                         long DepositAmount = depositDetail.DepositAmount + depositDetail.DiscountAmount + depositDetail.CnstrPrice + depositDetail.Fees + depositDetail.OtherAdjustments;
                         depositDetail.CarryAmount = RequestAmount - DepositAmount;
                     }
+                    else
+                    {
+                        long AdjustmentAmount =  depositDetail.DiscountAmount + depositDetail.CnstrPrice + depositDetail.Fees + depositDetail.OtherAdjustments + depositDetail.CarryAmount;
+                        // 繰越金を修正した場合は、入金金額で調整
+                        depositDetail.DepositAmount = RequestAmount - AdjustmentAmount;
+                    }
 
                     depositDetail.Editted = true;
                 }
@@ -2437,9 +2568,9 @@
         }
         #endregion
 
-        #region 発注者区分、発注者コードからヘッダヘッダ行を検索
+        #region 発注者区分、発注者コードからヘッダ行を検索
         /// <summary>
-        /// 発注者区分、発注者コードからヘッダヘッダ行を検索
+        /// 発注者区分、発注者コードからヘッダ行を検索
         /// </summary>
         /// <param name="depositOrderer"></param>
         /// <returns></returns>
@@ -2498,6 +2629,32 @@
         }
         #endregion
 
+        #region 入金情報から行インデックスを取得
+        /// <summary>
+        /// 入金情報から行インデックスを取得
+        /// </summary>
+        /// <param name="depositOrderer"></param>
+        /// <param name="deposit"></param>
+        /// <returns></returns>
+        private int GetRowIndexFromDeposit(DepositOrderer depositOrderer, Deposit deposit)
+        {
+            // ヘッダ行を取得
+            int HdIndex = DetectHeaderIndex(depositOrderer);
+
+            for (int i = HdIndex; i < dgvMaster.Rows.Count; i++)
+            {
+                var cells = dgvMaster.Rows[i].Cells;
+
+                if (CommonMotions.cnvInt(cells[(int)DispColumn.SeqNo].Value) == deposit.SeqNo)
+                {
+                    return i;
+                }
+            }
+
+            return -1;
+        }
+        #endregion
+
         #region 金額の設定
         /// <summary>
         /// 金額の設定
@@ -3157,6 +3314,44 @@
         }
         #endregion
 
+        #region エラー表示
+        private void SetErrorDisp(int trow, List<int> cols)
+        {
+            m_lstErrorRow.Add( trow );
+
+            if( cols.Count == 0)
+            {
+                dgvMaster.Rows[trow].DefaultCellStyle.BackColor = Color.Red;
+            }
+
+            foreach (int tcol in cols)
+            {
+                dgvMaster[tcol, trow].Style.BackColor = Color.Red;
+            }
+
+            return;
+        }
+        #endregion
+
+        #region エラー表示解除
+        private void UnsetErrorDisp()
+        {
+            if( m_lstErrorRow.Count == 0)
+            {
+                return;
+            }
+
+            foreach (int trow in m_lstErrorRow)
+            {
+                dgvMaster.Rows[trow].DefaultCellStyle.BackColor = Color.White;
+            }
+
+            m_lstErrorRow.Clear();
+
+            return;
+        }
+        #endregion
+
         #region デバッグ用非可視列の表示
         /// <summary>
         /// デバッグ用非可視列の表示
@@ -3172,5 +3367,110 @@
         }
         #endregion
 
+        #region セル検証
+        /// <summary>
+        /// セル検証
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void dgvMaster_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
+        {
+            int tcol = e.ColumnIndex;
+            int trow = e.RowIndex;
+
+            if (trow == -1)
+            {
+                return;
+            }
+
+            if ((tcol == (int)DispColumn.DepositAmountCash) ||              // 入金金額（振込）
+               (tcol == (int)DispColumn.DepositAmountBill)||                // 入金金額（手形）
+               (tcol == (int)DispColumn.DepositAmount) ||                   // 入金金額
+               (tcol == (int)DispColumn.DiscountAmount) ||                  // 値引金額
+               (tcol == (int)DispColumn.CnstrPrice) ||                      // 協力金
+               (tcol == (int)DispColumn.Fees) ||                            // 手数料
+               (tcol == (int)DispColumn.OtherAdjustments) ||                // その他調整
+               (tcol == (int)DispColumn.CarryAmount))                       // 次回繰越
+            {
+                // カンマは一旦削除して文字列を取得
+                string str = e.FormattedValue.ToString().Replace(",", string.Empty); ;
+
+                // 不要な空白は削除
+                str.Trim();
+
+                // 値が未設定の場合は０とする
+                if (str == "")
+                {
+                    str = "0";
+                }
+
+                long n = 0;
+
+                if (long.TryParse(str, out n) == true)
+                {
+                    if ((n > amount_max) || (n < amount_min))
+                    {
+                        MessageBox.Show("金額が登録可能範囲(-9,999,999,999～9,999,999,999)を超えました。", "入力エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                        e.Cancel = true;
+                    }
+
+                }
+                else
+                {
+                    MessageBox.Show("金額を入力してください", "入力エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    e.Cancel = true;
+                }
+
+            }
+
+            return;
+        }
+        #endregion
+
+        #region セル編集開始
+        /// <summary>
+        /// セル編集開始
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void dgvMaster_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
+        {
+            dgvMaster.CellBeginEdit -= dgvMaster_CellBeginEdit;
+
+            int tcol = e.ColumnIndex;
+            int trow = e.RowIndex;
+
+            if ((tcol == (int)DispColumn.DepositAmountCash) ||
+                (tcol == (int)DispColumn.DepositAmountBill) ||
+                (tcol == (int)DispColumn.DepositAmount) ||
+                (tcol == (int)DispColumn.DiscountAmount) ||
+                (tcol == (int)DispColumn.CnstrPrice) ||
+                (tcol == (int)DispColumn.Fees) ||
+                (tcol == (int)DispColumn.OtherAdjustments) ||
+                (tcol == (int)DispColumn.CarryAmount))
+            {
+                string val;
+
+                // セルに値が格納されている場合
+                if (dgvMaster[tcol, trow].Value != null)
+                {
+                    // カンマ区切りを解除
+                    val = dgvMaster[tcol, trow].Value.ToString().Replace(",", string.Empty);
+                }
+                else
+                {
+                    // 0を入力
+                    val = "0";
+                }
+                dgvMaster[tcol, trow].Value = val;
+
+                // 文字色は一律黒
+                dgvMaster[tcol, trow].Style.ForeColor = Color.Black;
+
+            }
+            dgvMaster.CellBeginEdit += dgvMaster_CellBeginEdit;
+
+        }
+        #endregion
     }
 }
