Skip to content

refs #356 部門コード重複時に別部門を参照しうる自動仕訳を Branch ID 基準に修正#370

Open
aomrikti wants to merge 3 commits into
masterfrom
i356
Open

refs #356 部門コード重複時に別部門を参照しうる自動仕訳を Branch ID 基準に修正#370
aomrikti wants to merge 3 commits into
masterfrom
i356

Conversation

@aomrikti

Copy link
Copy Markdown
Collaborator

code から部門を引く処理をやめ、明細の branch_id / sub_account_id を直接使うよう 4ファクトリを変更。部門補助の code 一意チェックをスキップ。
テストデータを first_boot に合わせ、 アサーションをbranch_id基準に修正。

code から部門を引く処理をやめ、明細の branch_id / sub_account_id を直接使うよう
4ファクトリを変更。部門補助の code 一意チェックをスキップ。
テストデータを first_boot に合わせ、 アサーションをbranch_id基準に修正。
Copilot AI review requested due to automatic review settings June 30, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

部門コードが重複するケースで、自動仕訳が「部門コードから部門を引く」ことで誤った部門を参照しうる問題を、明細の branch_id / sub_account_id(= Branch ID)を基準に扱うよう修正するPRです。あわせて、部門補助の code 一意チェックをスキップし、テストデータとアサーションを Branch ID 基準に更新しています。

Changes:

  • 自動振替(内部取引/費用配賦/資産配賦)で、部門補助科目の参照を「code→補助科目」から「Branch ID(branch.id / @src_jd.branch_id)」へ変更
  • 仮負債精算で、資産明細の部門決定を「sub_account(code)→Branch(code)」から「sub_account_id(Branch ID)を直接使用」へ変更
  • 部門補助(SUB_ACCOUNT_TYPE_BRANCH)の補助コード重複チェックをスキップし、テスト/fixture を Branch ID 前提へ更新

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/models/auto/transfer_journal/branch_code_duplication_test.rb 部門コード重複時でも transfer が Branch ID を使うことを確認する新規テスト追加
test/models/auto/journal/temporary_debt_factory_test.rb 仮負債精算が sub_account_id(Branch ID) を使うことを確認する新規テスト追加
test/data/journal_details.csv 仮負債明細の sub_account_id を Branch ID に合わせて更新
test/data/accounts.csv 関連勘定科目の sub_account_type を部門(8)へ更新
test/controllers/journals_controller/auto_test.rb 配賦系の sub_account_id アサーションを Branch ID 基準に更新
app/models/validators/unique_sub_accounts_validator.rb 部門補助の code 一意チェックをスキップ
app/models/auto/transfer_journal/internal_trade_factory.rb 部門補助科目を code lookup せず branch.id を設定
app/models/auto/transfer_journal/allocated_cost_factory.rb 部門補助科目を code lookup せず branch.id を設定
app/models/auto/transfer_journal/allocated_assets_factory.rb 部門補助科目を code lookup せず @src_jd.branch_id を設定
app/models/auto/journal/temporary_debt_factory.rb 資産明細の branch を sub_account_id(Branch ID)から直接決定

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/models/auto/journal/temporary_debt_factory_test.rb Outdated
Comment thread test/models/auto/transfer_journal/branch_code_duplication_test.rb Outdated
Comment thread test/models/auto/transfer_journal/branch_code_duplication_test.rb Outdated
Comment thread test/models/auto/journal/temporary_debt_factory_test.rb Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants