Repository navigation
Conversation
Share capped/OOP assessment arithmetic with OCA salary rules; retain confirmed monthly facts for per-fund MVP and historical regularity in MVP/VPP. Coordinate sources and confirmation under repeatable-read, preserve native refunds and expose adapter hooks for reviewed corrections. Validate with 195 native tests and repeated ordinary-officer Slovak HTTP/XSD workflows. Assisted-by: OpenAI Codex
A prorated rule category can retain fractional cents while the payslip and ledger record a currency-rounded GROSS. Derive the actual monetary income before applying statutory assessment-base rounding; verify 765.22 income and 107.13 employer pension premium. The clean native assembly passes 196 tests. Assisted-by: OpenAI Codex
Keep ordinary monthly evidence from accepting nonzero remuneration outside its insured relationship. Cover unconfirmed historical income, skip-compute confirmation and chart/journal setup with installed accounting. Assisted-by: OpenAI Codex
Validate optional feature facts through the same monthly retained source before skip-compute confirmation. Clean198 tests and actual officer HTTP/SK/XSD pass. Assisted-by: OpenAI Codex
Retain accepted sickness entitlement and average-time guidance alongside the retained-source extension hook. Assisted-by: OpenAI Codex
bf9c44d to
6f2017b
Compare
|
Thank you for this. Writing the per-fund bases into the MVP is the right fix, and the arithmetic matches Act 461/2003. The OOP comes off before the maximum base (§ 138a), and only for pension, disability and the reserve fund. Accident insurance stays uncapped and guarantee insurance takes no OOP. Only the employee cap is prorated for a part-month, which matches what our engine already does under § 138 ods. 13. The dated OOP values (200 € to 2026, 300 € from 2027) are the same in both engines. The rule's premium flooring and We applied the branch on current 19.0. The only conflicts were in the version lines, the changelogs and the docs, because #39/#40 have been merged since. We ran it under sk_SK on both engines, compared against a 19.0 baseline, and also ran your branch head as published. On Enterprise the existing MVP/VPP suites are unchanged (0 failures). On Community, see point 7 for the test results. The main question is how this fits the design we agreed in #25 and asked for on #34. Several of the points below depend on the answer. Design
Correctness
Conventions
Suggested split The PR would be easier to land in two parts, each mergeable on its own. (a) The shared record mechanism with the social funds, the OCA bridge, the fallback/refusal policy and consolidation (points 1 to 5). (b) The confirmation and source-locking controls (point 8, plus the locks on payslip children and state). (b) is where most of the new restrictions on existing payroll workflows are, and we would like to review it separately. |
|
Thank you for the detailed review and for exercising both engines. I have read all fourteen points. The published head still has the old split storage; I am replacing that design rather than asking you to merge two evidence mechanisms. The local rework already captures each rule's actual base/rate/amount for both health and social funds, including irregular agreements, and uses a common declaration reader. It retains the old evidence read-only instead of requiring confirmed historical payslips to be recomputed. The monthly-original warning policy and native original/refund/replacement path are also being exercised. This is still work in progress, not a claim that the revised PR is ready. Following the clarification in #34, the local base now owns the abstract mixin and generic checks, while the engine bridge owns the JSON/storage fields. The declaration framework exposes the plural accessor. VPP reads its eleven actual fund bases; historical ELDP reads employee pension bases. Missing evidence uses the named legacy warning for monthly originals and historical original ELDP, with strict corrective filings. Missing metadata from a customised rule no longer blocks payroll confirmation; inconsistent evidence still raises. XML attribute mappings stay in each declaration. The shared Community suite passed 331 tests and the base without an engine passed 64 tests. A real model upgrade retained an existing confirmed payslip's JSON, confirmation timestamp and salary facts, and both archived XML hashes. This does not establish cumulative multi-payslip payroll correctness: independent monthly sources still need the agreed warning policy until a reviewed cumulative calculation exists. I will submit the core as a new PR referencing #34 and #37, followed by the dependent calendar/declaration changes; these local changes are not yet ready for review. I will keep the confirmation/source-locking changes in a separate reviewable contribution, restrict the coordinator to relevant Slovak sources, and cover non-request retry/cleanup and language-independent fixtures. I have also recorded the requested changelog, formatting, citations and seasonal-deduction extensibility changes. For the test-revision question: the Community runs use OCA/payroll There is one additional small statutory rounding fix in #42: § 138(13) daily-cent flooring before multiplying a partial month's days. Its base-only tests and actual OCA premium test pass independently of this rework. It does not alter employer limits or historical records. |
|
Closing this one as superseded: the per-fund bases it kept for the MVP are now recorded natively by the shared fund core from #43 (merged into our 19.0 as 7e880561, with the Enterprise recorder since), and the OOP-before-maximum part landed as #48. A declaration that files from the recorded bases will come with your stacked work (votrelec#9 onwards). Thank you. |
Regular OCA payroll currently exports GROSS into every MVP assessment field. A EUR25,000 wage therefore exports EUR25,000 even for capped funds, and pensioner/student agreements export positive bases for exempt funds. This change makes the salary rules and retained monthly evidence use the same engine-neutral per-fund assessment helper, and makes MVP consume that evidence.
OOP is deducted before the applicable cap. Accident insurance remains uncapped; guarantee insurance does not use OOP. Employee/employer caps remain distinct for partial employment. PFP attributes are omitted when inapplicable. MVP and VPP read retained historical regularity, so a later HR-profile edit does not route historical pay into both declarations.
Confirmation checks effective versions, dated parameters, work/input rows and the actual salary-rule results, including both skip-compute settings. Confirmed sources remain protected after cancellation. Employee non-key epochs coordinate version inserts/edits and salary sources with confirmation under PostgreSQL repeatable-read without conflicting with deferred employee foreign keys. Independent monthly payslips cannot consume the same OOP/cap twice. Native refund bookkeeping and a subsequent replacement remain available; a bookkeeping refund alone is not a complete corrective monthly declaration.
The base helper has no payroll-engine dependency. The OCA adapter implements the retained-source hooks; the MVP/VPP modules remain engine-neutral. Engines without the hook keep their existing rendering: this PR does not claim to fix or certify the proprietary engine. Existing filed XML is preserved. Missing legacy OCA evidence requires an explicit reviewed compatibility adapter instead of reconstructing a base by dividing rounded premiums. Allocation/correction adapters can supply their own cumulative source and filter effective replacements. A within-month change of insurance profile requires separate consolidation support and is refused rather than silently merged.
Validation on Odoo19 in Docker:
These are calculation, lifecycle, source-consistency and schema checks; no actual authority filing or payment was made. Legal basis: sections138 and138a of Act461/2003; the verified 2026 examples use the corresponding dated parameters.
A further integration check reproduced a cent discrepancy for prorated income: the rule category retained765.217391 while the payslip/ledger recorded765.22. The shared fund helper now derives the currency-rounded income before statutory base rounding. The added native case verifies765.22 of pension base and107.13 employer premium. The final clean240-test suite passes; existing posted history is not recalculated.
Ordinary nonzero remuneration outside the employment period must use a reviewed historical income allocation; it cannot be retained as a regular monthly social-insurance source. The added lifecycle case retains an unconfirmed calculation, records the ended employment before confirmation and refuses the ordinary monthly source.
Updated on accepted upstream sync7bf7b663: the full payroll/base/OCA/MVP/VPP suite passes240 tests, and the real officer HTTP/Slovak/XSD workflow passes twice with identical XML bytes. Cooperating payroll features can add JSON-compatible retained inputs via
_l10n_sk_payroll_extra_source_facts; confirmation checks them even when recomputation is disabled. One independent extension-evidence case is included. Original confirmed sources remain unchanged.