From 5f5b5db59f74b956ed396a5743ce3e0b0ed14e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Wed, 4 Mar 2026 14:18:46 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[approval]=20body=5Ftemplate=20?= =?UTF-8?q?=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=A7=80?= =?UTF-8?q?=EC=B6=9C=EA=B2=B0=EC=9D=98=EC=84=9C=20=EC=96=91=EC=8B=9D=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - approval_forms 테이블에 body_template TEXT 컬럼 추가 - 지출결의서(expense) 양식 데이터 등록 (HTML 테이블 본문 템플릿 포함) --- ...00_add_body_template_to_approval_forms.php | 22 +++++ ...04_100100_insert_expense_approval_form.php | 93 +++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 database/migrations/2026_03_04_100000_add_body_template_to_approval_forms.php create mode 100644 database/migrations/2026_03_04_100100_insert_expense_approval_form.php diff --git a/database/migrations/2026_03_04_100000_add_body_template_to_approval_forms.php b/database/migrations/2026_03_04_100000_add_body_template_to_approval_forms.php new file mode 100644 index 0000000..f040681 --- /dev/null +++ b/database/migrations/2026_03_04_100000_add_body_template_to_approval_forms.php @@ -0,0 +1,22 @@ +text('body_template')->nullable()->after('template')->comment('본문 HTML 템플릿'); + }); + } + + public function down(): void + { + Schema::table('approval_forms', function (Blueprint $table) { + $table->dropColumn('body_template'); + }); + } +}; diff --git a/database/migrations/2026_03_04_100100_insert_expense_approval_form.php b/database/migrations/2026_03_04_100100_insert_expense_approval_form.php new file mode 100644 index 0000000..14f9d61 --- /dev/null +++ b/database/migrations/2026_03_04_100100_insert_expense_approval_form.php @@ -0,0 +1,93 @@ + + + + + + + + + 지출일자 + + 부서 + + + + 거래처 + + + + 계정과목 + 적요 + 금액 + 비고 + + + + + + + + + + + + + + + + + + + + + 합계 + + + + + 지출 사유 + + + +HTML; + + DB::table('approval_forms')->insertOrIgnore([ + 'tenant_id' => 1, + 'name' => '지출결의서', + 'code' => 'expense', + 'category' => 'expense', + 'template' => json_encode([ + 'fields' => [ + ['name' => 'expense_date', 'type' => 'date', 'label' => '지출일자'], + ['name' => 'vendor', 'type' => 'text', 'label' => '거래처'], + ['name' => 'account', 'type' => 'text', 'label' => '계정과목'], + ['name' => 'amount', 'type' => 'number', 'label' => '금액'], + ['name' => 'description', 'type' => 'text', 'label' => '적요'], + ], + ], JSON_UNESCAPED_UNICODE), + 'body_template' => $bodyTemplate, + 'is_active' => true, + 'created_by' => 1, + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + + public function down(): void + { + DB::table('approval_forms') + ->where('tenant_id', 1) + ->where('code', 'expense') + ->delete(); + } +};