Repository navigation
Import: keep the member number of Handkassa lines - #98
Merged
Merged
Conversation
import.php read the "Mitgliedsnummer" column of the Handkassa format but reset the member number to 0 for every format before the member matching, so the number was always lost. A Handkassa number of one to nine digits greater than 0 is now kept: the line is that member's fee (member true, type 1, as for a name match) and is not matched by name or by a member name in the line. Other values (empty, signed, longer, 0, text) count as no number and the name matching runs as before. Other formats are unchanged. The reference recording loses the name lookup for the fixture's numbered Handkassa line; its INSERT is unchanged. Red test in tests/http-import.php, six mutants in the import-checks target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve CHANGELOG.md Unreleased conflict, keeping both entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Problem
import.phpreads theMitgliedsnummercolumn of the Handkassa format ($data[9]), but before the member matching the member number was reset to 0 for every format, so it was always lost.Change
preg_match('/^\d{1,9}$/D')+intval); anything else (empty,+9004, ten digits,0, text) counts as no number, as before.member = trueand type 1 (same as a successful name match; a negative amount still becomes type 28) and is not matched by name or by a member name in the line, so the given number wins. Lines without a number: name matching unchanged.person_typeis not stored by the import INSERT, so it is untouched.import-latin9-handkassa.sqlloses the name lookup for the fixture's numbered line (Testa Mitglied;9031); its INSERT is identical.Tests
tests/http-import.phpwith synthetic Handkassa lines (number + non-member name; zero-padded number + empty name with another member's name in the text; ten digits; signed; 0). Before the fix the first line was stored as memberf, number 0, type 8. Green after;ImportMemberMatchTest,ReceiptImportTestpass.--only): six new mutants intests/mutation/targets/import-checks.php: 6/6 killed.PGACC_COVERAGE_BASE=origin/master:import.php: 6 changed executable lines, all covered. That run also had anhttp-receipts.phpfailure ("revision in a deadlock returned HTTP 302"), which pulled the file.php and import2.php coverage floors down. The test doesn't touch this change; CI reruns it.🤖 Generated with Claude Code