# v6: GemEgg 예실관리 - 실적입력시트 구현 ## 실적입력시트 설계 ### 용도 Money Forward에서 다운로드한 CSV 데이터를 붙여넣는 전용 시트 ### Node.js 구현 코드 ```javascript async function setupActualSheet(sheets) { const sheetName = '実績入力'; const rows = [ ['', '実績入力シート'], [], ['', 'Money ForwardのCSVデータを下記に貼り付けてください:'], [], ['', '↓ CSVデータ開始行 ↓'], [] ]; await sheets.spreadsheets.values.update({ spreadsheetId: SPREADSHEET_ID, range: `'${sheetName}'!A1`, valueInputOption: 'USER_ENTERED', requestBody: { values: rows } }); // 서식 적용 const sheetId = await getSheetId(sheets, sheetName); await sheets.spreadsheets.batchUpdate({ spreadsheetId: SPREADSHEET_ID, requestBody: { requests: [ // 타이틀 서식 { repeatCell: { range: { sheetId, startRowIndex: 0, endRowIndex: 1, startColumnIndex: 1, endColumnIndex: 2 }, cell: { userEnteredFormat: { textFormat: { fontSize: 14, bold: true } } }, fields: 'userEnteredFormat.textFormat' } }, // CSV 붙여넣기 영역 배경색 { repeatCell: { range: { sheetId, startRowIndex: 5, endRowIndex: 50, startColumnIndex: 1, endColumnIndex: 20 }, cell: { userEnteredFormat: { backgroundColor: { red: 1, green: 0.95, blue: 0.8 } } }, fields: 'userEnteredFormat.backgroundColor' } } ] } }); } ``` ## CSV 데이터 임포트 ### import-csv.js ```javascript async function main() { // CSV 파일 읽기 const csvContent = readFileSync(csvPath, 'utf8'); const records = parse(csvContent, { skip_empty_lines: false, relax_column_count: true }); // 実績入力シートに書き込み await sheets.spreadsheets.values.update({ spreadsheetId: SPREADSHEET_ID, range: "'実績入力'!B6", valueInputOption: 'USER_ENTERED', requestBody: { values: records } }); } ``` ### 임포트 결과 ``` 📥 CSV インポート開始... 📄 CSV 行数: 42 ✅ 実績入力シートにCSVデータを書き込みました 📊 実績データを解析中... ✓ 売上高: 9ヶ月分のデータ ✓ 役員報酬: 7ヶ月分のデータ ✓ 給料手当: 8ヶ月分のデータ ✓ 販売管理費 計: 8ヶ月分のデータ ✓ 営業損益金額: 9ヶ月分のデータ ``` ## 결과 화면 ``` ┌──────────────────────────────────────────────────────────────────┐ │ │ 実績入力シート │ ├───┼──────────────────────────────────────────────────────────────┤ │ │ │ │ │ Money ForwardのCSVデータを下記に貼り付けてください: │ │ │ │ │ │ ↓ CSVデータ開始行 ↓ │ ├───┼──────────────────────────────────────────────────────────────┤ │ │ [배경색: 연한 노란색 - CSV 붙여넣기 영역] │ │ │ 月次推移:損益計算書_株式会社Gemegg... │ │ │ 2025-04 2025-05 2025-06 ... │ │ │ 売上高 1267940 1123488 2098684 ... │ │ │ ... │ └──────────────────────────────────────────────────────────────────┘ ``` ## 다음 단계 v7에서는: - 예실출력시트 구현 - 수식 연결 --- **작성일**: 2025-12-05 **상태**: 완료 **다음**: v7 - 예실출력시트 구현