Skip to content

Commit

Permalink
Use dedicated transitory account for Mittagstisch (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
ursjoss authored Apr 29, 2024
1 parent 97a9ead commit f503723
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ The columns of the resulting accounting.csv file are defined as follows:
- `10920/20051`: Net Card income + tips (card) Mittagstisch [`Net Card MiTi` + `MiTi_Tips_Card`]
- `10920/10910`: Tips LoLa paid via Card [`Tips_Card` - `MiTi_Tips_Card`]
- `68450/10920`: Commission for Café, Vermietung, summer party, Deposit, Rental, Cultural Payments, and `PaidOut`, i.e. w/o Mittagstisch [`Commission LoLa`]
- `20051/10900`: Amount LoLa owes to Mittagstisch (`Debt to MiTi`)
- `20051/10930`: Amount LoLa owes to Mittagstisch (`Debt to MiTi`)
- `20051/30500`: Income LoLa from MiTi selling LoLa [`Gross MiTi (LoLa)` - `Contribution MiTi` = `Income LoLa MiTi`]


Expand All @@ -295,4 +295,4 @@ They serve for consolidation purposes:

Where the absolute net sum for the transitory accounts must not be > 0.05, i.e.:
- for `10920`: abs(`10920/30200` + `10920/30700` + `10920/30800` + `10920/23050` + `10920/46000` + `10920/31000` + `10920/32000` +`10920/20051` + `10920/10000` + `10920/10910` - `Payment SumUp` - `68450/10920`) < 0.05
- for `20051`: abs(`10920/20051` - `20051/10900` - `20051/30200`) < 0.05
- for `20051`: abs(`10920/20051` - `20051/10930` - `20051/30200`) < 0.05
6 changes: 3 additions & 3 deletions src/export/export_accounting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn gather_df_accounting(df: &DataFrame) -> PolarsResult<DataFrame> {
col("Net Card Total MiTi").alias("10920/20051"),
col("Tips Card LoLa").alias("10920/10910"),
col("LoLa_Commission").alias("68450/10920"),
col("Debt to MiTi").alias("20051/10900"),
col("Debt to MiTi").alias("20051/10930"),
col("Income LoLa MiTi").alias("20051/30500"),
])
.collect()
Expand Down Expand Up @@ -87,7 +87,7 @@ fn validate_acc_constraint_10920(df_acc: &DataFrame) -> Result<(), Box<dyn Error

/// validates the transitory account 10920 nets to 0
fn validate_acc_constraint_20051(df_acc: &DataFrame) -> Result<(), Box<dyn Error>> {
let net_expr = col("10920/20051") - col("20051/10900") - col("20051/30500");
let net_expr = col("10920/20051") - col("20051/10930") - col("20051/30500");
validate_constraint(df_acc, net_expr, "20051")?
}

Expand Down Expand Up @@ -563,7 +563,7 @@ mod tests {
"10920/20051" => &[net_card_income_plus_tips_miti_card],
"10920/10910" => &[tips_lola_paid_via_card],
"68450/10920" => &[Some(commission_lola)],
"20051/10900" => &[debt_to_miti],
"20051/10930" => &[debt_to_miti],
"20051/30500" => &[income_lola_miti],
)?;
match validate_acc_constraint(&df) {
Expand Down
2 changes: 1 addition & 1 deletion src/test_fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub fn accounting_df_03(sample_date: NaiveDate) -> DataFrame {
"10920/20051" => &[189.25],
"10920/10910" => &[0.0],
"68450/10920" => &[17.99],
"20051/10900" => &[145.76],
"20051/10930" => &[145.76],
"20051/30500" => &[42.49],
)
.expect("Valid accounting df 03")
Expand Down

0 comments on commit f503723

Please sign in to comment.