[Feature request] CSV export: switch to per‑expense saldo format and remove reimbursement column#473
Open
Uli-Z wants to merge 4 commits intospliit-app:mainfrom
Open
[Feature request] CSV export: switch to per‑expense saldo format and remove reimbursement column#473Uli-Z wants to merge 4 commits intospliit-app:mainfrom
Uli-Z wants to merge 4 commits intospliit-app:mainfrom
Conversation
…th last-share remainder\n\nPreviously, participant shares were computed in major units and rounded per-participant before saldo calculation. For amounts like 1.01 split across 2 people, this caused mismatches (e.g. -0.51 and +0.50) where per‑row saldos did not add up due to early rounding.\n\nThis change mirrors app behaviour: compute shares in minor units (cents), distribute floor(amount*share/total) incrementally and assign the remainder to the last relevant participant. Saldos are derived from these integer shares and only formatted at the end. This fixes the erroneous rounding assignment and keeps totals consistent.
eb22c9e to
c7d7401
Compare
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.
Background
Discussion status and references:
Problem statement:
Proposed direction:
Cost=0.Why now:
Summary
This PR switches the CSV export to a per‑expense saldo format that aligns better with user expectations and spreadsheet workflows. Participant columns carry the net effect (saldo) of each expense. Reimbursements use
Cost=0, which removes the need for a dedicated reimbursement flag.Changes
Date,Description,Category,Currency,Cost,Original cost,Original currency,Conversion rate,Split mode,Paid By.Is Reimbursement(redundant once reimbursements useCost=0).Cost=0; participant saldos reflect direction/amount.Costvalues; participant saldos remain consistent.expenseDate, thencreatedAt).CSV Format (Descriptive)
Date,Description,Category,Currency,Cost,Original cost,Original currency,Conversion rate,Split mode,Paid By.saldo = totalAmount - ownShareAmount(advance for others).saldo = - ownShareAmount(owed to the payer).Cost = 0(internal transfer; not group spending).Cost(distribution to participants).Testing
Cost=0.Rationale
Is Reimbursementbecomes unnecessary withCost=0; totals remain correct and the transfer direction is visible in participant columns.Why remove the
Is Reimbursementcolumn?Cost=0keeps group totals correct without an extra flag.Evidence
Files for testing
testcases.csv
convert-csv-to-sentences.py