From 3406b12260202e5bc5dada7275d66fad13a345dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 6 Feb 2026 09:58:07 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=EB=B0=94=EB=A1=9C=EB=B9=8C=20?= =?UTF-8?q?=EA=B3=84=EC=A2=8C=20=EA=B1=B0=EB=9E=98=EB=82=B4=EC=97=AD=20?= =?UTF-8?q?=EC=98=A4=EB=B2=84=EB=9D=BC=EC=9D=B4=EB=93=9C=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88?= =?UTF-8?q?=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 - barobill_bank_transaction_overrides 테이블 생성 - tenant_id + unique_key 복합 유니크 인덱스 - modified_summary, modified_cast 필드로 수정값 저장 Co-Authored-By: Claude Opus 4.5 --- ...obill_bank_transaction_overrides_table.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 database/migrations/2026_02_06_095159_create_barobill_bank_transaction_overrides_table.php diff --git a/database/migrations/2026_02_06_095159_create_barobill_bank_transaction_overrides_table.php b/database/migrations/2026_02_06_095159_create_barobill_bank_transaction_overrides_table.php new file mode 100644 index 0000000..ec43c8e --- /dev/null +++ b/database/migrations/2026_02_06_095159_create_barobill_bank_transaction_overrides_table.php @@ -0,0 +1,37 @@ +id(); + $table->unsignedBigInteger('tenant_id')->comment('테넌트 ID'); + $table->string('unique_key', 100)->comment('거래 고유키 (계좌번호|거래일시|입금|출금|잔액)'); + $table->string('modified_summary', 200)->nullable()->comment('수정된 적요'); + $table->string('modified_cast', 200)->nullable()->comment('수정된 내용'); + $table->timestamps(); + + // 복합 유니크 인덱스 (테넌트별 거래 고유키) + $table->unique(['tenant_id', 'unique_key'], 'bb_trans_override_unique'); + + // 조회용 인덱스 + $table->index('tenant_id', 'bb_trans_override_tenant_idx'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('barobill_bank_transaction_overrides'); + } +}; From 28bf44584470a1e86ec9e4b86c3271fbf77469c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 6 Feb 2026 11:00:39 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat:=EA=B3=84=EC=A2=8C=20=EC=9E=85?= =?UTF-8?q?=EC=B6=9C=EA=B8=88=EB=82=B4=EC=97=AD=20=EC=88=98=EB=8F=99?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=EC=9A=A9=20is=5Fmanual=20=EC=BB=AC=EB=9F=BC?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit barobill_bank_transactions 테이블에 is_manual boolean 컬럼 추가 Co-Authored-By: Claude Opus 4.6 --- ...al_to_barobill_bank_transactions_table.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 database/migrations/2026_02_06_120000_add_is_manual_to_barobill_bank_transactions_table.php diff --git a/database/migrations/2026_02_06_120000_add_is_manual_to_barobill_bank_transactions_table.php b/database/migrations/2026_02_06_120000_add_is_manual_to_barobill_bank_transactions_table.php new file mode 100644 index 0000000..31bd50d --- /dev/null +++ b/database/migrations/2026_02_06_120000_add_is_manual_to_barobill_bank_transactions_table.php @@ -0,0 +1,24 @@ +boolean('is_manual')->default(false) + ->after('account_name') + ->comment('수동 입력 여부'); + }); + } + + public function down(): void + { + Schema::table('barobill_bank_transactions', function (Blueprint $table) { + $table->dropColumn('is_manual'); + }); + } +}; From edbd95053cbee7fd544408c6448d2d9d41c393fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 6 Feb 2026 14:43:10 +0900 Subject: [PATCH 3/4] =?UTF-8?q?feat:=EA=B3=84=EC=A2=8C=20=EC=9E=85?= =?UTF-8?q?=EC=B6=9C=EA=B8=88=20=EB=B6=84=EA=B0=9C=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=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 - barobill_bank_transaction_splits 테이블 생성 - 계좌 입출금 거래를 여러 계정과목으로 분개하여 저장 Co-Authored-By: Claude Opus 4.6 --- ...barobill_bank_transaction_splits_table.php | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 database/migrations/2026_02_06_200000_create_barobill_bank_transaction_splits_table.php diff --git a/database/migrations/2026_02_06_200000_create_barobill_bank_transaction_splits_table.php b/database/migrations/2026_02_06_200000_create_barobill_bank_transaction_splits_table.php new file mode 100644 index 0000000..d260ea5 --- /dev/null +++ b/database/migrations/2026_02_06_200000_create_barobill_bank_transaction_splits_table.php @@ -0,0 +1,53 @@ +id(); + $table->foreignId('tenant_id')->constrained()->onDelete('cascade'); + + // 원본 거래 고유키 (바로빌에서 가져온 원본 데이터 식별) + $table->string('original_unique_key', 200)->comment('원본 거래 고유키 (bankAccountNum|transDt|deposit|withdraw|balance)'); + + // 분개 정보 + $table->decimal('split_amount', 18, 2)->comment('분개 금액'); + $table->string('account_code', 50)->nullable()->comment('계정과목 코드'); + $table->string('account_name', 100)->nullable()->comment('계정과목명'); + $table->string('description', 255)->nullable()->comment('분개 내역'); + $table->string('memo', 255)->nullable()->comment('분개 메모'); + $table->integer('sort_order')->default(0)->comment('정렬 순서'); + + // 원본 거래 정보 (조회 편의를 위해 저장) + $table->string('bank_account_num', 50)->comment('계좌번호'); + $table->string('trans_dt', 20)->comment('거래일시 (YYYYMMDDHHMMSS)'); + $table->string('trans_date', 8)->comment('거래일 (YYYYMMDD)'); + $table->decimal('original_deposit', 18, 2)->default(0)->comment('원본 입금액'); + $table->decimal('original_withdraw', 18, 2)->default(0)->comment('원본 출금액'); + $table->string('summary', 255)->nullable()->comment('원본 적요'); + + $table->timestamps(); + + // 인덱스 + $table->index(['tenant_id', 'original_unique_key'], 'bb_bank_split_tenant_key_idx'); + $table->index(['tenant_id', 'trans_date'], 'bb_bank_split_tenant_date_idx'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('barobill_bank_transaction_splits'); + } +}; From bdf6bcc480d7481b0368ae435db8c4e304f62bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 6 Feb 2026 15:23:37 +0900 Subject: [PATCH 4/4] =?UTF-8?q?feat:=EC=9D=BC=EB=B0=98=EC=A0=84=ED=91=9C?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80=20(journal=5Fentries,?= =?UTF-8?q?=20journal=5Fentry=5Flines)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- ...06_300000_create_journal_entries_table.php | 36 +++++++++++++++++ ...00001_create_journal_entry_lines_table.php | 40 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 database/migrations/2026_02_06_300000_create_journal_entries_table.php create mode 100644 database/migrations/2026_02_06_300001_create_journal_entry_lines_table.php diff --git a/database/migrations/2026_02_06_300000_create_journal_entries_table.php b/database/migrations/2026_02_06_300000_create_journal_entries_table.php new file mode 100644 index 0000000..11d1212 --- /dev/null +++ b/database/migrations/2026_02_06_300000_create_journal_entries_table.php @@ -0,0 +1,36 @@ +id(); + $table->unsignedBigInteger('tenant_id'); + $table->string('entry_no', 20)->comment('전표번호 JE-YYYYMMDD-NNN'); + $table->date('entry_date')->comment('전표일자'); + $table->string('entry_type', 20)->default('general')->comment('전표유형'); + $table->string('description', 500)->nullable()->comment('적요'); + $table->bigInteger('total_debit')->default(0)->comment('차변합계'); + $table->bigInteger('total_credit')->default(0)->comment('대변합계'); + $table->string('status', 20)->default('draft')->comment('상태: draft, confirmed'); + $table->string('created_by_name', 100)->nullable()->comment('작성자명'); + $table->text('attachment_note')->nullable()->comment('첨부메모'); + $table->timestamps(); + $table->softDeletes(); + + $table->unique(['tenant_id', 'entry_no']); + $table->index(['tenant_id', 'entry_date']); + $table->index(['tenant_id', 'status']); + }); + } + + public function down(): void + { + Schema::dropIfExists('journal_entries'); + } +}; diff --git a/database/migrations/2026_02_06_300001_create_journal_entry_lines_table.php b/database/migrations/2026_02_06_300001_create_journal_entry_lines_table.php new file mode 100644 index 0000000..84f9faa --- /dev/null +++ b/database/migrations/2026_02_06_300001_create_journal_entry_lines_table.php @@ -0,0 +1,40 @@ +id(); + $table->unsignedBigInteger('tenant_id'); + $table->unsignedBigInteger('journal_entry_id'); + $table->smallInteger('line_no')->comment('행번호'); + $table->string('dc_type', 10)->comment('차대구분: debit/credit'); + $table->string('account_code', 10)->comment('계정코드'); + $table->string('account_name', 100)->comment('계정명'); + $table->unsignedBigInteger('trading_partner_id')->nullable()->comment('거래처ID'); + $table->string('trading_partner_name', 100)->nullable()->comment('거래처명'); + $table->bigInteger('debit_amount')->default(0)->comment('차변금액'); + $table->bigInteger('credit_amount')->default(0)->comment('대변금액'); + $table->string('description', 300)->nullable()->comment('적요'); + $table->timestamps(); + + $table->foreign('journal_entry_id') + ->references('id') + ->on('journal_entries') + ->onDelete('cascade'); + + $table->index(['journal_entry_id', 'line_no']); + $table->index(['tenant_id', 'account_code']); + }); + } + + public function down(): void + { + Schema::dropIfExists('journal_entry_lines'); + } +};