From 2ed90dc6db2e0ba2b2bef579f8604ad15a8ba5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 27 Feb 2026 20:21:59 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[hr]=20=EC=82=AC=EC=97=85=EC=86=8C?= =?UTF-8?q?=EB=93=9D=EC=9E=90=20=EC=9E=84=EA=B8=88=EB=8C=80=EC=9E=A5=20?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=20=EB=A7=88=EC=9D=B4=EA=B7=B8?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - business_income_payments 테이블 생성 - 소득세(3%)/지방소득세(0.3%) 고정세율 구조 - (tenant_id, user_id, pay_year, pay_month) 유니크 제약 --- ..._create_business_income_payments_table.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 database/migrations/2026_02_27_300000_create_business_income_payments_table.php diff --git a/database/migrations/2026_02_27_300000_create_business_income_payments_table.php b/database/migrations/2026_02_27_300000_create_business_income_payments_table.php new file mode 100644 index 0000000..0319293 --- /dev/null +++ b/database/migrations/2026_02_27_300000_create_business_income_payments_table.php @@ -0,0 +1,44 @@ +id(); + $table->foreignId('tenant_id')->constrained('tenants')->comment('테넌트'); + $table->foreignId('user_id')->constrained('users')->comment('사업소득자 사용자'); + $table->unsignedSmallInteger('pay_year')->comment('급여 연도'); + $table->unsignedTinyInteger('pay_month')->comment('급여 월 (1-12)'); + $table->string('service_content', 200)->nullable()->comment('용역내용'); + $table->decimal('gross_amount', 15, 0)->default(0)->comment('지급총액'); + $table->decimal('income_tax', 15, 0)->default(0)->comment('소득세 (3%)'); + $table->decimal('local_income_tax', 15, 0)->default(0)->comment('지방소득세 (0.3%)'); + $table->decimal('total_deductions', 15, 0)->default(0)->comment('공제합계'); + $table->decimal('net_amount', 15, 0)->default(0)->comment('실지급액'); + $table->date('payment_date')->nullable()->comment('지급일자'); + $table->text('note')->nullable()->comment('비고'); + $table->string('status', 20)->default('draft')->comment('상태: draft/confirmed/paid'); + $table->timestamp('confirmed_at')->nullable()->comment('확정일시'); + $table->foreignId('confirmed_by')->nullable()->constrained('users')->comment('확정자'); + $table->timestamp('paid_at')->nullable()->comment('지급일시'); + $table->foreignId('created_by')->nullable()->constrained('users')->comment('생성자'); + $table->foreignId('updated_by')->nullable()->constrained('users')->comment('수정자'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->comment('삭제자'); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['tenant_id', 'user_id', 'pay_year', 'pay_month'], 'bip_tenant_user_period_unique'); + $table->index(['tenant_id', 'pay_year', 'pay_month'], 'bip_tenant_period_idx'); + }); + } + + public function down(): void + { + Schema::dropIfExists('business_income_payments'); + } +};