Conversation
payrolls に child_and_childcare_support を追加し、tax_jp 経由の額を給与計算・ 集計・自動仕訳(預り金・法定福利費)および入力・一覧に載せる。
デフォルト所属の branch_employee が増えたことで、費用配賦の按分件数・金額の 期待値を追随させる。
適用月の有無、厚生年金上限との関係、自動仕訳明細の有無を押さえる。
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces support for the “子ども・子育て支援金” starting 2026-04 across payroll calculation, journaling, reporting, and HR payroll UI so the new deduction/expense is computed, stored, displayed, and included in withholding-tax outputs.
Changes:
- Add a
child_and_childcare_supportfield to payrolls and incorporate it into social insurance totals and finder aggregates. - Compute the new support amount in
TaxUtils(monthly vs. bonus basis) and generate corresponding auto-journal lines (employee + company share). - Update HR payroll screens, withholding-tax report logic, and add/adjust tests + fixtures.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/models/tax_utils_test.rb | Adds unit tests for support amount behavior across effective dates and grade basis. |
| test/models/payroll_test.rb | Tests bonus insurance salary truncation + 1.5M cap behavior. |
| test/models/auto/journal/payroll_factory_test.rb | Validates journal detail creation/non-creation for the new support lines by YM. |
| test/helpers/hr/payroll_helper_test.rb | Ensures helper-driven auto-calculation includes the new support deduction. |
| test/fixtures/branch_employees.yml | Adds default branch fixture for employee 10 used in new tests. |
| test/controllers/journals_controller/allocated_cost_test.rb | Updates expectations impacted by fixture headcount change. |
| db/schema.rb | Reflects new payroll column and schema version bump. |
| db/migrate/20260403120000_add_column_child_and_childcare_support_on_payrolls.rb | Adds child_and_childcare_support column with default 0. |
| app/views/hr/payrolls/index.html.erb | Displays the new deduction row in payroll index totals. |
| app/views/hr/payrolls/_form.html.erb | Adds editable field + JS auto-fill for monthly payroll form. |
| app/views/hr/payrolls/_form_bonus.html.erb | Adds editable field + JS auto-fill for bonus payroll form. |
| app/utils/tax_utils.rb | Implements support amount assignment (monthly overwrite based on health grade; bonus based on salary). |
| app/models/reports/withholding_tax/detail_logic.rb | Includes support amount in “社会保険料等の金額” calculation. |
| app/models/payroll.rb | Adds validation, integrates deduction into totals, computes employee share, adds journal lookup helpers, caps bonus basis. |
| app/models/payroll_info/payroll_logic.rb | Adds support aggregation and includes it in exemption totals. |
| app/models/payroll_finder.rb | Includes support in annual/monthly rollups used by UI. |
| app/models/insurance.rb | Adds accessors for support all/half values on Insurance. |
| app/models/auto/journal/payroll_factory.rb | Generates debit/credit journal details for company/employee support shares and includes it in accrued expense calc. |
| app/controllers/hr/payrolls_controller.rb | Returns support in auto-calc JSON and permits it in strong params. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.