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(); + } +};