Skip to content

Commit

Permalink
RechnungJdbcService: fetch invoice number as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
kreinhard committed Dec 17, 2024
1 parent 884ff2c commit b4c78b8
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ class RechnungJdbcService {
it.auftragsPosition = AuftragsPositionDO().also { it.id = posId }
}
getLong(rs, "rechnung_fk")?.let { rechnungId ->
it.rechnung = RechnungDO().also { it.id = rechnungId }
val rechnungNummer = getInt(rs, "rechnung_nummer")
it.rechnung = RechnungDO().also {
it.id = rechnungId
it.nummer = rechnungNummer
}
}
}
}
Expand All @@ -149,8 +153,9 @@ class RechnungJdbcService {

companion object {
private val SELECT_RECHNUNG_ORDER = """
SELECT p.pk,p.deleted,p.rechnung_fk,p.number,p.menge,p.einzel_netto,p.vat,p.auftrags_position_fk
SELECT p.pk,p.deleted,p.rechnung_fk,p.number,p.menge,p.einzel_netto,p.vat,p.auftrags_position_fk,r.nummer as rechnung_nummer
FROM t_fibu_rechnung_position p
LEFT JOIN t_fibu_rechnung r ON p.rechnung_fk = r.pk
WHERE p.auftrags_position_fk IS NOT NULL
""".trimIndent()

Expand Down

0 comments on commit b4c78b8

Please sign in to comment.