Faktury zakupu nie zapłacone po terminie
warunek
case when convert(datetime, Dok.dok_PlatTermin)+1<convert(datetime, getDate()) and FinanseFW.nzf_Wartosc>0 then 1 else 0 end
dodatkowe tabele
left join nz__Finanse as FinanseFW on FinanseFW.nzf_IdDokumentAuto = Dok.dok_Id and FinanseFW.nzf_Typ = 40 and FinanseFW.nzf_Podtyp = 1