diff --git a/data/(220)通勤手当届出事由区分.csv b/data/(220)通勤手当届出事由区分.csv new file mode 100644 index 0000000..d64535e --- /dev/null +++ b/data/(220)通勤手当届出事由区分.csv @@ -0,0 +1,9 @@ +"01","新規","新規","","","","1" +"02","異動","異動","","","","1" +"03","転居(本人)","転居(本人)","","","","1" +"04","転居(配偶者)","転居(配偶者)","","","","1" +"05","消滅","消滅","","","","2" +"06","非支給","非支給","","","支給調整対象者のみ。認定簿のみに使用。","1" +"07","転記","転記","","","","1" +"08","その他","その他","","","","1" +"09","法改正","法改正","","","","1" \ No newline at end of file diff --git a/data/(244)通勤_定期券名称区分一覧.csv b/data/(244)通勤_定期券名称区分一覧.csv new file mode 100644 index 0000000..ad60b1f --- /dev/null +++ b/data/(244)通勤_定期券名称区分一覧.csv @@ -0,0 +1,3 @@ +"001","1箇月定期","1箇月定期","1箇月定期","" +"002","3箇月定期","3箇月定期","3箇月定期","" +"003","6箇月定期","6箇月定期","6箇月定期","" \ No newline at end of file diff --git a/data/(245)通勤_回数券名称区分一覧.csv b/data/(245)通勤_回数券名称区分一覧.csv new file mode 100644 index 0000000..a19c6e6 --- /dev/null +++ b/data/(245)通勤_回数券名称区分一覧.csv @@ -0,0 +1,55 @@ +"001","特定回数券(4700円)","特定回数券(4700円)","特定回数券(4700円)","","4700","470","14","0","0","0" +"002","回数券(1100円)","回数券(1100円)","鳴門市バス","","1100","110","11","1100","11","0" +"003","回数券(1900円)","回数券(1900円)","鳴門市バス","","1900","190","11","1900","11","0" +"004","回数券(3000円)","回数券(3000円)","鳴門市バス","","3000","300","11","3000","11","0" +"005","特定区間回数券(4500円)","特定区間回数券(4500円)","徳島〜鳴門間","","4500","450","14","4500","14","0" +"006","回数券(3000円)","回数券(3000円)","徳島市バス","","3000","200","17","3000","17","0" +"007","回数券(1400円)","回数券(1400円)","徳バス・鳴門市バス・徳島市バス共通","","1400","140","11","1400","11","0" +"008","回数券(5000円)","回数券(5000円)","徳バス・鳴門市バス・徳島市バス共通","","5000","500","12","5000","12","0" +"009","回数券(JRなんば〜高速鳴門)","回数券(JRなんば〜高速鳴門)","回数券(JRなんば〜高速鳴門)","","11340","3150","4","0","0","0" +"010","回数券(高速バス用)","回数券(高速バス用)","回数券(高速バス用)","","8820","2450","4","0","0","0" +"011","回数券(3000円)","回数券(3000円)","徳バス・徳島市バス・小松島市バス共通","","3000","100","25","50","20","0" +"012","回数券(6100円)","回数券(6100円)","特定回数乗車券・組合せ回数券","","6100","450","14","160","11","0" +"013","回数券(3300円)","回数券(3300円)","徳島バス","","3300","330","11","0","0","330" +"014","回数券(4500円)","回数券(4500円)","徳島バス","","4500","450","14","0","0","0" +"015","回数券(1600円)","回数券(1600円)","徳島バス","","1600","160","11","0","0","0" +"016","回数券(9900円)","回数券(9900円)","徳島バス(三ノ宮〜高速鳴門)","","9900","2750","4","0","0","0" +"017","回数券(2000円)","","鳴門市地域バス","","2000","182","11","0","0","0" +"018","回数券(2000円)","回数券(2000円)","鳴門市地域バス","","2000","200","11","0","0","0" +"019","ETC","","","","0","0","0","0","0","0" +"020","組合せ回数券","","","","3000","50","20","100","25","0" +"021","組合せ回数券","","","","3000","50","20","100","25","0" +"022","回数券","","","","400","40","11","0","0","0" +"023","定期券(400円)","","","","400","40","11","0","0","0" +"024","回数券(300円)","","","","300","30","11","0","0","0" +"025","回数券(4000円)","回数券(4000円)","","","4000","4000","12","0","0","0" +"026","回数券(4000円)","","","","4000","400","12","0","0","0" +"027","回数券(3000円)","","徳島市バス(市内均一料金)","","3000","210","17","0","0","0" +"028","回数券(3000円)","","徳島市営バス(市内均一料金)","","3000","210","17","0","0","0" +"029","回数券(4600円)","","徳島バス","","4600","460","14","0","0","0" +"030","回数券(1700円)","","徳島バス","","1700","170","11","0","0","0" +"031","回数券(4600円)","","","","4600","460","14","0","0","0" +"032","回数券(1700円)","","","","1700","170","11","0","0","0" +"033","特定回数券(4600円)","","","","4600","450","14","0","0","0" +"034","回数券(1700円)","","","","1700","170","11","0","0","0" +"035","回数券(高速バス用)","回数券(高速バス)R1.10.1","","","9200","2300","4","0","0","0" +"036","回数券(4600円)","","","","4600","460","14","0","0","0" +"037","回数券(1700円)","","","","1700","170","11","0","0","0" +"038","回数券(10260円)","","","","10260","2565","4","0","0","0" +"039","組合せ回数券(3000円)","","","","3000","50","20","100","25","0" +"040","回数券(4600円)","","","","4600","460","14","0","0","0" +"041","回数券(JRなんば〜高速鳴門)","","","","11700","2925","4","0","0","0" +"042","回数券(1600円)","回数券(1600円)","","","1600","1600","11","0","0","0" +"043","回数券(4600+1600)","回数券(4600円+1600円)","","","6200","4600","14","1600","11","0" +"044","回数券(2000円)","回数券(2000円)","回数券(2000円)","","2000","2000","11","0","0","0" +"045","回数券(2000円)","回数券(2000円)","回数券(2000円)","","2000","200","11","0","0","0" +"046","回数券(200円)","回数券(200円)","回数券(200円)","","200","20","11","0","0","0" +"047","組合せ回数券(3000円)","組合せ回数券(3000円)","組合せ回数券(3000円)","","3000","50","20","100","25","0" +"048","特定回数券(4600円)","特定回数券(4600円)","特定回数券(4600円)","","4600","460","14","0","0","0" +"049","回数券(100円)","回数券(100円)","回数券(100円)","","100","10","11","0","0","0" +"050","回数券(2400円)","","","","2400","218","0","0","0","0" +"051","回数券(高速バス)","","","","0","0","0","0","0","0" +"052","回数券(3400)","西日本JRバス回数券","","","12240","3400","4","0","0","0" +"053","回数券(高速舞子~高速鳴門)R6.10.1","回数券(高速舞子~高速鳴門)R6.10.1","","","11160","2790","4","0","0","0" +"054","回数券(400円)","回数券(400円)","回数券(400円)","","400","40","11","0","0","0" +"055","特定回数券(5700円)","特定回数券(5700円)","","","5700","570","14","0","0","0" \ No newline at end of file diff --git a/data/223通勤_決定事項区分.csv b/data/223通勤_決定事項区分.csv index 924e937..7a4ff85 100644 --- a/data/223通勤_決定事項区分.csv +++ b/data/223通勤_決定事項区分.csv @@ -1,3 +1,3 @@ "1","法第12条第1項 該当","法第12条第1項 該当","","" "2","法第12条第1項 該当(規則第5条)","法第12条第1項 該当(規則第5条)","","" -"3","法第12条第1項 非該当","法第12条第1項 非該当","","" +"3","法第12条第1項 非該当","法第12条第1項 非該当","","" \ No newline at end of file diff --git a/data/住所情報.csv b/data/住所情報.csv new file mode 100644 index 0000000..93ef26a --- /dev/null +++ b/data/住所情報.csv @@ -0,0 +1,19 @@ +00027442, 2025/11/30, "4000053・スR・ス・ス・ス・ス・スb・ス{・スs・ス蝸「・ス・ス", "2623-41 ・スR・ス・ス・ス・スw・ス蝸「・スh・ス・ス103" +00027442, 2025/11/30, " ", "" +00027442, 2025/11/30, "住所1", "住所2" +00027442, 2025/11/30, "住所1", "住所2-2" +00027442, 2025/11/30, "住所1", "" +00098984, 2025/11/30, "4093815・スR・ス・ス・ス・ス・ス・ス・ス・ス・スs・ス・ス・ス・ス", "1559-1-D203" +00138801, 2025/11/30, "4093815・スR・ス・ス・ス・ス・ス・ス・ス・ス・スs・ス・ス・ス・ス", "1559-1 ・スR・ス・ス・ス・スw・ス・ス・ス・ス・スh・ス・スB-201" +00147107, 2025/11/30, "4000016・スR・ス・ス・ス・ス・スb・ス{・スs・ス・ス・スc", "3-5-241-306" +00177402, 2025/11/30, "4000016・スR・ス・ス・ス・ス・スb・ス{・スs・ス・ス・スc", "3-5-24 ・ス・ス・ス・ス・スh・スノ包ソス・スc・スZ・ス・ス1・ス・ス・ス・ス307" +00188435, 2025/11/30, "4000016・スR・ス・ス・ス・ス・スb・ス{・スs・ス・ス・スc", "3-5-22 ・ス・ス・スc・スZ・ス・ス1-303" +00189445, 2025/11/30, "4000016・スR・ス・ス・ス・ス・スb・ス{・スs・ス・ス・スc", "3-5-22-2-204" +00189748, 2025/11/30, "1700011・ス・ス・ス・ス・スs・スL・ス・ス・ス・スr・スワ本・ス・ス", "4-46-11-533" +00198054, 2025/11/30, "1690072・ス・ス・ス・ス・スs・スV・スh・ス・ス・スv・ス・ス", "3-12-4-304" +00206158, 2025/11/30, "4000016・スR・ス・ス・ス・ス・スb・ス{・スs・ス・ス・スc", "3-5-22-2-204" +00206461, 2025/11/30, "2770024・ス・スt・ス・ス・ス・ス・スs・ス・スt・ス・ス", "9-14" +00206966, 2025/11/30, "4000016", "" +00282249, 2025/11/30, "1070062", "" +01002918, 2025/11/30, "4001513", "" +01018823, 2025/11/30, "4093815", "" diff --git a/data/区間.csv b/data/区間.csv index 5fd67c0..5ed799d 100644 --- a/data/区間.csv +++ b/data/区間.csv @@ -1,4 +1,4 @@ -pԃR[h,ʋ@֋敪,ʋ@֖,pԔ,pԒ,,^,̏ꍇ1ӌ^,A,ʗ敪,ʗ̌,ʗ̕Sz +pԃR[h,ʋ@֋敪,ʋ@֖,pԔ,pԒ,,^,̏ꍇ1ӌ^,A,ʗ敪,ʗ,ʗSz 00001,002,iq,,b{,22,2233,,,,, 00002,002,iq,yJ,b{,,0,,,,, 00003,002,iq,c,b{,,0,,,,, @@ -71,5 +71,5 @@ 00070,002,iq,։w,Ճmw,20,2000,,,,, 00071,003,RoX,Vv싴,Rw,30,3000,,,,, 00072,002,iq,,b{,1,2,3,,,, -00073,001,ʗp,smart,smart,2222,222,2222,,,, +00073,001,JR k,smart,smart,2222,222,2222,,,, 00074,002,iq,b{,b{,22,2222,2222,,,, \ No newline at end of file diff --git a/data/区間詳細.csv b/data/区間詳細.csv index 848d354..c84c2ad 100644 --- a/data/区間詳細.csv +++ b/data/区間詳細.csv @@ -9,12 +9,9 @@ 00056,1,003,Uӌ,10030,10030,1,,,, 00067,1,003,Uӌ,4486.666,26920,6,,,, 00068,1,003,Uӌ,52800,316800,6,,,, -00069,1,006,Uӌ,7181.666,43090,6,,,, 00070,1,003,Uӌ,6426.666,38560,6,,,, 00071,1,003,Uӌ,6879,6879,1,,,, 00001,2,001,eXg,15000,0,0,0,0,0, 00001,3,001,vyChJ[h,20000,20000,,,,, 00002,2,001,eXg,15000,0,0,0,0,0, -00002,3,002,0002eXg,45000,60000,,,,, -00003,2,002,eXg2,500,500,10,500,10,0, -00004,3,003,0004eXg,5000,5000,,,,, \ No newline at end of file +00003,2,002,eXg2,500,500,10,500,10,0, \ No newline at end of file diff --git a/src/module/Common_Button.bas b/src/module/Common_Button.bas index ad47c93..7c75820 100644 --- a/src/module/Common_Button.bas +++ b/src/module/Common_Button.bas @@ -89,8 +89,10 @@ Private Sub DO_CSV_Import(ws As Excel.Worksheet) Dim colLetters As Variant: colLetters = cfg("HeaderColumns") Dim writeRow As Long: writeRow = cfg("StartRow") Dim i As Long + ' loop row For i = LBound(csvData, 1) To UBound(csvData, 1) Dim j As Long + ' loop column For j = 0 To expectedColumnCount - 1 ws.Cells(writeRow, ws.Range(colLetters(j) & "1").Column).Value = CleanCSVField(CStr(csvData(i, j + 1))) Next j @@ -181,13 +183,19 @@ Private Sub DO_CSV_Export(ws As Excel.Worksheet) ' === Step 4: Count data columns === Dim expectedColumnCount As Long: expectedColumnCount = sheetConf("ExpectedColumnCount") - Dim outputArr As Variant - ReDim outputArr(1 To rowCount + 1, 1 To expectedColumnCount) ' === Step 5: check export csv has header === Dim hasHeader As Boolean: hasHeader = sheetConf("HasHeader") Dim dataRow As Long: dataRow = 1 + Dim outputArr As Variant + ' when has header + 1 + If hasHeader Then + ReDim outputArr(1 To rowCount + 1, 1 To expectedColumnCount) + Else + ReDim outputArr(1 To rowCount, 1 To expectedColumnCount) + End If + ' === Step 6: Build array with header and data === If hasHeader Then Dim headerArr As Variant diff --git a/src/module/Common_Functions.bas b/src/module/Common_Functions.bas index da95ade..7fc1ee6 100644 --- a/src/module/Common_Functions.bas +++ b/src/module/Common_Functions.bas @@ -7,9 +7,6 @@ Option Explicit ' - GetLastDataRowInRange ' - ClearDataRows ' - ClearDataRow -' - SortDataRows -' - ToggleAutoFilter -' - AutoFitColumnWidth ' ============================================================ ' Common Functions @@ -247,48 +244,13 @@ Sub ClearDataRows(ByVal ws As Worksheet) clearRange.ClearContents clearRange.Interior.Color = vbWhite - Dim clearErrorRange As Range - Set clearErrorRange = ws.Range(ws.Cells(startRow, ws.Range(errorCol & "1").Column), ws.Cells(lastDataRow, ws.Range(errorCol & "1").Column)) - clearErrorRange.ClearContents - clearErrorRange.Interior.Color = vbWhite - End If -End Sub - -Sub SortDataRows(Optional ByVal sortColumn As Long = 3) - Dim ws As Worksheet - Dim lastRow As Long - Dim startRow As Long - Dim sortOrder As Long - - Set ws = ActiveSheet - startRow = 7 - lastRow = GetLastDataRow(ws, sortColumn) - - If lastRow < startRow Then - MsgBox "No data to sort.", vbExclamation - Exit Sub - End If - - ' Determine sort order based on first row's current state - Dim currentFirst As String - Dim nextFirst As String - currentFirst = Trim(ws.Cells(startRow, sortColumn).Value) - nextFirst = Trim(ws.Cells(startRow + 1, sortColumn).Value) - - If currentFirst <> "" And nextFirst <> "" Then - If currentFirst > nextFirst Then - sortOrder = xlAscending - Else - sortOrder = xlDescending + If errorCol <> "" Then + Dim clearErrorRange As Range + Set clearErrorRange = ws.Range(ws.Cells(startRow, ws.Range(errorCol & "1").Column), ws.Cells(lastDataRow, ws.Range(errorCol & "1").Column)) + clearErrorRange.ClearContents + clearErrorRange.Interior.Color = vbWhite End If - Else - sortOrder = xlAscending End If - - ws.Range(ws.Cells(startRow, 1), ws.Cells(lastRow, 20)).Sort _ - Key1:=ws.Cells(startRow, sortColumn), _ - Order1:=sortOrder, _ - Header:=xlNo End Sub ' Format: code:value (no space around colon) diff --git a/src/module/Common_Global_Cache.bas b/src/module/Common_Global_Cache.bas index bbb8fc9..c764cfa 100644 --- a/src/module/Common_Global_Cache.bas +++ b/src/module/Common_Global_Cache.bas @@ -488,7 +488,7 @@ Private Sub RefreshSheetDict() sheetConf("CSV_Encoding") = "utf-8" sheetConf("HasHeader") = False sheetConf("ExpectedColumnCount") = 4 - sheetConf("HeaderColumns") = Array() + sheetConf("HeaderColumns") = Array("C", "D", "E", "F") sheetConf("AlwaysQuote") = True sheetConf("FilterRow") = 5 Set sheetConfDict("O1") = sheetConf @@ -504,7 +504,7 @@ Private Sub RefreshSheetDict() sheetConf("CSV_Encoding") = "utf-8" sheetConf("HasHeader") = False sheetConf("ExpectedColumnCount") = 13 - sheetConf("HeaderColumns") = Array() + sheetConf("HeaderColumns") = Array("C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O") sheetConf("AlwaysQuote") = True sheetConf("FilterRow") = 5 sheetConf("KeyCol") = 3 diff --git a/通勤手当テンプレート_案.xlsm b/通勤手当テンプレート_案.xlsm index 07bbbf5..d112af3 100644 Binary files a/通勤手当テンプレート_案.xlsm and b/通勤手当テンプレート_案.xlsm differ