Skip to content

Commit

Permalink
fix SQL statement für Prefill des Verrechnungskontos (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolot27 authored Jan 20, 2025
1 parent 7661d7b commit 683a719
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/de/jost_net/JVerein/server/DDLTool/Updates/Update0456.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,19 @@ public void run() throws ApplicationException
COLTYPE.BIGINT, 20, null, false, false)));

// Standard Verrechnungskonto setzen wie es auch bisher bestimmt wurde
execute("UPDATE einstellung SET verrechnungskonto = "
+ " (SELECT konto.id from konto"
+ " JOIN einstellung ON einstellung.iban LIKE CONCAT('%', konto.nummer)"
+ " ORDER by length(konto.nummer) DESC LIMIT 1)");
if (getDriver().equals(DRIVER.MYSQL))
{
execute("UPDATE einstellung INNER JOIN konto ON einstellung.iban LIKE "
+ "CONCAT('%', konto.nummer) SET verrechnungskonto = konto.id "
+ "WHERE konto.id IS NULL;");
}
else
{
execute("UPDATE einstellung SET verrechnungskonto = "
+ " (SELECT konto.id from konto"
+ " JOIN einstellung ON einstellung.iban LIKE CONCAT('%', konto.nummer)"
+ " ORDER by length(konto.nummer) DESC LIMIT 1)");
}
}
}
}

0 comments on commit 683a719

Please sign in to comment.