Anbei die Basis SQL die der SOVA Service für die Rechnungsübertragung benutzt.
Stand 18.06.2019
SQL Header
select
abk.*,
k.uid as UID,
pfkid.sel1 as ABS_UID
from bp10abk abk
left join g01ko k on k.idr = abk.kid
left join g01places pfkid on pfkid.idr = abk.idpfkid
where abk.idr = :IDABK
SQL Header PDF
select idr, pdf_re
from bp10abkdata
where idr = :IDABK
SQL POS
select
p.*,
bwv2.antnreinrichtung,
replace(bwv.kl_svnr,'-','') as SVNR,
(select first 1 gz.gmkz
from g25gmkz gz
where gz.land = pg.land and gz.plz = pg.plz) gmkz,
prod.text as PROD_TEXT,
tc.codeland as TARCODE,
th.name as TH_NAME
from bp10abk_pos p
join bp01erf e on e.idr = p.iderf
join gp01bw bw on bw.idr = e.idbw
join gp01bwv bwv on bwv.idr = bw.idbwv
join gp01bwv2 bwv2 on bwv2.idr = bw.idbwv
join gp08prod prod on prod.idr = e.prodid
join gp06tarcode tc on tc.idr = e.tarcodeid
join gp02th th on th.idr = e.thid
join gp03pg pg on pg.idr = e.pgid
where p.idabk = :IDABK
order by p.abk_pos