Index: branches/ddl/20171024_SQL.txt
===================================================================
--- branches/ddl/20171024_SQL.txt	(nonexistent)
+++ branches/ddl/20171024_SQL.txt	(revision 302)
@@ -0,0 +1,79 @@
+-- �ƎҐ����f�[�^
+DROP TABLE IF EXISTS billingdata_OLD;
+CREATE TABLE billingdata_OLD As Select * from billingdata;
+
+drop table if exists billingdata cascade;
+
+create table billingdata (
+  COMPANYCODE decimal(8,0) default '0' not null comment '���͉�ЃR�[�h'
+  , TARGETDATE decimal(6,0) default '0' not null comment '�Ώ۔N��'
+  , PAYMENTKIND decimal(1,0) default '0' not null comment '�x���敪'
+  , SEQNO decimal(3,0) default '0' not null comment '�A��'
+  , BILLPRICE decimal(10,0) comment '�������z'
+  , ENTRYDATE datetime comment '�o�^�N����'
+  , UPDATEDATE datetime comment '�X�V�N����'
+  , constraint billingdata_PKC primary key (COMPANYCODE,TARGETDATE,PAYMENTKIND,SEQNO)
+) comment '�ƎҐ����f�[�^' ;
+
+Insert INTO billingdata
+SELECT
+  COMPANYCODE
+  , TARGETDATE
+  , 0
+  , SEQNO
+  , BILLPRICE
+  , ENTRYDATE
+  , UPDATEDATE
+FROM billingdata_OLD
+;
+commit;
+
+
+-- �ƎҐ������׃f�[�^
+DROP TABLE IF EXISTS billingdatadetail_OLD;
+CREATE TABLE billingdatadetail_OLD As Select * from billingdatadetail;
+
+drop table if exists billingdatadetail cascade;
+
+create table billingdatadetail (
+  COMPANYCODE decimal(8,0) default '0' not null comment '���͉�ЃR�[�h'
+  , TARGETDATE decimal(6,0) default '0' not null comment '�Ώ۔N��'
+  , PAYMENTKIND decimal(1,0) default '0' not null comment '�x���敪'
+  , SEQNO decimal(3,0) default '0' not null comment '�A��'
+  , LINECOUNT decimal(3,0) default '0' not null comment '�s�ԍ�'
+  , CONSTRUCTIONCODE decimal(10,0) comment '�H���ԍ�'
+  , CONSTRUCTIONROWCNT decimal(3,0) default '0' not null comment '�s�ԍ�'
+  , CONSTRUCTIONCOLCNT decimal(3,0) default '0' not null comment '��ԍ�'
+  , FIELDNAME varchar(120) comment '���ꖼ'
+  , BILLPRICE decimal(10,0) comment '�������z'
+  , HIGHWPRICE decimal(10,0) comment '������'
+  , HARDWPRICE decimal(10,0) comment '������'
+  , INDSWASTETAX decimal(10,0) comment '�Y�p��'
+  , NOTE varchar(120) comment '���l'
+  , ENTRYDATE datetime comment '�o�^�N����'
+  , UPDATEDATE datetime comment '�X�V�N����'
+  , constraint billingdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,PAYMENTKIND,SEQNO,LINECOUNT)
+) comment '�ƎҐ������׃f�[�^' ;
+
+Insert INTO billingdatadetail
+SELECT
+  COMPANYCODE
+  , TARGETDATE
+  , 0
+  , SEQNO
+  , LINECOUNT
+  , CONSTRUCTIONCODE
+  , CONSTRUCTIONROWCNT
+  , CONSTRUCTIONCOLCNT
+  , FIELDNAME
+  , BILLPRICE
+  , HIGHWPRICE
+  , HARDWPRICE
+  , INDSWASTETAX
+  , NOTE
+  , ENTRYDATE
+  , UPDATEDATE
+FROM billingdatadetail_OLD
+;
+commit;
+
Index: branches/ddl/20171130_SQL.txt
===================================================================
--- branches/ddl/20171130_SQL.txt	(nonexistent)
+++ branches/ddl/20171130_SQL.txt	(revision 302)
@@ -0,0 +1,21 @@
+-- �H����������f�[�^
+drop table if exists PeriodAvoidance cascade;
+
+create table PeriodAvoidance (
+  ConstructionCode decimal(10,0) unsigned not null comment '�H���R�[�h'
+  , ConstructionStatusFlg decimal(2,0) not null comment '�H����ԃt���O'
+  , FieldNo decimal(2,0) not null comment '�`�F�b�N�Ώۃt�B�[���h�ԍ�'
+  , EntryDate datetime not null comment '�o�^���t'
+  , UpdateDate datetime not null comment '�X�V���t'
+  , constraint PeriodAvoidance_PKC primary key (ConstructionCode,ConstructionStatusFlg,FieldNo)
+) comment '�H����������f�[�^' ;
+
+create index PeriodAvoidance_Index1
+  on PeriodAvoidance(ConstructionCode);
+
+create index PeriodAvoidance_Index2
+  on PeriodAvoidance(ConstructionStatusFlg);
+
+create index PeriodAvoidance_Index3
+  on PeriodAvoidance(FieldNo);
+
Index: branches/ddl/20171207_SQL.txt
===================================================================
--- branches/ddl/20171207_SQL.txt	(nonexistent)
+++ branches/ddl/20171207_SQL.txt	(revision 302)
@@ -0,0 +1,54 @@
+-- ���������׃f�[�^
+DROP TABLE IF EXISTS purchaseorderdetail_OLD;
+CREATE TABLE purchaseorderdetail_OLD As Select * from purchaseorderdetail;
+
+drop table if exists purchaseorderdetail cascade;
+
+create table purchaseorderdetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '�H���R�[�h'
+  , SeqNo decimal(3,0) unsigned not null comment '�������}��'
+  , GroupCount decimal(1,0) not null comment '�O���[�v�ԍ�'
+  , LineCount decimal(3,0) unsigned not null comment '�s�ԍ�'
+  , ComponentCode decimal(5,0) unsigned not null comment '�\���L�['
+  , ItemCode decimal(5,0) unsigned not null comment '�H��L�['
+  , FirstString varchar(120) comment '�H��E�i��'
+  , SecondString varchar(120) comment '���e����'
+  , UnitCount decimal(8,2) not null comment '����'
+  , UnitName varchar(30) comment '�P��'
+  , UnitPrice decimal(10,0) not null comment '�P��'
+  , OrdersLinePrice decimal(12,0) comment '���z'
+  , SourceCode decimal(10,0) unsigned not null comment '�\�Z�쐬���H���ԍ�'
+  , SourceLineCnt decimal(3,0) unsigned not null comment '�������쐬���䒠�s�ԍ�'
+  , DataTypeFlag decimal(1,0) unsigned not null comment '�f�[�^�^�C�v�t���O'
+  , EntryDate datetime not null comment '�o�^���t'
+  , UpdateDate datetime not null comment '�X�V���t'
+  , constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount)
+) comment '���������׃f�[�^' ;
+
+create index POrderDetail_Index1
+  on purchaseorderdetail(SourceCode);
+
+Insert INTO purchaseorderdetail
+SELECT
+  ConstructionCode
+  , SeqNo
+  , GroupCount
+  , LineCount
+  , ComponentCode
+  , ItemCode
+  , FirstString
+  , SecondString
+  , UnitCount
+  , UnitName
+  , UnitPrice
+  , OrdersLinePrice
+  , SourceCode
+  , SourceLineCnt
+  , 0
+  , EntryDate
+  , UpdateDate
+FROM purchaseorderdetail_OLD
+;
+update purchaseorderdetail set DataTypeFlag = 1 where FirstString like '%�@��%';
+
+commit;
Index: branches/ddl/20171211_SQL.txt
===================================================================
--- branches/ddl/20171211_SQL.txt	(nonexistent)
+++ branches/ddl/20171211_SQL.txt	(revision 302)
@@ -0,0 +1,102 @@
+-- �H���ڍב䒠���׃f�[�^
+DROP TABLE IF EXISTS constructionledgerdetail_OLD;
+CREATE TABLE constructionledgerdetail_OLD As Select * from constructionledgerdetail;
+
+drop table if exists constructionledgerdetail cascade;
+
+create table constructionledgerdetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '�H���R�[�h'
+  , GroupCount decimal(2,0) unsigned not null comment '�O���[�v�ԍ�'
+  , LineCount decimal(4,0) unsigned not null comment '�s�ԍ�'
+  , ComponentCode decimal(5,0) unsigned not null comment '�\���L�['
+  , ItemCode decimal(5,0) unsigned not null comment '�H��L�['
+  , FirstString varchar(120) comment '���ږ���'
+  , SecondString varchar(120) comment '�H�����e'
+  , CompanyType decimal(1,0) not null comment '���͉�ЃR�[�h�^�C�v'
+  , CompanyCode decimal(8,0) not null comment '���͉�ЃR�[�h'
+  , CompanyName varchar(120) comment '���͉�Ж���'
+  , EstimatePrice decimal(12,0) not null comment '�\�Z�i���ρj���z'
+  , ExecutionAmount decimal(12,0) not null comment '���s���z'
+  , AmountConfigRate decimal(5,2) not null comment '���z�\����'
+  , PaymentBurden decimal(12,0) not null comment '�x����U�z'
+  , FixDataFlg decimal(1,0) not null comment '�Œ�f�[�^�t���O'
+  , IndependentFlg decimal(1,0) not null comment '�Ɨ��f�[�^�t���O'
+  , FluctuationFlg decimal(1,0) not null comment '�����f�[�^�t���O'
+  , SalaryFlg decimal(1,0) not null comment '���^�U���敪'
+  , SalaryDays decimal(4,0) not null comment '���^�U������'
+  , OperatingFlg decimal(1,0) not null comment '�S�����t���O'
+  , SourceCode decimal(10,0) unsigned not null comment '���H���ԍ�'
+  , JoinTitleFlg decimal(1,0) not null comment '�H�����̃^�C�g��'
+  , SalaryOnRegist decimal(12,0) not null comment '�o�^�����z���^'
+  , PurchaseOrderFlg decimal(2,0) not null comment '���������s�t���O'
+  , DetailCount decimal(4,0) unsigned not null comment '���הԍ�'
+  , EntryDate datetime not null comment '�o�^���t'
+  , UpdateDate datetime not null comment '�X�V���t'
+  , constraint constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
+) comment '�H���ڍב䒠���׃f�[�^' ;
+
+create index LedgerDetail_Index01
+  on constructionledgerdetail(ConstructionCode);
+
+create index LedgerDetail_Index02
+  on constructionledgerdetail(GroupCount);
+
+create index LedgerDetail_Index03
+  on constructionledgerdetail(LineCount);
+
+create index LedgerDetail_Index04
+  on constructionledgerdetail(SourceCode);
+
+create index LedgerDetail_Index05
+  on constructionledgerdetail(DetailCount);
+
+Insert INTO constructionledgerdetail
+SELECT
+  ConstructionCode
+  , GroupCount
+  , LineCount
+  , ComponentCode
+  , ItemCode
+  , FirstString
+  , SecondString
+  , CompanyType
+  , CompanyCode
+  , CompanyName
+  , EstimatePrice
+  , ExecutionAmount
+  , AmountConfigRate
+  , PaymentBurden
+  , FixDataFlg
+  , IndependentFlg
+  , FluctuationFlg
+  , SalaryFlg
+  , SalaryDays
+  , OperatingFlg
+  , SourceCode
+  , JoinTitleFlg
+  , SalaryOnRegist
+  , PurchaseOrderFlg
+  , 0
+  , EntryDate
+  , UpdateDate
+FROM constructionledgerdetail_OLD
+;
+
+ALTER TABLE purchaseorderdetail 
+CHANGE SourceCode SourceCode decimal(10,0) unsigned not null
+COMMENT '�䒠�H���ԍ�';
+ALTER TABLE purchaseorderdetail 
+CHANGE SourceLineCnt SourceDetailCnt decimal(4,0) unsigned not null
+COMMENT '�䒠���הԍ�';
+
+ALTER TABLE constructionledgerexcute 
+CHANGE LineCount LineCount decimal(4,0) unsigned not null
+comment '�s�ԍ�';
+
+Truncate table paymentapprovalinfo;
+Truncate table paymentdatadetail;
+Truncate table billingdata;
+Truncate table billingdatadetail;
+Truncate table billingpaymentsummary;
+commit;
+
Index: branches/ddl/ProcessManagement.sql
===================================================================
--- branches/ddl/ProcessManagement.sql	(revision 301)
+++ branches/ddl/ProcessManagement.sql	(revision 302)
@@ -1,5 +1,5 @@
 -- Project Name : noname
--- Date/Time    : 2017/10/05 15:29:38
+-- Date/Time    : 2017/12/12 10:48:17
 -- Author       : Horiuchi
 -- RDBMS Type   : MySQL
 -- Application  : A5:SQL Mk-2
@@ -615,7 +615,7 @@
 create table constructionledgerdetail (
   ConstructionCode decimal(10,0) unsigned not null comment '�H���R�[�h'
   , GroupCount decimal(2,0) unsigned not null comment '�O���[�v�ԍ�'
-  , LineCount decimal(3,0) unsigned not null comment '�s�ԍ�'
+  , LineCount decimal(4,0) unsigned not null comment '�s�ԍ�'
   , ComponentCode decimal(5,0) unsigned not null comment '�\���L�['
   , ItemCode decimal(5,0) unsigned not null comment '�H��L�['
   , FirstString varchar(120) comment '���ږ���'
@@ -637,6 +637,7 @@
   , JoinTitleFlg decimal(1,0) not null comment '�H�����̃^�C�g��'
   , SalaryOnRegist decimal(12,0) not null comment '�o�^�����z���^'
   , PurchaseOrderFlg decimal(2,0) not null comment '���������s�t���O'
+  , DetailCount decimal(4,0) unsigned not null comment '���הԍ�'
   , EntryDate datetime not null comment '�o�^���t'
   , UpdateDate datetime not null comment '�X�V���t'
   , constraint constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
@@ -649,8 +650,14 @@
   on constructionledgerdetail(GroupCount);
 
 create index LedgerDetail_Index03
+  on constructionledgerdetail(LineCount);
+
+create index LedgerDetail_Index04
   on constructionledgerdetail(SourceCode);
 
+create index LedgerDetail_Index05
+  on constructionledgerdetail(DetailCount);
+
 -- �H���ڍב䒠���s�f�[�^
 drop table if exists constructionledgerexcute cascade;
 
@@ -657,7 +664,7 @@
 create table constructionledgerexcute (
   ConstructionCode decimal(10,0) unsigned not null comment '�H���R�[�h'
   , GroupCount decimal(2,0) unsigned not null comment '�O���[�v�ԍ�'
-  , LineCount decimal(3,0) unsigned not null comment '�s�ԍ�'
+  , LineCount decimal(4,0) unsigned not null comment '�s�ԍ�'
   , ColumnCount decimal(3,0) not null comment '��ԍ�'
   , PaymentAmount decimal(12,0) not null comment '�x�����z'
   , TargetMonth date not null comment '�Ώ۔N��'
@@ -1502,6 +1509,27 @@
   , constraint paymentdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
 ) comment '�x�����׃f�[�^' ;
 
+-- �H����������f�[�^
+drop table if exists periodavoidance cascade;
+
+create table periodavoidance (
+  ConstructionCode decimal(10,0) unsigned not null comment '�H���R�[�h'
+  , ConstructionStatusFlg decimal(2,0) not null comment '�H����ԃt���O'
+  , FieldNo decimal(2,0) not null comment '�`�F�b�N�Ώۃt�B�[���h�ԍ�'
+  , EntryDate datetime not null comment '�o�^���t'
+  , UpdateDate datetime not null comment '�X�V���t'
+  , constraint periodavoidance_PKC primary key (ConstructionCode,ConstructionStatusFlg,FieldNo)
+) comment '�H����������f�[�^' ;
+
+create index PeriodAvoidance_Index1
+  on periodavoidance(ConstructionCode);
+
+create index PeriodAvoidance_Index2
+  on periodavoidance(ConstructionStatusFlg);
+
+create index PeriodAvoidance_Index3
+  on periodavoidance(FieldNo);
+
 -- �S���ҏ��F�f�[�^
 drop table if exists personapproval cascade;
 
@@ -1662,21 +1690,6 @@
   , constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
 ) comment '�����ґł����킹�c���^�f�[�^�i�o�Ȏҁj' ;
 
--- �����ґł����킹�c���^�f�[�^�i�o�Ȏҁj
-drop table if exists proceedingsdataattendee cascade;
-
-create table proceedingsdataattendee (
-  PersonCode decimal(8,0) not null comment '�쐬�҃R�[�h'
-  , ProceedingsDataDate date not null comment '�c���^�쐬��'
-  , ConstructionCode int(11) not null comment '�H���ԍ�'
-  , SeqNo smallint(6) not null comment '�f�[�^�s�ԍ�'
-  , Department varchar(100) comment '�o�Ȏҏ���'
-  , AttendeeName varchar(100) comment '�o�ȎҎ���'
-  , EntryDate datetime not null comment '�o�^�N����'
-  , UpdateDate datetime not null comment '�X�V�N����'
-  , constraint proceedingsdataattendee_PKC primary key (PersonCode,ProceedingsDataDate,ConstructionCode,SeqNo)
-) comment '�����ґł����킹�c���^�f�[�^�i�o�Ȏҁj' ;
-
 -- �����ґł����킹�c���^�f�[�^�i���ׁj
 drop table if exists proceedingsdatadetail cascade;
 
@@ -1825,8 +1838,9 @@
   , UnitName varchar(30) comment '�P��'
   , UnitPrice decimal(10,0) not null comment '�P��'
   , OrdersLinePrice decimal(12,0) comment '���z'
-  , SourceCode decimal(10,0) unsigned not null comment '�\�Z�쐬���H���ԍ�'
-  , SourceLineCnt decimal(3,0) unsigned not null comment '�������쐬���䒠�s�ԍ�'
+  , SourceCode decimal(10,0) unsigned not null comment '�䒠�H���ԍ�'
+  , SourceDetailCnt decimal(4,0) unsigned not null comment '�䒠���הԍ�'
+  , DataTypeFlag decimal(1,0) unsigned not null comment '�f�[�^�^�C�v�t���O'
   , EntryDate datetime not null comment '�o�^���t'
   , UpdateDate datetime not null comment '�X�V���t'
   , constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount)
Index: branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs	(revision 302)
@@ -14,7 +14,7 @@
         /// <summary>
         /// 本体バージョン
         /// </summary>
-        public static int s_SystemVersion = 114;
+        public static int s_SystemVersion = 116;
 
         /// <summary>
         /// コピー・環境バージョン
Index: branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsChangeLedgerData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsChangeLedgerData.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsChangeLedgerData.cs	(revision 302)
@@ -92,15 +92,16 @@
 
                 for (int i = (int)CostDataOfPerson.DataNoDef.Transport; i <= (int)CostDataOfPerson.DataNoDef.DisposalCost; i++)
                 {
-                    string strSQL = "SELECT CONSTRUCTIONCODE, DATATYPE, DATE_FORMAT(ACTIONDATE,'%Y/%m'), SUM(ENTRYPRICE) FROM COSTDATAOFPERSON";
-                    strSQL += String.Format(" WHERE DATE_FORMAT(ACTIONDATE,'%Y/%m') = '{0}'", TargetMonth);
-                    strSQL += String.Format(" AND DATATYPE = {0}", i);
-                    strSQL += " AND CONSTRUCTIONCODE IN (SELECT A1.CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO A1";
-                    strSQL += string.Format(" WHERE (A1.SALESPERSONCODE = {0} OR A1.CONSTRUCTIONPERSONCODE = {0} OR A1.CONSTRSUBPERSONCODE = {0} OR A1.CONSTRUCTIONINSTRUCTOR = {0}))", PersonCode);
-                    strSQL += " GROUP BY CONSTRUCTIONCODE, DATATYPE, DATE_FORMAT(ACTIONDATE,'%Y/%m')";
-                    strSQL += " ORDER BY CONSTRUCTIONCODE, DATATYPE";
+                    StringBuilder strSQL = new StringBuilder();
+                    strSQL.Append("SELECT CONSTRUCTIONCODE, DATATYPE, DATE_FORMAT(ACTIONDATE,'%Y/%m'), SUM(ENTRYPRICE) FROM COSTDATAOFPERSON");
+                    strSQL.AppendFormat(" WHERE DATE_FORMAT(ACTIONDATE,'%Y/%m') = '{0}'", TargetMonth);
+                    strSQL.AppendFormat(" AND DATATYPE = {0}", i);
+                    strSQL.Append(" AND CONSTRUCTIONCODE IN (SELECT A1.CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO A1");
+                    strSQL.AppendFormat(" WHERE (A1.SALESPERSONCODE = {0} OR A1.CONSTRUCTIONPERSONCODE = {0} OR A1.CONSTRSUBPERSONCODE = {0} OR A1.CONSTRUCTIONINSTRUCTOR = {0}))", PersonCode);
+                    strSQL.Append(" GROUP BY CONSTRUCTIONCODE, DATATYPE, DATE_FORMAT(ACTIONDATE,'%Y/%m')");
+                    strSQL.Append(" ORDER BY CONSTRUCTIONCODE, DATATYPE");
                     ArrayList arList = new ArrayList();
-                    if (!CostDB.ExecuteReader(strSQL, ref arList, false)) continue;
+                    if (!CostDB.ExecuteReader(strSQL.ToString(), ref arList, false)) continue;
                     if (arList.Count == 0) continue;
 
                     foreach (object[] wrkrec in arList)
@@ -996,51 +997,75 @@
         /// </summary>
         /// <param name="EntryList"></param>
         /// <returns></returns>
-        public static bool EntryExecuteData(List<ConstructionLedgerExcute> EntryList)
+        public static bool EntryExecuteData(IOConstructionLedgerDetail DetailDB
+                                            , IOConstructionLedgerExcute ExecDB
+                                            , ArrayList EntryList)
         {
-            IOConstructionLedgerExcute ExecDB = new IOConstructionLedgerExcute();
             try
             {
-                ExecDB.connect(); ExecDB.beginTran();
-
                 StringBuilder strSQL = new StringBuilder();
                 bool bExists = true;
                 bool bRet = true;
                 List<int> ConstrCodeList = new List<int>();
-                List<ConstructionLedgerExcute> ExecList = new List<ConstructionLedgerExcute>();
-                int nLineCount = 0;
+                ArrayList ExecList = new ArrayList();
 
-                foreach (ConstructionLedgerExcute CurRec in EntryList)
+                foreach (object[] CurData in EntryList)
                 {
-                    strSQL.Clear();
 
+                    ConstructionLedgerDetail DetailRec = (ConstructionLedgerDetail)CurData[0];
+                    ConstructionLedgerExcute ExcuteRec = (ConstructionLedgerExcute)CurData[1];
+
                     // 工事番号が0の場合は処理しない
-                    if (CurRec.ConstructionCode == 0) continue;
+                    if (ExcuteRec.ConstructionCode == 0) continue;
                     // グループ番号が0の場合は処理しない
-                    if (CurRec.GroupCount == 0) continue;
-                    // 行・列番号が0の場合は処理しない
-                    if (CurRec.LineCount == 0 && CurRec.ColumnCount == 0) continue;
+                    if (ExcuteRec.GroupCount == 0) continue;
 
-                    // キー作成
-                    strSQL.AppendFormat(ExecDB.CreatePrimarykeyString(CurRec.ConstructionCode,
-                                                                        CurRec.GroupCount,
-                                                                        CurRec.LineCount,
-                                                                        CurRec.ColumnCount));
+                    // SQL作成
+                    strSQL.Clear();
+                    strSQL.Append("Select");
+                    strSQL.Append(" A.ConstructionCode");
+                    strSQL.Append(", A.GroupCount");
+                    strSQL.Append(", A.LineCount");
+                    strSQL.Append(", B.ColumnCount");
+                    strSQL.Append(", B.TargetMonth");
+                    strSQL.Append(" From");
+                    strSQL.Append(" constructionledgerdetail AS A");
+                    strSQL.Append(" Left Join constructionledgerexcute AS B");
+                    strSQL.Append("    On B.ConstructionCode = A.ConstructionCode");
+                    strSQL.Append("    And B.GroupCount = A.GroupCount");
+                    strSQL.Append("    And B.LineCount = A.LineCount");
+                    strSQL.AppendFormat("    And B.ColumnCount = {0}", ExcuteRec.ColumnCount);
+
+                    strSQL.AppendFormat(" Where A.ConstructionCode = {0}", ExcuteRec.ConstructionCode);
+                    strSQL.AppendFormat(" And A.GroupCount = {0}", ExcuteRec.GroupCount);
+                    strSQL.AppendFormat(" And A.DetailCount = {0}", DetailRec.DetailCount);
+
                     ExecList.Clear();
-                    if (!ExecDB.SelectAction(strSQL.ToString(), ref ExecList, false)) continue;
+                    if (!ExecDB.ExecuteReader(strSQL.ToString(), ref ExecList, false)) continue;
+                    if (ExcuteRec.ConstructionCode == 2017028801) { Debug.WriteLine(""); }
+                    bExists = false;
+                    object[] objRec = (object[])ExecList[0];
+                    // 明細データが存在する場合
                     if (ExecList.Count > 0)
-                        bExists = true;
-                    else
-                        bExists = false;
+                    {
+                        // 行番号をセットする
+                        ExcuteRec.LineCount = CommonMotions.cnvInt(objRec[2]);
+                        // 実行データも存在する場合
+                        if (CommonMotions.cnvInt(objRec[3]) != 0)
+                        {
+                            bExists = true;
+                        }
+                    }
 
+
                     if (bExists)
                     {   // データ存在時は支払金額更新
-                        if(!ExecDB.UpdateFeild(CurRec.ConstructionCode,
-                                            CurRec.GroupCount,
-                                            CurRec.LineCount,
-                                            CurRec.ColumnCount,
+                        if (!ExecDB.UpdateFeild(ExcuteRec.ConstructionCode,
+                                            ExcuteRec.GroupCount,
+                                            ExcuteRec.LineCount,
+                                            ExcuteRec.ColumnCount,
                                             (int)IOConstructionLedgerExcute.TableColumn.PaymentAmount,
-                                            CurRec.PaymentAmount,
+                                            ExcuteRec.PaymentAmount,
                                             false))
                         {
                             bRet = false;
@@ -1049,19 +1074,31 @@
                     }
                     else
                     {
-                        // 行番号が設定されていない場合は新規に取得する
-                        if (CurRec.LineCount == 0)
+                        // キー項目取得条件作成
+                        strSQL.Clear();
+                        strSQL.Append(DetailDB.CreatePrimarykeyString(ExcuteRec.ConstructionCode, ExcuteRec.GroupCount));
+                        strSQL.AppendFormat(" And DetailCount = {0}", DetailRec.DetailCount);
+
+                        // データがない場合は新規行番号を取得する
+                        ExcuteRec.LineCount = DetailDB.SelectMaxLineCount(strSQL.ToString(), false);
+                        DetailRec.LineCount = ExcuteRec.LineCount;
+
+                        // 明細データも実行データも存在しない
+                        if (ExecList.Count < 1)
                         {
-                            nLineCount = 0;
-                            if (GetNewLineNo(ExecDB, CurRec, ref nLineCount))
+                            // データがない場合は新規明細番号を取得する
+                            DetailRec.DetailCount = DetailDB.SelectMaxDetailCount(strSQL.ToString(), false);
+
+                            // 明細データ新規作成
+                            if (!DetailDB.InsertAction(DetailRec, false))
                             {
                                 bRet = false;
                                 break;
                             }
-                            CurRec.LineCount = nLineCount;
                         }
-                        // 新規作成
-                        if (!ExecDB.InsertAction(CurRec, false))
+
+                        // 実行データ新規作成
+                        if (!ExecDB.InsertAction(ExcuteRec, false))
                         {
                             bRet = false;
                             break;
@@ -1073,7 +1110,7 @@
                     foreach (int CurCode in ConstrCodeList)
                     {
                         // 既に追加済みかを探す
-                        if (CurCode == CurRec.ConstructionCode)
+                        if (CurCode == ExcuteRec.ConstructionCode)
                         {
                             bAddFlg = false;
                             break;
@@ -1081,87 +1118,27 @@
                     }
                     if (bAddFlg)
                     {   // 更新対象リストへ追加
-                        ConstrCodeList.Add(CurRec.ConstructionCode);
+                        ConstrCodeList.Add(ExcuteRec.ConstructionCode);
                     }
                 }
-                // ループ後エラーがあれば処理終了
-                if (!bRet)
+                // ループ後エラーが無ければ再計算処理
+                if (bRet)
                 {
-                    ExecDB.rollback();
-                    return bRet;
+                    // 台帳再計算
+                    if (!LedgerRecalculate(ExecDB, ConstrCodeList))
+                    {
+                        bRet = false;
+                    }
                 }
-
-                // 台帳再計算
-                if (!LedgerRecalculate(ExecDB, ConstrCodeList))
-                {
-                    bRet = false;
-                    ExecDB.rollback();
-                }
-
                 return bRet;
             }
             catch (System.Exception ex)
             {
                 logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                ExecDB.rollback();
                 return false;
             }
-            finally
-            {
-                ExecDB.commit();
-                ExecDB.close(); ExecDB = null;
-            }
         }
         #endregion
-
-        #region 工事台帳より新規の行番号を取得する
-        /// <summary>
-        /// 工事台帳より新規の行番号を取得する
-        /// </summary>
-        private static bool GetNewLineNo(IOConstructionLedgerExcute ExecDB, ConstructionLedgerExcute CurRec, ref int nLineCount)
-        {
-            try
-            {
-                StringBuilder strSQL = new StringBuilder();
-                ArrayList CountData = new ArrayList();
-
-                // 行番号が0の場合は施工費の最大行番号で新規データ作成
-                strSQL.Clear();
-                strSQL.Append("SELECT MAX(LINECOUNT) FROM CONSTRUCTIONLEDGERDETAIL");
-                strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", CurRec.ConstructionCode);
-                strSQL.AppendFormat(" AND GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
-                strSQL.AppendFormat(" AND FLUCTUATIONFLG = {0}", (int)ConstructionLedgerDetail.FlucFlgDef.Normal);
-
-                CountData.Clear();
-                if (!ExecDB.ExecuteReader(strSQL.ToString(), ref CountData, false)) return false;
-
-                object[] objRec = (object[])CountData[0];
-                nLineCount = CommonMotions.cnvInt(objRec[0]) + 1;
-
-                // ----- 取得行以下を1行下げる
-                // 工事詳細台帳明細データ
-                strSQL.Clear();
-                strSQL.Append("UPDATE CONSTRUCTIONLEDGERDETAIL SET LineCount = (LineCount + 1)");
-                strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", CurRec.ConstructionCode);
-                strSQL.AppendFormat(" AND LineCount >= {0}", nLineCount);
-                if (!ExecDB.ExecuteNonQuery(strSQL.ToString(), false)) return false;
-
-                // 工事詳細台帳実行データ
-                strSQL.Clear();
-                strSQL.Append("UPDATE CONSTRUCTIONLEDGEREXCUTE SET LineCount = (LineCount + 1)");
-                strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", CurRec.ConstructionCode);
-                strSQL.AppendFormat(" AND LineCount >= {0}", nLineCount);
-                if (!ExecDB.ExecuteNonQuery(strSQL.ToString(), false)) return false;
-
-                return true;
-            }
-            catch (System.Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
-            }
-        }
-        #endregion
         // ↑↑ ** ----- インターフェース ----- **
     }
 }
Index: branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs	(revision 302)
@@ -127,6 +127,7 @@
             MaterialKind = 127,                 // 127:資材種類マスタ
             MaterialItem = 128,                 // 128:資材品目マスタ
             SalesConfirm = 129,                 // 129:売上確認
+            BankBusinessDay = 130,              // 130:銀行営業日マスタ
         }
         #endregion
 
@@ -237,6 +238,8 @@
                                                                                 { (int)MaintenanceExecuteNo.MaterialKind,               "資材種類登録"},               // 127
                                                                                 { (int)MaintenanceExecuteNo.MaterialItem,               "資材品目登録"},               // 128
                                                                                 { (int)MaintenanceExecuteNo.SalesConfirm,               "売上順一覧"},                 // 129
+                                                                                { (int)MaintenanceExecuteNo.BankBusinessDay,            "銀行営業日登録"},             // 130
+
                                                                                 };
         #endregion
 
@@ -765,6 +768,9 @@
                         case (int)MaintenanceExecuteNo.SalesConfirm:                        // 129:売上確認
                             MaintenanceExecuteNo_SalesConfirm(m_ProcControlPara[NowPoint]);
                             break;
+                        case (int)MaintenanceExecuteNo.BankBusinessDay:                     // 130:銀行営業日
+                            MaintenanceExecuteNo_BBD(m_ProcControlPara[NowPoint]);
+                            break;
 
 
                         #endregion
@@ -3611,8 +3617,42 @@
         }
         #endregion
 
+        #region 銀行営業日マスタ
+        /// <summary>
+        /// 銀行営業日マスタ
+        /// </summary>
+        public static void MaintenanceExecuteNo_BBD(ProcessParameter CurrentPara)
+        {
+            // 銀行営業日マスタ
+            FrmBBD frm = new FrmBBD();
+            try
+            {
+                // 起動・編集フラグ
+                int ProcessNo = (int)MaintenanceExecuteNo.BankBusinessDay;
+                int EditFlg = (int)CommonDefine.ProcessDataEdit.Reference;
+                if (!ClsSecurityPermission.GetExecutePermission(ProcessNo, ref EditFlg))
+                {
+                    BackProcess();
+                    return;
+                }
+                if (EditFlg == (int)CommonDefine.ProcessDataEdit.Reference) frm.EditLock = true;
+
+                frm.ShowDialog();
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+                BackProcess();
+            }
+            finally
+            {
+                frm.Dispose(); frm = null;
+            }
+        }
         #endregion
 
+        #endregion
+
         #region サブフォーム
         #region 掲示板メッセージ入力
         /// <summary>
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBankBusinessDayMaster.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBankBusinessDayMaster.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBankBusinessDayMaster.cs	(revision 302)
@@ -116,6 +116,7 @@
 
                 foreach (BankBusinessDayMaster work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO BankBusinessDayMaster");
 
                     strcmd.Append(" VALUES (");
@@ -188,8 +189,7 @@
             StringBuilder strcmd = new StringBuilder();
             try
             {
-                strcmd.Append("Update BankBusinessDayMaster Set DeleteFlg = 1");
-                strcmd.Append(", UpdateDate = NOW()");
+                strcmd.Append("Delete From BankBusinessDayMaster");
                 strcmd.Append(AddSQLString);
 
                 if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingData.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingData.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingData.cs	(revision 302)
@@ -113,6 +113,7 @@
 
                 foreach (BillingData work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO BillingData");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingDataDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingDataDetail.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingDataDetail.cs	(revision 302)
@@ -137,6 +137,7 @@
 
                 foreach (BillingDataDetail work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO BillingDataDetail");
 
                     strcmd.Append("(");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingPaymentSummary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingPaymentSummary.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingPaymentSummary.cs	(revision 302)
@@ -135,6 +135,7 @@
 
                 foreach (BillingPaymentSummary work in data)
                 {
+                    strcmd.Clear(); 
                     strcmd.Append("INSERT INTO BillingPaymentSummary");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerDetail.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerDetail.cs	(revision 302)
@@ -58,6 +58,7 @@
             JoinTitleFlg,           // 工事名称タイトル
             SalaryOnRegist,         // 登録時月額給与
             PurchaseOrderFlg,       // 注文書発行フラグ
+            DetailCount,            // 明細番号
 
             EntryDate,
             UpdateDate,
@@ -109,6 +110,7 @@
             strcmd.Append(", JoinTitleFlg");             // 工事名称タイトル
             strcmd.Append(", SalaryOnRegist");           // 登録時月額給与
             strcmd.Append(", PurchaseOrderFlg");         // 注文書発行フラグ
+            strcmd.Append(", DetailCount");              // 明細番号
 
             strcmd.Append(", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')");
             strcmd.Append(", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')");
@@ -242,6 +244,7 @@
                 strcmd.AppendFormat(", {0}", work.JoinTitleFlg);            // 工事名称タイトル
                 strcmd.AppendFormat(", {0}", work.SalaryOnRegist);          // 登録時月額給与
                 strcmd.AppendFormat(", {0}", work.PurchaseOrderFlg);        // 注文書発行フラグ
+                strcmd.AppendFormat(", {0}", work.DetailCount);             // 明細番号
 
                 strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
                 strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
@@ -314,6 +317,7 @@
                     strcmd.AppendFormat(", {0}", work.JoinTitleFlg);            // 工事名称タイトル
                     strcmd.AppendFormat(", {0}", work.SalaryOnRegist);          // 登録時月額給与
                     strcmd.AppendFormat(", {0}", work.PurchaseOrderFlg);        // 注文書発行フラグ
+                    strcmd.AppendFormat(", {0}", work.DetailCount);             // 明細番号
 
                     strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
                     strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
@@ -377,6 +381,7 @@
                 strcmd.AppendFormat(", JoinTitleFlg = {0}", data.JoinTitleFlg);                 // 工事名称タイトルフラグ
                 strcmd.AppendFormat(", SalaryOnRegist = {0}", data.SalaryOnRegist);             // 登録時月額給与
                 strcmd.AppendFormat(", PurchaseOrderFlg = {0}", data.PurchaseOrderFlg);         // 注文書発行フラグ
+                strcmd.AppendFormat(", DetailCount = {0}", data.DetailCount);                   // 明細番号
 
                 strcmd.Append(", UpdateDate = NOW()");
                 strcmd.Append(AddSQLString);
@@ -458,6 +463,7 @@
                 wrk.JoinTitleFlg = int.Parse(objwrk[(int)TableColumn.JoinTitleFlg].ToString());                  // 工事名称タイトルフラグ
                 wrk.SalaryOnRegist = CommonMotions.cnvDouble(objwrk[(int)TableColumn.SalaryOnRegist]);           // 登録時月額給与
                 wrk.PurchaseOrderFlg = int.Parse(objwrk[(int)TableColumn.PurchaseOrderFlg].ToString());          // 注文書発行フラグ
+                wrk.DetailCount = int.Parse(objwrk[(int)TableColumn.DetailCount].ToString());                    // 明細番号
 
                 wrk.EntryDate = DateTime.Parse(objwrk[(int)TableColumn.EntryDate].ToString());
                 wrk.UpdateDate = DateTime.Parse(objwrk[(int)TableColumn.UpdateDate].ToString());
@@ -617,6 +623,9 @@
                     case (int)TableColumn.PurchaseOrderFlg:      // 注文書発行フラグ
                         strcmd.AppendFormat(" PurchaseOrderFlg = {0}", ((int)value).ToString());
                         break;
+                    case (int)TableColumn.DetailCount:          // 明細番号
+                        strcmd.AppendFormat(" DetailCount = {0}", ((int)value).ToString());
+                        break;
 
                     default:
                         break;
@@ -637,16 +646,16 @@
         /// <param name="OutsourcingFlg"></param>
         /// <param name="LineCount"></param>
         /// <returns></returns>
-        public string CreatePrimarykeyString(int ConstructionCode, int GroupCount = 0, int LineCount = 0)
+        public string CreatePrimarykeyString(int ConstructionCode, int GroupCount = 0, int LineCount = 0, string strArias = "")
         {
             StringBuilder strWork = new StringBuilder();
             try
             {
-                strWork.AppendFormat(" Where ConstructionCode = {0}", ConstructionCode);
+                strWork.AppendFormat(" Where {0}ConstructionCode = {1}", strArias, ConstructionCode);
                 if (GroupCount != 0)
-                    strWork.AppendFormat(" And GroupCount = {0}", GroupCount);
+                    strWork.AppendFormat(" And {0}GroupCount = {1}", strArias, GroupCount);
                 if (LineCount != 0)
-                    strWork.AppendFormat(" And LineCount = {0}", LineCount);
+                    strWork.AppendFormat(" And {0}LineCount = {1}", strArias, LineCount);
 
                 return strWork.ToString();
             }
@@ -697,5 +706,45 @@
             return iRet;
         }
         #endregion
+
+        #region 明細番号の最大値を取得
+        /// <summary>
+        /// 明細の最大値を取得する
+        /// </summary>
+        /// <param name="AddSQLString"></param>
+        /// <param name="bConnect"></param>
+        /// <returns></returns>
+        public int SelectMaxDetailCount(string AddSQLString, bool bConnect = true)
+        {
+            // インターフェース
+            StringBuilder strcmd = new StringBuilder();
+            ArrayList arData = new ArrayList();
+            int iRet = 0;
+            try
+            {
+                // SQL作成
+                strcmd.Append("SELECT IFNULL(MAX(DetailCount), 0) FROM ConstructionLedgerDetail");
+                strcmd.Append(AddSQLString);
+
+                // SQL実行
+                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
+
+                // データセット
+                foreach (object[] objwrk in arData)
+                {
+                    if (objwrk[0].ToString().Equals("null"))
+                        iRet = 0;
+                    else
+                        iRet = int.Parse(objwrk[0].ToString());
+                }
+
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}：{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
+            }
+            return iRet;
+        }
+        #endregion
     }
 }
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerExcute.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerExcute.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerExcute.cs	(revision 302)
@@ -352,7 +352,7 @@
         /// 1項目の更新を行う
         /// </summary>
         /// <returns></returns>
-        public bool UpdateFeild(int ConstructionCode, int FeildNo, object value, bool bConnect = true)
+        public bool UpdateFeild(string strWhere, int FeildNo, object value, bool bConnect = true)
         {
             StringBuilder strcmd = new StringBuilder();
             try
@@ -389,7 +389,7 @@
                 }
 
                 strcmd.Append(", UpdateDate = NOW()");
-                strcmd.Append(CreatePrimarykeyString(ConstructionCode));
+                strcmd.Append(strWhere);
 
                 if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionMaterialInfo.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionMaterialInfo.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionMaterialInfo.cs	(revision 302)
@@ -122,6 +122,7 @@
 
                 foreach (ConstructionMaterialInfo work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO ConstructionMaterialInfo");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODeadLineMaster.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODeadLineMaster.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODeadLineMaster.cs	(revision 302)
@@ -119,6 +119,7 @@
 
                 foreach (DeadLineMaster work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO DeadLineMaster");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCategoryName.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCategoryName.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMCategoryName.cs	(revision 302)
@@ -120,6 +120,7 @@
 
                 foreach (CategoryNameMaster work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO CategoryNameMaster");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMExpenses.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMExpenses.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMExpenses.cs	(revision 302)
@@ -179,6 +179,7 @@
 
                 foreach (ExpensesMaster work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO ExpensesMaster");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialInfo.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialInfo.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialInfo.cs	(revision 302)
@@ -112,6 +112,7 @@
 
                 foreach (MaterialInfo work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO MaterialInfo");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialItem.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialItem.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialItem.cs	(revision 302)
@@ -120,6 +120,7 @@
 
                 foreach (MaterialItemMaster work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO MaterialItemMaster");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialRecordInfo.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialRecordInfo.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialRecordInfo.cs	(revision 302)
@@ -123,6 +123,7 @@
 
                 foreach (MaterialRecordInfo work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO MaterialRecordInfo");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialTypes.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialTypes.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialTypes.cs	(revision 302)
@@ -111,6 +111,7 @@
 
                 foreach (MaterialKindMaster work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO MaterialKindMaster");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentApprovalInfo.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentApprovalInfo.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentApprovalInfo.cs	(revision 302)
@@ -201,6 +201,7 @@
 
                 foreach (PaymentApprovalInfo work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO PaymentApprovalInfo");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentDataDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentDataDetail.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentDataDetail.cs	(revision 302)
@@ -143,6 +143,7 @@
 
                 foreach (PaymentDataDetail work in data)
                 {
+                    strcmd.Clear();
                     strcmd.Append("INSERT INTO PaymentDataDetail");
 
                     strcmd.Append(" VALUES (");
Index: branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrderDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrderDetail.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrderDetail.cs	(revision 302)
@@ -46,8 +46,8 @@
             UnitName,		        // 単位
             UnitPrice,		        // 単価
             OrdersLinePrice,		// 金額
-            SourceCode,             // 予算作成時工事番号
-            SourceLineCnt,	        // 注文書作成時台帳行番号
+            SourceCode,             // 台帳工事番号
+            SourceDetailCnt,	    // 台帳明細番号
             DataTypeFlag,           // 明細行データタイプフラグ
 
             EntryDate,
@@ -89,8 +89,8 @@
             strcmd.Append(", UnitName");		        // 単位
             strcmd.Append(", UnitPrice");		        // 単価
             strcmd.Append(", OrdersLinePrice");		    // 金額
-            strcmd.Append(", SourceCode");              // 予算作成時工事番号
-            strcmd.Append(", SourceLineCnt");	        // 注文書作成時台帳行番号
+            strcmd.Append(", SourceCode");              // 台帳工事番号
+            strcmd.Append(", SourceDetailCnt");	        // 台帳明細番号
             strcmd.Append(", DataTypeFlag");            // 明細行データタイプフラグ
 
             strcmd.Append(", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')");
@@ -217,8 +217,8 @@
                 strcmd.AppendFormat(",'{0}'", work.UnitName);		        // 単位
                 strcmd.AppendFormat(", {0}", work.UnitPrice);		        // 単価
                 strcmd.AppendFormat(", {0}", work.OrdersLinePrice);         // 金額
-                strcmd.AppendFormat(", {0}", work.SourceCode);              // 予算作成時工事番号
-                strcmd.AppendFormat(", {0}", work.SourceLineCnt);	        // 注文書作成時台帳行番号
+                strcmd.AppendFormat(", {0}", work.SourceCode);              // 台帳工事番号
+                strcmd.AppendFormat(", {0}", work.SourceDetailCnt);	        // 台帳明細番号
                 strcmd.AppendFormat(", {0}", work.DataTypeFlag);            // 明細行データタイプフラグ
 
 
@@ -279,8 +279,8 @@
                     strcmd.AppendFormat(",'{0}'", work.UnitName);		        // 単位
                     strcmd.AppendFormat(", {0}", work.UnitPrice);		        // 単価
                     strcmd.AppendFormat(", {0}", work.OrdersLinePrice);         // 金額
-                    strcmd.AppendFormat(", {0}", work.SourceCode);              // 予算作成時工事番号
-                    strcmd.AppendFormat(", {0}", work.SourceLineCnt);	        // 注文書作成時台帳行番号
+                    strcmd.AppendFormat(", {0}", work.SourceCode);              // 台帳工事番号
+                    strcmd.AppendFormat(", {0}", work.SourceDetailCnt);	        // 台帳明細番号
                     strcmd.AppendFormat(", {0}", work.DataTypeFlag);            // 明細行データタイプフラグ
 
                     strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
@@ -332,8 +332,8 @@
                 strcmd.AppendFormat(", UnitName = '{0}'", data.UnitName);		                // 単位
                 strcmd.AppendFormat(", UnitPrice = {0}", data.UnitPrice);		                // 単価
                 strcmd.AppendFormat(", OrdersLinePrice = {0}", data.OrdersLinePrice);		    // 金額
-                strcmd.AppendFormat(", SourceCode = {0}", data.SourceCode);                     // 予算作成時工事番号
-                strcmd.AppendFormat(", SourceLineCnt = {0}", data.SourceLineCnt);	            // 注文書作成時台帳行番号
+                strcmd.AppendFormat(", SourceCode = {0}", data.SourceCode);                     // 台帳工事番号
+                strcmd.AppendFormat(", SourceDetailCnt = {0}", data.SourceDetailCnt);	        // 台帳明細番号
                 strcmd.AppendFormat(", DataTypeFlag = {0}", data.DataTypeFlag);                 // 明細行データタイプフラグ
 
                 strcmd.Append(", UpdateDate = NOW()");
@@ -383,7 +383,7 @@
         /// 1項目の更新を行う
         /// </summary>
         /// <returns></returns>
-        public bool UpdateFeild(int ConstructionCode, int FeildNo, object value, bool bConnect = true)
+        public bool UpdateFeild(string strWhere, int FeildNo, object value, bool bConnect = true)
         {
             StringBuilder strcmd = new StringBuilder();
             try
@@ -429,11 +429,11 @@
                     case (int)TableColumn.OrdersLinePrice:	// 金額
                         strcmd.AppendFormat(" OrdersLinePrice = {0}", ((double)value).ToString());
                         break;
-                    case (int)TableColumn.SourceCode:       // 予算作成時工事番号
+                    case (int)TableColumn.SourceCode:       // 台帳工事番号
                         strcmd.AppendFormat(" SourceCode = {0}", ((int)value).ToString());
                         break;
-                    case (int)TableColumn.SourceLineCnt:	// 注文書作成時台帳行番号
-                        strcmd.AppendFormat(" SourceLineCnt = {0}", ((int)value).ToString());
+                    case (int)TableColumn.SourceDetailCnt:	// 台帳明細番号
+                        strcmd.AppendFormat(" SourceDetailCnt = {0}", ((int)value).ToString());
                         break;
                     case (int)TableColumn.DataTypeFlag:     // 明細行データタイプフラグ
                         strcmd.AppendFormat(" DataTypeFlag = {0}", ((int)value).ToString());
@@ -441,7 +441,7 @@
                 }
 
                 strcmd.Append(", UpdateDate = NOW()");
-                strcmd.Append(CreatePrimarykeyString(ConstructionCode));
+                strcmd.Append(strWhere);
 
                 if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
 
@@ -480,8 +480,8 @@
                 wrk.UnitName = objwrk[(int)TableColumn.UnitName].ToString();		                            // 単位
                 wrk.UnitPrice = CommonMotions.cnvDouble(objwrk[(int)TableColumn.UnitPrice]);		            // 単価
                 wrk.OrdersLinePrice = CommonMotions.cnvDouble(objwrk[(int)TableColumn.OrdersLinePrice]);		// 金額
-                wrk.SourceCode = int.Parse(objwrk[(int)TableColumn.SourceCode].ToString());                     // 予算作成時工事番号
-                wrk.SourceLineCnt = int.Parse(objwrk[(int)TableColumn.SourceLineCnt].ToString());	            // 注文書作成時台帳行番号
+                wrk.SourceCode = int.Parse(objwrk[(int)TableColumn.SourceCode].ToString());                     // 台帳工事番号
+                wrk.SourceDetailCnt = int.Parse(objwrk[(int)TableColumn.SourceDetailCnt].ToString());	        // 台帳明細番号
                 wrk.DataTypeFlag = int.Parse(objwrk[(int)TableColumn.DataTypeFlag].ToString());                 // 明細行データタイプフラグ
 
 
@@ -509,7 +509,7 @@
         /// <param name="OutsourcingFlg"></param>
         /// <param name="LineCount"></param>
         /// <returns></returns>
-        public string CreatePrimarykeyString(int ConstructionCode, int SeqNo = 0, int GroupCount = 0, int LineCount = 0, string strArias = "")
+        public string CreatePrimarykeyString(int ConstructionCode, int SeqNo = 0, int GroupCount = -1, int LineCount = 0, string strArias = "")
         {
             StringBuilder strWork = new StringBuilder();
             try
@@ -517,7 +517,7 @@
                 strWork.AppendFormat(" Where {0}ConstructionCode = {1}", strArias, ConstructionCode);
                 if (SeqNo != 0)
                     strWork.AppendFormat(" And {0}SEQNO = {1}", strArias, SeqNo);
-                if (GroupCount != 0)
+                if (GroupCount != -1)
                     strWork.AppendFormat(" And {0}GROUPCOUNT = {1}", strArias, GroupCount);
                 if (LineCount != 0)
                     strWork.AppendFormat(" And {0}LineCount = {1}", strArias, LineCount);
Index: branches/src/ProcessManagement/ProcessManagement/DataModel/BankBusinessDayMaster.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DataModel/BankBusinessDayMaster.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DataModel/BankBusinessDayMaster.cs	(revision 302)
@@ -9,12 +9,12 @@
     public class BankBusinessDayMaster
     {
         #region メンバ変数
-        private int m_YearMonth = 0;       // 年月
-        private int m_BankBusinessDay = 0;         // 銀行営業日
-        private string m_Note = "";         // 備考
-        private int m_DeleteFlg = 0;        // 削除フラグ
-        private DateTime m_EntryDate = DateTime.Now;    // 登録日付
-        private DateTime m_UpdateDate = DateTime.Now;   // 更新日付
+        private int         m_YearMonth = 0;                // 年月
+        private int         m_BankBusinessDay = 0;          // 銀行営業日
+        private string      m_Note = "";                    // 備考
+        private int         m_DeleteFlg = 0;                // 削除フラグ
+        private DateTime    m_EntryDate = DateTime.Now;     // 登録日付
+        private DateTime    m_UpdateDate = DateTime.Now;    // 更新日付
         #endregion
 
         #region コンストラクタ
Index: branches/src/ProcessManagement/ProcessManagement/DataModel/ConstructionLedgerDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DataModel/ConstructionLedgerDetail.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DataModel/ConstructionLedgerDetail.cs	(revision 302)
@@ -122,6 +122,7 @@
         private int     m_JoinTitleFlg = 0;                 // 工事名称タイトル
         private double  m_SalaryOnRegist = 0;               // 登録時月額給与
         private int     m_PurchaseOrderFlg = 0;             // 注文書発行フラグ
+        private int     m_DetailCount = 0;                  // 明細番号
 
         private DateTime m_EntryDate = DateTime.Now;        // 登録日付
         private DateTime m_UpdateDate = DateTime.Now;       // 更新日付
@@ -324,6 +325,14 @@
             get { return m_PurchaseOrderFlg; }
             set { m_PurchaseOrderFlg = value; }
         }
+        /// <summary>
+        /// 明細番号
+        /// </summary>
+        public int DetailCount
+        {
+            get { return m_DetailCount; }
+            set { m_DetailCount = value; }
+        }
 
         /// <summary>
         /// 登録日付
Index: branches/src/ProcessManagement/ProcessManagement/DataModel/PurchaseOrderDetail.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/DataModel/PurchaseOrderDetail.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/DataModel/PurchaseOrderDetail.cs	(revision 302)
@@ -68,8 +68,8 @@
         private string  m_UnitName = string.Empty;	        // 単位
         private double  m_UnitPrice = 0;	                // 単価
         private double  m_OrdersLinePrice = 0;	            // 金額
-        private double  m_SourceCode = 0;                   // 予算作成時工事番号
-        private int     m_SourceLineCnt = 0;                // 注文書作成時台帳行番号
+        private long    m_SourceCode = 0;                   // 台帳工事番号
+        private int     m_SourceDetailCnt = 0;              // 台帳明細番号
 
         private int     m_DataTypeFlag = 0;                 // 明細行データタイプフラグ
 
@@ -179,20 +179,20 @@
             set { m_OrdersLinePrice = value; }
         }
         /// <summary>
-        /// 予算作成時工事番号
+        /// 台帳工事番号
         /// </summary>
-        public double SourceCode
+        public long SourceCode
         {
             get { return m_SourceCode; }
             set { m_SourceCode = value; }
         }
         /// <summary>
-        /// 注文書作成時台帳行番号
+        /// 台帳明細番号
         /// </summary>
-        public int SourceLineCnt
+        public int SourceDetailCnt
         {
-            get { return m_SourceLineCnt; }
-            set { m_SourceLineCnt = value; }
+            get { return m_SourceDetailCnt; }
+            set { m_SourceDetailCnt = value; }
         }
 
         /// <summary>
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionListAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionListAuxiliary.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionListAuxiliary.cs	(revision 302)
@@ -1041,7 +1041,7 @@
                 strSQL.Append(" Left Join processapprovaldetail AS A3");
                 strSQL.Append("    On A3.ConstructionCode = A2.ConstructionCode");
                 strSQL.AppendFormat("    And A3.ApprovalCode = {0}", (int)ClsExcute.ApprovalListNo.PurchaseOrderEntryApproval);
-                strSQL.Append("    And A3.LinkCode = A2.SeqNo");
+                strSQL.Append("          And A3.LinkCode = A2.SeqNo");
                 strSQL.Append(" Left Join processapproval AS A4");
                 strSQL.Append("    On A4.ConstructionCode = A3.ConstructionCode");
                 strSQL.Append("    And A4.ApprovalCode = A3.ApprovalCode");
@@ -1056,8 +1056,9 @@
                 strSQL.AppendFormat(" WHERE A1.CONSTRUCTIONCODE = {0}", ParentCode);
                 strSQL.AppendFormat("  And A1.SOURCECODE = {0}", SourceCode);
                 strSQL.AppendFormat("  AND A1.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
-                strSQL.Append("  AND A1.COMPANYCODE > 0");
-                strSQL.AppendFormat("  And A1.PurchaseOrderFlg <> {0}",(int)ConstructionLedgerDetail.PurOrderFlgDef.NotMakingData);
+                strSQL.Append("        AND A1.COMPANYCODE > 0");
+                strSQL.AppendFormat("  And (A1.PurchaseOrderFlg > {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.ChangeOld);
+                strSQL.AppendFormat("  And A1.PurchaseOrderFlg <> {0})", (int)ConstructionLedgerDetail.PurOrderFlgDef.NotMakingData);
 
                 strSQL.AppendFormat("  And ((ConstrType.PublicFlg != {0}", (int)ConstructionTypeMaster.ConstructionTypeDef.Community);
                 strSQL.AppendFormat("    And A1.EXECUTIONAMOUNT >= {0})", CommonDefine.s_PrintOutPrice);
@@ -1069,8 +1070,8 @@
 
                 ArrayList arList = new ArrayList();
                 if (!OrderDB.ExecuteReader(strSQL.ToString(), ref arList)) return false;
-                if (arList.Count == 0) return false;
-
+                if (arList.Count == 0) return true;
+                
                 bool bRet = true;
                 foreach (object[] objRec in arList)
                 {
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/DataChange.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/DataChange.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/DataChange.cs	(revision 302)
@@ -206,12 +206,6 @@
                     return false;
                 }
 
-                LinkDB.commit();
-                BaseDB.commit();
-                DetailDB.commit();
-                PDateDB.commit();
-
-
                 // ���N���v���Z�X�Z�b�g
                 int NowPoint = ClsExcute.NextProcess((int)ClsExcute.ProcessExecuteNo.EstimateInput);
                 // �I���H���ԍ��Z�b�g
@@ -226,6 +220,12 @@
             }
             finally
             {
+
+                LinkDB.commit();
+                BaseDB.commit();
+                DetailDB.commit();
+                PDateDB.commit();
+
                 LinkDB.close(); LinkDB = null;
                 BaseDB.close(); BaseDB = null;
                 DetailDB.close(); DetailDB = null;
@@ -234,9 +234,9 @@
         }
         #endregion
 
-        #region ���z�����f�[�^�����ݒ菈��
+        #region �����H���f�[�^�����ݒ菈��
         /// <summary>
-        /// ���z�����f�[�^�����ݒ菈��
+        /// �����H���f�[�^�����ݒ菈��
         /// </summary>
         /// <param name="Code"></param>
         /// <param name="DB1"></param>
@@ -246,7 +246,7 @@
         {
             try
             {
-                // ���z�����������擾����
+                // �����H���������擾����
                 StringBuilder strSQL = new StringBuilder();
                 strSQL.AppendFormat("SELECT COUNT(*) FROM CONSTRUCTIONBASEINFO A WHERE A.CONSTRUCTIONSTATUSFLG != {0}",
                                                         CommonDefine.ProjectsStatus.First(x => x.Value.Equals("�� �� ��")).Key);
@@ -284,9 +284,9 @@
         }
         #endregion
 
-        #region ���z�������F�H����{��񏉊��ݒ�
+        #region �����H�����F�H����{��񏉊��ݒ�
         /// <summary>
-        /// ���z�������F�H����{��񏉊��ݒ�
+        /// �����H�����F�H����{��񏉊��ݒ�
         /// </summary>
         /// <param name="cbRec"></param>
         private bool InitSetBaseInfo(int ToCode, IOConstructionBaseInfo cbDB)
@@ -293,11 +293,22 @@
         {
             try
             {
-                // �H����{���̐ݒ�
+                // �R�s�[���H����{���̐ݒ�
                 StringBuilder strSQL = new StringBuilder();
                 strSQL.Append(cbDB.CreatePrimarykeyString(ToCode));
                 ConstructionBaseInfo cbRec = new ConstructionBaseInfo();
                 if (!cbDB.SelectAction(strSQL.ToString(), ref cbRec, false)) return false;
+            
+                // �R�s�[�����e�H���ƈႤ�ꍇ
+                if (ToCode != m_ConstructionCode)
+                {
+                    StringBuilder strGetOrgSQL = new StringBuilder();
+                    strGetOrgSQL.Append(cbDB.CreatePrimarykeyString(m_ConstructionCode));
+                    ConstructionBaseInfo OrgRec = new ConstructionBaseInfo();
+                    if (!cbDB.SelectAction(strGetOrgSQL.ToString(), ref OrgRec, false)) return false;
+                    // �����_��H���������Z�b�g����
+                    cbRec.ConstructionPeriodEnd2 = OrgRec.ConstructionPeriodEnd2;
+                }
 
                 cbRec.TyingFlg = (int)ConstructionBaseInfo.TyingFlgDef.Tying;                          // �R�t���t���O
                 cbRec.ConstructionStatusFlg = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("�˗��󂯒�")).Key;  // �H���i�����
@@ -321,9 +332,10 @@
                 cbRec.OrdersDecisionPriceInTax = 0;                                                 // �ō��󒍌�����z
                 cbRec.TransferConstructionDate = DateTime.MinValue;                                 // �H���ڊǓ�
                 //cbRec.ConstructionPeriodStart = DateTime.MinValue;                                  // �_��H���J�n
-                //cbRec.ConstructionPeriodEnd = DateTime.MinValue;                                    // �_��H������
-                //cbRec.ConstructionPeriodStart2 = DateTime.MinValue;                                 // �_��H���J�n�i�������j
-                //cbRec.ConstructionPeriodEnd2 = DateTime.MinValue;                                   // �_��H�������i�������j
+                if (cbRec.ConstructionPeriodEnd2 != DateTime.MinValue)                               // �����_��H������������Ό_��H��������ύX
+                    cbRec.ConstructionPeriodEnd = cbRec.ConstructionPeriodEnd2;                     // �_��H������
+                cbRec.ConstructionPeriodStart2 = DateTime.MinValue;                                 // �_��H���J�n�i�������j
+                cbRec.ConstructionPeriodEnd2 = DateTime.MinValue;                                   // �_��H�������i�������j
                 //cbRec.StartDate = DateTime.MinValue;	                                            // �H���J�n��
                 //cbRec.EndDate = DateTime.MinValue;                                                  // �H���I����
                 cbRec.PurchaseOrderMailingDate = DateTime.MinValue;                                 // �������X����
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfo.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfo.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfo.cs	(revision 302)
@@ -1377,13 +1377,6 @@
                 CreateProcessContextMenu(m_SubForm);
                 // *-----* �����ړ��{�^���ݒ� *-----*
 
-                // �\���ʒu����
-                if (m_SubForm)
-                {
-                    this.StartPosition = FormStartPosition.CenterParent;
-                    this.Top += CommonDefine.s_DefalutShiftValue;
-                    this.Left += CommonDefine.s_DefalutShiftValue;
-                }
 
                 // �����t�H�[�J�X
                 this.ActiveControl = m_DspCtrl[(int)DspCnt.ConstructionPeriod];
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudget.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudget.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudget.cs	(revision 302)
@@ -778,14 +778,6 @@
                     SeeModeLock();
                 }
 
-                // �\���ʒu����
-                if (m_SubForm)
-                {
-                    this.StartPosition = FormStartPosition.CenterParent;
-                    this.Top += CommonDefine.s_DefalutShiftValue;
-                    this.Left += CommonDefine.s_DefalutShiftValue;
-                }
-
                 // �ύX�t���OOFF
                 m_bChengeAns = false;
                 m_bInitFlg = false;
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudgetAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudgetAuxiliary.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudgetAuxiliary.cs	(revision 302)
@@ -2777,11 +2777,9 @@
                 // 給与コンテンツセット
                 Content = string.Format(CommonDefine.s_SalaryCostMonthlyFormat, CalcBetweenTimes.ToString("#,0"), CommonDefine.InstructorMonthryCost.ToString("#,0"));
 
-                // 差分日付
-                int dDiffDays = 0;
-                // ----- 増減工事のこの場合は期間が同じかのチェックを行う
                 if (m_ConstructionBaseInfo.TyingFlg == (int)ConstructionBaseInfo.TyingFlgDef.Tying)
                 {
+                    // ----- 増減工事の場合は期間が同じかのチェックを行う
                     // 親の期間を取得する
                     DateTime StDate = m_ParentBaseInfo.ConstructionPeriodStart2;
                     DateTime EdDate = m_ParentBaseInfo.ConstructionPeriodEnd2;
@@ -2792,7 +2790,8 @@
                     int MyMonths = DateTimeUtil.GetElapsedMonths(m_ConstructionBaseInfo.ConstructionPeriodStart
                                                                 , m_ConstructionBaseInfo.ConstructionPeriodEnd);
                     // 期間が同じ場合は処理しない
-                    if (StDate == m_ConstructionBaseInfo.ConstructionPeriodStart && EdDate == m_ConstructionBaseInfo.ConstructionPeriodEnd)
+                    if (StDate.Date == m_ConstructionBaseInfo.ConstructionPeriodStart.Date
+                        && EdDate.Date == m_ConstructionBaseInfo.ConstructionPeriodEnd.Date)
                     {
                         CostsValue = 0;
                         Content = string.Empty;
@@ -2804,16 +2803,14 @@
                     }
                     else
                     {
-                        // 差分日付を取得する
-                        dDiffDays = CalcDifferenceDate(m_ConstructionBaseInfo.ConstructionPeriodStart,
-                                                        m_ConstructionBaseInfo.ConstructionPeriodEnd);
                         // 支払い給与計算
-                        CostsValue = CommonDefine.InstructorMonthryCost * CalcBetweenTimes;
+                        int BetweenMonthTimes = MyMonths - ParentMonths;
+                        CostsValue = CommonDefine.InstructorMonthryCost * BetweenMonthTimes;
                         // 構成比率
                         AmountConfigRate = (CostsValue / OrdersPrice) * 100.0;
                         if (AmountConfigRate < -999.00 || 999.00 < AmountConfigRate) AmountConfigRate = 0;
                         // 給与コンテンツセット
-                        Content = string.Format(CommonDefine.s_SalaryCostMonthlyFormat, CalcBetweenTimes.ToString("#,0"), CommonDefine.InstructorMonthryCost.ToString("#,0"));
+                        Content = string.Format(CommonDefine.s_SalaryCostMonthlyFormat, BetweenMonthTimes.ToString("#,0"), CommonDefine.InstructorMonthryCost.ToString("#,0"));
                     }
                 }
 
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.cs	(revision 302)
@@ -120,116 +120,120 @@
         public enum GridColumn
         {
             /// <summary>
-            /// ��
+            ///  0:��
             /// </summary>
             No = 0,
             /// <summary>
-            /// �Œ�t���O
+            ///  1:�Œ�t���O
             /// </summary>
             FixFlg,
             /// <summary>
-            /// �ڍב䒠�s�ԍ�
+            ///  2:�ڍב䒠�s�ԍ�
             /// </summary>
             DataLineCount,
             /// <summary>
-            /// �O���[�v�ԍ�
+            ///  3:�O���[�v�ԍ�
             /// </summary>
             GroupCount,
             /// <summary>
-            /// �\���L�[
+            ///  4:�\���L�[
             /// </summary>
             ComponentCode,
             /// <summary>
-            /// �H��L�[
+            ///  5:�H��L�[
             /// </summary>
             ItemCode,
             /// <summary>
-            /// ���ږ���
+            ///  6:���ږ���
             /// </summary>
             ItemName,
             /// <summary>
-            /// �Ǝ햼��
+            ///  7:�Ǝ햼��
             /// </summary>
             TextName,
             /// <summary>
-            /// ���͉�ЃR�[�h�^�C�v
+            ///  8:���͉�ЃR�[�h�^�C�v
             /// </summary>
             CompanyType,
             /// <summary>
-            /// ���͉�ЃR�[�h
+            ///  9:���͉�ЃR�[�h
             /// </summary>
             CompanyCode,
             /// <summary>
-            /// ���͉�Ж���
+            /// 10:���͉�Ж���
             /// </summary>
             CompanyName,
             /// <summary>
-            /// �\����z
+            /// 11:�\����z
             /// </summary>
             EstimatePrice,
             /// <summary>
-            /// ���s���z
+            /// 12:���s���z
             /// </summary>
             ExecPrice,
             /// <summary>
-            /// �\���䗦
+            /// 13:�\���䗦
             /// </summary>
             Percent,
             /// <summary>
-            /// �^�C�g���s�t���O
+            /// 14:�^�C�g���s�t���O
             /// </summary>
             TitleFlg,
             /// <summary>
-            /// �g�[�^���s�t���O
+            /// 15:�g�[�^���s�t���O
             /// </summary>
             TotalFlg,
             /// <summary>
-            /// �󔒍s�t���O
+            /// 16:�󔒍s�t���O
             /// </summary>
             BlankFlg,
             /// <summary>
-            /// �Ɨ����ڃt���O
+            /// 17:�Ɨ����ڃt���O
             /// </summary>
             IndependentFlg,
             /// <summary>
-            /// �]�����ڃt���O
+            /// 18:�]�����ڃt���O
             /// </summary>
             ChildFlg,
             /// <summary>
-            /// �����H���t���O
+            /// 19:�����H���t���O
             /// </summary>
             FluctuationFlg,
             /// <summary>
-            /// ���^�U���敪
+            /// 20:���^�U���敪
             /// </summary>
             SalaryFlg,
             /// <summary>
-            /// ���^�U������
+            /// 21:���^�U������
             /// </summary>
             SalaryDays,
             /// <summary>
-            /// �S�����t���O
+            /// 22:�S�����t���O
             /// </summary>
             OperatingFlg,
             /// <summary>
-            /// ���H���ԍ�
+            /// 23:���H���ԍ�
             /// </summary>
             SourceCode,
             /// <summary>
-            /// �H�����̃^�C�g��
+            /// 24:�H�����̃^�C�g��
             /// </summary>
             JoinTitleFlg,
             /// <summary>
-            /// �o�^�����z���^
+            /// 25:�o�^�����z���^
             /// </summary>
             SalaryOnRegist,
             /// <summary>
-            /// ���������s�t���O
+            /// 26:���������s�t���O
             /// </summary>
             PurchaseOrderFlg,
             /// <summary>
-            /// �x�����z1�J����
+            /// 27:���הԍ�
             /// </summary>
+            DetailNo,
+            /// <summary>
+            /// 28:�x�����z1�J����
+            /// </summary>
             Payment,
         }
 
@@ -976,14 +980,6 @@
                 // �V�X�e���Ǘ��҂͍폜�ł���
                 if (CommonMotions.LoginUserData.PersonCode == CommonDefine.AdminCode) btnDataDelete.Visible = true;
 
-                // �\���ʒu����
-                if (m_SubForm)
-                {
-                    this.StartPosition = FormStartPosition.CenterParent;
-                    this.Top += CommonDefine.s_DefalutShiftValue;
-                    this.Left += CommonDefine.s_DefalutShiftValue;
-                }
-
                 // �ύX�t���OOFF
                 m_bChengeAns = false;
             }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.designer.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.designer.cs	(revision 302)
@@ -89,6 +89,14 @@
             this.panel2 = new System.Windows.Forms.Panel();
             this.lblCellTotal = new System.Windows.Forms.Label();
             this.dgvAllDisplay = new ProcessManagement.Forms.CustomControls.DataGridViewEX();
+            this.btnDispDown = new System.Windows.Forms.Button();
+            this.btnDispUp = new System.Windows.Forms.Button();
+            this.btnOtherProc = new System.Windows.Forms.Button();
+            this.btnAssistantChange = new System.Windows.Forms.Button();
+            this.btnInstractorChange = new System.Windows.Forms.Button();
+            this.btnChangePrice = new System.Windows.Forms.Button();
+            this.button1 = new System.Windows.Forms.Button();
+            this.button2 = new System.Windows.Forms.Button();
             this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column27 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -116,14 +124,7 @@
             this.Column24 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column25 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column26 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.btnDispDown = new System.Windows.Forms.Button();
-            this.btnDispUp = new System.Windows.Forms.Button();
-            this.btnOtherProc = new System.Windows.Forms.Button();
-            this.btnAssistantChange = new System.Windows.Forms.Button();
-            this.btnInstractorChange = new System.Windows.Forms.Button();
-            this.btnChangePrice = new System.Windows.Forms.Button();
-            this.button1 = new System.Windows.Forms.Button();
-            this.button2 = new System.Windows.Forms.Button();
+            this.Column28 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel1.SuspendLayout();
             this.pnlGroup2.SuspendLayout();
             this.pnlGroup1.SuspendLayout();
@@ -833,7 +834,8 @@
             this.Column23,
             this.Column24,
             this.Column25,
-            this.Column26});
+            this.Column26,
+            this.Column28});
             this.dgvAllDisplay.Location = new System.Drawing.Point(6, 4);
             this.dgvAllDisplay.Name = "dgvAllDisplay";
             this.dgvAllDisplay.RowHeadersVisible = false;
@@ -852,6 +854,113 @@
             this.dgvAllDisplay.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgvAllDisplay_KeyDown);
             this.dgvAllDisplay.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgvAllDisplay_MouseUp);
             // 
+            // btnDispDown
+            // 
+            this.btnDispDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnDispDown.Font = new System.Drawing.Font("ＭＳ 明朝", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnDispDown.Location = new System.Drawing.Point(1300, 418);
+            this.btnDispDown.Name = "btnDispDown";
+            this.btnDispDown.Size = new System.Drawing.Size(40, 40);
+            this.btnDispDown.TabIndex = 42;
+            this.btnDispDown.TabStop = false;
+            this.btnDispDown.Text = "▼";
+            this.btnDispDown.UseVisualStyleBackColor = true;
+            this.btnDispDown.Visible = false;
+            this.btnDispDown.Click += new System.EventHandler(this.btnDispDown_Click);
+            // 
+            // btnDispUp
+            // 
+            this.btnDispUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnDispUp.Font = new System.Drawing.Font("ＭＳ 明朝", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnDispUp.Location = new System.Drawing.Point(1300, 354);
+            this.btnDispUp.Name = "btnDispUp";
+            this.btnDispUp.Size = new System.Drawing.Size(40, 40);
+            this.btnDispUp.TabIndex = 41;
+            this.btnDispUp.TabStop = false;
+            this.btnDispUp.Text = "▲";
+            this.btnDispUp.UseVisualStyleBackColor = true;
+            this.btnDispUp.Visible = false;
+            this.btnDispUp.Click += new System.EventHandler(this.btnDispUp_Click);
+            // 
+            // btnOtherProc
+            // 
+            this.btnOtherProc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+            this.btnOtherProc.BackColor = System.Drawing.Color.SpringGreen;
+            this.btnOtherProc.Location = new System.Drawing.Point(7, 656);
+            this.btnOtherProc.Name = "btnOtherProc";
+            this.btnOtherProc.Size = new System.Drawing.Size(160, 30);
+            this.btnOtherProc.TabIndex = 95;
+            this.btnOtherProc.TabStop = false;
+            this.btnOtherProc.Text = "他の画面へ";
+            this.btnOtherProc.UseVisualStyleBackColor = false;
+            this.btnOtherProc.Click += new System.EventHandler(this.btnOtherProc_Click);
+            // 
+            // btnAssistantChange
+            // 
+            this.btnAssistantChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnAssistantChange.BackColor = System.Drawing.Color.Beige;
+            this.btnAssistantChange.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold);
+            this.btnAssistantChange.Location = new System.Drawing.Point(381, 656);
+            this.btnAssistantChange.Name = "btnAssistantChange";
+            this.btnAssistantChange.Size = new System.Drawing.Size(130, 30);
+            this.btnAssistantChange.TabIndex = 96;
+            this.btnAssistantChange.Text = "副担当者変更";
+            this.btnAssistantChange.UseVisualStyleBackColor = false;
+            this.btnAssistantChange.Visible = false;
+            this.btnAssistantChange.Click += new System.EventHandler(this.btnAssistantChange_Click);
+            // 
+            // btnInstractorChange
+            // 
+            this.btnInstractorChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnInstractorChange.BackColor = System.Drawing.Color.MistyRose;
+            this.btnInstractorChange.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold);
+            this.btnInstractorChange.Location = new System.Drawing.Point(519, 656);
+            this.btnInstractorChange.Name = "btnInstractorChange";
+            this.btnInstractorChange.Size = new System.Drawing.Size(130, 30);
+            this.btnInstractorChange.TabIndex = 97;
+            this.btnInstractorChange.Text = "指導員変更";
+            this.btnInstractorChange.UseVisualStyleBackColor = false;
+            this.btnInstractorChange.Visible = false;
+            this.btnInstractorChange.Click += new System.EventHandler(this.btnInstractorChange_Click);
+            // 
+            // btnChangePrice
+            // 
+            this.btnChangePrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnChangePrice.BackColor = System.Drawing.Color.Gold;
+            this.btnChangePrice.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold);
+            this.btnChangePrice.Location = new System.Drawing.Point(243, 656);
+            this.btnChangePrice.Name = "btnChangePrice";
+            this.btnChangePrice.Size = new System.Drawing.Size(130, 30);
+            this.btnChangePrice.TabIndex = 99;
+            this.btnChangePrice.Text = "受注金額変更";
+            this.btnChangePrice.UseVisualStyleBackColor = false;
+            this.btnChangePrice.Visible = false;
+            this.btnChangePrice.Click += new System.EventHandler(this.btnChangePrice_Click);
+            // 
+            // button1
+            // 
+            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.button1.Location = new System.Drawing.Point(1300, 540);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(37, 35);
+            this.button1.TabIndex = 100;
+            this.button1.Text = "○";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Visible = false;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // button2
+            // 
+            this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.button2.Location = new System.Drawing.Point(1300, 581);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(37, 35);
+            this.button2.TabIndex = 101;
+            this.button2.Text = "１";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Visible = false;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
             // Column1
             // 
             dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
@@ -1130,113 +1239,12 @@
             this.Column26.Visible = false;
             this.Column26.Width = 5;
             // 
-            // btnDispDown
+            // Column28
             // 
-            this.btnDispDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnDispDown.Font = new System.Drawing.Font("ＭＳ 明朝", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnDispDown.Location = new System.Drawing.Point(1300, 418);
-            this.btnDispDown.Name = "btnDispDown";
-            this.btnDispDown.Size = new System.Drawing.Size(40, 40);
-            this.btnDispDown.TabIndex = 42;
-            this.btnDispDown.TabStop = false;
-            this.btnDispDown.Text = "▼";
-            this.btnDispDown.UseVisualStyleBackColor = true;
-            this.btnDispDown.Visible = false;
-            this.btnDispDown.Click += new System.EventHandler(this.btnDispDown_Click);
+            this.Column28.HeaderText = "明細番号";
+            this.Column28.Name = "Column28";
+            this.Column28.Visible = false;
             // 
-            // btnDispUp
-            // 
-            this.btnDispUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnDispUp.Font = new System.Drawing.Font("ＭＳ 明朝", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnDispUp.Location = new System.Drawing.Point(1300, 354);
-            this.btnDispUp.Name = "btnDispUp";
-            this.btnDispUp.Size = new System.Drawing.Size(40, 40);
-            this.btnDispUp.TabIndex = 41;
-            this.btnDispUp.TabStop = false;
-            this.btnDispUp.Text = "▲";
-            this.btnDispUp.UseVisualStyleBackColor = true;
-            this.btnDispUp.Visible = false;
-            this.btnDispUp.Click += new System.EventHandler(this.btnDispUp_Click);
-            // 
-            // btnOtherProc
-            // 
-            this.btnOtherProc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-            this.btnOtherProc.BackColor = System.Drawing.Color.SpringGreen;
-            this.btnOtherProc.Location = new System.Drawing.Point(7, 656);
-            this.btnOtherProc.Name = "btnOtherProc";
-            this.btnOtherProc.Size = new System.Drawing.Size(160, 30);
-            this.btnOtherProc.TabIndex = 95;
-            this.btnOtherProc.TabStop = false;
-            this.btnOtherProc.Text = "他の画面へ";
-            this.btnOtherProc.UseVisualStyleBackColor = false;
-            this.btnOtherProc.Click += new System.EventHandler(this.btnOtherProc_Click);
-            // 
-            // btnAssistantChange
-            // 
-            this.btnAssistantChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnAssistantChange.BackColor = System.Drawing.Color.Beige;
-            this.btnAssistantChange.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold);
-            this.btnAssistantChange.Location = new System.Drawing.Point(381, 656);
-            this.btnAssistantChange.Name = "btnAssistantChange";
-            this.btnAssistantChange.Size = new System.Drawing.Size(130, 30);
-            this.btnAssistantChange.TabIndex = 96;
-            this.btnAssistantChange.Text = "副担当者変更";
-            this.btnAssistantChange.UseVisualStyleBackColor = false;
-            this.btnAssistantChange.Visible = false;
-            this.btnAssistantChange.Click += new System.EventHandler(this.btnAssistantChange_Click);
-            // 
-            // btnInstractorChange
-            // 
-            this.btnInstractorChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnInstractorChange.BackColor = System.Drawing.Color.MistyRose;
-            this.btnInstractorChange.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold);
-            this.btnInstractorChange.Location = new System.Drawing.Point(519, 656);
-            this.btnInstractorChange.Name = "btnInstractorChange";
-            this.btnInstractorChange.Size = new System.Drawing.Size(130, 30);
-            this.btnInstractorChange.TabIndex = 97;
-            this.btnInstractorChange.Text = "指導員変更";
-            this.btnInstractorChange.UseVisualStyleBackColor = false;
-            this.btnInstractorChange.Visible = false;
-            this.btnInstractorChange.Click += new System.EventHandler(this.btnInstractorChange_Click);
-            // 
-            // btnChangePrice
-            // 
-            this.btnChangePrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnChangePrice.BackColor = System.Drawing.Color.Gold;
-            this.btnChangePrice.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold);
-            this.btnChangePrice.Location = new System.Drawing.Point(243, 656);
-            this.btnChangePrice.Name = "btnChangePrice";
-            this.btnChangePrice.Size = new System.Drawing.Size(130, 30);
-            this.btnChangePrice.TabIndex = 99;
-            this.btnChangePrice.Text = "受注金額変更";
-            this.btnChangePrice.UseVisualStyleBackColor = false;
-            this.btnChangePrice.Visible = false;
-            this.btnChangePrice.Click += new System.EventHandler(this.btnChangePrice_Click);
-            // 
-            // button1
-            // 
-            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.button1.Location = new System.Drawing.Point(1300, 540);
-            this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(37, 35);
-            this.button1.TabIndex = 100;
-            this.button1.Text = "○";
-            this.button1.UseVisualStyleBackColor = true;
-            this.button1.Visible = false;
-            this.button1.Click += new System.EventHandler(this.button1_Click);
-            // 
-            // button2
-            // 
-            this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.button2.Location = new System.Drawing.Point(1300, 581);
-            this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(37, 35);
-            this.button2.TabIndex = 101;
-            this.button2.Text = "１";
-            this.button2.UseVisualStyleBackColor = true;
-            this.button2.Visible = false;
-            this.button2.Click += new System.EventHandler(this.button2_Click);
-            // 
             // FrmConstructionLedger
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@@ -1372,5 +1380,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column24;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column25;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column26;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column28;
     }
 }
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.resx
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.resx	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.resx	(revision 302)
@@ -189,4 +189,7 @@
   <metadata name="Column26.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="Column28.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedgerAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedgerAuxiliary.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedgerAuxiliary.cs	(revision 302)
@@ -1659,6 +1659,7 @@
                 // 行位置取得
                 m_CostsRowCount[(int)CostsRowLine.ConstructionCostLine] = dgv.RowCount - 1;
 
+                int nDetailCount = 1;
                 foreach (ConstructionBudgetDetail DetailRec in DetailList)
                 {
                     object[] RowData = new object[dgv.Columns.Count];
@@ -1678,7 +1679,7 @@
                     RowData[(int)GridColumn.IndependentFlg] = "1";
                     RowData[(int)GridColumn.FluctuationFlg] = "0";
                     RowData[(int)GridColumn.PurchaseOrderFlg] = (int)ConstructionLedgerDetail.PurOrderFlgDef.NoCreate;
-
+                    RowData[(int)GridColumn.DetailNo] = nDetailCount;
                     // 合計欄位置取得
                     int TotalPoint = dgv.ColumnCount + (int)ColPayTotal.Totals;
                     RowData[TotalPoint] = "0";
@@ -1690,6 +1691,8 @@
                     }
                     // 行セット
                     CreateDataRow(RowData);
+
+                    nDetailCount++;
                 }
             }
             catch (Exception ex)
@@ -2696,34 +2699,37 @@
             {
                 // 工事詳細台帳明細データを読み込む
                 strcmd.Append("SELECT");
-                strcmd.Append("  A.ConstructionCode");	        // 工事コード
-                strcmd.Append(", A.GroupCount");               // グループ番号
-                strcmd.Append(", A.LineCount");                // 行番号
-                strcmd.Append(", A.ComponentCode");            // 構成キー
-                strcmd.Append(", A.ItemCode");		            // 工種キー
-                strcmd.Append(", A.FirstString");              // 項目名称
-                strcmd.Append(", A.SecondString");             // 工事内容
-                strcmd.Append(", A.CompanyType");              // 協力会社コードタイプ
-                strcmd.Append(", A.CompanyCode");              // 協力会社コード
-                strcmd.Append(", A.CompanyName");              // 協力会社名称
-                strcmd.Append(", A.EstimatePrice");            // 予算（見積）金額
-                strcmd.Append(", A.ExecutionAmount");          // 実行金額
-                strcmd.Append(", A.AmountConfigRate");         // 金額構成率
-                strcmd.Append(", A.PaymentBurden");            // 支払補填額
-                strcmd.Append(", A.FixDataFlg");               // 固定データフラグ
-                strcmd.Append(", A.IndependentFlg");           // 独立データフラグ
-                strcmd.Append(", A.FluctuationFlg");           // 増減データフラグ
-                strcmd.Append(", A.SalaryFlg");                // 給与振分区分
-                strcmd.Append(", A.SalaryDays");               // 給与振分日数
-                strcmd.Append(", A.OperatingFlg");             // 担当中フラグ
-                strcmd.Append(", A.SourceCode");               // 元工事番号
-                strcmd.Append(", A.JoinTitleFlg");             // 工事名称タイトル
-                strcmd.Append(", A.SalaryOnRegist");           // 登録時月額給与
-                strcmd.Append(", A.PurchaseOrderFlg");         // 注文書発行フラグ
-                strcmd.Append(", DATE_FORMAT(A.EntryDate, '%Y/%m/%d %H:%i:%s')");
-                strcmd.Append(", DATE_FORMAT(A.UpdateDate, '%Y/%m/%d %H:%i:%s')");
+                strcmd.Append("  A.*");
+                //strcmd.Append("  A.ConstructionCode");	        // 工事コード
+                //strcmd.Append(", A.GroupCount");               // グループ番号
+                //strcmd.Append(", A.LineCount");                // 行番号
+                //strcmd.Append(", A.ComponentCode");            // 構成キー
+                //strcmd.Append(", A.ItemCode");		           // 工種キー
+                //strcmd.Append(", A.FirstString");              // 項目名称
+                //strcmd.Append(", A.SecondString");             // 工事内容
+                //strcmd.Append(", A.CompanyType");              // 協力会社コードタイプ
+                //strcmd.Append(", A.CompanyCode");              // 協力会社コード
+                //strcmd.Append(", A.CompanyName");              // 協力会社名称
+                //strcmd.Append(", A.EstimatePrice");            // 予算（見積）金額
+                //strcmd.Append(", A.ExecutionAmount");          // 実行金額
+                //strcmd.Append(", A.AmountConfigRate");         // 金額構成率
+                //strcmd.Append(", A.PaymentBurden");            // 支払補填額
+                //strcmd.Append(", A.FixDataFlg");               // 固定データフラグ
+                //strcmd.Append(", A.IndependentFlg");           // 独立データフラグ
+                //strcmd.Append(", A.FluctuationFlg");           // 増減データフラグ
+                //strcmd.Append(", A.SalaryFlg");                // 給与振分区分
+                //strcmd.Append(", A.SalaryDays");               // 給与振分日数
+                //strcmd.Append(", A.OperatingFlg");             // 担当中フラグ
+                //strcmd.Append(", A.SourceCode");               // 元工事番号
+                //strcmd.Append(", A.JoinTitleFlg");             // 工事名称タイトル
+                //strcmd.Append(", A.SalaryOnRegist");           // 登録時月額給与
+                //strcmd.Append(", A.PurchaseOrderFlg");         // 注文書発行フラグ
+                //strcmd.Append(", A.DetailCount");              // 明細番号
+                //strcmd.Append(", DATE_FORMAT(A.EntryDate, '%Y/%m/%d %H:%i:%s')");
+                //strcmd.Append(", DATE_FORMAT(A.UpdateDate, '%Y/%m/%d %H:%i:%s')");
 
-                strcmd.Append(", B.TARGETMONTH, B.PAYMENTAMOUNT");
+                strcmd.Append(", B.TARGETMONTH");
+                strcmd.Append(", B.PAYMENTAMOUNT");
                 strcmd.Append(" FROM CONSTRUCTIONLEDGERDETAIL AS A");
                 strcmd.Append(" LEFT JOIN CONSTRUCTIONLEDGEREXCUTE AS B");
                 strcmd.Append(" ON B.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE");
@@ -2730,7 +2736,7 @@
                 strcmd.Append(" AND B.GROUPCOUNT = A.GROUPCOUNT");
                 strcmd.Append(" AND B.LINECOUNT = A.LINECOUNT");
                 strcmd.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode);
-                strcmd.Append(" ORDER BY A.GROUPCOUNT ASC, A.LINECOUNT ASC, B.COLUMNCOUNT ASC");
+                strcmd.Append(" ORDER BY A.GROUPCOUNT ASC, A.LINECOUNT ASC, A.DETAILCOUNT ASC, B.COLUMNCOUNT ASC");
 
             }
             catch (Exception ex)
@@ -2880,6 +2886,8 @@
                     }
                     // 注文書発行フラグ
                     RowData[(int)GridColumn.PurchaseOrderFlg] = DetailRec.PurchaseOrderFlg;
+                    // 明細番号
+                    RowData[(int)GridColumn.DetailNo] = DetailRec.DetailCount;
 
                     // ----- 支払いデータをセットする
                     double TotalValue = 0;
@@ -3500,6 +3508,11 @@
                 SetData.Cells[(int)GridColumn.CompanyName].ReadOnly = false;
                 SetData.Cells[(int)GridColumn.ExecPrice].ReadOnly = false;
 
+                // 明細番号をセット
+                int MaxCount = dgv.Rows.Cast<DataGridViewRow>().Where(x => CommonMotions.cnvInt(x.Cells[(int)GridColumn.GroupCount].Value) == (int)DataGroup.ConstructionCosts)
+                                                                .Max(y => CommonMotions.cnvInt(y.Cells[(int)GridColumn.DetailNo].Value)) + 1;
+                SetData.Cells[(int)GridColumn.DetailNo].Value = MaxCount;
+
                 // 行番号を振りなおす
                 int StLineCnt = 0;
                 //if (GroupCount == (int)GroupName_ConstructionLedger.ConstructionCosts)
@@ -4292,8 +4305,8 @@
                 DataGridView dgv = dgvAllDisplay;
                 int PaymentBurdenCol = dgv.ColumnCount + (int)ColPayTotal.PaymentBurdens;
                 int RowLineCnt = 0;
-                int nOldLineCnt = 0;
-                int nWrkCompanyCode = 0;
+                //int nOldLineCnt = 0;
+                //int nWrkCompanyCode = 0;
                 List<ConstructionLedgerDetail> NewList = new List<ConstructionLedgerDetail>();
                 ArrayList PDetailList = new ArrayList();
 
@@ -4342,19 +4355,6 @@
                     // 行データ作成
                     CreateInsertRowData(wrkRow, RowLineCnt, ref NewList);
 
-                    // 明細行の位置が変わっているかの判定
-                    nOldLineCnt = CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.DataLineCount].Value);
-                    if (nOldLineCnt == 0) continue;
-                    if (nOldLineCnt == RowLineCnt) continue;
-
-                    // 協力会社定義なしは処理しない
-                    nWrkCompanyCode = CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.CompanyCode].Value);
-                    if (nWrkCompanyCode < 1) continue;
-
-                    // 明細行の位置が変わっていた時はリストに追加する
-                    int nSourceCode = CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.SourceCode].Value);               // 元工事番号
-                    PDetailList.Add(new object[] { nWrkCompanyCode, nOldLineCnt, RowLineCnt, nSourceCode });
-
                 } // iRows
 
                 // 登録
@@ -4367,24 +4367,6 @@
                     }
                 }
 
-                // ----- 登録後処理
-                if (PDetailList.Count > 0)
-                {
-                    // 注文書明細データ行番号更新
-                    if (!SetPurchaseOrderDetailLineCount(PDetailDB, PDetailList))
-                    {
-                        MessageBox.Show("注文書明細データ：更新登録に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                        return false;
-                    }
-
-                    // 業者請求明細データ行番号更新
-                    if (!SetBillingDataDetailLineCount(BDetailDB, PDetailList))
-                    {
-                        MessageBox.Show("業者請求明細データ：更新登録に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                        return false;
-                    }
-                }
-
                 return true;
             }
             catch (System.Exception ex)
@@ -4414,7 +4396,7 @@
                 NewRec.ConstructionCode = m_ConstructionCode;                                                       // 工事番号
                 int GroupCnt = CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.GroupCount].Value);
                 NewRec.GroupCount = GroupCnt;                                                                       // グループ番号
-                NewRec.LineCount = RowLineCnt;                                                                      // 行番号
+                NewRec.LineCount = (RowLineCnt * 10);                                                               // 行番号(行挿入等で増える場合があるため1の位を空ける)
                 NewRec.ComponentCode = CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.ComponentCode].Value);     // 構成キー
                 NewRec.ItemCode = CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.ItemCode].Value);		        // 工種キー
                 NewRec.FirstString = CommonMotions.cnvString(wrkRow.Cells[(int)GridColumn.ItemName].Value);         // 項目名称
@@ -4474,6 +4456,7 @@
                 NewRec.JoinTitleFlg = CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.JoinTitleFlg].Value);           // 工事名称タイトル
                 NewRec.SalaryOnRegist = CommonMotions.cnvDouble(wrkRow.Cells[(int)GridColumn.SalaryOnRegist].Value);    // 登録時月額給与
                 NewRec.PurchaseOrderFlg = CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.PurchaseOrderFlg].Value);   // 注文書発行フラグ
+                NewRec.DetailCount = CommonMotions.cnvInt(wrkRow.Cells[(int)GridColumn.DetailNo].Value);                // 明細番号
 
                 NewList.Add(NewRec);
             }
@@ -4594,113 +4577,6 @@
             }
         }
         #endregion
-
-        #region 注文書明細台帳行番号更新
-        /// <summary>
-        /// 注文書明細台帳行番号更新
-        /// </summary>
-        private bool SetPurchaseOrderDetailLineCount(IOPurchaseOrderDetail PDetailDB, ArrayList PDetailList)
-        {
-            try
-            {
-                StringBuilder strSQL = new StringBuilder();
-                ArrayList DataList = new ArrayList();
-                // 行番号を後ろからにする
-                PDetailList.Reverse();
-                foreach (object[] CurCount in PDetailList)
-                {
-                    // 行番号変化リストより更新を行う
-                    strSQL.Clear();
-
-                    strSQL.Append("Select");
-                    strSQL.Append(" A.ConstructionCode,");
-                    strSQL.Append(" A.SeqNo,");
-                    strSQL.Append(" A.GroupCount,");
-                    strSQL.Append(" A.LineCount,");
-                    strSQL.Append(" A.SourceCode,");
-                    strSQL.Append(" A.SourceLineCnt,");
-                    strSQL.Append(" A.ConstructionCode");
-                    strSQL.Append(" From purchaseorderdetail as A");
-                    strSQL.Append(", purchaseorder as B");
-                    strSQL.AppendFormat(" Where A.ConstructionCode = {0}", CommonMotions.cnvInt(CurCount[3]));
-                    strSQL.AppendFormat(" And A.SourceCode = {0}", m_ConstructionCode);
-                    strSQL.AppendFormat(" And A.SourceLineCnt = {0}", CommonMotions.cnvInt(CurCount[1]));
-                    strSQL.Append(" And B.ConstructionCode = A.ConstructionCode");
-                    strSQL.Append(" And B.SeqNo = A.SeqNo");
-                    strSQL.AppendFormat(" And B.CompanyCode = {0}", CommonMotions.cnvInt(CurCount[0]));
-                    strSQL.Append(" Order by A.SeqNo");
-
-                    DataList.Clear();
-                    if (!PDetailDB.ExecuteReader(strSQL.ToString(), ref DataList, false)) return false;
-                    // 注文書が無い場合は処理しない
-                    if (DataList.Count == 0) continue;
-                    // 注文書が2行以上ある場合は変更後の場合があるので処理しない
-                    if (DataList.Count > 1) continue;
-
-                    object[] RefRec = (object[])DataList[0];
-                    // 注文書があれば行番号を更新する
-                    strSQL.Clear();
-                    strSQL.Append("UPDATE PurchaseOrderDetail");
-                    strSQL.Append(" SET");
-                    strSQL.AppendFormat(" SourceLineCnt = {0}", CommonMotions.cnvInt(CurCount[2]));
-                    strSQL.Append(PDetailDB.CreatePrimarykeyString(CommonMotions.cnvInt(RefRec[0]),
-                                                                    CommonMotions.cnvInt(RefRec[1]),
-                                                                    CommonMotions.cnvInt(RefRec[2]),
-                                                                    CommonMotions.cnvInt(RefRec[3])));
-                    if (!PDetailDB.ExecuteNonQuery(strSQL.ToString(), false)) return false;
-                }
-                return true;
-            }
-            catch (System.Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
-            }
-        }
-        #endregion
-
-        #region 業者請求明細台帳行番号更新
-        /// <summary>
-        /// 業者請求明細台帳行番号更新
-        /// </summary>
-        private bool SetBillingDataDetailLineCount(IOBillingDataDetail BDetailDB, ArrayList PDetailList)
-        {
-            try
-            {
-                StringBuilder strSQL = new StringBuilder();
-                List<BillingDataDetail> DataList = new List<BillingDataDetail>();
-                foreach (object[] CurCount in PDetailList)
-                {
-                    // 行番号変化リストより更新を行う
-                    strSQL.Clear();
-                    strSQL.AppendFormat(" Where COMPANYCODE = {0}", CommonMotions.cnvInt(CurCount[0]));
-                    strSQL.AppendFormat(" And CONSTRUCTIONCODE = {0}", m_ConstructionCode);
-                    strSQL.AppendFormat(" And CONSTRUCTIONROWCNT = {0}", CommonMotions.cnvInt(CurCount[1]));
-                    DataList.Clear();
-                    if (!BDetailDB.SelectAction(strSQL.ToString(), ref DataList, false)) return false;
-                    // 注文書が無い場合は処理しない
-                    if (DataList.Count == 0) continue;
-
-                    // 注文書があれば行番号を更新する
-                    strSQL.Clear();
-                    strSQL.Append("UPDATE billingdatadetail");
-                    strSQL.Append(" SET");
-                    strSQL.AppendFormat(" CONSTRUCTIONROWCNT = {0}", CommonMotions.cnvInt(CurCount[2]));
-                    strSQL.Append(BDetailDB.CreatePrimarykeyString(DataList[0].CompanyCode,
-                                                                    DataList[0].TargetDate,
-                                                                    DataList[0].SeqNo,
-                                                                    DataList[0].LineCount));
-                    if (!BDetailDB.ExecuteNonQuery(strSQL.ToString(), false)) return false;
-                }
-                return true;
-            }
-            catch (System.Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
-            }
-        }
-        #endregion
         // ---------- データ登録↑↑
 
         #region 画面項目のチェック
@@ -6230,6 +6106,9 @@
                     TargetLine = i;
                 }
 
+                // 明細番号をセット
+                int MaxCount = dgv.Rows.Cast<DataGridViewRow>().Where(x => CommonMotions.cnvInt(x.Cells[(int)GridColumn.GroupCount].Value) == (int)DataGroup.ConstructionCosts)
+                                                                .Max(y => CommonMotions.cnvInt(y.Cells[(int)GridColumn.DetailNo].Value)) + 1;
                 // データ増減番号取得
                 int FluctuationNo = (int)ConstructionLedgerDetail.FlucFlgDef.Fluctuates;
                 // 次の行から追加
@@ -6258,6 +6137,7 @@
                     GridRow.Cells[(int)GridColumn.IndependentFlg].Value = "1";
                     GridRow.Cells[(int)GridColumn.FluctuationFlg].Value = FluctuationNo;
                     GridRow.Cells[(int)GridColumn.PurchaseOrderFlg].Value = (int)ConstructionLedgerDetail.PurOrderFlgDef.NoCreate;
+                    GridRow.Cells[(int)GridColumn.DetailNo].Value = MaxCount++;
 
                     // 合計欄位置取得
                     int TotalPoint = dgv.ColumnCount + (int)ColPayTotal.Totals;
@@ -7127,6 +7007,10 @@
                 // データ増減番号取得
                 int FluctuationNo = (int)ConstructionLedgerDetail.FlucFlgDef.Normal;
 
+                // 明細番号をセット
+                int MaxCount = dgv.Rows.Cast<DataGridViewRow>().Where(x => CommonMotions.cnvInt(x.Cells[(int)GridColumn.GroupCount].Value) == (int)DataGroup.ConstructionCosts)
+                                                                .Max(y => CommonMotions.cnvInt(y.Cells[(int)GridColumn.DetailNo].Value)) + 1;
+
                 // 次の行から追加
                 TargetLine++;
                 // データ追加
@@ -7153,6 +7037,7 @@
                     GridRow.Cells[(int)GridColumn.IndependentFlg].Value = "1";
                     GridRow.Cells[(int)GridColumn.FluctuationFlg].Value = FluctuationNo;
                     GridRow.Cells[(int)GridColumn.PurchaseOrderFlg].Value = (int)ConstructionLedgerDetail.PurOrderFlgDef.NoCreate;
+                    GridRow.Cells[(int)GridColumn.DetailNo].Value = MaxCount++;
 
                     // 合計欄位置取得
                     int TotalPoint = dgv.ColumnCount + (int)ColPayTotal.Totals;
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DRConstruction/FrmDRConstruction.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DRConstruction/FrmDRConstruction.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DRConstruction/FrmDRConstruction.cs	(revision 302)
@@ -600,14 +600,6 @@
                     SeeModeLock();
                 }
 
-                // �\���ʒu����
-                if (m_SubForm)
-                {
-                    this.StartPosition = FormStartPosition.CenterParent;
-                    this.Top += CommonDefine.s_DefalutShiftValue;
-                    this.Left += CommonDefine.s_DefalutShiftValue;
-                }
-
                 // �ύX�t���OOFF
                 m_bChengeAns = false;
             }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/FrmEstimateBudget.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/FrmEstimateBudget.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/FrmEstimateBudget.cs	(revision 302)
@@ -669,14 +669,6 @@
                     }
                 }
 
-                // �\���ʒu����
-                if (m_SubForm)
-                {
-                    this.StartPosition = FormStartPosition.CenterParent;
-                    this.Top += CommonDefine.s_DefalutShiftValue;
-                    this.Left += CommonDefine.s_DefalutShiftValue;
-                }
-
                 // �ύX�t���OOFF
                 m_bChengeAns = false;
             }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.cs	(revision 302)
@@ -1223,14 +1223,6 @@
                 pnlApproval.Visible = false;
             }
 
-            // �\���ʒu����
-            if (m_SubForm)
-            {
-                this.StartPosition = FormStartPosition.CenterParent;
-                this.Top += CommonDefine.s_DefalutShiftValue;
-                this.Left += CommonDefine.s_DefalutShiftValue;
-            }
-
             // �������z�v�Z�t���OOff
             bAmountAllocationStopFlg = false;
         }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimatePrint/FrmEstimatePrint.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimatePrint/FrmEstimatePrint.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimatePrint/FrmEstimatePrint.cs	(revision 302)
@@ -278,14 +278,6 @@
                 // 参照の場合は入力できない
                 ReadOnly();
             }
-
-            // 表示位置調整
-            if (m_SubForm)
-            {
-                this.StartPosition = FormStartPosition.CenterParent;
-                this.Top += CommonDefine.s_DefalutShiftValue;
-                this.Left += CommonDefine.s_DefalutShiftValue;
-            }
         }
         #endregion
 
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Proceedings/FrmProceedings.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Proceedings/FrmProceedings.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Proceedings/FrmProceedings.cs	(revision 302)
@@ -519,14 +519,6 @@
                     SeeModeLock();
                 }
 
-                // �\���ʒu����
-                if (m_SubForm)
-                {
-                    this.StartPosition = FormStartPosition.CenterParent;
-                    this.Top += CommonDefine.s_DefalutShiftValue;
-                    this.Left += CommonDefine.s_DefalutShiftValue;
-                }
-
                 // �ύX�t���OOFF
                 m_bChengeAns = false;
                 m_bInitFlg = false;
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/CreateNewTabPage.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/CreateNewTabPage.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/CreateNewTabPage.cs	(revision 302)
@@ -862,11 +862,11 @@
                 NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.SourceCode].Width = 5;
 
                 // 工事台帳行
-                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerLine].HeaderText = "工事台帳行";
-                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerLine].Name = string.Format("Group1TextBoxColumnLedgerLine{0}", PageCount);
-                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerLine].ReadOnly = true;
-                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerLine].Visible = false;
-                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerLine].Width = 5;
+                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerDetailNo].HeaderText = "工事台帳行";
+                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerDetailNo].Name = string.Format("Group1TextBoxColumnLedgerLine{0}", PageCount);
+                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerDetailNo].ReadOnly = true;
+                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerDetailNo].Visible = false;
+                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerDetailNo].Width = 5;
 
                 // 予算書金額
                 NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.BudgetValue].HeaderText = "予算書金額";
@@ -914,7 +914,7 @@
                 NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.UnitPrice],
                 NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.PriceValue],
                 NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.SourceCode],
-                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerLine],
+                NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.LedgerDetailNo],
                 NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.BudgetValue],
                 NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.PreviousValue],
                 NewPage.Group1TextBoxColumn[(int)DispDetailGridColumn.DataType]});
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.Designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.Designer.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.Designer.cs	(revision 302)
@@ -69,6 +69,7 @@
             this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Column13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dgvAllDisplay)).BeginInit();
@@ -352,7 +353,8 @@
             this.Column8,
             this.Column4,
             this.Column11,
-            this.Column12});
+            this.Column12,
+            this.Column13});
             this.dgvAllDisplay.EnableHeadersVisualStyles = false;
             this.dgvAllDisplay.Location = new System.Drawing.Point(10, 22);
             this.dgvAllDisplay.Name = "dgvAllDisplay";
@@ -503,6 +505,12 @@
             this.Column12.Visible = false;
             this.Column12.Width = 5;
             // 
+            // Column13
+            // 
+            this.Column13.HeaderText = "注文書発行フラグ";
+            this.Column13.Name = "Column13";
+            this.Column13.Visible = false;
+            // 
             // FrmOrderEntryList
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@@ -554,6 +562,7 @@
         private System.Windows.Forms.Label label7;
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.Button btnTargetOut;
+        private System.Windows.Forms.Button button1;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
@@ -568,6 +577,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column11;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
-        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column13;
     }
 }
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.cs	(revision 302)
@@ -92,9 +92,13 @@
             /// </summary>
             OrderNo,
             /// <summary>
-            /// 行番号
+            /// 台帳明細番号
             /// </summary>
-            LineCount,
+            DetailCount,
+            /// <summary>
+            /// 注文書発行フラグ
+            /// </summary>
+            PurchaseOrderFlg,
         }
         #endregion
 
@@ -380,30 +384,5 @@
 
         }
         #endregion
-
-        #region デバッグロジック
-        /// <summary>
-        /// デバッグロジック
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void button1_Click(object sender, EventArgs e)
-        {
-            IOPurchaseOrderDetail PDetail = new IOPurchaseOrderDetail();
-            try
-            {
-                PDetail.connect(); PDetail.beginTran();
-                if (!SetLineCount1(PDetail)) return;
-                if (!SetLineCount2(PDetail)) return;
-                PDetail.commit();
-
-                MessageBox.Show("処理終了");
-            }
-            finally
-            {
-                PDetail.close(); PDetail = null;
-            }
-        }
-        #endregion
     }
 }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.resx
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.resx	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryList.resx	(revision 302)
@@ -150,4 +150,7 @@
   <metadata name="Column12.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="Column13.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryListAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryListAuxiliary.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmOrderEntryListAuxiliary.cs	(revision 302)
@@ -163,7 +163,7 @@
             DetailString,
             ApprovalStatus,
             PurchaseSeqNo,
-            LedgerLine,
+            LedgerDetailNo,
             OrderNo,
             PrintoutDate,
             PublicFlg,
@@ -179,67 +179,51 @@
         {
             try
             {
-                strSQL.Append("SELECT");
+                strSQL.Append(" (SELECT");
                 strSQL.Append(" A.CONSTRUCTIONCODE");
-                strSQL.Append(", A.FIRSTSTRING");
-                strSQL.Append(", A.SECONDSTRING");
-                strSQL.Append(", A.COMPANYCODE AS COMPANYCODE");
-                strSQL.Append(", A.COMPANYNAME");
-                strSQL.Append(", A.EXECUTIONAMOUNT");
-                strSQL.Append(", A.SOURCECODE");
-                strSQL.Append(", A.PURCHASEORDERFLG");
-                strSQL.Append(", B.DETAILSTRING");
-                strSQL.Append(", - 1 AS APPVAL");
-                strSQL.Append(", 0 AS SEQNO");
-                strSQL.Append(", A.LINECOUNT AS LINECOUNT");
-                strSQL.Append(", 0 AS ORDERNO");
-                strSQL.AppendFormat(", DATE ('{0}') AS PRINTOUTDATE", DateTime.MinValue.ToShortDateString());
-                strSQL.Append(", ConstrType.PublicFlg");
+                strSQL.Append(" , A.FIRSTSTRING");
+                strSQL.Append(" , A.SECONDSTRING");
+                strSQL.Append(" , A.COMPANYCODE AS COMPANYCODE");
+                strSQL.Append(" , A.COMPANYNAME");
+                strSQL.Append(" , A.EXECUTIONAMOUNT");
+                strSQL.Append(" , A.SOURCECODE");
+                strSQL.Append(" , A.PURCHASEORDERFLG");
+                strSQL.Append(" , B.DETAILSTRING");
+                strSQL.Append(" , -1 AS APPVAL");
+                strSQL.Append(" , 0 AS SEQNO");
+                strSQL.Append(" , A.DetailCount AS LINECOUNT");
+                strSQL.Append(" , 0 AS ORDERNO");
+                strSQL.AppendFormat(" , DATE ('{0}') AS PRINTOUTDATE", DateTime.MinValue.ToShortDateString());
+                strSQL.Append(" , ConstrType.PublicFlg");
                 strSQL.Append(" FROM CONSTRUCTIONLEDGERDETAIL A");
-
-                strSQL.Append(" LEFT JOIN CONSTRUCTIONBASEINFODETAIL B ON B.CONSTRUCTIONCODE = A.SOURCECODE");
+                strSQL.Append(" LEFT JOIN CONSTRUCTIONBASEINFODETAIL B");
+                strSQL.Append("       ON B.CONSTRUCTIONCODE = A.SOURCECODE");
                 strSQL.AppendFormat(" AND B.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DataNoDef.ConstructionName);
-                strSQL.Append(" Inner Join constructionbaseinfo AS Base On Base.ConstructionCode = A.ConstructionCode");
-                strSQL.Append(" Inner Join constructiontypemaster As ConstrType On ConstrType.TypeCode = Base.ConstructionType");
+                strSQL.Append(" Inner Join constructionbaseinfo AS Base");
+                strSQL.Append("    On Base.ConstructionCode = A.ConstructionCode");
+                strSQL.Append(" Inner Join constructiontypemaster As ConstrType");
+                strSQL.Append("    On ConstrType.TypeCode = Base.ConstructionType");
 
                 strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", ParentCode);
                 strSQL.AppendFormat(" AND A.SOURCECODE = {0}", SearchCode);
                 strSQL.AppendFormat(" AND A.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
-                strSQL.Append(" AND A.COMPANYCODE > 0");
-                strSQL.AppendFormat(" AND A.COMPANYTYPE <> {0}", (int)CommonDefine.CodeDataType.Person);
-                strSQL.AppendFormat(" AND A.PurchaseOrderFlg > {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.ChangeOld);
-
+                strSQL.Append("       AND A.COMPANYCODE > 0");
+                strSQL.AppendFormat(" AND A.COMPANYTYPE != {0}", (int)CommonDefine.CodeDataType.Person);
+                strSQL.AppendFormat(" AND (A.PurchaseOrderFlg > {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.ChangeOld);
+                strSQL.AppendFormat(" AND A.PurchaseOrderFlg != {0})", (int)ConstructionLedgerDetail.PurOrderFlgDef.Making);
+                
                 strSQL.AppendFormat(" AND ((ConstrType.PublicFlg != {0}", (int)ConstructionTypeMaster.ConstructionTypeDef.Community);
-                strSQL.Append("       AND (A.SOURCECODE, A.COMPANYCODE) IN (SELECT SUMTBL.SOURCECODE, SUMTBL.COMPANYCODE");
-                strSQL.Append("                                         FROM CONSTRUCTIONLEDGERDETAIL SUMTBL");
-                strSQL.AppendFormat("                                   WHERE SUMTBL.CONSTRUCTIONCODE = {0}", ParentCode);
-                strSQL.AppendFormat("                                   AND SUMTBL.SOURCECODE = {0}", SearchCode);
-                strSQL.AppendFormat("                                   AND SUMTBL.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
-                strSQL.Append("                                         AND SUMTBL.COMPANYCODE > 0");
-                strSQL.Append("                                         GROUP BY SUMTBL.SOURCECODE, SUMTBL.COMPANYCODE, SUMTBL.PURCHASEORDERFLG");
-                strSQL.AppendFormat("                                   HAVING SUM(SUMTBL.EXECUTIONAMOUNT) >= {0}))", CommonDefine.s_PrintOutPrice);
-
+                strSQL.AppendFormat(" AND A.EXECUTIONAMOUNT >= {0})", CommonDefine.s_PrintOutPrice);
                 strSQL.AppendFormat(" OR (ConstrType.PublicFlg = {0}", (int)ConstructionTypeMaster.ConstructionTypeDef.Community);
-                strSQL.Append("       AND (A.SOURCECODE, A.COMPANYCODE) IN (SELECT SUMTBL.SOURCECODE, SUMTBL.COMPANYCODE");
-                strSQL.Append("                                         FROM CONSTRUCTIONLEDGERDETAIL SUMTBL");
-                strSQL.AppendFormat("                                   WHERE SUMTBL.CONSTRUCTIONCODE = {0}", ParentCode);
-                strSQL.AppendFormat("                                   AND SUMTBL.SOURCECODE = {0}", SearchCode);
-                strSQL.AppendFormat("                                   AND SUMTBL.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
-                strSQL.Append("                                         AND SUMTBL.COMPANYCODE > 0");
-                strSQL.Append("                                         GROUP BY SUMTBL.SOURCECODE, SUMTBL.COMPANYCODE, SUMTBL.PURCHASEORDERFLG");
-                strSQL.AppendFormat("                                   HAVING SUM(SUMTBL.EXECUTIONAMOUNT) >= {0})))", CommonDefine.s_PrintOutPricePublic);
+                strSQL.AppendFormat(" AND A.EXECUTIONAMOUNT >= {0}))", CommonDefine.s_PrintOutPricePublic);
 
-                strSQL.Append(" AND NOT EXISTS (SELECT * FROM purchaseorderdetail AS C, purchaseorder AS D");
-                strSQL.Append(" WHERE C.ConstructionCode = A.SourceCode");
-                strSQL.Append(" AND C.SourceLineCnt = A.LineCount");
-                strSQL.AppendFormat(" And C.GroupCount = {0}", (int)PurchaseOrderDetail.GroupCountDef.Detail);
-                strSQL.Append(" AND D.ConstructionCode = C.ConstructionCode");
-                strSQL.Append(" AND D.SeqNo = C.SeqNo");
-                strSQL.Append(" AND D.CompanyCode = A.CompanyCode");
-                strSQL.Append(" )");
+                strSQL.Append(" Group by");
+                strSQL.Append(" A.CONSTRUCTIONCODE");
+                strSQL.Append(" , A.GROUPCOUNT");
+                strSQL.Append(" , A.COMPANYCODE");
+                strSQL.Append(" , A.PurchaseOrderFlg)");
 
-
-                strSQL.Append("UNION (SELECT");
+                strSQL.Append(" UNION (SELECT");
                 strSQL.Append(" A.CONSTRUCTIONCODE");
                 strSQL.Append(", A.FIRSTSTRING");
                 strSQL.Append(", A.SECONDSTRING");
@@ -256,7 +240,7 @@
                 strSQL.Append(", B.DETAILSTRING");
                 strSQL.Append(", IFNULL(C.APPROVALSTATUS, - 1) APPVAL");
                 strSQL.Append(", E.SEQNO AS SEQNO");
-                strSQL.Append(", A.LINECOUNT AS LINECOUNT");
+                strSQL.Append(", A.DetailCount AS LINECOUNT");
                 strSQL.Append(", IFNULL(C.ORDERNO, 0) AS ORDERNO");
                 strSQL.Append(", DATE_FORMAT(F.PRINTOUTDATE, '%Y/%m/%d') AS PRINTOUTDATE");
                 strSQL.Append(", ConstrType.PublicFlg");
@@ -266,16 +250,16 @@
                 strSQL.Append(" Inner Join CONSTRUCTIONBASEINFO As Base ON Base.CONSTRUCTIONCODE = A.SOURCECODE");
                 strSQL.Append(" Inner Join constructiontypemaster As ConstrType On ConstrType.TypeCode = Base.ConstructionType");
 
-                strSQL.Append(" LEFT JOIN CONSTRUCTIONBASEINFODETAIL B ON B.CONSTRUCTIONCODE = A.SOURCECODE");
-                strSQL.AppendFormat(" AND B.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DataNoDef.ConstructionName);
-
-                strSQL.Append(" LEFT JOIN PURCHASEORDERDETAIL E ON E.CONSTRUCTIONCODE = A.SOURCECODE");
+                strSQL.Append(" Inner JOIN PURCHASEORDERDETAIL E ON E.CONSTRUCTIONCODE = A.SOURCECODE");
                 strSQL.AppendFormat(" AND E.GroupCount = {0}", (int)PurchaseOrderDetail.GroupCountDef.Detail);
-                strSQL.Append(" AND E.SOURCELINECNT = A.LINECOUNT");
+                strSQL.Append(" AND E.SourceDetailCnt = A.DetailCount");
 
-                strSQL.Append(" LEFT JOIN PURCHASEORDER F ON F.CONSTRUCTIONCODE = A.SOURCECODE");
+                strSQL.Append(" Inner JOIN PURCHASEORDER F ON F.CONSTRUCTIONCODE = A.SOURCECODE");
                 strSQL.Append("    AND F.SeqNo = E.SeqNo");
 
+                strSQL.Append(" LEFT JOIN CONSTRUCTIONBASEINFODETAIL B ON B.CONSTRUCTIONCODE = A.SOURCECODE");
+                strSQL.AppendFormat(" AND B.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DataNoDef.ConstructionName);
+
                 strSQL.Append(" LEFT JOIN PROCESSAPPROVALDETAIL G ON G.CONSTRUCTIONCODE = E.CONSTRUCTIONCODE");
                 strSQL.AppendFormat(" AND G.APPROVALCODE = {0} AND G.LINKCODE = E.SEQNO", (int)ClsExcute.ApprovalListNo.PurchaseOrderEntryApproval);
 
@@ -288,9 +272,12 @@
                 strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", ParentCode);
                 strSQL.AppendFormat(" AND A.SOURCECODE = {0}", SearchCode);
                 strSQL.AppendFormat(" AND A.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
-                strSQL.Append(" AND A.COMPANYCODE > 0");
+                strSQL.AppendFormat(" AND A.PurchaseOrderFlg = {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.Making);
+                strSQL.Append("       AND A.COMPANYCODE > 0");
                 strSQL.AppendFormat(" AND A.COMPANYTYPE <> {0}", (int)CommonDefine.CodeDataType.Person);
-                strSQL.Append(" AND F.COMPANYCODE = A.COMPANYCODE)");
+                strSQL.Append("       AND F.COMPANYCODE = A.COMPANYCODE");
+                strSQL.Append("       Group by A.CompanyCode, A.PURCHASEORDERFLG, F.SeqNo");
+                strSQL.Append(")");
 
                 strSQL.Append(" ORDER BY ORDERNO DESC, PURCHASEORDERFLG ASC, SOURCECODE ASC, COMPANYCODE ASC, APPVAL ASC");
             }
@@ -384,37 +371,28 @@
                 GetDisplayDataList(ref arList);
 
                 int iNo = 1;
-                string brkConstrName = string.Empty;
-                string strConstrName = string.Empty;
-                string strCompanyName = string.Empty;
-                int SeqNo = 0;
-                int AppStat = 0;
-                int Orderflg = 0;
                 int ApprovalCnt = 0;
                 int BaseDataCnt = 0;
-                int OrderNo = 0;
-                int LineCount = 0;
-                DateTime Printout = DateTime.Now;
-                bool NotCreateFlg = false;
+                string brkConstrName = string.Empty;
                 foreach (object[] objRec in arList)
                 {
                     // 親フォームデータセット
                     m_OrderFrm.DetailList.Add(objRec);
 
-                    SeqNo = CommonMotions.cnvInt(objRec[(int)ReadDBColumn.PurchaseSeqNo]);
-                    AppStat = CommonMotions.cnvInt(objRec[(int)ReadDBColumn.ApprovalStatus]);
-                    Orderflg = CommonMotions.cnvInt(objRec[(int)ReadDBColumn.PurchaseOrderflg]);
-                    OrderNo = CommonMotions.cnvInt(objRec[(int)ReadDBColumn.OrderNo]);
-                    Printout = CommonMotions.cnvDate(objRec[(int)ReadDBColumn.PrintoutDate]);
-                    LineCount = CommonMotions.cnvInt(objRec[(int)ReadDBColumn.LedgerLine]);
+                    int SeqNo = CommonMotions.cnvInt(objRec[(int)ReadDBColumn.PurchaseSeqNo]);
+                    int AppStat = CommonMotions.cnvInt(objRec[(int)ReadDBColumn.ApprovalStatus]);
+                    int Orderflg = CommonMotions.cnvInt(objRec[(int)ReadDBColumn.PurchaseOrderflg]);
+                    int OrderNo = CommonMotions.cnvInt(objRec[(int)ReadDBColumn.OrderNo]);
+                    DateTime Printout = CommonMotions.cnvDate(objRec[(int)ReadDBColumn.PrintoutDate]);
+                    int DetailCount = CommonMotions.cnvInt(objRec[(int)ReadDBColumn.LedgerDetailNo]);
 
-                    strConstrName = CommonMotions.cnvString(objRec[(int)ReadDBColumn.DetailString]);
-                    strCompanyName = CommonMotions.cnvString(objRec[(int)ReadDBColumn.CompanyName]);
+                    string strConstrName = CommonMotions.cnvString(objRec[(int)ReadDBColumn.DetailString]);
+                    string strCompanyName = CommonMotions.cnvString(objRec[(int)ReadDBColumn.CompanyName]);
 
                     if (!brkConstrName.Equals(strConstrName)) brkConstrName = strConstrName;
                     else strConstrName = string.Empty;
 
-                    NotCreateFlg = false;
+                    bool NotCreateFlg = false;
                     if (Orderflg == (int)ConstructionLedgerDetail.PurOrderFlgDef.NotMakingData)
                     {
                         NotCreateFlg = true;
@@ -432,7 +410,8 @@
                                                     CommonMotions.cnvInt(objRec[(int)ReadDBColumn.SourceCode]),
                                                     CommonMotions.cnvInt(objRec[(int)ReadDBColumn.CompanyCode]),
                                                     OrderNo,
-                                                    LineCount
+                                                    DetailCount,
+                                                    Orderflg
                                                     );
                     // 行状態セット
                     ChageRowColor(CurRowCnt, Orderflg, AppStat, Printout, OrderNo, ref  ApprovalCnt, ref BaseDataCnt);
@@ -700,15 +679,19 @@
                 StringBuilder strNotMake = new StringBuilder();
                 bool bFirstAll = true;
                 bool bFirstNotMake = true;
-                int LineCout = 0;
+                int CompanyCode = 0;
                 foreach (DataGridViewRow CurRow in dgvAllDisplay.Rows)
                 {
+                    // 作成済みは処理しない
+                    int Orderflg = CommonMotions.cnvInt(CurRow.Cells[(int)GridColumn.PurchaseOrderFlg].Value);
+                    if (Orderflg == (int)ConstructionLedgerDetail.PurOrderFlgDef.Making) continue;
+                    
                     // 行取得
-                    LineCout = CommonMotions.cnvInt(CurRow.Cells[(int)GridColumn.LineCount].Value);
+                    CompanyCode = CommonMotions.cnvInt(CurRow.Cells[(int)GridColumn.CompanyCode].Value);
 
                     // ----- 表示しているデータを全て対象とするラインを取得する
                     if (!bFirstAll) strDispAllData.Append(",");
-                    strDispAllData.AppendFormat(" {0}", LineCout);
+                    strDispAllData.AppendFormat(" {0}", CompanyCode);
 
                     bFirstAll = false;
 
@@ -717,15 +700,10 @@
                     if (!(bool)CurRow.Cells[(int)GridColumn.NotCreate].Value) continue;
 
                     if (!bFirstNotMake) strNotMake.Append(",");
-                    strNotMake.AppendFormat(" {0}", LineCout);
+                    strNotMake.AppendFormat(" {0}", CompanyCode);
 
                     bFirstNotMake = false;
                 }
-                //if (strNotMake.Length == 0)
-                //{
-                //    MessageBox.Show("データが選択されていません。", "選択エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                //    return;
-                //}
 
                 int TargetCode = ClsProcessExist.GetParentConstrCode(m_ConstructionCode);
 
@@ -738,8 +716,9 @@
                     strUpdate.AppendFormat("UPDATE CONSTRUCTIONLEDGERDETAIL SET PURCHASEORDERFLG = {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.NoCreate);
                     strUpdate.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", TargetCode);
                     strUpdate.AppendFormat(" AND GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
-                    strUpdate.AppendFormat(" AND PURCHASEORDERFLG = {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.NotMakingData);
-                    strUpdate.AppendFormat(" AND LINECOUNT IN ({0})", strDispAllData.ToString());
+                    strUpdate.AppendFormat(" AND (PURCHASEORDERFLG != {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.Making);
+                    strUpdate.AppendFormat(" AND PURCHASEORDERFLG != {0})", (int)ConstructionLedgerDetail.PurOrderFlgDef.ChangeOld);
+                    strUpdate.AppendFormat(" AND CompanyCode IN ({0})", strDispAllData.ToString());
 
                     DetailDB.ExecuteNonQuery(strUpdate.ToString(), false);
                 }
@@ -751,7 +730,9 @@
                     strUpdate.AppendFormat("UPDATE CONSTRUCTIONLEDGERDETAIL SET PURCHASEORDERFLG = {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.NotMakingData);
                     strUpdate.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", TargetCode);
                     strUpdate.AppendFormat(" AND GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
-                    strUpdate.AppendFormat(" AND LINECOUNT IN ({0})", strNotMake.ToString());
+                    strUpdate.AppendFormat(" AND (PURCHASEORDERFLG != {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.Making);
+                    strUpdate.AppendFormat(" AND PURCHASEORDERFLG != {0})", (int)ConstructionLedgerDetail.PurOrderFlgDef.ChangeOld);
+                    strUpdate.AppendFormat(" AND CompanyCode IN ({0})", strNotMake.ToString());
 
                     if (!DetailDB.ExecuteNonQuery(strUpdate.ToString(), false))
                     {
@@ -815,228 +796,5 @@
         }
         #endregion
 
-        #region << ---------- デバッグロジック
-        private bool SetLineCount2(IOPurchaseOrderDetail PDetail)
-        {
-            try
-            {
-                StringBuilder strSQL = new StringBuilder();
-
-                strSQL.Append("Select");
-                strSQL.Append(" A.*");
-                strSQL.Append(", ifnull(BX.OrdersLinePrice, '***')");   // 6
-                strSQL.Append(", BX.ConstructionCode DesConstrCode");   // 7
-                strSQL.Append(", BX.SeqNo AS DesSeqNo");                // 8
-                strSQL.Append(", BX.GroupCount AS DesGrpNo");           // 9
-                strSQL.Append(", BX.LineCount AS DesLineCnt");          // 10
-                strSQL.Append(", BX.SourceLineCnt AS SourceLineCnt");   // 11
-                strSQL.Append(" From");
-                strSQL.Append(" (select");
-                strSQL.Append(" AX.ConstructionCode AS ConstructionCode");  // 0
-                strSQL.Append(", AX.GroupCount AS GroupCount");             // 1
-                strSQL.Append(", AX.LineCount AS LineCount");               // 2
-                strSQL.Append(", AX.CompanyCode AS CompanyCode");           // 3
-                strSQL.Append(", Count(*) As CompanyCount");                // 4
-                strSQL.Append(", AX.ExecutionAmount");                      // 5
-                strSQL.Append(" From");
-                strSQL.Append(" constructionledgerdetail AS AX");
-                strSQL.Append(" Where");
-                strSQL.Append(" AX.GroupCount = 2");
-                strSQL.Append(" And AX.CompanyCode > 2");
-                strSQL.Append(" Group by");
-                strSQL.Append(" AX.ConstructionCode");
-                strSQL.Append(", AX.CompanyCode");
-                strSQL.Append(") AS A,");
-                strSQL.Append(" purchaseorderdetail AS BX");
-                strSQL.Append(" Left Join purchaseorder AS CX");
-                strSQL.Append(" ON CX.ConstructionCode = BX.ConstructionCode");
-                strSQL.Append(" And CX.SeqNo = BX.SeqNo");
-                strSQL.Append(" Where");
-                strSQL.Append(" A.CompanyCount < 2");
-                strSQL.Append(" And BX.GroupCount = 0");
-                strSQL.Append(" AND BX.SourceCode = A.ConstructionCode");
-                strSQL.Append(" And CX.CompanyCode = A.CompanyCode");
-                strSQL.Append(" order by");
-                strSQL.Append(" ConstructionCode");
-                strSQL.Append(", CompanyCode");
-
-                ArrayList arList = new ArrayList();
-                if (!PDetail.ExecuteReader(strSQL.ToString(), ref arList, false)) return false;
-
-                int nConstructionCode = 0;
-                int nSeqNo = 0;
-                int nGroupCount = 0;
-                int nLineCount = 0;
-                int nSourceLine = 0;
-                StringBuilder strcmd = new StringBuilder();
-                foreach (object[] objRec in arList)
-                {
-                    nConstructionCode = CommonMotions.cnvInt(objRec[7]);
-                    nSeqNo = CommonMotions.cnvInt(objRec[8]);
-                    nGroupCount = CommonMotions.cnvInt(objRec[9]);
-                    nLineCount = CommonMotions.cnvInt(objRec[10]);
-                    nSourceLine = CommonMotions.cnvInt(objRec[2]);
-
-                    strcmd.Clear();
-                    strcmd.Append("UPDATE PurchaseOrderDetail");
-                    strcmd.Append(" SET");
-                    strcmd.AppendFormat(" SourceLineCnt = {0}", nSourceLine);
-                    strcmd.Append(PDetail.CreatePrimarykeyString(nConstructionCode, nSeqNo, nGroupCount, nLineCount));
-                    if (!PDetail.ExecuteNonQuery(strcmd.ToString(), false))
-                    {
-                        PDetail.rollback();
-                        return false;
-                    }
-                }
-                return true;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
-            }
-        }
-
-        private bool SetLineCount1(IOPurchaseOrderDetail PDetail)
-        {
-            try
-            {
-                StringBuilder strSQL = new StringBuilder();
-
-                strSQL.Append("select");
-                strSQL.Append("  A.ConstructionCode");
-                strSQL.Append(", A.SOURCECODE");
-                strSQL.Append(", A.SeqNo");
-                strSQL.Append(", A.GroupCount");
-                strSQL.Append(", A.LineCount");
-                strSQL.Append(", A.SourceLineCnt AS DESLINE");
-                strSQL.Append(", C.LineCount AS SORLINE");
-                strSQL.Append(", B.CompanyCode AS PurCompany");
-                strSQL.Append(", C.CompanyCode AS LedCompany");
-                strSQL.Append(", A.OrdersLinePrice AS DESVAL");
-                strSQL.Append(", C.ExecutionAmount AS SORVAL");
-                strSQL.Append(", ROUND((C.ExecutionAmount * 0.875), 0)");
-                strSQL.Append(" from");
-                strSQL.Append("  purchaseorderdetail AS A");
-                strSQL.Append(", purchaseorder AS B");
-                strSQL.Append(", constructionledgerdetail AS C");
-                strSQL.Append(", constructionledger AS D");
-                strSQL.Append(" where");
-                strSQL.Append(" A.GroupCount=0");
-                strSQL.Append(" And A.SourceCode<>0");
-                strSQL.Append(" And B.ConstructionCode = A.ConstructionCode");
-                strSQL.Append(" And B.SeqNo = A.SeqNo");
-                strSQL.Append(" And C.ConstructionCode = A.SOURCECODE");
-                strSQL.Append(" And C.GroupCount = 2");
-                strSQL.Append(" And C.CompanyCode = B.CompanyCode");
-                strSQL.Append(" And (C.ExecutionAmount = A.OrdersLinePrice");
-                strSQL.Append(" Or ROUND((C.ExecutionAmount * 0.875), 0) = A.OrdersLinePrice)");
-                strSQL.Append(" And D.ConstructionCode = C.ConstructionCode");
-
-                ArrayList arList = new ArrayList();
-                if (!PDetail.ExecuteReader(strSQL.ToString(), ref arList, false)) return false;
-
-                int nConstructionCode = 0;
-                int nSeqNo = 0;
-                int nGroupCount = 0;
-                int nLineCount = 0;
-                int nSourceLine = 0;
-                StringBuilder strcmd = new StringBuilder();
-                foreach (object[] objRec in arList)
-                {
-                    nConstructionCode = CommonMotions.cnvInt(objRec[0]);
-                    nSeqNo = CommonMotions.cnvInt(objRec[2]);
-                    nGroupCount = CommonMotions.cnvInt(objRec[3]);
-                    nLineCount = CommonMotions.cnvInt(objRec[4]);
-                    nSourceLine = CommonMotions.cnvInt(objRec[6]);
-
-                    strcmd.Clear();
-                    strcmd.Append("UPDATE PurchaseOrderDetail");
-                    strcmd.Append(" SET");
-                    strcmd.AppendFormat(" SourceLineCnt = {0}", nSourceLine);
-                    strcmd.Append(PDetail.CreatePrimarykeyString(nConstructionCode, nSeqNo, nGroupCount, nLineCount));
-                    if (!PDetail.ExecuteNonQuery(strcmd.ToString(), false))
-                    {
-                        PDetail.rollback();
-                        return false;
-                    }
-                }
-
-                strSQL.Clear();
-                strSQL.Append("Select");
-                strSQL.Append(" A.*");
-                strSQL.Append(" ,D.ConstructionCode AS SorCode");   // 5
-                strSQL.Append(" ,D.CompanyCode AS SorComCode");     // 6
-                strSQL.Append(" ,D.ExecutionAmount AS SorVal");     // 7
-                strSQL.Append(" ,D.LineCount AS SorLine");          // 8
-
-                strSQL.Append(" ,B.ConstructionCode AS DesCode");   // 9
-                strSQL.Append(" ,B.SeqNo AS DesSeq");               // 10
-                strSQL.Append(" ,B.GroupCount AS DesGrp");          // 11
-                strSQL.Append(" ,B.LineCount AS DesLine");          // 12
-                strSQL.Append(" ,B.SourceCode AS DesSorCode");      // 13
-                strSQL.Append(" ,B.OrdersLinePrice AS DesSorLine"); // 14
-                strSQL.Append(" From");
-                strSQL.Append(" (select AX.ConstructionCode AS ConstructionCode");
-                strSQL.Append(", AX.CompanyCode AS CompanyCode");
-                strSQL.Append(", Count(*) As CompanyCount");
-                strSQL.Append(", SUM(AX.ExecutionAmount) As ExeVal");
-                strSQL.Append(", ROUND(((SUM(AX.ExecutionAmount) / 8.0) / Count(*)), 0) AS SumVal");
-                strSQL.Append(" From");
-                strSQL.Append(" constructionledgerdetail AS AX");
-                strSQL.Append(" Where");
-                strSQL.Append(" AX.GroupCount = 2");
-                strSQL.Append(" And AX.CompanyCode > 1");
-                strSQL.Append(" And AX.PurchaseOrderFlg = 1");
-                strSQL.Append(" Group by");
-                strSQL.Append(" AX.ConstructionCode");
-                strSQL.Append(", AX.CompanyCode) AS A");
-                strSQL.Append(",purchaseorderdetail AS B");
-                strSQL.Append(",purchaseorder AS C");
-                strSQL.Append(",constructionledgerdetail AS D");
-                strSQL.Append(" Where");
-                strSQL.Append(" A.CompanyCount > 1");
-                strSQL.Append(" And (A.ExeVal <> 0 And A.SumVal <> 0)");
-                strSQL.Append(" And B.SourceCode = A.ConstructionCode");
-                strSQL.Append(" And B.GroupCount = 0");
-                strSQL.Append(" And C.ConstructionCode = B.ConstructionCode");
-                strSQL.Append(" And C.SeqNo = B.SeqNo");
-                strSQL.Append(" And C.CompanyCode = A.CompanyCode");
-                strSQL.Append(" And (D.ConstructionCode = B.SourceCode");
-                strSQL.Append(" And D.GroupCount = 2");
-                strSQL.Append(" And D.CompanyCode = A.CompanyCode");
-                strSQL.Append(" And D.ExecutionAmount = (B.OrdersLinePrice + A.SumVal))");
-
-                arList.Clear();
-                if (!PDetail.ExecuteReader(strSQL.ToString(), ref arList, false)) return false;
-                foreach (object[] objRec in arList)
-                {
-                    nConstructionCode = CommonMotions.cnvInt(objRec[9]);
-                    nSeqNo = CommonMotions.cnvInt(objRec[10]);
-                    nGroupCount = CommonMotions.cnvInt(objRec[11]);
-                    nLineCount = CommonMotions.cnvInt(objRec[12]);
-                    nSourceLine = CommonMotions.cnvInt(objRec[8]);
-
-                    strcmd.Clear();
-                    strcmd.Append("UPDATE PurchaseOrderDetail");
-                    strcmd.Append(" SET");
-                    strcmd.AppendFormat(" SourceLineCnt = {0}", nSourceLine);
-                    strcmd.Append(PDetail.CreatePrimarykeyString(nConstructionCode, nSeqNo, nGroupCount, nLineCount));
-                    if (!PDetail.ExecuteNonQuery(strcmd.ToString(), false))
-                    {
-                        PDetail.rollback();
-                        return false;
-                    }
-                }
-                return true;
-            }
-            catch (Exception ex)
-            {
-                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
-            }
-        }
-        #endregion
-
     }
 }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPOConvert.Designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPOConvert.Designer.cs	(nonexistent)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPOConvert.Designer.cs	(revision 302)
@@ -0,0 +1,273 @@
+﻿namespace ProcessManagement.Forms.DataEntry
+{
+    partial class FrmPOConvert
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.btnDataEntry = new System.Windows.Forms.Button();
+            this.btnEnd = new System.Windows.Forms.Button();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.lblCount01 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.lblCount02 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.lblCount03 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.lblCount04 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.lblCount05 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.lblCount06 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // btnDataEntry
+            // 
+            this.btnDataEntry.BackColor = System.Drawing.Color.Green;
+            this.btnDataEntry.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnDataEntry.ForeColor = System.Drawing.Color.White;
+            this.btnDataEntry.Location = new System.Drawing.Point(294, 315);
+            this.btnDataEntry.Name = "btnDataEntry";
+            this.btnDataEntry.Size = new System.Drawing.Size(120, 30);
+            this.btnDataEntry.TabIndex = 51;
+            this.btnDataEntry.Text = "実　行";
+            this.btnDataEntry.UseVisualStyleBackColor = false;
+            this.btnDataEntry.Click += new System.EventHandler(this.btnDataEntry_Click);
+            // 
+            // btnEnd
+            // 
+            this.btnEnd.BackColor = System.Drawing.Color.Blue;
+            this.btnEnd.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnEnd.ForeColor = System.Drawing.Color.White;
+            this.btnEnd.Location = new System.Drawing.Point(420, 315);
+            this.btnEnd.Name = "btnEnd";
+            this.btnEnd.Size = new System.Drawing.Size(120, 30);
+            this.btnEnd.TabIndex = 53;
+            this.btnEnd.Text = "終　了";
+            this.btnEnd.UseVisualStyleBackColor = false;
+            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
+            // 
+            // label1
+            // 
+            this.label1.Anchor = System.Windows.Forms.AnchorStyles.Top;
+            this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
+            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label1.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label1.ForeColor = System.Drawing.Color.Black;
+            this.label1.Location = new System.Drawing.Point(40, 10);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(500, 20);
+            this.label1.TabIndex = 54;
+            this.label1.Text = "注文書データ変換";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.ForeColor = System.Drawing.Color.White;
+            this.label2.Location = new System.Drawing.Point(126, 52);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(110, 16);
+            this.label2.TabIndex = 55;
+            this.label2.Text = "対象台帳行数";
+            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // lblCount01
+            // 
+            this.lblCount01.BackColor = System.Drawing.Color.White;
+            this.lblCount01.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCount01.ForeColor = System.Drawing.Color.Black;
+            this.lblCount01.Location = new System.Drawing.Point(251, 50);
+            this.lblCount01.Name = "lblCount01";
+            this.lblCount01.Size = new System.Drawing.Size(110, 20);
+            this.lblCount01.TabIndex = 55;
+            this.lblCount01.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.ForeColor = System.Drawing.Color.White;
+            this.label4.Location = new System.Drawing.Point(126, 86);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(93, 16);
+            this.label4.TabIndex = 55;
+            this.label4.Text = "処理済行数";
+            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // lblCount02
+            // 
+            this.lblCount02.BackColor = System.Drawing.Color.White;
+            this.lblCount02.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCount02.ForeColor = System.Drawing.Color.Black;
+            this.lblCount02.Location = new System.Drawing.Point(251, 84);
+            this.lblCount02.Name = "lblCount02";
+            this.lblCount02.Size = new System.Drawing.Size(110, 20);
+            this.lblCount02.TabIndex = 55;
+            this.lblCount02.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.ForeColor = System.Drawing.Color.White;
+            this.label3.Location = new System.Drawing.Point(126, 120);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(93, 16);
+            this.label3.TabIndex = 55;
+            this.label3.Text = "変換済行数";
+            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // lblCount03
+            // 
+            this.lblCount03.BackColor = System.Drawing.Color.White;
+            this.lblCount03.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCount03.ForeColor = System.Drawing.Color.Black;
+            this.lblCount03.Location = new System.Drawing.Point(251, 118);
+            this.lblCount03.Name = "lblCount03";
+            this.lblCount03.Size = new System.Drawing.Size(110, 20);
+            this.lblCount03.TabIndex = 55;
+            this.lblCount03.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.ForeColor = System.Drawing.Color.White;
+            this.label5.Location = new System.Drawing.Point(126, 154);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(93, 16);
+            this.label5.TabIndex = 55;
+            this.label5.Text = "支払列変換";
+            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // lblCount04
+            // 
+            this.lblCount04.BackColor = System.Drawing.Color.White;
+            this.lblCount04.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCount04.ForeColor = System.Drawing.Color.Black;
+            this.lblCount04.Location = new System.Drawing.Point(251, 152);
+            this.lblCount04.Name = "lblCount04";
+            this.lblCount04.Size = new System.Drawing.Size(110, 20);
+            this.lblCount04.TabIndex = 55;
+            this.lblCount04.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.ForeColor = System.Drawing.Color.White;
+            this.label6.Location = new System.Drawing.Point(126, 188);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(93, 16);
+            this.label6.TabIndex = 55;
+            this.label6.Text = "明細行変換";
+            this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // lblCount05
+            // 
+            this.lblCount05.BackColor = System.Drawing.Color.White;
+            this.lblCount05.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCount05.ForeColor = System.Drawing.Color.Black;
+            this.lblCount05.Location = new System.Drawing.Point(251, 186);
+            this.lblCount05.Name = "lblCount05";
+            this.lblCount05.Size = new System.Drawing.Size(110, 20);
+            this.lblCount05.TabIndex = 55;
+            this.lblCount05.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.ForeColor = System.Drawing.Color.White;
+            this.label8.Location = new System.Drawing.Point(126, 222);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(93, 16);
+            this.label8.TabIndex = 55;
+            this.label8.Text = "支払行変換";
+            this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // lblCount06
+            // 
+            this.lblCount06.BackColor = System.Drawing.Color.White;
+            this.lblCount06.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblCount06.ForeColor = System.Drawing.Color.Black;
+            this.lblCount06.Location = new System.Drawing.Point(251, 220);
+            this.lblCount06.Name = "lblCount06";
+            this.lblCount06.Size = new System.Drawing.Size(110, 20);
+            this.lblCount06.TabIndex = 55;
+            this.lblCount06.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // FrmPOConvert
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+            this.BackColor = System.Drawing.Color.Black;
+            this.ClientSize = new System.Drawing.Size(580, 357);
+            this.Controls.Add(this.lblCount06);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.lblCount05);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.lblCount04);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.lblCount03);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.lblCount02);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.lblCount01);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.btnDataEntry);
+            this.Controls.Add(this.btnEnd);
+            this.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+            this.KeyPreview = true;
+            this.MaximizeBox = false;
+            this.Name = "FrmPOConvert";
+            this.ShowIcon = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmPOConvert_FormClosing);
+            this.Load += new System.EventHandler(this.FrmPOConvert_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button btnDataEntry;
+        private System.Windows.Forms.Button btnEnd;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label lblCount01;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label lblCount02;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label lblCount03;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label lblCount04;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label lblCount05;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label lblCount06;
+    }
+}
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPOConvert.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPOConvert.cs	(nonexistent)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPOConvert.cs	(revision 302)
@@ -0,0 +1,335 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Collections;
+using System.Linq;
+
+using log4net;
+using log4net.Appender;
+using log4net.Repository.Hierarchy;
+
+using ProcessManagement.Common;
+using ProcessManagement.DB.IOAccess;
+using ProcessManagement.DataModel;
+using ProcessManagement.DB.MySql;
+using ProcessManagement.DB.Core;
+using ProcessManagement.Forms.Master;
+using ProcessManagement.Forms.SubForms;
+using ProcessManagement.Forms.ControlsAction;
+using ProcessManagement.Forms.CustomControls;
+
+namespace ProcessManagement.Forms.DataEntry
+{
+    public partial class FrmPOConvert : Form
+    {
+        #region 使用定義
+        //log4netログを使用する
+        private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+        #endregion
+
+        #region 定数
+        #endregion
+
+        #region 変数
+        #endregion
+
+        #region プロパティ
+
+        #endregion
+
+        #region コンストラクタ
+        public FrmPOConvert()
+        {
+            InitializeComponent();
+        }
+        #endregion
+
+        #region フォームロード
+        /// <summary>
+        /// フォームロード
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void FrmPOConvert_Load(object sender, EventArgs e)
+        {
+            try
+            {
+            }
+            catch (System.Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region ×ボタン
+        /// <summary>
+        /// ×ボタン
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void FrmPOConvert_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            try
+            {
+            }
+            catch (System.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)
+        {
+            this.Close();
+        }
+        #endregion
+
+        #region 登録ボタン
+        /// <summary>
+        /// 登録ボタン押下
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnDataEntry_Click(object sender, EventArgs e)
+        {
+            IOConstructionLedgerDetail LedgerDDB = new IOConstructionLedgerDetail();
+            IOPurchaseOrderDetail PurOrderDDB = new IOPurchaseOrderDetail();
+            IOConstructionLedgerExcute ExecDB = new IOConstructionLedgerExcute();
+            try
+            {
+                LedgerDDB.connect(); LedgerDDB.beginTran();
+                PurOrderDDB.connect(); PurOrderDDB.beginTran();
+                ExecDB.connect(); ExecDB.beginTran();
+                
+                if (!ConvertProc1(LedgerDDB, PurOrderDDB))
+                {
+                    LedgerDDB.rollback();
+                    PurOrderDDB.rollback();
+                    ExecDB.rollback();
+                    return;
+                }
+
+                if (!ConvertProc2(ExecDB, LedgerDDB))
+                {
+                    LedgerDDB.rollback();
+                    PurOrderDDB.rollback();
+                    ExecDB.rollback();
+                    return;
+                }
+
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                LedgerDDB.commit();
+                PurOrderDDB.commit();
+                ExecDB.commit();
+
+                LedgerDDB.close(); LedgerDDB = null;
+                PurOrderDDB.close(); PurOrderDDB = null;
+                ExecDB.close(); ExecDB = null;
+            }
+        }
+        #endregion
+
+        #region 変換処理1
+        /// <summary>
+        /// 変換処理1
+        /// </summary>
+        private bool ConvertProc1(IOConstructionLedgerDetail LedgerDDB
+                                    ,IOPurchaseOrderDetail PurOrderDDB)
+        {
+            try
+            {
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.AppendFormat(" Where GroupCount = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
+                strSQL.Append(" Order by ConstructionCode,LineCount");
+                List<ConstructionLedgerDetail> DetailList = new List<ConstructionLedgerDetail>();
+                LedgerDDB.SelectAction(strSQL.ToString(), ref DetailList, false);
+                if (DetailList.Count < 1) return false;
+                lblCount01.Text = DetailList.Count.ToString("0,0");
+                this.Refresh();
+
+                int nDcnt = 0;
+                int nAllcnt = 0;
+                int nBreakKey = 0;
+                foreach (ConstructionLedgerDetail CurRec in DetailList)
+                {
+                    if (nBreakKey != CurRec.ConstructionCode)
+                    {
+                        nDcnt = 1;
+                        nBreakKey = CurRec.ConstructionCode;
+                    }
+
+                    strSQL.Clear();
+                    strSQL.Append(LedgerDDB.CreatePrimarykeyString(CurRec.ConstructionCode, CurRec.GroupCount, CurRec.LineCount));
+                    if (!LedgerDDB.UpdateFeild(strSQL.ToString()
+                                                , (int)IOConstructionLedgerDetail.TableColumn.DetailCount
+                                                , nDcnt
+                                                , false))
+                    {
+                        MessageBox.Show("工事台帳明細：明細番号更新エラー");
+                        return false;
+                    }
+                    nDcnt++;
+                    nAllcnt++;
+                }
+                lblCount02.Text = nAllcnt.ToString("0,0");
+                this.Refresh();
+
+                strSQL.Clear();
+                strSQL.AppendFormat(" Where GroupCount = {0}", (int)PurchaseOrderDetail.GroupCountDef.Detail);
+                strSQL.Append(" And SourceDetailCnt != 0");
+                strSQL.Append(" Order by ConstructionCode,SeqNo,LineCount");
+
+                List<PurchaseOrderDetail> OrderList = new List<PurchaseOrderDetail>();
+                PurOrderDDB.SelectAction(strSQL.ToString(), ref OrderList, false);
+                if (OrderList.Count < 1) return false;
+
+                int OrederCnt = 0;
+                foreach (PurchaseOrderDetail OrderRec in OrderList)
+                {
+                    strSQL.Clear();
+                    strSQL.Append(LedgerDDB.CreatePrimarykeyString((int)OrderRec.SourceCode
+                                                                    , (int)FrmConstructionLedger.DataGroup.ConstructionCosts
+                                                                    , OrderRec.SourceDetailCnt));
+                    ConstructionLedgerDetail LedgerRec = new ConstructionLedgerDetail();
+                    if (!LedgerDDB.SelectAction(strSQL.ToString(), ref LedgerRec, false)) continue;
+
+                    strSQL.Clear();
+                    strSQL.Append(PurOrderDDB.CreatePrimarykeyString(OrderRec.ConstructionCode, OrderRec.SeqNo, OrderRec.GroupCount, OrderRec.LineCount));
+                    if (!PurOrderDDB.UpdateFeild(strSQL.ToString()
+                                                , (int)IOPurchaseOrderDetail.TableColumn.SourceDetailCnt
+                                                , LedgerRec.DetailCount
+                                                , false))
+                    {
+                        MessageBox.Show("注文書明細：明細番号更新エラー");
+                        return false;
+                    }
+
+                    OrederCnt++;
+                }
+
+                lblCount03.Text = OrederCnt.ToString("0,0");
+                this.Refresh();
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
+            }
+        }
+        #endregion
+
+        #region 変換処理2
+        /// <summary>
+        /// 変換処理2
+        /// </summary>
+        private bool ConvertProc2(IOConstructionLedgerExcute ExecDB, IOConstructionLedgerDetail LedgerDDB)
+        {
+            try
+            {
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(" Where ColumnCount > 26");
+                strSQL.Append(" Order by ConstructionCode ASC, ColumnCount DESC");
+                List<ConstructionLedgerExcute> DataList = new List<ConstructionLedgerExcute>();
+                ExecDB.SelectAction(strSQL.ToString(), ref DataList, false);
+                if (DataList.Count < 1) return false;
+
+                int nCnt = 1;
+                foreach (ConstructionLedgerExcute CurRec in DataList)
+                {
+                    strSQL.Clear();
+                    strSQL.Append(ExecDB.CreatePrimarykeyString(CurRec.ConstructionCode, CurRec.GroupCount, CurRec.LineCount, CurRec.ColumnCount));
+                    if (!ExecDB.UpdateFeild(strSQL.ToString()
+                                        , (int)IOConstructionLedgerExcute.TableColumn.ColumnCount
+                                        , (CurRec.ColumnCount + 1)
+                                        , false))
+                    {
+                        MessageBox.Show("注文書実行データ：列位置更新エラー");
+                        return false;
+                    }
+                    nCnt++;
+                }
+
+                lblCount04.Text = nCnt.ToString("0,0");
+                this.Refresh();
+
+                strSQL.Clear();
+                strSQL.Append(" Order By ConstructionCode ASC, LineCount DESC");
+                List<ConstructionLedgerDetail> DList = new List<ConstructionLedgerDetail>();
+                LedgerDDB.SelectAction(strSQL.ToString(), ref DList, false);
+                if (DataList.Count < 1) return false;
+
+                nCnt = 1;
+                foreach (ConstructionLedgerDetail CurRec in DList)
+                {
+                    strSQL.Clear();
+                    strSQL.Append(LedgerDDB.CreatePrimarykeyString(CurRec.ConstructionCode, CurRec.GroupCount, CurRec.LineCount));
+                    if (!LedgerDDB.UpdateFeild(strSQL.ToString()
+                                        , (int)IOConstructionLedgerDetail.TableColumn.LineCount
+                                        , (CurRec.LineCount * 10)
+                                        , false))
+                    {
+                        MessageBox.Show("注文書明細データ：行番号更新エラー");
+                        return false;
+                    }
+                    nCnt++;
+                }
+                lblCount05.Text = nCnt.ToString("0,0");
+                this.Refresh();
+
+
+                strSQL.Clear();
+                strSQL.Append(" Order By ConstructionCode ASC, LineCount DESC");
+                List<ConstructionLedgerExcute> EList = new List<ConstructionLedgerExcute>();
+                ExecDB.SelectAction(strSQL.ToString(), ref EList, false);
+                if (DataList.Count < 1) return false;
+
+                nCnt = 1;
+                foreach (ConstructionLedgerExcute CurRec in EList)
+                {
+                    strSQL.Clear();
+                    strSQL.Append(ExecDB.CreatePrimarykeyString(CurRec.ConstructionCode, CurRec.GroupCount, CurRec.LineCount, CurRec.ColumnCount));
+                    if (!ExecDB.UpdateFeild(strSQL.ToString()
+                                        , (int)IOConstructionLedgerExcute.TableColumn.LineCount
+                                        , (CurRec.LineCount * 10)
+                                        , false))
+                    {
+                        MessageBox.Show("注文書支払データ：行番号更新エラー");
+                        return false;
+                    }
+                    nCnt++;
+                }
+                lblCount06.Text = nCnt.ToString("0,0");
+                this.Refresh();
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
+            }
+        }
+        #endregion
+    }
+}
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPOConvert.resx
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPOConvert.resx	(nonexistent)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPOConvert.resx	(revision 302)
@@ -0,0 +1,120 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.Designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.Designer.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.Designer.cs	(revision 302)
@@ -151,11 +151,14 @@
             this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ColDataFlg = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.label15 = new System.Windows.Forms.Label();
             this.TabCollections = new System.Windows.Forms.TabControl();
             this.btnOtherProc = new System.Windows.Forms.Button();
             this.btnPageDelete = new System.Windows.Forms.Button();
             this.btnChangeCompany = new System.Windows.Forms.Button();
+            this.button1 = new System.Windows.Forms.Button();
+            this.btnLineDelete = new System.Windows.Forms.Button();
             this.panel1.SuspendLayout();
             this.panel2.SuspendLayout();
             this.pnlApproval.SuspendLayout();
@@ -1419,7 +1422,8 @@
             this.Column12,
             this.Column1,
             this.Column2,
-            this.ColDataFlg});
+            this.ColDataFlg,
+            this.Column3});
             this.dgvAllDisplay.EnableHeadersVisualStyles = false;
             this.dgvAllDisplay.Location = new System.Drawing.Point(8, 20);
             this.dgvAllDisplay.Name = "dgvAllDisplay";
@@ -1557,6 +1561,12 @@
             this.ColDataFlg.Name = "ColDataFlg";
             this.ColDataFlg.Visible = false;
             // 
+            // Column3
+            // 
+            this.Column3.HeaderText = "明細番号";
+            this.Column3.Name = "Column3";
+            this.Column3.Visible = false;
+            // 
             // label15
             // 
             this.label15.BackColor = System.Drawing.Color.Cyan;
@@ -1597,10 +1607,10 @@
             // btnPageDelete
             // 
             this.btnPageDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnPageDelete.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
+            this.btnPageDelete.BackColor = System.Drawing.Color.DeepPink;
             this.btnPageDelete.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.btnPageDelete.ForeColor = System.Drawing.Color.Black;
-            this.btnPageDelete.Location = new System.Drawing.Point(812, 656);
+            this.btnPageDelete.ForeColor = System.Drawing.Color.Yellow;
+            this.btnPageDelete.Location = new System.Drawing.Point(812, 655);
             this.btnPageDelete.Name = "btnPageDelete";
             this.btnPageDelete.Size = new System.Drawing.Size(120, 30);
             this.btnPageDelete.TabIndex = 96;
@@ -1614,7 +1624,7 @@
             this.btnChangeCompany.BackColor = System.Drawing.Color.DeepSkyBlue;
             this.btnChangeCompany.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
             this.btnChangeCompany.ForeColor = System.Drawing.Color.Black;
-            this.btnChangeCompany.Location = new System.Drawing.Point(686, 655);
+            this.btnChangeCompany.Location = new System.Drawing.Point(500, 655);
             this.btnChangeCompany.Name = "btnChangeCompany";
             this.btnChangeCompany.Size = new System.Drawing.Size(120, 30);
             this.btnChangeCompany.TabIndex = 97;
@@ -1622,6 +1632,35 @@
             this.btnChangeCompany.UseVisualStyleBackColor = false;
             this.btnChangeCompany.Click += new System.EventHandler(this.btnChangeCompany_Click);
             // 
+            // button1
+            // 
+            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.button1.BackColor = System.Drawing.Color.DarkSlateGray;
+            this.button1.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.button1.ForeColor = System.Drawing.Color.White;
+            this.button1.Location = new System.Drawing.Point(193, 656);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(120, 30);
+            this.button1.TabIndex = 97;
+            this.button1.Text = "データ変更";
+            this.button1.UseVisualStyleBackColor = false;
+            this.button1.Visible = false;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // btnLineDelete
+            // 
+            this.btnLineDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnLineDelete.BackColor = System.Drawing.Color.LightPink;
+            this.btnLineDelete.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnLineDelete.ForeColor = System.Drawing.Color.Red;
+            this.btnLineDelete.Location = new System.Drawing.Point(686, 655);
+            this.btnLineDelete.Name = "btnLineDelete";
+            this.btnLineDelete.Size = new System.Drawing.Size(120, 30);
+            this.btnLineDelete.TabIndex = 96;
+            this.btnLineDelete.Text = "行　削　除";
+            this.btnLineDelete.UseVisualStyleBackColor = false;
+            this.btnLineDelete.Click += new System.EventHandler(this.btnLineDelete_Click);
+            // 
             // FrmPurchaseOrderEntry
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@@ -1628,7 +1667,9 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
             this.BackColor = System.Drawing.Color.Black;
             this.ClientSize = new System.Drawing.Size(1344, 692);
+            this.Controls.Add(this.button1);
             this.Controls.Add(this.btnChangeCompany);
+            this.Controls.Add(this.btnLineDelete);
             this.Controls.Add(this.btnPageDelete);
             this.Controls.Add(this.btnOtherProc);
             this.Controls.Add(this.TabCollections);
@@ -1647,6 +1688,7 @@
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmPurchaseOrderEntry_FormClosing);
             this.Load += new System.EventHandler(this.FrmPurchaseOrderEntry_Load);
+            this.Shown += new System.EventHandler(this.FrmPurchaseOrderEntry_Shown);
             this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmPurchaseOrderEntry_KeyDown);
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
@@ -1778,6 +1820,7 @@
         private System.Windows.Forms.Button btnPageDelete;
         private System.Windows.Forms.Button btnChangeCompany;
         private System.Windows.Forms.Label lblFixComment;
+        private System.Windows.Forms.Button button1;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column14;
@@ -1791,5 +1834,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
         private System.Windows.Forms.DataGridViewTextBoxColumn ColDataFlg;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
+        private System.Windows.Forms.Button btnLineDelete;
     }
 }
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.cs	(revision 302)
@@ -88,9 +88,9 @@
             /// </summary>
             SourceCode,
             /// <summary>
-            /// 工事台帳行
+            /// 工事台帳明細番号
             /// </summary>
-            LedgerLine,
+            LedgerDetailNo,
             /// <summary>
             /// 予算書金額
             /// </summary>
@@ -497,6 +497,11 @@
         /// 承認済みロックフラグ
         /// </summary>
         bool m_bApprovalLock = false;
+
+        /// <summary>
+        /// 新規データ作成フラグ
+        /// </summary>
+        bool m_bCreateNewData = false;
         #endregion
 
         #region プロパティ
@@ -629,14 +634,6 @@
                 // 自画面初期表示
                 InitDataLoad();
 
-                // 表示位置調整
-                if (m_SubForm)
-                {
-                    this.StartPosition = FormStartPosition.CenterParent;
-                    this.Top += CommonDefine.s_DefalutShiftValue;
-                    this.Left += CommonDefine.s_DefalutShiftValue;
-                }
-
                 // データ変更フラグOFF
                 m_bChengeAns = false;
             }
@@ -905,6 +902,32 @@
         }
         #endregion
 
+        #region 行削除ボタン
+        /// <summary>
+        /// 行削除ボタン
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnLineDelete_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                // 行削除
+                LineRemoveProcess();
+
+                // ページが1ページの時はページ削除ボタン非表示
+                if (m_TabPageList.Count < 2)
+                {
+                    btnPageDelete.Visible = false;
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
         #region ページ削除ボタン押下
         /// <summary>
         /// ページ削除ボタン押下
@@ -917,6 +940,12 @@
             {
                 // ページ削除
                 if (!PageRemoveProcess()) return;
+
+                // ページが1ページの時はページ削除ボタン非表示
+                if (m_TabPageList.Count < 2)
+                {
+                    btnPageDelete.Visible = false;
+                }
             }
             catch (Exception ex)
             {
@@ -1664,5 +1693,33 @@
             ChangeCompanyOrders();
         }
         #endregion
+
+        #region デバッグ用ボタン
+        /// <summary>
+        /// デバッグ用ボタン
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button1_Click(object sender, EventArgs e)
+        {
+            FrmPOConvert frm = new FrmPOConvert();
+            frm.ShowDialog();
+            frm.Dispose();
+            frm = null;
+        }
+        #endregion
+
+        #region 画面表示後処理
+        /// <summary>
+        /// 画面表示後処理
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void FrmPurchaseOrderEntry_Shown(object sender, EventArgs e)
+        {
+            // 工事予算書画面表示
+            InitOtherForm();
+        }
+        #endregion
     }
 }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.resx
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.resx	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.resx	(revision 302)
@@ -147,4 +147,7 @@
   <metadata name="ColDataFlg.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntryAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntryAuxiliary.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntryAuxiliary.cs	(revision 302)
@@ -97,6 +97,46 @@
         }
         #endregion
 
+        #region 初期時工事予算書画面表示
+        /// <summary>
+        /// 初期時工事予算書画面表示
+        /// </summary>
+        private void InitOtherForm()
+        {
+            try
+            {
+                int ProcessNo = (int)ClsExcute.ProcessExecuteNo.ConstructionBudget;
+                // フォームがあれば最前面へ
+                FrmConstructionBudget frm = (FrmConstructionBudget)ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle;
+                if (frm != null)
+                {
+                    frm.Activate();
+                    return;
+                }
+
+                // 工事予算書入力起動
+                frm = new FrmConstructionBudget();
+                ClsExcute.SubFormHandleList[ProcessNo].ProcessNo = s_CurrentProcessNo;
+                ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle = (Form)frm;
+                frm.ConstructionCode = m_ConstructionCode;
+                frm.EditLock = m_EditLock;
+                frm.SubForm = true;
+                frm.ShowInTaskbar = true;
+
+                // クロースドハンドラをこちらで定義する
+                frm.FormClosed += new FormClosedEventHandler(FrmConstructionBudgetClosed);
+                frm.Show();
+
+                // フォームをずらす
+                frm.Location = CommonMotions.SetFormPosion(this.Location);
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
         #region 行デフォルト色へ変更
         /// <summary>
         /// 行をデフォルト色にする
@@ -189,10 +229,10 @@
         private bool DispOrderEntryList()
         {
             FrmOrderEntryList frm = new FrmOrderEntryList();
+            this.Hide();
             try
             {
                 frm.OrderFrm = this;
-                this.Hide();
                 frm.ConstructionCode = m_ConstructionCode;
                 frm.ShowDialog();
 
@@ -203,8 +243,6 @@
                 m_OrderNo = CommonMotions.cnvInt(objRec[(int)FrmOrderEntryList.ReadDBColumn.OrderNo]);
                 //if (m_OrderNo == 0) m_OrderNo = -1;
 
-                this.Show();
-
                 return true;
             }
             catch (System.Exception ex)
@@ -214,6 +252,7 @@
             }
             finally
             {
+                this.Show();
                 frm.Dispose(); frm = null;
             }
         }
@@ -232,6 +271,7 @@
                 DispHeader();
 
                 // 注文書よりデータを取り込む
+                m_bCreateNewData = false;
                 if (!SetPurchaseOrderData())
                 {
                     // 工事詳細台帳よりデータを取り込む
@@ -239,8 +279,18 @@
 
                     // 承認データ受付番号セット
                     SetApprovalOrderNo();
+
+                    m_bCreateNewData = true;
                 }
 
+                // 新規時は削除ボタン非表示
+                if (m_bCreateNewData)
+                {
+                    btnPageDelete.Visible = false;
+                    btnDataDelete.Visible = false;
+                }
+                if (m_TabPageList.Count < 2) btnPageDelete.Visible = false;
+
                 // 申請・承認表示処理
                 InitApprovalDisplay();
 
@@ -436,46 +486,27 @@
                 // 工事台帳コードのセット
                 object[] ParentRec = (object[])m_DetailList[0];
                 strSQL.Clear();
-                strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}",
-                                        CommonMotions.cnvInt(ParentRec[(int)FrmOrderEntryList.ReadDBColumn.ConstructionCode]));
+                strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}"
+                                            , CommonMotions.cnvInt(ParentRec[(int)FrmOrderEntryList.ReadDBColumn.ConstructionCode]));
+                strSQL.AppendFormat(" AND SOURCECODE = {0}"
+                                            , CommonMotions.cnvInt(ParentRec[(int)FrmOrderEntryList.ReadDBColumn.SourceCode]));
+                strSQL.AppendFormat(" AND PurchaseOrderFlg = {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.NoCreate);
 
-                int SourceCode = 0;
-                int CompanyCode = 0;
-                int LineNo = 0;
-                int brkSourceCode = 0;
-                bool bFirstCode = true;
+                strSQL.Append(" AND (");
                 bool bFirstCompany = true;
                 foreach (object[] CurRec in m_DetailList)
                 {
-                    SourceCode = CommonMotions.cnvInt(CurRec[(int)FrmOrderEntryList.ReadDBColumn.SourceCode]);
-                    CompanyCode = CommonMotions.cnvInt(CurRec[(int)FrmOrderEntryList.ReadDBColumn.CompanyCode]);
-                    LineNo = CommonMotions.cnvInt(CurRec[(int)FrmOrderEntryList.ReadDBColumn.LedgerLine]);
-                    // 工事番号のセット
-                    if (brkSourceCode != SourceCode)
-                    {
-                        if (bFirstCode)
-                        {
-                            strSQL.Append(" AND");
-                            bFirstCode = false;
-                        }
-                        else
-                        {
-                            strSQL.Append(")) OR");
-                        }
+                    int CompanyCode = CommonMotions.cnvInt(CurRec[(int)FrmOrderEntryList.ReadDBColumn.CompanyCode]);
 
-                        strSQL.AppendFormat(" (SOURCECODE = {0} AND (", SourceCode);
-
-                        brkSourceCode = SourceCode;
-                        bFirstCompany = true;
-                    }
                     // 会社番号のセット
                     if (!bFirstCompany) strSQL.Append(" OR");
 
-                    strSQL.AppendFormat(" (COMPANYCODE = {0} AND LINECOUNT = {1})", CompanyCode, LineNo);
+                    strSQL.AppendFormat(" COMPANYCODE = {0}", CompanyCode);
                     
                     bFirstCompany = false;
                 }
-                strSQL.Append(")) ORDER BY COMPANYCODE");
+                strSQL.Append(")");
+                strSQL.Append(" ORDER BY COMPANYCODE");
             }
             catch (System.Exception ex)
             {
@@ -658,7 +689,7 @@
                     CurRow.Cells[(int)DispDetailGridColumn.SourceCode].Value = DetailRec.ConstructionCode;
                     TotalPrice += DetailRec.ExecutionAmount;
                     // 工事台帳行
-                    CurRow.Cells[(int)DispDetailGridColumn.LedgerLine].Value = DetailRec.LineCount;
+                    CurRow.Cells[(int)DispDetailGridColumn.LedgerDetailNo].Value = DetailRec.DetailCount;
                     // 予算書金額
                     CurRow.Cells[(int)DispDetailGridColumn.BudgetValue].Value = DetailRec.ExecutionAmount;
                     // 前回入力値金額
@@ -806,9 +837,9 @@
                     strSQL.Append(" Left Join constructionledgerdetail As B");
                     strSQL.Append("   On B.SourceCode = A.ConstructionCode");
                     strSQL.Append("   And B.ConstructionCode = A.SourceCode");
-                    strSQL.Append("   And B.LineCount = A.SourceLineCnt");
+                    strSQL.Append("   And B.DetailCount = A.SourceDetailCnt");
                     
-                    strSQL.Append(DetailDB.CreatePrimarykeyString(OrderRec.ConstructionCode, OrderRec.SeqNo, 0, 0, "A."));
+                    strSQL.Append(DetailDB.CreatePrimarykeyString(OrderRec.ConstructionCode, OrderRec.SeqNo, -1, 0, "A."));
                     strSQL.AppendFormat(" And A.GroupCount in ({0}, {1})", (int)PurchaseOrderDetail.GroupCountDef.Detail
                                                                         , (int)PurchaseOrderDetail.GroupCountDef.StatutoryWelfare);
 
@@ -996,7 +1027,7 @@
                     GetRow.Cells[(int)DispDetailGridColumn.UnitPrice].Value = DetailRec.UnitPrice.ToString("#,#");	            // 単価
                     GetRow.Cells[(int)DispDetailGridColumn.PriceValue].Value = DetailRec.OrdersLinePrice.ToString("#,0");       // 金額
                     GetRow.Cells[(int)DispDetailGridColumn.SourceCode].Value = DetailRec.SourceCode;                            // 元工事番号
-                    GetRow.Cells[(int)DispDetailGridColumn.LedgerLine].Value = DetailRec.SourceLineCnt;                         // 元台帳行番号
+                    GetRow.Cells[(int)DispDetailGridColumn.LedgerDetailNo].Value = DetailRec.SourceDetailCnt;                       // 元台帳明細番号
                     GetRow.Cells[(int)DispDetailGridColumn.DataType].Value = DetailRec.DataTypeFlag;                            // データタイプ
 
                     GetRow.Cells[(int)DispDetailGridColumn.BudgetValue].Value = CommonMotions.cnvInt(ObjRec[DetailFeildCnt]);   // 予算書金額
@@ -1686,9 +1717,9 @@
                         && CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.GroupNo].Value) == (int)PurchaseOrderDetail.DataTypeFlagDef.CommonData)
                     {
                         // 元台帳行番号変更
-                        int nSourceLineCnt = 0;
-                        if (!CreateRowLedgerDetail(LDetailDB, DataTab, GetRow, ref nSourceLineCnt)) return false;
-                        GetRow.Cells[(int)DispDetailGridColumn.LedgerLine].Value = nSourceLineCnt;
+                        int nSourceDetailCnt = 0;
+                        if (!CreateRowLedgerDetail(LDetailDB, DataTab, GetRow, ref nSourceDetailCnt)) return false;
+                        GetRow.Cells[(int)DispDetailGridColumn.LedgerDetailNo].Value = nSourceDetailCnt;
                     }
 
                     PurchaseOrderDetail DatailRec = new PurchaseOrderDetail();
@@ -1705,7 +1736,7 @@
                     DatailRec.UnitPrice = CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.UnitPrice].Value);	        // 単価
                     DatailRec.OrdersLinePrice = CommonMotions.cnvDouble(GetRow.Cells[(int)DispDetailGridColumn.PriceValue].Value);  // 金額
                     DatailRec.SourceCode = CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.SourceCode].Value);          // 元工事番号
-                    DatailRec.SourceLineCnt = CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.LedgerLine].Value);       // 元台帳行番号
+                    DatailRec.SourceDetailCnt = CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.LedgerDetailNo].Value);     // 元台帳明細番号
                     DatailRec.DataTypeFlag = CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.DataType].Value);          // データタイプ
 
                     // データ書込み
@@ -1767,7 +1798,7 @@
         private bool CreateRowLedgerDetail(IOConstructionLedgerDetail LDetailDB
                                             , PurchaseOrderInputPage DataTab
                                             , DataGridViewRow GetRow
-                                            , ref int nLineCnt)
+                                            , ref int nDetailCnt)
         {
             try
             {
@@ -1776,10 +1807,10 @@
                 // 台帳の追加行位置を取得する
                 int ConstrCode = CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.SourceCode].Value);
                 int GrpCnt = (int)FrmConstructionLedger.DataGroup.ConstructionCosts;
-                int LedgerLineCnt = CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.LedgerLine].Value);
+                int LedgerLineCnt = CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.LedgerDetailNo].Value);
                 
                 strSQL.Append(LDetailDB.CreatePrimarykeyString(ConstrCode, GrpCnt));
-                nLineCnt = LDetailDB.SelectMaxLineCount(strSQL.ToString(), false) + 1;
+                nDetailCnt = LDetailDB.SelectMaxDetailCount(strSQL.ToString(), false) + 1;
 
                 strSQL.Clear();
                 strSQL.Append("Insert INTO ConstructionLedgerDetail");
@@ -1786,18 +1817,18 @@
                 strSQL.Append(" SELECT");
                 strSQL.Append(" A.ConstructionCode");                       // 工事番号
                 strSQL.Append(", A.GroupCount");                            // グループ番号
-                strSQL.AppendFormat(", {0}", nLineCnt);                     // 行番号
+                strSQL.Append(", (A.LineCount + 1)");                       // 行番号
                 strSQL.Append(", A.ComponentCode");                         // 構成キー
                 strSQL.Append(", A.ItemCode");		                        // 工種キー
-                strSQL.Append(", A.FirstString");                           // 項目名称
-                strSQL.Append(", A.SecondString");                          // 工事内容
+                strSQL.Append(", ''");                                      // 項目名称
+                strSQL.Append(", ''");                                      // 工事内容
                 strSQL.Append(", A.CompanyType");                           // 協力会社コードタイプ
                 strSQL.AppendFormat(", {0}",DataTab.OrderCompanyCode);      // 協力会社コード
-                strSQL.Append(", B.CompanyName");                           // 協力会社名称
-                strSQL.Append(", A.EstimatePrice");                         // 予算（見積）金額
-                strSQL.Append(", A.ExecutionAmount");                       // 実行金額
-                strSQL.Append(", A.AmountConfigRate");                      // 金額構成率
-                strSQL.Append(", A.PaymentBurden");                         // 支払補填額
+                strSQL.AppendFormat(", '{0}'", DataTab.PageValueItem[(int)PageValue.SubConstractorName].Text);  // 協力会社名称
+                strSQL.Append(", 0");                                       // 予算（見積）金額
+                strSQL.Append(", 0");                                       // 実行金額
+                strSQL.Append(", 0");                                       // 金額構成率
+                strSQL.Append(", 0");                                       // 支払補填額
                 strSQL.Append(", A.FixDataFlg");                            // 固定データフラグ
                 strSQL.Append(", A.IndependentFlg");                        // 独立データフラグ
                 strSQL.Append(", A.FluctuationFlg");                        // 増減データフラグ
@@ -1808,12 +1839,13 @@
                 strSQL.Append(", A.JoinTitleFlg");                          // 工事名称タイトル
                 strSQL.Append(", A.SalaryOnRegist");                        // 登録時月額給与
                 strSQL.AppendFormat(", {0}", (int)ConstructionLedgerDetail.PurOrderFlgDef.Making);  // 注文書発行フラグ
+                strSQL.AppendFormat(", {0}", nDetailCnt);                     // 明細番号
                 strSQL.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", DateTime.Now);
                 strSQL.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", DateTime.Now);
                 strSQL.Append(" FROM ConstructionLedgerDetail As A");
-                strSQL.Append(" Left Join subcontractormaster As B On B.CompanyCode = A.CompanyCode");
 
-                strSQL.Append(LDetailDB.CreatePrimarykeyString(ConstrCode, GrpCnt, LedgerLineCnt));
+                strSQL.Append(LDetailDB.CreatePrimarykeyString(ConstrCode, GrpCnt, 0, "A."));
+                strSQL.AppendFormat(" And A.DetailCount = {0}", LedgerLineCnt);
 
                 if (!LDetailDB.ExecuteNonQuery(strSQL.ToString(), false))
                 {
@@ -1823,7 +1855,8 @@
 
                 // 変更前業者行更新
                 strSQL.Clear();
-                strSQL.Append(LDetailDB.CreatePrimarykeyString(ConstrCode, GrpCnt, LedgerLineCnt));
+                strSQL.Append(LDetailDB.CreatePrimarykeyString(ConstrCode, GrpCnt));
+                strSQL.AppendFormat(" And DetailCount = {0}", LedgerLineCnt);
                 if (!LDetailDB.UpdateFeild(strSQL.ToString()
                                             , (int)IOConstructionLedgerDetail.TableColumn.PurchaseOrderFlg
                                             , (int)ConstructionLedgerDetail.PurOrderFlgDef.ChangeOld
@@ -1869,7 +1902,7 @@
                     // 金額
                     PriceVal = CommonMotions.cnvInt(CurRow.Cells[(int)DispDetailGridColumn.PriceValue].Value);
                     // 工事台帳行
-                    LedgerLine = CommonMotions.cnvInt(CurRow.Cells[(int)DispDetailGridColumn.LedgerLine].Value);
+                    LedgerLine = CommonMotions.cnvInt(CurRow.Cells[(int)DispDetailGridColumn.LedgerDetailNo].Value);
                     // 数量金額無は処理しない
                     if (QuantityVal == 0 && PriceVal == 0) continue;
                     if (LedgerLine == 0) continue;
@@ -1880,7 +1913,7 @@
                     strSQL.AppendFormat(" AND SOURCECODE = {0}", m_ConstructionCode);
                     strSQL.AppendFormat(" AND GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts);
                     strSQL.AppendFormat(" AND COMPANYCODE = {0}", DataTab.OrderCompanyCode);
-                    strSQL.AppendFormat(" AND LINECOUNT = {0}", LedgerLine);
+                    strSQL.AppendFormat(" AND DetailCount = {0}", LedgerLine);
                     if (!LDetailDB.UpdateFeild(strSQL.ToString()
                                                 , (int)IOConstructionLedgerDetail.TableColumn.PurchaseOrderFlg
                                                 , (int)ConstructionLedgerDetail.PurOrderFlgDef.Making
@@ -1956,6 +1989,7 @@
                 LDetailDB.connect(); LDetailDB.beginTran();
 
                 StringBuilder strDel = new StringBuilder();
+                StringBuilder strUpdate = new StringBuilder();
                 for (int i = StartCnt; i < EndCnt; i++)
                 {
                     PurchaseOrderInputPage DataTab = m_TabPageList[i];
@@ -1989,12 +2023,13 @@
                             != (int)PurchaseOrderDetail.GroupCountDef.Detail) continue;
 
                         SourceCode = CommonMotions.cnvInt(CurRow.Cells[(int)DispDetailGridColumn.SourceCode].Value);
-                        SourceLine = CommonMotions.cnvInt(CurRow.Cells[(int)DispDetailGridColumn.LedgerLine].Value);
-                        if(!LDetailDB.UpdateFeild(SourceCode,
+                        SourceLine = CommonMotions.cnvInt(CurRow.Cells[(int)DispDetailGridColumn.LedgerDetailNo].Value);
+                        strUpdate.Clear();
+                        strUpdate.AppendFormat(LDetailDB.CreatePrimarykeyString(SourceCode, (int)FrmConstructionLedger.DataGroup.ConstructionCosts));
+                        strUpdate.AppendFormat(" And DetailCount = {0}", SourceLine);
+                        if (!LDetailDB.UpdateFeild(strUpdate.ToString(),
                                                     (int)IOConstructionLedgerDetail.TableColumn.PurchaseOrderFlg,
                                                     (int)ConstructionLedgerDetail.PurOrderFlgDef.NoCreate,
-                                                    (int)FrmConstructionLedger.DataGroup.ConstructionCosts,
-                                                    SourceLine,
                                                     false))
                         {
                             OrderDB.rollback();
@@ -2029,12 +2064,135 @@
         }
         #endregion
 
+        #region 行削除処理
+        /// <summary>
+        /// 行削除ボタン押下後の削除処理
+        /// </summary>
+        /// <returns></returns>
+        private bool LineRemoveProcess()
+        {
+            IOPurchaseOrderDetail PDetailDB = new IOPurchaseOrderDetail();
+            IOConstructionLedgerDetail LDetailDB = new IOConstructionLedgerDetail();
+
+            // タブカウント取得
+            int TabCnt = TabCollections.SelectedIndex;
+            PurchaseOrderInputPage DataTab = m_TabPageList[TabCnt];
+            DataGridView dgv = DataTab.Group1DataGridView;
+            DataGridViewRow GetRow = dgv.CurrentRow;
+            Color[] wrkSave = new Color[2];
+            bool bLineDel = false;
+            try
+            {
+                // 通常データ以外は処理しない
+                if (CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.DataType].Value)
+                    != (int)PurchaseOrderDetail.DataTypeFlagDef.CommonData) return true;
+                if (CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.LedgerDetailNo].Value) < 1) return true;
+
+                wrkSave[0] = GetRow.DefaultCellStyle.BackColor;
+                wrkSave[1] = GetRow.DefaultCellStyle.ForeColor;
+                GetRow.DefaultCellStyle.BackColor = Color.Blue;
+                GetRow.DefaultCellStyle.ForeColor = Color.White;
+
+                if (MessageBox.Show("選択中の行を削除します。", "行削除確認"
+                        , MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return true;
+
+
+                if (MessageBox.Show("「はい(Y)」を選択すると選択されている行は削除されます！！\n本当によろしいですか？", "削除確認"
+                        , MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return true;
+
+                // 行削除
+                int nRemoveNo = GetRow.Index;
+                dgv.Rows.RemoveAt(nRemoveNo);
+
+                bLineDel = true;
+
+                // 明細グリッド合計計算処理
+                CalculateDetailGridTotal(dgv);
+
+                // 新規データはデータを処理しない
+                if (m_bCreateNewData) return true;
+
+                int SeqCnt = DataTab.SeqNo;
+
+                PDetailDB.connect(); PDetailDB.beginTran();
+                LDetailDB.connect(); LDetailDB.beginTran();
+
+                StringBuilder strDel = new StringBuilder();
+                strDel.Append(PDetailDB.CreatePrimarykeyString(m_ConstructionCode, SeqCnt, (int)PurchaseOrderDetail.DataTypeFlagDef.CommonData));
+                if (!PDetailDB.DeleteAction(strDel.ToString(), false))
+                {
+                    PDetailDB.rollback();
+                    MessageBox.Show("注文書明細データ削除に失敗しました。", "削除処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    return false;
+                }
+
+                // 台帳の注文書作成フラグをOFFにする
+                // 明細行のみを対象とする
+                if (CommonMotions.chkObjectIsNull(GetRow.Cells[(int)DispDetailGridColumn.GroupNo].Value)) return false;
+                if (CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.GroupNo].Value)
+                    != (int)PurchaseOrderDetail.GroupCountDef.Detail) return false;
+
+                int SourceCode = CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.SourceCode].Value);
+                int SourceLine = CommonMotions.cnvInt(GetRow.Cells[(int)DispDetailGridColumn.LedgerDetailNo].Value);
+                StringBuilder strUpdate = new StringBuilder();
+                strUpdate.AppendFormat(LDetailDB.CreatePrimarykeyString(SourceCode, (int)FrmConstructionLedger.DataGroup.ConstructionCosts));
+                strUpdate.AppendFormat(" And DetailCount = {0}", SourceLine);
+                if (!LDetailDB.UpdateFeild(strUpdate.ToString(),
+                                            (int)IOConstructionLedgerDetail.TableColumn.PurchaseOrderFlg,
+                                            (int)ConstructionLedgerDetail.PurOrderFlgDef.NoCreate,
+                                            false))
+                {
+                    PDetailDB.rollback();
+                    LDetailDB.rollback();
+                    MessageBox.Show("工事台帳データ注文書フラグ更新に失敗しました。", "削除処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    return false;
+                }
+
+                PDetailDB.commit();
+                LDetailDB.commit();
+
+                // 残った明細行を確認する
+                int nDataCnt = dgv.Rows.Cast<DataGridViewRow>().Where(x => CommonMotions.cnvInt(x.Cells[(int)DispDetailGridColumn.DataType].Value)
+                                                                                == (int)PurchaseOrderDetail.DataTypeFlagDef.CommonData
+                                                                        && CommonMotions.cnvInt(x.Cells[(int)DispDetailGridColumn.PriceValue].Value) != 0)
+                                                                .Count();
+                if (nDataCnt < 1)
+                {
+                    bool bSave = m_bChengeAns;
+                    m_bChengeAns = false;
+                    
+                    // ページ削除
+                    PageRemoveProcess(false);
+                    
+                    m_bChengeAns = bSave;
+                }
+                return true;
+            }
+            catch (System.Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
+            }
+            finally
+            {
+                if (!bLineDel)
+                {
+                    GetRow.DefaultCellStyle.BackColor = wrkSave[0];
+                    GetRow.DefaultCellStyle.ForeColor = wrkSave[1];
+                }
+
+                PDetailDB.close(); PDetailDB = null;
+                LDetailDB.close(); LDetailDB = null;
+            }
+        }
+        #endregion
+
         #region ページ削除処理
         /// <summary>
         /// ページ削除ボタン押下後の削除処理
         /// </summary>
         /// <returns></returns>
-        private bool PageRemoveProcess()
+        private bool PageRemoveProcess(bool bDispMsg = true)
         {
             try
             {
@@ -2044,18 +2202,22 @@
                     if (MessageBox.Show("データの変更がありますがページ削除を実行してもよろしいですか。", "ページ削除実行確認"
                             , MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return true;
                 }
-                
-                if (MessageBox.Show("選択中のページを削除します。", "ページ削除確認"
-                        , MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return true;
 
-                if (MessageBox.Show("「はい(Y)」を選択すると表示されている\n協力業者の注文書データは削除されます！！\n本当によろしいですか？", "削除確認"
-                        , MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return true;
+                if (bDispMsg)
+                {
+                    if (MessageBox.Show("選択中のページを削除します。", "ページ削除確認"
+                            , MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return true;
 
+                    if (MessageBox.Show("「はい(Y)」を選択すると表示されている\n協力業者の注文書データは削除されます！！\n本当によろしいですか？", "削除確認"
+                            , MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return true;
+                }
+
                 // タブカウント取得
                 int TabCnt = TabCollections.SelectedIndex;
 
                 // データ削除
-                if (!DataRemoveProcess(false, TabCnt, (TabCnt + 1))) return false;
+                if (!m_bCreateNewData)
+                    if (!DataRemoveProcess(false, TabCnt, (TabCnt + 1))) return false;
 
                 // タブを削除する
                 TabCollections.TabPages.RemoveAt(TabCnt);
@@ -2063,6 +2225,13 @@
                 // 配列から削除
                 m_TabPageList.RemoveAt(TabCnt);
 
+                // ページが無くなった場合は処理終了
+                if (m_TabPageList.Count < 1)
+                {
+                    m_bChengeAns = false;
+                    this.Close();
+                }
+
                 return true;
             }
             catch (System.Exception ex)
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderPrint/PrintFormat1.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderPrint/PrintFormat1.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderPrint/PrintFormat1.cs	(revision 302)
@@ -301,7 +301,7 @@
                     }
 
                     // ブロック２編集
-                    RARet = SetBlock2Data(0, OrderRec, workRec.DetailString);
+                    RARet = SetBlock2Data(OrderRec, workRec.DetailString);
                     if (RARet != CommonDefine.RetunAnswer.Answer0) return RARet;
 
                     // 中断処理
@@ -313,7 +313,7 @@
                     }
 
                     // ブロック３編集
-                    RARet = SetBlock3Data(0, OrderRec);
+                    RARet = SetBlock3Data(OrderRec);
                     if (RARet != CommonDefine.RetunAnswer.Answer0) return RARet;
 
                     // 中断処理
@@ -325,7 +325,7 @@
                     }
 
                     // ブロック４編集
-                    RARet = SetBlock4Data(0, OrderRec);
+                    RARet = SetBlock4Data(OrderRec);
                     if (RARet != CommonDefine.RetunAnswer.Answer0) return RARet;
 
                     // 中断処理
@@ -349,7 +349,7 @@
                     }
 
                     // ブロック２編集
-                    RARet = SetBlock2Data(151, OrderRec, workRec.DetailString);
+                    RARet = SetBlock2Data(OrderRec, workRec.DetailString, 153);
                     if (RARet != CommonDefine.RetunAnswer.Answer0) return RARet;
 
                     // 中断処理
@@ -361,7 +361,7 @@
                     }
 
                     // ブロック３編集
-                    RARet = SetBlock3Data(151, OrderRec);
+                    RARet = SetBlock3Data(OrderRec, 153);
                     if (RARet != CommonDefine.RetunAnswer.Answer0) return RARet;
 
                     // 中断処理
@@ -373,7 +373,7 @@
                     }
 
                     // ブロック４編集
-                    RARet = SetBlock4Data(151, OrderRec);
+                    RARet = SetBlock4Data(OrderRec, 153);
                     if (RARet != CommonDefine.RetunAnswer.Answer0) return RARet;
 
                     // 中断処理
@@ -384,28 +384,6 @@
                         return CommonDefine.RetunAnswer.Answer0;
                     }
 
-                    //// ページ名称セット
-                    //strPageName = string.Format("{0}約款", ContractorRec.CompanyName);
-                    //// 約款ページ取得
-                    //m_UsedExcel.ExcelSheetGet(SheetName[(int)enumSheetName.Clause], true, strPageName);
-                    //// 約款ページ行サイズ変更
-                    //m_UsedExcel.ExcelRaneSizeSet("A1:O88", s_DefaultRowSize);
-                    //// 約款ページ列サイズ変更
-                    //m_UsedExcel.ExcelRaneSizeSet("A1:O88", s_DefaultColumnSize, false);
-                    //// 約款ページ縦・横セット
-                    //m_UsedExcel.ExcelFitCountSet(2, 1);
-
-                    //// ページ名称セット（2017/11/29　とりあえず約款を2枚印刷）
-                    //strPageName = string.Format("{0}約款", ContractorRec.CompanyName);
-                    //// 約款ページ取得
-                    //m_UsedExcel.ExcelSheetGet(SheetName[(int)enumSheetName.Clause], true, strPageName);
-                    //// 約款ページ行サイズ変更
-                    //m_UsedExcel.ExcelRaneSizeSet("A1:O88", s_DefaultRowSize);
-                    //// 約款ページ列サイズ変更
-                    //m_UsedExcel.ExcelRaneSizeSet("A1:O88", s_DefaultColumnSize, false);
-                    //// 約款ページ縦・横セット
-                    //m_UsedExcel.ExcelFitCountSet(2, 1);
-
                     // コントロールの表示を変更する
                     this.Invoke(m_progressDlg, new object[] { ++m_ProgressCount });
                 }
@@ -509,7 +487,7 @@
         /// <param name="OrderRec"></param>
         /// <param name="ConstractionName"></param>
         /// <returns></returns>
-        private CommonDefine.RetunAnswer SetBlock2Data(int startLine, PurchaseOrder OrderRec, string ConstractionName)
+        private CommonDefine.RetunAnswer SetBlock2Data(PurchaseOrder OrderRec, string ConstractionName, int startLine = 0)
         {
             IOConstructionBaseInfoDetail InfoDetailDB = new IOConstructionBaseInfoDetail();
             IOMPersonInCharge PersonDB = new IOMPersonInCharge();
@@ -599,7 +577,7 @@
         /// <param name="startLine"></param>
         /// <param name="OrderRec"></param>
         /// <returns></returns>
-        private CommonDefine.RetunAnswer SetBlock3Data(int startLine, PurchaseOrder OrderRec)
+        private CommonDefine.RetunAnswer SetBlock3Data(PurchaseOrder OrderRec, int startLine = 0)
         {
             IOPurchaseOrderDetail OrderDetailDB = new IOPurchaseOrderDetail();
             try
@@ -655,7 +633,7 @@
         /// <param name="startLine"></param>
         /// <param name="OrderRec"></param>
         /// <returns></returns>
-        private CommonDefine.RetunAnswer SetBlock4Data(int startLine, PurchaseOrder OrderRec)
+        private CommonDefine.RetunAnswer SetBlock4Data(PurchaseOrder OrderRec, int startLine = 0)
         {
             IOPurchaseOrderDetail OrderDetailDB = new IOPurchaseOrderDetail();
             try
@@ -701,11 +679,11 @@
             IOMSubContractor ContractorDB = new IOMSubContractor();
             try
             {
-                m_UsedExcel.ExcelCellSet("B162", "〒" + CommonMotions.SystemMasterData.ZipCode);         // 自社 郵便番号
-                m_UsedExcel.ExcelCellSet("B163", CommonMotions.SystemMasterData.Address1 +
+                m_UsedExcel.ExcelCellSet("B164", "〒" + CommonMotions.SystemMasterData.ZipCode);         // 自社 郵便番号
+                m_UsedExcel.ExcelCellSet("B165", CommonMotions.SystemMasterData.Address1 +
                                                 CommonMotions.SystemMasterData.Address2 +
                                                 CommonMotions.SystemMasterData.Address3);               // 自社 住所
-                m_UsedExcel.ExcelCellSet("C166", CommonMotions.SystemMasterData.CompanyName1 +
+                m_UsedExcel.ExcelCellSet("C168", CommonMotions.SystemMasterData.CompanyName1 +
                                                 CommonMotions.SystemMasterData.CompanyName2);           // 自社 会社名
 
                 // 協力会社名取得
@@ -736,10 +714,10 @@
                         break;
                 }
 
-                m_UsedExcel.ExcelCellSet("M164", "〒" + ContractorRec.ZipCode);                  // 発注先 郵便番号
-                m_UsedExcel.ExcelCellSet("M165", strA2);                                         // 発注先 住所1
-                m_UsedExcel.ExcelCellSet("M166", strA3);                                         // 発注先 住所2
-                m_UsedExcel.ExcelCellSet("M167", strA4);                                         // 発注先 会社
+                m_UsedExcel.ExcelCellSet("M166", "〒" + ContractorRec.ZipCode);                  // 発注先 郵便番号
+                m_UsedExcel.ExcelCellSet("M167", strA2);                                         // 発注先 住所1
+                m_UsedExcel.ExcelCellSet("M168", strA3);                                         // 発注先 住所2
+                m_UsedExcel.ExcelCellSet("M169", strA4);                                         // 発注先 会社
 
                 return CommonDefine.RetunAnswer.Answer0;
             }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryList.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryList.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryList.cs	(revision 302)
@@ -646,33 +646,35 @@
                 CreateProcessContextMenu();
                 // *-----* �����ړ��{�^���ݒ� *-----*
 
-                // �\���E���F�\������
-                InitApprovalDisplay();
+                // ���F�{�^���̕\������
+                ApprovalDispControl();
+                //// �\���E���F�\������
+                //InitApprovalDisplay();
 
-                // ���F��ʂ́u���F�Ώۃf�[�^������v����̋N�����͏��F�{�^���̕\��������
-                bool bApproval = ClsApprovalPermission.ExceApprovalScreen((int)ClsExcute.SubFormExecuteNo.ApprovalPerson);
-                if (bApproval)
-                {
-                    // ���F�ΏۃR�[�h���擾����
-                    int ApprovalCode = ClsExcute.AppovalList.First(x => x.Value.Equals(s_MyProcessName[m_Labourkind])).Key;
-                    // �H���Č��̊Ǘ��������擾����
-                    //int DepartmentCode = ClsApprovalPermission.GetFromPersonAndApprovalTheDepartment(m_PersonCode, ApprovalCode, m_CreateDate, m_SeqNo);
-                    int DepartmentCode = CommonMotions.LoginUserData.DepartmentCode;
-                    // �Č��ɑ΂��Đ\��������Ă��邩���m�F����
-                    bool Pettition = false;
-                    if (!m_FirstFlg)
-                    {
-                        //Pettition = ClsApprovalPermission.CheckPersonPetition2(m_PaInfo.ApprovalPerson, ApprovalCode, m_PaInfo.ApprovalDate, (int)CommonDefine.s_Default_OrderNo);
-                        Pettition = ClsApprovalPermission.CheckPersonPetition(m_PaymentPersonCode, ApprovalCode, m_OrderDate, (int)CommonDefine.s_Default_OrderNo);
-                    }
-                    // ���O�C���҂����F�҂����m�F����
-                    bool Approvaler = ClsApprovalPermission.CheckUserForApprover(ApprovalCode, DepartmentCode);
-                    // �\�����Ń��O�C���҂����F�҂̏ꍇ�͏��F�{�^����\������
-                    if (Pettition && Approvaler)
-                    {
-                        pnlApprovalButton.Visible = true;
-                    }
-                }
+                //// ���F��ʂ́u���F�Ώۃf�[�^������v����̋N�����͏��F�{�^���̕\��������
+                //bool bApproval = ClsApprovalPermission.ExceApprovalScreen((int)ClsExcute.SubFormExecuteNo.ApprovalPerson);
+                //if (bApproval)
+                //{
+                //    // ���F�ΏۃR�[�h���擾����
+                //    int ApprovalCode = ClsExcute.AppovalList.First(x => x.Value.Equals(s_MyProcessName[m_Labourkind])).Key;
+                //    // �H���Č��̊Ǘ��������擾����
+                //    //int DepartmentCode = ClsApprovalPermission.GetFromPersonAndApprovalTheDepartment(m_PersonCode, ApprovalCode, m_CreateDate, m_SeqNo);
+                //    int DepartmentCode = CommonMotions.LoginUserData.DepartmentCode;
+                //    // �Č��ɑ΂��Đ\��������Ă��邩���m�F����
+                //    bool Pettition = false;
+                //    if (!m_FirstFlg)
+                //    {
+                //        //Pettition = ClsApprovalPermission.CheckPersonPetition2(m_PaInfo.ApprovalPerson, ApprovalCode, m_PaInfo.ApprovalDate, (int)CommonDefine.s_Default_OrderNo);
+                //        Pettition = ClsApprovalPermission.CheckPersonPetition(m_PaymentPersonCode, ApprovalCode, m_OrderDate, (int)CommonDefine.s_Default_OrderNo);
+                //    }
+                //    // ���O�C���҂����F�҂����m�F����
+                //    bool Approvaler = ClsApprovalPermission.CheckUserForApprover(ApprovalCode, DepartmentCode);
+                //    // �\�����Ń��O�C���҂����F�҂̏ꍇ�͏��F�{�^����\������
+                //    if (Pettition && Approvaler)
+                //    {
+                //        pnlApprovalButton.Visible = true;
+                //    }
+                //}
 
                 m_initDataLoad = false;
             }
@@ -1392,6 +1394,9 @@
 
             // �f�[�^�\��
             DispGridData();
+
+            // ���F�{�^���̕\������
+            ApprovalDispControl();
         }
         #endregion
 
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryList.designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryList.designer.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryList.designer.cs	(revision 302)
@@ -107,13 +107,6 @@
             this.btnShowView = new System.Windows.Forms.Button();
             this.btnDataUpDate = new System.Windows.Forms.Button();
             this.groupBoxEx1 = new ProcessManagement.Forms.CustomControls.GroupBoxEx();
-            this.label11 = new System.Windows.Forms.Label();
-            this.cmbPerson = new System.Windows.Forms.ComboBox();
-            this.cmbDepartment = new System.Windows.Forms.ComboBox();
-            this.label4 = new System.Windows.Forms.Label();
-            this.panel2 = new System.Windows.Forms.Panel();
-            this.rdbProject = new System.Windows.Forms.RadioButton();
-            this.rdbCompany = new System.Windows.Forms.RadioButton();
             this.pnlApproval = new System.Windows.Forms.Panel();
             this.lblApprovalCount = new System.Windows.Forms.Label();
             this.btnPetition = new System.Windows.Forms.Button();
@@ -122,6 +115,13 @@
             this.btnOnApproval = new System.Windows.Forms.Button();
             this.btnNotApproval = new System.Windows.Forms.Button();
             this.btnOnHold = new System.Windows.Forms.Button();
+            this.label11 = new System.Windows.Forms.Label();
+            this.cmbPerson = new System.Windows.Forms.ComboBox();
+            this.cmbDepartment = new System.Windows.Forms.ComboBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.panel2 = new System.Windows.Forms.Panel();
+            this.rdbProject = new System.Windows.Forms.RadioButton();
+            this.rdbCompany = new System.Windows.Forms.RadioButton();
             this.lblPaymentDate = new System.Windows.Forms.Label();
             this.label5 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
@@ -329,9 +329,9 @@
             this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel1.SuspendLayout();
             this.groupBoxEx1.SuspendLayout();
-            this.panel2.SuspendLayout();
             this.pnlApproval.SuspendLayout();
             this.pnlApprovalButton.SuspendLayout();
+            this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dgvCompany)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.dgvProject)).BeginInit();
             this.SuspendLayout();
@@ -624,98 +624,6 @@
             this.groupBoxEx1.TabIndex = 2;
             this.groupBoxEx1.TabStop = false;
             // 
-            // label11
-            // 
-            this.label11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
-            this.label11.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.label11.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label11.ForeColor = System.Drawing.Color.Black;
-            this.label11.Location = new System.Drawing.Point(692, 6);
-            this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(120, 25);
-            this.label11.TabIndex = 101;
-            this.label11.Text = "担 当 者";
-            this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // cmbPerson
-            // 
-            this.cmbPerson.BackColor = System.Drawing.Color.White;
-            this.cmbPerson.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cmbPerson.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.cmbPerson.FormattingEnabled = true;
-            this.cmbPerson.Location = new System.Drawing.Point(820, 7);
-            this.cmbPerson.Name = "cmbPerson";
-            this.cmbPerson.Size = new System.Drawing.Size(200, 23);
-            this.cmbPerson.TabIndex = 100;
-            // 
-            // cmbDepartment
-            // 
-            this.cmbDepartment.BackColor = System.Drawing.Color.White;
-            this.cmbDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cmbDepartment.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.cmbDepartment.FormattingEnabled = true;
-            this.cmbDepartment.Location = new System.Drawing.Point(476, 7);
-            this.cmbDepartment.Name = "cmbDepartment";
-            this.cmbDepartment.Size = new System.Drawing.Size(200, 23);
-            this.cmbDepartment.TabIndex = 98;
-            // 
-            // label4
-            // 
-            this.label4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
-            this.label4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.label4.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.label4.ForeColor = System.Drawing.Color.Black;
-            this.label4.Location = new System.Drawing.Point(348, 6);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(120, 25);
-            this.label4.TabIndex = 99;
-            this.label4.Text = "部　　署";
-            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // panel2
-            // 
-            this.panel2.BackColor = System.Drawing.Color.White;
-            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            this.panel2.Controls.Add(this.rdbProject);
-            this.panel2.Controls.Add(this.rdbCompany);
-            this.panel2.Location = new System.Drawing.Point(132, 38);
-            this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(200, 27);
-            this.panel2.TabIndex = 97;
-            // 
-            // rdbProject
-            // 
-            this.rdbProject.AutoSize = true;
-            this.rdbProject.BackColor = System.Drawing.Color.White;
-            this.rdbProject.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.rdbProject.ForeColor = System.Drawing.Color.Black;
-            this.rdbProject.Location = new System.Drawing.Point(103, 2);
-            this.rdbProject.Margin = new System.Windows.Forms.Padding(4);
-            this.rdbProject.Name = "rdbProject";
-            this.rdbProject.Size = new System.Drawing.Size(77, 20);
-            this.rdbProject.TabIndex = 9;
-            this.rdbProject.Text = "現　場";
-            this.rdbProject.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
-            this.rdbProject.UseVisualStyleBackColor = false;
-            // 
-            // rdbCompany
-            // 
-            this.rdbCompany.AutoSize = true;
-            this.rdbCompany.BackColor = System.Drawing.Color.White;
-            this.rdbCompany.Checked = true;
-            this.rdbCompany.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
-            this.rdbCompany.ForeColor = System.Drawing.Color.Black;
-            this.rdbCompany.Location = new System.Drawing.Point(10, 2);
-            this.rdbCompany.Margin = new System.Windows.Forms.Padding(4);
-            this.rdbCompany.Name = "rdbCompany";
-            this.rdbCompany.Size = new System.Drawing.Size(77, 20);
-            this.rdbCompany.TabIndex = 8;
-            this.rdbCompany.TabStop = true;
-            this.rdbCompany.Text = "業　者";
-            this.rdbCompany.TextAlign = System.Drawing.ContentAlignment.TopCenter;
-            this.rdbCompany.UseVisualStyleBackColor = false;
-            this.rdbCompany.CheckedChanged += new System.EventHandler(this.rdbCompany_CheckedChanged);
-            // 
             // pnlApproval
             // 
             this.pnlApproval.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -724,7 +632,7 @@
             this.pnlApproval.Controls.Add(this.lblApprovalCount);
             this.pnlApproval.Controls.Add(this.btnPetition);
             this.pnlApproval.Controls.Add(this.btnApproval);
-            this.pnlApproval.Location = new System.Drawing.Point(1054, 2);
+            this.pnlApproval.Location = new System.Drawing.Point(1053, 0);
             this.pnlApproval.Name = "pnlApproval";
             this.pnlApproval.Size = new System.Drawing.Size(262, 34);
             this.pnlApproval.TabIndex = 33;
@@ -779,7 +687,7 @@
             this.pnlApprovalButton.Controls.Add(this.btnOnApproval);
             this.pnlApprovalButton.Controls.Add(this.btnNotApproval);
             this.pnlApprovalButton.Controls.Add(this.btnOnHold);
-            this.pnlApprovalButton.Location = new System.Drawing.Point(1054, 2);
+            this.pnlApprovalButton.Location = new System.Drawing.Point(1053, 0);
             this.pnlApprovalButton.Name = "pnlApprovalButton";
             this.pnlApprovalButton.Size = new System.Drawing.Size(262, 34);
             this.pnlApprovalButton.TabIndex = 34;
@@ -824,6 +732,98 @@
             this.btnOnHold.UseVisualStyleBackColor = false;
             this.btnOnHold.Click += new System.EventHandler(this.btnOnHold_Click);
             // 
+            // label11
+            // 
+            this.label11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.label11.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label11.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label11.ForeColor = System.Drawing.Color.Black;
+            this.label11.Location = new System.Drawing.Point(692, 6);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(120, 25);
+            this.label11.TabIndex = 101;
+            this.label11.Text = "担 当 者";
+            this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // cmbPerson
+            // 
+            this.cmbPerson.BackColor = System.Drawing.Color.White;
+            this.cmbPerson.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cmbPerson.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.cmbPerson.FormattingEnabled = true;
+            this.cmbPerson.Location = new System.Drawing.Point(820, 7);
+            this.cmbPerson.Name = "cmbPerson";
+            this.cmbPerson.Size = new System.Drawing.Size(200, 23);
+            this.cmbPerson.TabIndex = 100;
+            // 
+            // cmbDepartment
+            // 
+            this.cmbDepartment.BackColor = System.Drawing.Color.White;
+            this.cmbDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cmbDepartment.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
+            this.cmbDepartment.FormattingEnabled = true;
+            this.cmbDepartment.Location = new System.Drawing.Point(476, 7);
+            this.cmbDepartment.Name = "cmbDepartment";
+            this.cmbDepartment.Size = new System.Drawing.Size(200, 23);
+            this.cmbDepartment.TabIndex = 98;
+            // 
+            // label4
+            // 
+            this.label4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.label4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label4.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label4.ForeColor = System.Drawing.Color.Black;
+            this.label4.Location = new System.Drawing.Point(348, 6);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(120, 25);
+            this.label4.TabIndex = 99;
+            this.label4.Text = "部　　署";
+            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // panel2
+            // 
+            this.panel2.BackColor = System.Drawing.Color.White;
+            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.panel2.Controls.Add(this.rdbProject);
+            this.panel2.Controls.Add(this.rdbCompany);
+            this.panel2.Location = new System.Drawing.Point(132, 38);
+            this.panel2.Name = "panel2";
+            this.panel2.Size = new System.Drawing.Size(200, 27);
+            this.panel2.TabIndex = 97;
+            // 
+            // rdbProject
+            // 
+            this.rdbProject.AutoSize = true;
+            this.rdbProject.BackColor = System.Drawing.Color.White;
+            this.rdbProject.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.rdbProject.ForeColor = System.Drawing.Color.Black;
+            this.rdbProject.Location = new System.Drawing.Point(103, 2);
+            this.rdbProject.Margin = new System.Windows.Forms.Padding(4);
+            this.rdbProject.Name = "rdbProject";
+            this.rdbProject.Size = new System.Drawing.Size(77, 20);
+            this.rdbProject.TabIndex = 9;
+            this.rdbProject.Text = "現　場";
+            this.rdbProject.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.rdbProject.UseVisualStyleBackColor = false;
+            // 
+            // rdbCompany
+            // 
+            this.rdbCompany.AutoSize = true;
+            this.rdbCompany.BackColor = System.Drawing.Color.White;
+            this.rdbCompany.Checked = true;
+            this.rdbCompany.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.rdbCompany.ForeColor = System.Drawing.Color.Black;
+            this.rdbCompany.Location = new System.Drawing.Point(10, 2);
+            this.rdbCompany.Margin = new System.Windows.Forms.Padding(4);
+            this.rdbCompany.Name = "rdbCompany";
+            this.rdbCompany.Size = new System.Drawing.Size(77, 20);
+            this.rdbCompany.TabIndex = 8;
+            this.rdbCompany.TabStop = true;
+            this.rdbCompany.Text = "業　者";
+            this.rdbCompany.TextAlign = System.Drawing.ContentAlignment.TopCenter;
+            this.rdbCompany.UseVisualStyleBackColor = false;
+            this.rdbCompany.CheckedChanged += new System.EventHandler(this.rdbCompany_CheckedChanged);
+            // 
             // lblPaymentDate
             // 
             this.lblPaymentDate.BackColor = System.Drawing.Color.White;
@@ -2789,10 +2789,10 @@
             this.panel1.PerformLayout();
             this.groupBoxEx1.ResumeLayout(false);
             this.groupBoxEx1.PerformLayout();
+            this.pnlApproval.ResumeLayout(false);
+            this.pnlApprovalButton.ResumeLayout(false);
             this.panel2.ResumeLayout(false);
             this.panel2.PerformLayout();
-            this.pnlApproval.ResumeLayout(false);
-            this.pnlApprovalButton.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.dgvCompany)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.dgvProject)).EndInit();
             this.ResumeLayout(false);
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryListAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryListAuxiliary.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestSummaryList/FrmRequestSummaryListAuxiliary.cs	(revision 302)
@@ -2743,6 +2743,49 @@
         }
         #endregion
 
+        #region ���F�{�^���̕\������
+        /// <summary>
+        /// ���F�{�^���̕\������
+        /// </summary>
+        private void ApprovalDispControl()
+        {
+            try
+            {
+                // �\���E���F�\������
+                InitApprovalDisplay();
+
+                // ���F��ʂ́u���F�Ώۃf�[�^������v����̋N�����͏��F�{�^���̕\��������
+                bool bApproval = ClsApprovalPermission.ExceApprovalScreen((int)ClsExcute.SubFormExecuteNo.ApprovalPerson);
+                if (bApproval)
+                {
+                    // ���F�ΏۃR�[�h���擾����
+                    int ApprovalCode = ClsExcute.AppovalList.First(x => x.Value.Equals(s_MyProcessName[m_Labourkind])).Key;
+                    // �H���Č��̊Ǘ��������擾����
+                    //int DepartmentCode = ClsApprovalPermission.GetFromPersonAndApprovalTheDepartment(m_PersonCode, ApprovalCode, m_CreateDate, m_SeqNo);
+                    int DepartmentCode = CommonMotions.LoginUserData.DepartmentCode;
+                    // �Č��ɑ΂��Đ\��������Ă��邩���m�F����
+                    bool Pettition = false;
+                    if (!m_FirstFlg)
+                    {
+                        //Pettition = ClsApprovalPermission.CheckPersonPetition2(m_PaInfo.ApprovalPerson, ApprovalCode, m_PaInfo.ApprovalDate, (int)CommonDefine.s_Default_OrderNo);
+                        Pettition = ClsApprovalPermission.CheckPersonPetition(m_PaymentPersonCode, ApprovalCode, m_OrderDate, (int)CommonDefine.s_Default_OrderNo);
+                    }
+                    // ���O�C���҂����F�҂����m�F����
+                    bool Approvaler = ClsApprovalPermission.CheckUserForApprover(ApprovalCode, DepartmentCode);
+                    // �\�����Ń��O�C���҂����F�҂̏ꍇ�͏��F�{�^����\������
+                    if (Pettition && Approvaler)
+                    {
+                        pnlApprovalButton.Visible = true;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("�V�X�e���G���[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
         #region �������\���E���F�\������
         /// <summary>
         /// �������\���E���F�\������
@@ -3417,8 +3460,8 @@
                 // �f�[�^�擾�@���v�E���v���v�Z����ׁA�S�Ẵf�[�^���擾����
                 if (!IoBd.ExecuteReader(sql.ToString(), ref arData)) return;
 
-                if (!m_FirstFlg)
-                {
+                //if (!m_FirstFlg)
+                //{
                     if (arData.Count < 1)
                     {
                         bNewData = true;
@@ -3428,7 +3471,7 @@
                         SetSQLOrder(ref sql);
                         if (!IoBd.ExecuteReader(sql.ToString(), ref arData)) return;
                     }
-                }
+                //}
 
                 DataProgressBar.Maximum = arData.Count;
                 DataProgressBar.Value = 0;
@@ -4219,7 +4262,7 @@
                 sql.Append("    end as PurchaseOrderReturnDate ");
                 
                 sql.Append("  , '��' as PaData ");
-                sql.Append("  , Cld.LineCount as LinePoint ");
+                sql.Append("  , Cld.DetailCount as LinePoint ");
                 sql.AppendFormat("  , PERIOD_DIFF({0}", m_Select_TargetDate);
                 sql.AppendFormat("  , DATE_FORMAT(Cl.ConstructionStart, '%Y%m')) + {0} AS ColPoint ", DefaultCol);
                 sql.Append("  , Cld.SecondString as DetailName ");
@@ -4606,7 +4649,9 @@
                                         IOBillingDataDetail IoBdD,
                                         IOPaymentDataDetail IoPdD,
                                         IOPaymentApprovalInfo IoPaI,
-                                        IOBillingPaymentSummary IoBps)
+                                        IOBillingPaymentSummary IoBps,
+                                        IOConstructionLedgerDetail IoDetail,
+                                        IOConstructionLedgerExcute IoExec)
         {
             try
             {
@@ -4615,6 +4660,8 @@
                 IoPdD.rollback();
                 IoPaI.rollback();
                 IoBps.rollback();
+                IoDetail.rollback();
+                IoExec.rollback();
             }
             catch (System.Exception ex)
             {
@@ -4867,6 +4914,8 @@
             IOPaymentDataDetail IoPdD = new IOPaymentDataDetail();
             IOPaymentApprovalInfo IoPaI = new IOPaymentApprovalInfo();
             IOBillingPaymentSummary IoBps = new IOBillingPaymentSummary();
+            IOConstructionLedgerDetail IoDetail = new IOConstructionLedgerDetail();
+            IOConstructionLedgerExcute IoExec = new IOConstructionLedgerExcute();
 
             DataGridView dgv = getShowingView();
 
@@ -4874,7 +4923,7 @@
             List<BillingDataDetail> BdDList = new List<BillingDataDetail>();
             List<PaymentDataDetail> PdDList = new List<PaymentDataDetail>();
             List<BillingPaymentSummary> BpsList = new List<BillingPaymentSummary>();
-            List<ConstructionLedgerExcute> CleEntryList = new List<ConstructionLedgerExcute>();
+            ArrayList CleEntryList = new ArrayList();
 
             BillingData BdWork = new BillingData();
             BillingDataDetail BdDWork;
@@ -4913,6 +4962,8 @@
                 IoPdD.connect(); IoPdD.beginTran();
                 IoPaI.connect(); IoPaI.beginTran();
                 IoBps.connect(); IoBps.beginTran();
+                IoDetail.connect(); IoDetail.beginTran();
+                IoExec.connect(); IoExec.beginTran();
 
                 // �폜�������s�t���O
                 bool bError = false;
@@ -4931,7 +4982,7 @@
                         if (!DataDeleteProcess(IoBd, IoBdD, IoPdD, IoPaI, TargetDate))
                         {
                             // RollBack
-                            DataEntryRollBack(IoBd, IoBdD, IoPdD, IoPaI, IoBps);
+                            DataEntryRollBack(IoBd, IoBdD, IoPdD, IoPaI, IoBps, IoDetail, IoExec);
                             return false;
                         }
                     }
@@ -5242,16 +5293,7 @@
                         }
 
                         // ----- �H���ڍב䒠�̎x�����z�̈ꊇ�o�^���X�g�֒ǉ��i�s�P�ʂŒǉ��j
-                        ConstructionLedgerExcute CleEntry = new ConstructionLedgerExcute();
-                        CleEntry.ConstructionCode = CommonMotions.cnvInt(r.Cells[m_Genba_Column].Value);
-                        CleEntry.GroupCount = (int)FrmConstructionLedger.DataGroup.ConstructionCosts;
-                        CleEntry.LineCount = CommonMotions.cnvInt(r.Cells[(int)DispColumn.ConstructionLedgerLineNo].Value);
-                        CleEntry.ColumnCount = CommonMotions.cnvInt(r.Cells[(int)DispColumn.ConstructionLedgerColNo].Value);
-                        CleEntry.PaymentAmount = CommonMotions.cnvLong(r.Cells[(int)DispColumn.KojiSeikyu].Value);
-                        CleEntry.TargetMonth = CommonMotions.cnvDate(string.Format("{0}/01", cmbTargetMonth.Text));
-                        CleEntry.EntryDate = DateTime.Now;
-                        CleEntry.UpdateDate = DateTime.Now;
-                        CleEntryList.Add(CleEntry);
+                        CreateLedgerData(r, ref CleEntryList);
 
                         DataProgressBar.Value++;
                         DataProgressBar.Update();
@@ -5302,9 +5344,9 @@
                     // �H���ڍב䒠�x�����f�[�^�ꊇ�o�^
                     if (CleEntryList.Count > 0)
                     {
-                        if (!ClsChangeLedgerData.EntryExecuteData(CleEntryList))
+                        if (!ClsChangeLedgerData.EntryExecuteData(IoDetail, IoExec, CleEntryList))
                         {
-                            DataEntryRollBack(IoBd, IoBdD, IoPdD, IoPaI, IoBps);
+                            DataEntryRollBack(IoBd, IoBdD, IoPdD, IoPaI, IoBps, IoDetail, IoExec);
                             MessageBox.Show("�H���ڍב䒠�x�����f�[�^�ꊇ�o�^", "�o�^�G���[", MessageBoxButtons.OK, MessageBoxIcon.Error);
                             return false;
                         }
@@ -5312,7 +5354,7 @@
                 }
                 catch (Exception ex)
                 {
-                    DataEntryRollBack(IoBd, IoBdD, IoPdD, IoPaI, IoBps);
+                    DataEntryRollBack(IoBd, IoBdD, IoPdD, IoPaI, IoBps, IoDetail, IoExec);
                     MessageBox.Show(ex.Message, "�o�^�G���[", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     return false;
                 }
@@ -5322,6 +5364,8 @@
                 IoPdD.commit();
                 IoPaI.commit();
                 IoBps.commit();
+                IoDetail.commit();
+                IoExec.commit();
 
                 m_bChengeAns = false;
 
@@ -5329,7 +5373,7 @@
             }
             catch (System.Exception ex)
             {
-                DataEntryRollBack(IoBd, IoBdD, IoPdD, IoPaI, IoBps);
+                DataEntryRollBack(IoBd, IoBdD, IoPdD, IoPaI, IoBps, IoDetail, IoExec);
                 logger.ErrorFormat("�V�X�e���G���[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
                 return false;
             }
@@ -5340,6 +5384,8 @@
                 IoPdD.close(); IoPdD = null;
                 IoPaI.close(); IoPaI = null;
                 IoBps.close(); IoBps = null;
+                IoDetail.close(); IoDetail = null;
+                IoExec.close(); IoExec = null;
 
                 // ProgressBar�̒l��ύX����
                 DataProgressBar.Value = DataProgressBar.Maximum;
@@ -5355,6 +5401,42 @@
         }
         #endregion
 
+        #region �H���䒠�X�V�f�[�^�쐬
+        /// <summary>
+        /// �H���䒠�X�V�f�[�^�쐬
+        /// </summary>
+        private void CreateLedgerData(DataGridViewRow CurRow, ref ArrayList CleEntryList)
+        {
+            try
+            {
+                ConstructionLedgerDetail DetailRec = new ConstructionLedgerDetail();
+                DetailRec.ConstructionCode = CommonMotions.cnvInt(CurRow.Cells[m_Genba_Column].Value);	                        // �H���R�[�h
+                DetailRec.SecondString = CommonMotions.cnvString(CurRow.Cells[(int)DispColumn.DetailName].Value);	            // �H�����e
+                DetailRec.CompanyType = (int)ConstructionLedgerDetail.CompanyTypeDef.Subconstractor;	                        // ���͉�ЃR�[�h�^�C�v
+                DetailRec.CompanyCode = CommonMotions.cnvInt(CurRow.Cells[m_Company_Column].Value);                             // ���͉�ЃR�[�h
+                DetailRec.CompanyName = CommonMotions.cnvString(CurRow.Cells[m_CompanyNM_Column].Value); 	                    // ���͉�Ж���
+                DetailRec.DetailCount = CommonMotions.cnvInt(CurRow.Cells[(int)DispColumn.ConstructionLedgerLineNo].Value);     // ���הԍ�
+
+                ConstructionLedgerExcute CleEntry = new ConstructionLedgerExcute();
+                CleEntry.ConstructionCode = CommonMotions.cnvInt(CurRow.Cells[m_Genba_Column].Value);
+                CleEntry.GroupCount = (int)FrmConstructionLedger.DataGroup.ConstructionCosts;
+                CleEntry.LineCount = 0;                                                                                         // �s�ԍ��̓Z�b�g���Ȃ�
+                CleEntry.ColumnCount = CommonMotions.cnvInt(CurRow.Cells[(int)DispColumn.ConstructionLedgerColNo].Value);
+                CleEntry.PaymentAmount = CommonMotions.cnvLong(CurRow.Cells[(int)DispColumn.KojiSeikyu].Value);
+                CleEntry.TargetMonth = CommonMotions.cnvDate(string.Format("{0}/01", cmbTargetMonth.Text));
+
+                CleEntry.EntryDate = DateTime.Now;
+                CleEntry.UpdateDate = DateTime.Now;
+                CleEntryList.Add(new object[] { DetailRec, CleEntry });
+
+            }
+            catch (System.Exception ex)
+            {
+                logger.ErrorFormat("�V�X�e���G���[�F{0}�F{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
         #region �ƎҐ����x���T�}���[�f�[�^�쐬�E�X�V
         /// <summary>
         /// �ƎҐ����x���T�}���[�f�[�^�쐬�E�X�V
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/TAndPCosts/FrmTAndPCosts.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/TAndPCosts/FrmTAndPCosts.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/TAndPCosts/FrmTAndPCosts.cs	(revision 302)
@@ -470,14 +470,6 @@
                 // グリッドロック
                 GridEditLock();
 
-                // 表示位置調整
-                if (m_SubForm)
-                {
-                    this.StartPosition = FormStartPosition.CenterParent;
-                    this.Top += CommonDefine.s_DefalutShiftValue;
-                    this.Left += CommonDefine.s_DefalutShiftValue;
-                }
-
                 // 初期表示フラグOFF
                 m_bInitFlg = false;
 
Index: branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBD.Designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBD.Designer.cs	(nonexistent)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBD.Designer.cs	(revision 302)
@@ -0,0 +1,391 @@
+﻿namespace ProcessManagement.Forms.Master
+{
+    partial class FrmBBD
+    {
+        /// <summary>
+        /// 必要なデザイナー変数です。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 使用中のリソースをすべてクリーンアップします。
+        /// </summary>
+        /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows フォーム デザイナーで生成されたコード
+
+        /// <summary>
+        /// デザイナー サポートに必要なメソッドです。このメソッドの内容を
+        /// コード エディターで変更しないでください。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.label1 = new System.Windows.Forms.Label();
+            this.lblMonth01 = new System.Windows.Forms.Label();
+            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.lblMonth02 = new System.Windows.Forms.Label();
+            this.lblMonth03 = new System.Windows.Forms.Label();
+            this.lblMonth04 = new System.Windows.Forms.Label();
+            this.lblMonth05 = new System.Windows.Forms.Label();
+            this.lblMonth06 = new System.Windows.Forms.Label();
+            this.lblMonth07 = new System.Windows.Forms.Label();
+            this.lblMonth08 = new System.Windows.Forms.Label();
+            this.lblMonth09 = new System.Windows.Forms.Label();
+            this.lblMonth10 = new System.Windows.Forms.Label();
+            this.lblMonth11 = new System.Windows.Forms.Label();
+            this.lblMonth12 = new System.Windows.Forms.Label();
+            this.btnDataDelete = new System.Windows.Forms.Button();
+            this.btnDataEntry = new System.Windows.Forms.Button();
+            this.btnEnd = new System.Windows.Forms.Button();
+            this.label2 = new System.Windows.Forms.Label();
+            this.numUDYear = new System.Windows.Forms.NumericUpDown();
+            this.tableLayoutPanel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.numUDYear)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.BackColor = System.Drawing.Color.GreenYellow;
+            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label1.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.label1.ForeColor = System.Drawing.Color.Black;
+            this.label1.Location = new System.Drawing.Point(330, 10);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(500, 20);
+            this.label1.TabIndex = 6;
+            this.label1.Text = "銀　行　営　業　日　登　録";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth01
+            // 
+            this.lblMonth01.BackColor = System.Drawing.Color.White;
+            this.lblMonth01.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth01.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth01.Location = new System.Drawing.Point(3, 0);
+            this.lblMonth01.Name = "lblMonth01";
+            this.lblMonth01.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth01.TabIndex = 7;
+            this.lblMonth01.Text = "2015年1月";
+            this.lblMonth01.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // tableLayoutPanel1
+            // 
+            this.tableLayoutPanel1.ColumnCount = 4;
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 284F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 284F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 284F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 284F));
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth01, 0, 0);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth02, 1, 0);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth03, 2, 0);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth04, 3, 0);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth05, 0, 2);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth06, 1, 2);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth07, 2, 2);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth08, 3, 2);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth09, 0, 4);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth10, 1, 4);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth11, 2, 4);
+            this.tableLayoutPanel1.Controls.Add(this.lblMonth12, 3, 4);
+            this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 74);
+            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+            this.tableLayoutPanel1.RowCount = 6;
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 144F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 144F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 144F));
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(1136, 492);
+            this.tableLayoutPanel1.TabIndex = 9;
+            // 
+            // lblMonth02
+            // 
+            this.lblMonth02.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth02.BackColor = System.Drawing.Color.White;
+            this.lblMonth02.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth02.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth02.Location = new System.Drawing.Point(287, 0);
+            this.lblMonth02.Name = "lblMonth02";
+            this.lblMonth02.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth02.TabIndex = 7;
+            this.lblMonth02.Text = "2015年1月";
+            this.lblMonth02.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth03
+            // 
+            this.lblMonth03.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth03.BackColor = System.Drawing.Color.White;
+            this.lblMonth03.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth03.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth03.Location = new System.Drawing.Point(571, 0);
+            this.lblMonth03.Name = "lblMonth03";
+            this.lblMonth03.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth03.TabIndex = 7;
+            this.lblMonth03.Text = "2015年1月";
+            this.lblMonth03.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth04
+            // 
+            this.lblMonth04.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth04.BackColor = System.Drawing.Color.White;
+            this.lblMonth04.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth04.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth04.Location = new System.Drawing.Point(855, 0);
+            this.lblMonth04.Name = "lblMonth04";
+            this.lblMonth04.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth04.TabIndex = 7;
+            this.lblMonth04.Text = "2015年1月";
+            this.lblMonth04.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth05
+            // 
+            this.lblMonth05.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth05.BackColor = System.Drawing.Color.White;
+            this.lblMonth05.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth05.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth05.Location = new System.Drawing.Point(3, 164);
+            this.lblMonth05.Name = "lblMonth05";
+            this.lblMonth05.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth05.TabIndex = 7;
+            this.lblMonth05.Text = "2015年1月";
+            this.lblMonth05.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth06
+            // 
+            this.lblMonth06.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth06.BackColor = System.Drawing.Color.White;
+            this.lblMonth06.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth06.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth06.Location = new System.Drawing.Point(287, 164);
+            this.lblMonth06.Name = "lblMonth06";
+            this.lblMonth06.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth06.TabIndex = 7;
+            this.lblMonth06.Text = "2015年1月";
+            this.lblMonth06.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth07
+            // 
+            this.lblMonth07.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth07.BackColor = System.Drawing.Color.White;
+            this.lblMonth07.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth07.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth07.Location = new System.Drawing.Point(571, 164);
+            this.lblMonth07.Name = "lblMonth07";
+            this.lblMonth07.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth07.TabIndex = 7;
+            this.lblMonth07.Text = "2015年1月";
+            this.lblMonth07.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth08
+            // 
+            this.lblMonth08.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth08.BackColor = System.Drawing.Color.White;
+            this.lblMonth08.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth08.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth08.Location = new System.Drawing.Point(855, 164);
+            this.lblMonth08.Name = "lblMonth08";
+            this.lblMonth08.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth08.TabIndex = 7;
+            this.lblMonth08.Text = "2015年1月";
+            this.lblMonth08.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth09
+            // 
+            this.lblMonth09.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth09.BackColor = System.Drawing.Color.White;
+            this.lblMonth09.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth09.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth09.Location = new System.Drawing.Point(3, 328);
+            this.lblMonth09.Name = "lblMonth09";
+            this.lblMonth09.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth09.TabIndex = 7;
+            this.lblMonth09.Text = "2015年1月";
+            this.lblMonth09.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth10
+            // 
+            this.lblMonth10.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth10.BackColor = System.Drawing.Color.White;
+            this.lblMonth10.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth10.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth10.Location = new System.Drawing.Point(287, 328);
+            this.lblMonth10.Name = "lblMonth10";
+            this.lblMonth10.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth10.TabIndex = 7;
+            this.lblMonth10.Text = "2015年1月";
+            this.lblMonth10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth11
+            // 
+            this.lblMonth11.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth11.BackColor = System.Drawing.Color.White;
+            this.lblMonth11.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth11.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth11.Location = new System.Drawing.Point(571, 328);
+            this.lblMonth11.Name = "lblMonth11";
+            this.lblMonth11.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth11.TabIndex = 7;
+            this.lblMonth11.Text = "2015年1月";
+            this.lblMonth11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lblMonth12
+            // 
+            this.lblMonth12.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.lblMonth12.BackColor = System.Drawing.Color.White;
+            this.lblMonth12.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblMonth12.Font = new System.Drawing.Font("ＭＳ 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.lblMonth12.Location = new System.Drawing.Point(855, 328);
+            this.lblMonth12.Name = "lblMonth12";
+            this.lblMonth12.Size = new System.Drawing.Size(278, 20);
+            this.lblMonth12.TabIndex = 7;
+            this.lblMonth12.Text = "2015年1月";
+            this.lblMonth12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // btnDataDelete
+            // 
+            this.btnDataDelete.BackColor = System.Drawing.Color.Red;
+            this.btnDataDelete.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnDataDelete.ForeColor = System.Drawing.Color.White;
+            this.btnDataDelete.Location = new System.Drawing.Point(902, 574);
+            this.btnDataDelete.Name = "btnDataDelete";
+            this.btnDataDelete.Size = new System.Drawing.Size(120, 30);
+            this.btnDataDelete.TabIndex = 2;
+            this.btnDataDelete.Text = "削　除";
+            this.btnDataDelete.UseVisualStyleBackColor = false;
+            this.btnDataDelete.Click += new System.EventHandler(this.btnDataDelete_Click);
+            // 
+            // btnDataEntry
+            // 
+            this.btnDataEntry.BackColor = System.Drawing.Color.Green;
+            this.btnDataEntry.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnDataEntry.ForeColor = System.Drawing.Color.White;
+            this.btnDataEntry.Location = new System.Drawing.Point(776, 574);
+            this.btnDataEntry.Name = "btnDataEntry";
+            this.btnDataEntry.Size = new System.Drawing.Size(120, 30);
+            this.btnDataEntry.TabIndex = 1;
+            this.btnDataEntry.Text = "内容登録";
+            this.btnDataEntry.UseVisualStyleBackColor = false;
+            this.btnDataEntry.Click += new System.EventHandler(this.btnDataEntry_Click);
+            // 
+            // btnEnd
+            // 
+            this.btnEnd.BackColor = System.Drawing.Color.Blue;
+            this.btnEnd.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.btnEnd.ForeColor = System.Drawing.Color.White;
+            this.btnEnd.Location = new System.Drawing.Point(1028, 574);
+            this.btnEnd.Name = "btnEnd";
+            this.btnEnd.Size = new System.Drawing.Size(120, 30);
+            this.btnEnd.TabIndex = 3;
+            this.btnEnd.Text = "終　了";
+            this.btnEnd.UseVisualStyleBackColor = false;
+            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
+            // 
+            // label2
+            // 
+            this.label2.BackColor = System.Drawing.Color.GreenYellow;
+            this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label2.Location = new System.Drawing.Point(12, 38);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(99, 22);
+            this.label2.TabIndex = 14;
+            this.label2.Text = "対象年度";
+            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // numUDYear
+            // 
+            this.numUDYear.BackColor = System.Drawing.Color.White;
+            this.numUDYear.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.numUDYear.ForeColor = System.Drawing.Color.Black;
+            this.numUDYear.Location = new System.Drawing.Point(119, 38);
+            this.numUDYear.Name = "numUDYear";
+            this.numUDYear.ReadOnly = true;
+            this.numUDYear.Size = new System.Drawing.Size(80, 23);
+            this.numUDYear.TabIndex = 17;
+            this.numUDYear.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.numUDYear.ValueChanged += new System.EventHandler(this.numUDYear_ValueChanged);
+            // 
+            // FrmBBD
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 16F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.Color.DimGray;
+            this.ClientSize = new System.Drawing.Size(1160, 617);
+            this.Controls.Add(this.numUDYear);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.btnDataDelete);
+            this.Controls.Add(this.btnDataEntry);
+            this.Controls.Add(this.btnEnd);
+            this.Controls.Add(this.tableLayoutPanel1);
+            this.Controls.Add(this.label1);
+            this.Font = new System.Drawing.Font("ＭＳ 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+            this.Margin = new System.Windows.Forms.Padding(4);
+            this.MaximizeBox = false;
+            this.MinimizeBox = false;
+            this.Name = "FrmBBD";
+            this.ShowIcon = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmBBD_FormClosing);
+            this.Load += new System.EventHandler(this.FrmBBD_Load);
+            this.tableLayoutPanel1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.numUDYear)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label lblMonth01;
+        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+        private System.Windows.Forms.Label lblMonth02;
+        private System.Windows.Forms.Label lblMonth03;
+        private System.Windows.Forms.Label lblMonth04;
+        private System.Windows.Forms.Label lblMonth05;
+        private System.Windows.Forms.Label lblMonth06;
+        private System.Windows.Forms.Label lblMonth07;
+        private System.Windows.Forms.Label lblMonth08;
+        private System.Windows.Forms.Label lblMonth09;
+        private System.Windows.Forms.Label lblMonth10;
+        private System.Windows.Forms.Label lblMonth11;
+        private System.Windows.Forms.Label lblMonth12;
+        private System.Windows.Forms.Button btnDataDelete;
+        private System.Windows.Forms.Button btnDataEntry;
+        private System.Windows.Forms.Button btnEnd;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.NumericUpDown numUDYear;
+    }
+}
+
Index: branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBD.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBD.cs	(nonexistent)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBD.cs	(revision 302)
@@ -0,0 +1,233 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+using log4net;
+using log4net.Appender;
+using log4net.Repository.Hierarchy;
+
+using ProcessManagement.Forms.CustomControls;
+using ProcessManagement.DataModel;
+using ProcessManagement.Common;
+using ProcessManagement.DB.IOAccess;
+using ProcessManagement.Forms.ControlsAction;
+
+namespace ProcessManagement.Forms.Master
+{
+    public partial class FrmBBD : Form
+    {
+        #region 使用定義
+        //log4netログを使用する
+        private static readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+        #endregion
+
+        #region 定数
+
+        #endregion
+
+        #region 変数
+        /// <summary>
+        /// 初期フラグ
+        /// </summary>
+        bool m_initDataLoad = true;
+        /// <summary>
+        /// フィールド値変化フラグ
+        /// </summary>
+        private bool m_bChengeAns = false;
+
+        private CalennderPage m_CalendPage = new CalennderPage();
+
+        /// <summary>
+        /// 参照フラグ
+        /// </summary>
+        private bool m_EditLock = false;
+        #endregion
+
+        #region プロパティ
+
+        /// <summary>
+        /// 参照フラグ
+        /// </summary>
+        public bool EditLock
+        {
+            get { return m_EditLock; }
+            set { m_EditLock = value; }
+        }
+        #endregion
+
+        #region コンストラクタ
+        /// <summary>
+        /// コンストラクタ
+        /// </summary>
+        public FrmBBD()
+        {
+            InitializeComponent();
+        }
+        #endregion
+
+        #region 画面ロード
+        /// <summary>
+        /// 画面ロード
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void FrmBBD_Load(object sender, EventArgs e)
+        {
+
+            // 営業年度取得
+            SetnumUDYear();
+
+            // 初期化
+            InitCreatePage();
+
+            // カレンダー表示
+            DisplayCalender();
+
+            // 参照時はデータ変更させない
+            if (m_EditLock)
+            {
+                ExecReadOnly();
+            }
+
+            m_bChengeAns = false;
+            m_initDataLoad = false;
+        }
+        #endregion
+
+        #region ×ボタン押下
+        /// <summary>
+        /// ×ボタン押下
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void FrmBBD_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            if (m_bChengeAns)
+            {
+                if (MessageBox.Show("データに変更があります、登録せずに終了してよろしいですか？。", "終了確認"
+                                , MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
+                {
+                    e.Cancel = true;
+                    return;
+                }
+            }
+            // 前プロセスに戻る
+            ClsExcute.BackProcess();
+        }
+        #endregion
+
+        #region データ登録
+        /// <summary>
+        /// データ登録
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnDataEntry_Click(object sender, EventArgs e)
+        {
+            //データチェック
+            if (!DispFeildCheck()) return;
+
+            if (MessageBox.Show("銀行営業日を更新します、よろしいですか？", "登録確認"
+                    , MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return;
+
+            if (!BusinesCalenderEntry()) return;
+
+            CommonMotions.EntryEndMessage("銀行営業日データ");
+
+            this.Close();
+        }
+        #endregion
+
+        #region データ削除
+        /// <summary>
+        /// データ削除
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnDataDelete_Click(object sender, EventArgs e)
+        {
+            IOBankBusinessDayMaster bbdDB = new IOBankBusinessDayMaster();
+            try
+            {
+                if (MessageBox.Show("表示中のデータを削除します。", "削除確認"
+                        , MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return;
+
+                string wrkSQL = string.Format(" Where Truncate(YEARMONTH / 100, 0) = {0}", numUDYear.Value);
+                // データ削除
+                if (!bbdDB.DeleteAction(wrkSQL))
+                {
+                    bbdDB.rollback();
+                    return;
+                }
+
+                m_bChengeAns = false;
+
+                CommonMotions.RemoveEndMessage("銀行営業日データ");
+
+                // 終了
+                this.Close();
+
+            }
+            catch (System.Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                bbdDB.commit(); bbdDB.close(); bbdDB = null;
+            }
+        }
+        #endregion
+
+        #region 終了ボタン押下
+        /// <summary>
+        /// 終了ボタン押下
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnEnd_Click(object sender, EventArgs e)
+        {
+            this.Close();
+        }
+        #endregion
+
+        #region ラベルダブルクリック
+        /// <summary>
+        /// ラベルダブルクリック
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void lblDayData_DoubleClick(object sender, EventArgs e)
+        {
+            // 参照時は処理しない
+            if (m_EditLock) return;
+
+            Label lblData = (Label)sender;
+            // 色を変える
+            if (lblData.BackColor == Color.Red) lblData.BackColor = Color.White;
+            else if (lblData.BackColor == Color.White) lblData.BackColor = Color.Red;
+        }
+        #endregion
+
+        #region 対象年変更
+        /// <summary>
+        /// 対象年変更
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void numUDYear_ValueChanged(object sender, EventArgs e)
+        {
+            if (m_initDataLoad) return;
+            
+            // カレンダー表示
+            DisplayCalender();
+        }
+        #endregion
+    }
+}
Index: branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBD.resx
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBD.resx	(nonexistent)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBD.resx	(revision 302)
@@ -0,0 +1,120 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file
Index: branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBDAux.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBDAux.cs	(nonexistent)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/Master/BankBusinessDay/FrmBBDAux.cs	(revision 302)
@@ -0,0 +1,635 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Collections;
+
+using ProcessManagement.Forms.CustomControls;
+using ProcessManagement.DataModel;
+using ProcessManagement.Common;
+using ProcessManagement.DB.IOAccess;
+using ProcessManagement.Forms.ControlsAction;
+
+namespace ProcessManagement.Forms.Master
+{
+    public partial class FrmBBD
+    {
+        #region 定数
+        /// <summary>
+        /// カラムポジション
+        /// </summary>
+        public static int[] s_ColumnPosision = new int[] { 3, 43, 83, 123, 163, 203, 243 };
+        /// <summary>
+        /// ロウポジション
+        /// </summary>
+        public static int[] s_RowPosision = new int[] { 0, 20, 40, 60, 80, 100, 120 };
+
+        #endregion
+
+        #region 初期ページ表示
+        /// <summary>
+        /// 初期ページ表示
+        /// </summary>
+        private void InitCreatePage()
+        {
+            try
+            {
+                m_CalendPage.lblMonthTitle[0] = lblMonth01;
+                m_CalendPage.lblMonthTitle[1] = lblMonth02;
+                m_CalendPage.lblMonthTitle[2] = lblMonth03;
+                m_CalendPage.lblMonthTitle[3] = lblMonth04;
+                m_CalendPage.lblMonthTitle[4] = lblMonth05;
+                m_CalendPage.lblMonthTitle[5] = lblMonth06;
+                m_CalendPage.lblMonthTitle[6] = lblMonth07;
+                m_CalendPage.lblMonthTitle[7] = lblMonth08;
+                m_CalendPage.lblMonthTitle[8] = lblMonth09;
+                m_CalendPage.lblMonthTitle[9] = lblMonth10;
+                m_CalendPage.lblMonthTitle[10] = lblMonth11;
+                m_CalendPage.lblMonthTitle[11] = lblMonth12;
+
+                // 12カ月処理する
+                int MonthTitleMax = m_CalendPage.lblMonthTitle.Length;
+                for (int i = 0; i < MonthTitleMax; i++)
+                {
+                    m_CalendPage.MonthTableLayout[i] = new TableLayoutPanel();
+                    m_CalendPage.MonthryData[i] = new MonthryData();
+
+                    // 1カ月分処理する
+                    int RowPosisionMax = s_RowPosision.Length;
+                    for (int iy = 0; iy < RowPosisionMax; iy++)
+                    {
+                        // 1週間分処理する
+                        int ColumnPosisionMax = s_ColumnPosision.Length;
+                        for (int ix = 0; ix < ColumnPosisionMax; ix++)
+                        {
+                            //　ラベルの設定
+                            switch (iy)
+                            {
+                                case 0:
+                                    m_CalendPage.MonthryData[i].lblWeekTitle[ix] = new Label();
+                                    // 曜日表示
+                                    m_CalendPage.MonthryData[i].lblWeekTitle[ix].Text = CommonDefine.DayOfTheWeekString[ix];
+                                    m_CalendPage.MonthryData[i].lblWeekTitle[ix].TextAlign = ContentAlignment.MiddleCenter;
+
+                                    break;
+                                default:
+                                    int wrkIY = iy - 1;
+                                    m_CalendPage.MonthryData[i].lblDayData[ix + (wrkIY * 7)] = new Label();
+                                    // 日表示
+                                    m_CalendPage.MonthryData[i].lblDayData[ix + (wrkIY * 7)].TextAlign = ContentAlignment.MiddleRight;
+                                    m_CalendPage.MonthryData[i].lblDayData[ix + (wrkIY * 7)].DoubleClick += new System.EventHandler(this.lblDayData_DoubleClick);
+
+                                    break;
+                            }
+                        }
+                    }
+                }
+
+                //
+                // MonthTableLayout
+                // 
+                int CalendPageMax = m_CalendPage.MonthTableLayout.Length;
+                for (int i = 0; i < CalendPageMax; i++)
+                {
+                    m_CalendPage.MonthTableLayout[i].BackColor = System.Drawing.Color.White;
+                    m_CalendPage.MonthTableLayout[i].ColumnCount = 7;
+                    m_CalendPage.MonthTableLayout[i].ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
+                    m_CalendPage.MonthTableLayout[i].ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
+                    m_CalendPage.MonthTableLayout[i].ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
+                    m_CalendPage.MonthTableLayout[i].ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
+                    m_CalendPage.MonthTableLayout[i].ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
+                    m_CalendPage.MonthTableLayout[i].ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
+                    m_CalendPage.MonthTableLayout[i].ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
+                    for (int iy = 0; iy < 7; iy++)
+                    {
+                        for (int ix = 0; ix < 7; ix++)
+                        {
+                            switch (iy)
+                            {
+                                case 0:
+                                    m_CalendPage.MonthTableLayout[i].Controls.Add(m_CalendPage.MonthryData[i].lblWeekTitle[ix], ix, iy);
+                                    break;
+                                default:
+                                    int wrkIY = iy - 1;
+                                    m_CalendPage.MonthTableLayout[i].Controls.Add(m_CalendPage.MonthryData[i].lblDayData[ix + (wrkIY * 7)], ix, iy);
+                                    break;
+                            }
+                        }
+                    }
+                    m_CalendPage.MonthTableLayout[i].Location = new System.Drawing.Point(m_CalendPage.lblMonthTitle[0].Location.X, m_CalendPage.lblMonthTitle[0].Location.Y + 23);
+                    m_CalendPage.MonthTableLayout[i].Name = "MonthTableLayout" + i.ToString("00");
+                    m_CalendPage.MonthTableLayout[i].RowCount = 7;
+                    m_CalendPage.MonthTableLayout[i].RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+                    m_CalendPage.MonthTableLayout[i].RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+                    m_CalendPage.MonthTableLayout[i].RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+                    m_CalendPage.MonthTableLayout[i].RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+                    m_CalendPage.MonthTableLayout[i].RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+                    m_CalendPage.MonthTableLayout[i].RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+                    m_CalendPage.MonthTableLayout[i].RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+                    m_CalendPage.MonthTableLayout[i].Size = new System.Drawing.Size(278, 138);
+                    m_CalendPage.MonthTableLayout[i].TabIndex = 8;
+
+                    int iXPoint = 0;
+                    int iYPoint = 0;
+                    GetMonthTabTableLayoutPoint(i, ref iXPoint, ref iYPoint);
+
+                    this.tableLayoutPanel1.Controls.Add(m_CalendPage.MonthTableLayout[i], iXPoint, iYPoint);
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region 月別レイアウトテーブル位置取得
+        /// <summary>
+        /// 月別レイアウトテーブル位置取得
+        /// </summary>
+        /// <param name="Count"></param>
+        /// <param name="iXPoint"></param>
+        /// <param name="iYPoint"></param>
+        private void GetMonthTabTableLayoutPoint(int Count, ref int iXPoint, ref int iYPoint)
+        {
+            switch (Count)
+            {
+                case 0:
+                    iXPoint = 0; iYPoint = 1;
+                    break;
+                case 1:
+                    iXPoint = 1; iYPoint = 1;
+                    break;
+                case 2:
+                    iXPoint = 2; iYPoint = 1;
+                    break;
+                case 3:
+                    iXPoint = 3; iYPoint = 1;
+                    break;
+                case 4:
+                    iXPoint = 0; iYPoint = 3;
+                    break;
+                case 5:
+                    iXPoint = 1; iYPoint = 3;
+                    break;
+                case 6:
+                    iXPoint = 2; iYPoint = 3;
+                    break;
+                case 7:
+                    iXPoint = 3; iYPoint = 3;
+                    break;
+                case 8:
+                    iXPoint = 0; iYPoint = 5;
+                    break;
+                case 9:
+                    iXPoint = 1; iYPoint = 5;
+                    break;
+                case 10:
+                    iXPoint = 2; iYPoint = 5;
+                    break;
+                case 11:
+                    iXPoint = 3; iYPoint = 5;
+                    break;
+            }
+
+        }
+        #endregion
+
+        #region 画面クリア
+        /// <summary>
+        /// 画面クリア
+        /// </summary>
+        private void ClearCalender()
+        {
+            try
+            {
+                tableLayoutPanel1.SuspendLayout();
+
+                // 12カ月処理する
+                for (int i = 0; i < m_CalendPage.lblMonthTitle.Length; i++)
+                {
+                    m_CalendPage.lblMonthTitle[i].Text = "";
+
+                    for (int ix = 0; ix < m_CalendPage.MonthryData[i].lblDayData.Length; ix++)
+                    {
+                        m_CalendPage.MonthryData[i].lblDayData[ix].Text = "";
+
+                        m_CalendPage.MonthryData[i].lblDayData[ix].BackColor = Color.White;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region 新規カレンダー作成表示
+        /// <summary>
+        /// 新規カレンダー作成表示
+        /// </summary>
+        private void CreateNewCalender(bool bNoneData)
+        {
+            try
+            {
+                // 表示クリア
+                ClearCalender();
+
+                // 設定年月日作成
+                string CalenderDate = string.Format("{0}/{1}", numUDYear.Value, "01/01");
+                DateTime wrkStartDate = CommonMotions.cnvDate(CalenderDate);
+
+                tableLayoutPanel1.SuspendLayout();
+
+                // 12カ月処理する
+                for (int i = 0; i < m_CalendPage.lblMonthTitle.Length; i++)
+                {
+                    // 月をセットする
+                    string CurDate = wrkStartDate.AddMonths(i).ToShortDateString();
+                    string CurYear = CurDate.Substring(0, CurDate.IndexOf("/"));
+                    string CurMonth = CurDate.Substring(CurDate.IndexOf("/") + 1, 2);
+                    m_CalendPage.lblMonthTitle[i].Text = CurYear + "年" + CurMonth + "月";
+
+                    // 日付の開始位置と週数を求める
+                    int XStart = 0;
+                    int YEnd = s_RowPosision.Length;
+
+                    // 月の最終日から週数を求める
+                    int mlength = DateTime.DaysInMonth(CommonMotions.cnvInt(CurYear), CommonMotions.cnvInt(CurMonth));
+                    CurDate = CurYear + "/" + CurMonth + "/" + mlength.ToString("00");
+                    YEnd = CommonMotions.NthWeek(CommonMotions.cnvDate(CurDate));
+
+                    // 開始日の曜日から開始位置を求める
+                    XStart = (int)wrkStartDate.AddMonths(i).DayOfWeek;
+
+                    // 1カ月分処理する
+                    int iDay = 1;
+                    for (int iy = 0; iy < YEnd; iy++)
+                    {
+                        // 1週目以外は最初から始める
+                        if (iy != 0) XStart = 0;
+
+                        // 1週間分処理する
+                        for (int ix = XStart; ix < s_ColumnPosision.Length; ix++)
+                        {
+                            // 月の最終日まで処理を行う
+                            if (iDay > mlength) break;
+                            // 日付セット
+                            m_CalendPage.MonthryData[i].lblDayData[ix + (iy * 7)].Text = iDay.ToString();
+                            
+                            // 会社営業日データが無い場合はここで営業日設定
+                            if (bNoneData)
+                            {
+                                DateTime dtweek = CommonMotions.cnvDate(CurYear + "/" + CurMonth + "/" + iDay.ToString("00"));
+                                DayOfWeek dayofweek = dtweek.DayOfWeek;
+                                if (dayofweek == DayOfWeek.Sunday)
+                                {
+                                    m_CalendPage.MonthryData[i].lblDayData[ix + (iy * 7)].BackColor = Color.Red;
+                                }
+                                else if (dayofweek == DayOfWeek.Saturday)
+                                {
+                                    m_CalendPage.MonthryData[i].lblDayData[ix + (iy * 7)].BackColor = Color.Red;
+                                }
+                            }
+                            iDay++;     // 月日数
+                        }
+                    }
+                }
+
+                tableLayoutPanel1.ResumeLayout();
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region カレンダー表示
+        /// <summary>
+        /// カレンダー表示
+        /// </summary>
+        private void DisplayCalender()
+        {
+            IOBankBusinessDayMaster bbdDB = new IOBankBusinessDayMaster();
+            try
+            {
+                StringBuilder wrkSQL = new StringBuilder();
+                wrkSQL.Append("SELECT");
+                wrkSQL.Append(" Count(*)");
+                wrkSQL.Append(" FROM bankbusinessdaymaster");
+                wrkSQL.Append(" Where");
+                wrkSQL.AppendFormat(" truncate (YEARMONTH / 100, 0) = {0}", numUDYear.Value);
+                ArrayList arData = new ArrayList();
+
+                // SQL実行
+                if (!bbdDB.ExecuteReader(wrkSQL.ToString(), ref arData, true)) return;
+                if (arData.Count == 0) return;
+
+                // データセット
+                object[] objwrk = (object[])arData[0];
+                // 営業日カレンダーデータがある場合
+                if (CommonMotions.cnvInt(objwrk[0]) != 0)
+                {
+                    CreateNewCalender(false);
+                    CalenderDataLoad();
+                }
+                else
+                {
+                    CreateNewCalender(true);
+                }
+
+
+                m_bChengeAns = false;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                bbdDB.close(); bbdDB = null;
+            }
+        }
+        #endregion
+
+        #region カレンダー表示
+        /// <summary>
+        /// カレンダー表示
+        /// </summary>
+        private void CalenderDataLoad()
+        {
+            IOBankBusinessDayMaster bbdDB = new IOBankBusinessDayMaster();
+            try
+            {
+                int MonthCnt = m_CalendPage.lblMonthTitle.Length;
+                for (int i = 0; i < MonthCnt; i++)
+                {
+                    if (m_CalendPage.lblMonthTitle[i].Text.Length == 0) continue;
+
+                    // 該当年を検索する
+                    string nen = m_CalendPage.lblMonthTitle[i].Text.Substring(0, m_CalendPage.lblMonthTitle[i].Text.IndexOf("年"));
+                    int tergetYear = CommonMotions.cnvInt(nen);
+                    // 該当月を検索する
+                    string wrkTuki = m_CalendPage.lblMonthTitle[i].Text.Substring(m_CalendPage.lblMonthTitle[i].Text.IndexOf("年") + 1, 2);
+                    int tergetMonth = CommonMotions.cnvInt(wrkTuki);
+
+                    StringBuilder strGetMonth = new StringBuilder();
+                    strGetMonth.Append("SELECT");
+                    strGetMonth.Append(" t1.d");
+                    strGetMonth.Append(", CONCAT(");
+                    strGetMonth.Append("truncate (C.YEARMONTH / 100, 0)");
+                    strGetMonth.Append(", '/'");
+                    strGetMonth.Append(", lpad(mod(C.YEARMONTH, 100), 2, 0)");
+                    strGetMonth.Append(", '/'");
+                    strGetMonth.Append(", lpad(C.BANKBUSINESSDAY, 2, 0)");
+                    strGetMonth.Append(") AS BusDAY");
+                    strGetMonth.Append(" FROM");
+                    strGetMonth.Append(" (");
+                    strGetMonth.Append(" SELECT");
+                    strGetMonth.Append(" A1.years");
+                    strGetMonth.Append(", A2.month");
+                    strGetMonth.Append(", A3.days");
+                    strGetMonth.Append(", CAST(");
+                    strGetMonth.Append(" CONCAT(A1.years, '/', A2.month, '/', A3.days) as DATE");
+                    strGetMonth.Append(") as d");
+                    strGetMonth.Append(" FROM");
+                    strGetMonth.Append(" yearmaster as A1");
+                    strGetMonth.Append(", monthmaster as A2");
+                    strGetMonth.Append(", daymaster as A3");
+                    strGetMonth.AppendFormat(" WHERE A1.years = {0}", tergetYear);
+                    strGetMonth.AppendFormat(" AND A2.month = {0}", tergetMonth);
+                    strGetMonth.Append(" AND CAST(CONCAT(A1.years, '/', A2.month, '/', A3.days) as DATE) IS NOT NULL) t1");
+                    strGetMonth.Append(" LEFT JOIN bankbusinessdaymaster C ON ((C.YEARMONTH * 100) + C.BANKBUSINESSDAY) = t1.d");
+                    strGetMonth.Append(" ORDER BY t1.d"); 
+
+                    ArrayList dataList = new ArrayList();
+                    if (!bbdDB.ExecuteReader(strGetMonth.ToString(), ref dataList)) continue;
+                    if (dataList.Count == 0) continue;
+
+                    int lblDayCnt = m_CalendPage.MonthryData[i].lblDayData.Length;
+                    object[] CurData = null;
+                    for (int ix = 0; ix < lblDayCnt; ix++)
+                    {
+                        if (m_CalendPage.MonthryData[i].lblDayData[ix].Text.Length == 0) continue;
+
+                        // ラベルの日付より取得データの位置を取る
+                        int daycnt = CommonMotions.cnvInt(m_CalendPage.MonthryData[i].lblDayData[ix].Text) - 1;
+                        CurData = (object[])dataList[daycnt];
+                        if (CommonMotions.cnvDate(CurData[1]) == DateTime.MinValue)
+                        {
+                            m_CalendPage.MonthryData[i].lblDayData[ix].BackColor = Color.Red;
+                        }
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                bbdDB.close(); bbdDB = null;
+            }
+        }
+        #endregion
+
+        #region 営業日を登録する
+        /// <summary>
+        /// 営業日を登録する
+        /// </summary>
+        private bool BusinesCalenderEntry()
+        {
+            IOBankBusinessDayMaster bbdDB = new IOBankBusinessDayMaster();
+            try
+            {
+                bbdDB.connect();
+                bbdDB.beginTran();
+
+                // まず削除する
+                string wrkSQL = string.Format(" Where Truncate(YEARMONTH / 100, 0) = {0}", numUDYear.Value);
+                // データ削除
+                bbdDB.DeleteAction(wrkSQL, false);
+
+
+                List<BankBusinessDayMaster> DataList = new List<BankBusinessDayMaster>();
+                // 設定年月日作成
+                string CalenderDate = string.Format("{0}01", m_CalendPage.lblMonthTitle[0].Text.Replace("年", "/").Replace("月", "/"));
+                DateTime wrkStartDate = CommonMotions.cnvDate(CalenderDate);
+                // 12カ月処理する
+                for (int i = 0; i < m_CalendPage.lblMonthTitle.Length; i++)
+                {
+                    // 月をセットする
+                    string CurDate = wrkStartDate.AddMonths(i).ToShortDateString();
+                    string CurYear = CurDate.Substring(0, CurDate.IndexOf("/"));
+                    string CurMonth = CurDate.Substring(CurDate.IndexOf("/") + 1, 2);
+                    // 月の最終日から週数を求める
+                    int mlength = DateTime.DaysInMonth(CommonMotions.cnvInt(CurYear), CommonMotions.cnvInt(CurMonth));
+
+                    // 1週間分処理する
+                    for (int ix = 0; ix < m_CalendPage.MonthryData[i].lblDayData.Length; ix++)
+                    {
+                        // 月の最終日まで処理を行う
+                        if (m_CalendPage.MonthryData[i].lblDayData[ix].Text.Length == 0)
+                            continue;
+                        // 営業日を加算する
+                        if (m_CalendPage.MonthryData[i].lblDayData[ix].BackColor == Color.Red) continue;
+
+                        BankBusinessDayMaster wrkRec = new BankBusinessDayMaster();
+                        wrkRec.YearMonth = (CommonMotions.cnvInt(CurYear) * 100) + CommonMotions.cnvInt(CurMonth);          // 年月
+                        wrkRec.BankBusinessDay = CommonMotions.cnvInt(m_CalendPage.MonthryData[i].lblDayData[ix].Text);     // 銀行営業日
+
+                        DataList.Add(wrkRec);
+                    }
+                }
+                if (!bbdDB.InsertAction(DataList, false))
+                {
+                    bbdDB.rollback();
+                    MessageBox.Show("登録に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    return false;
+                }
+
+                bbdDB.commit();
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
+            }
+            finally
+            {
+                bbdDB.close(); bbdDB = null;
+            }
+        }
+        #endregion
+
+        #region 画面項目のチェック
+        /// <summary>
+        /// 画面項目のチェック
+        /// </summary>
+        /// <returns></returns>
+        private bool DispFeildCheck()
+        {
+            try
+            {
+                return true;
+            }
+            catch (System.Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
+            }
+        }
+        #endregion
+
+        #region 対象年度セット
+        /// <summary>
+        /// 対象年度セット
+        /// </summary>
+        private void SetnumUDYear()
+        {
+            IOBankBusinessDayMaster calDB = new IOBankBusinessDayMaster();
+            try
+            {
+                // 当年度取得
+                int ToYear = CommonMotions.SystemMasterData.ConstructionYear;
+
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT");
+                strSQL.Append(" Truncate (YEARMONTH / 100, 0)");
+                strSQL.Append(", COUNT(*)");
+                strSQL.Append(" FROM");
+                strSQL.Append(" bankbusinessdaymaster");
+                strSQL.Append(" GROUP BY");
+                strSQL.Append(" Truncate (YEARMONTH / 100, 0)");
+                strSQL.Append(" ORDER BY");
+                strSQL.Append(" Truncate (YEARMONTH / 100, 0)");
+
+                ArrayList arList = new ArrayList();
+                int Max = 0;
+                int Min = 0;
+                if (calDB.ExecuteReader(strSQL.ToString(), ref arList) || arList.Count != 0)
+                {
+                    // 最大・最低値取得
+                    GetMaxMinYear(arList, ref Max, ref Min);
+                    if (Max < ToYear) Max = ToYear;
+                }
+                else
+                {
+                    Max = ToYear;
+                    Min = ToYear;
+                }
+                if (Max <= DateTime.Now.Year) ++Max;
+
+                // 最大・最低値セット
+                numUDYear.Minimum = Min;
+                numUDYear.Maximum = Max;
+                numUDYear.Value = ToYear;
+            }
+            catch (System.Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+            finally
+            {
+                calDB.close(); calDB = null;
+            }
+        }
+        #endregion
+
+        #region 配列より最大値・最低値を取得する
+        /// <summary>
+        /// 配列より最大値・最低値を取得する
+        /// </summary>
+        /// <param name="arList"></param>
+        /// <param name="Max"></param>
+        /// <param name="Min"></param>
+        private void GetMaxMinYear(ArrayList arList, ref int Max, ref int Min)
+        {
+            try
+            {
+                bool init = true;
+                foreach (object[] wrkobj in arList)
+                {
+                    if (init)
+                    {
+                        Min = CommonMotions.cnvInt(wrkobj[0]);
+                        init = false;
+                    }
+                    Max = CommonMotions.cnvInt(wrkobj[0]);
+                }
+            }
+            catch (System.Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region 参照時ロック処理
+        /// <summary>
+        /// 参照時ロック処理
+        /// </summary>
+        private void ExecReadOnly()
+        {
+            try
+            {
+                btnDataEntry.Visible = false;
+                btnDataDelete.Visible = false;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+    }
+}
Index: branches/src/ProcessManagement/ProcessManagement/Forms/Master/Calender/FrmCalendarAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/Master/Calender/FrmCalendarAuxiliary.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/Master/Calender/FrmCalendarAuxiliary.cs	(revision 302)
@@ -604,8 +604,6 @@
                 // 当年度取得
                 int ToYear = CommonMotions.SystemMasterData.ConstructionYear;
 
-                //string strSQL = "SELECT TO_CHAR(Holiday ,'YYYY'), COUNT(*) FROM HOLIDAYCALENDERMASTER";
-                //strSQL += " GROUP BY TO_CHAR(Holiday ,'YYYY') ORDER BY TO_CHAR(Holiday ,'YYYY')";
                 string strSQL = "SELECT DATE_FORMAT(Holiday ,'%Y'), COUNT(*) FROM HOLIDAYCALENDERMASTER";
                 strSQL += " GROUP BY DATE_FORMAT(Holiday ,'%Y') ORDER BY DATE_FORMAT(Holiday ,'%Y')";
 
@@ -623,6 +621,8 @@
                     Max = ToYear;
                     Min = ToYear;
                 }
+
+                if (Max <= DateTime.Now.Year) ++Max;
                 // 最大・最低値セット
                 numUDYear.Minimum = Min;
                 numUDYear.Maximum = Max;
Index: branches/src/ProcessManagement/ProcessManagement/Forms/Master/Security/FrmSecurity.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/Master/Security/FrmSecurity.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/Master/Security/FrmSecurity.cs	(revision 302)
@@ -171,6 +171,7 @@
                                                     new KeyValuePair<int, string>((int)ClsExcute.MaintenanceExecuteNo.MaterialKind, string.Empty),          // 資材種類登録
                                                     new KeyValuePair<int, string>((int)ClsExcute.MaintenanceExecuteNo.MaterialItem, string.Empty),          // 資材品目登録
                                                     new KeyValuePair<int, string>((int)ClsExcute.MaintenanceExecuteNo.SalesConfirm, string.Empty),          // 売上確認
+                                                    new KeyValuePair<int, string>((int)ClsExcute.MaintenanceExecuteNo.BankBusinessDay, string.Empty),       // 銀行営業日登録
                                                                         };
         #endregion
         #endregion
Index: branches/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/ZMenu/FrmMenu.cs	(revision 302)
@@ -718,7 +718,7 @@
                                                                     (int)ClsExcute.MaintenanceExecuteNo.MaterialKind,
                                                                     (int)ClsExcute.MaintenanceExecuteNo.MaterialItem
                                                                 },
-                                                                { 0,
+                                                                { (int)ClsExcute.MaintenanceExecuteNo.BankBusinessDay,
                                                                     0,
                                                                     0,
                                                                     (int)ClsExcute.MaintenanceExecuteNo.SalesConfirm
Index: branches/src/ProcessManagement/ProcessManagement/ProcessManagement.csproj
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/ProcessManagement.csproj	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/ProcessManagement.csproj	(revision 302)
@@ -422,6 +422,12 @@
     <Compile Include="Forms\DataEntry\PurchaseOrderEntry\FrmOrderEntryListAuxiliary.cs">
       <SubType>Form</SubType>
     </Compile>
+    <Compile Include="Forms\DataEntry\PurchaseOrderEntry\FrmPOConvert.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Forms\DataEntry\PurchaseOrderEntry\FrmPOConvert.Designer.cs">
+      <DependentUpon>FrmPOConvert.cs</DependentUpon>
+    </Compile>
     <Compile Include="Forms\DataEntry\PurchaseOrderEntry\PurchaseOrderInputPage.cs" />
     <Compile Include="DataModel\PurchaseOrderDetail.cs" />
     <Compile Include="DataModel\PurchaseOrder.cs" />
@@ -793,6 +799,15 @@
     <Compile Include="Forms\Master\ApprovalRoute\FrmApprovalDispAux.cs">
       <SubType>Form</SubType>
     </Compile>
+    <Compile Include="Forms\Master\BankBusinessDay\FrmBBD.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Forms\Master\BankBusinessDay\FrmBBD.Designer.cs">
+      <DependentUpon>FrmBBD.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Forms\Master\BankBusinessDay\FrmBBDAux.cs">
+      <SubType>Form</SubType>
+    </Compile>
     <Compile Include="Forms\Master\CategoryName\FrmCategoryNameMaster.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1476,6 +1491,9 @@
     <EmbeddedResource Include="Forms\DataEntry\PurchaseOrderEntry\FrmOrderEntryList.resx">
       <DependentUpon>FrmOrderEntryList.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Forms\DataEntry\PurchaseOrderEntry\FrmPOConvert.resx">
+      <DependentUpon>FrmPOConvert.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Forms\DataEntry\PurchaseStatusInput\FrmPurchaseStatusInput.resx">
       <DependentUpon>FrmPurchaseStatusInput.cs</DependentUpon>
     </EmbeddedResource>
@@ -1551,6 +1569,9 @@
     <EmbeddedResource Include="Forms\Master\ApprovalRoute\FrmApprovalDisp.resx">
       <DependentUpon>FrmApprovalDisp.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Forms\Master\BankBusinessDay\FrmBBD.resx">
+      <DependentUpon>FrmBBD.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Forms\Master\CategoryName\FrmCategoryNameMaster.resx">
       <DependentUpon>FrmCategoryNameMaster.cs</DependentUpon>
     </EmbeddedResource>
Index: branches/src/ProcessManagement/ProcessManagement/Properties/AssemblyInfo.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Properties/AssemblyInfo.cs	(revision 301)
+++ branches/src/ProcessManagement/ProcessManagement/Properties/AssemblyInfo.cs	(revision 302)
@@ -32,7 +32,7 @@
 // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を 
 // 既定値にすることができます:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.1.14")]
-[assembly: AssemblyFileVersion("1.0.1.14")]
+[assembly: AssemblyVersion("1.0.1.16")]
+[assembly: AssemblyFileVersion("1.0.1.16")]
 // Log4netを使用する
 [assembly: log4net.Config.XmlConfigurator(ConfigFile = @"log4net.config", Watch = true)]
\ No newline at end of file
