ALTER VIEW "DBA"."objects_export_standard"( )
AS select
DBA.RO_Obj_GetObjectLocation(ident, DBA.RO_Obj_GetDate4Location()) as Station,
dist_mark as Kennzeichen,
obj_no as ObjNr,
grouping as Tarifgruppe,
car_label as Hersteller,
car_modell as Modell,
car_modellspec as Modellspezifikation,
hsn as HSN,
tsn as TSN,
chassis_no as Fahrgestellnummer,
date_license as Zulassung,
date_registration as Meldedatum,
(if DBA.RO_Obj_GetMiscObjectInfo(ident, 'note', 1) = 1 then 'Ja' else 'Nein' endif) as Notizen,
if cleanliness = 0 then 'schmutzig' else (if cleanliness = 1 then 'geht so' else (if cleanliness = 2 then 'sauber' else 'sehr sauber' endif) endif) endif as Sauberkeit,
fuel_percent as Tankstand,
kind_of_fuel as Kraftstoffart,
mileage as Kilometerstand,
(select con_no from dba.contractview where conobj_ident = dba.RO_Obj_GetCurrentCheckoutConobjIdent(objects.ident)) as VeNr,
(select trim(firstname + ' ' + name1) from dba.contractview where conobj_ident = dba.RO_Obj_GetCurrentCheckoutConobjIdent(objects.ident)) as VeMieter,
ident
from dba.objects