Collection of OCL Expressions
OCL expression for all entries
OCL expressions for addresses
OCL expressions for users
OCL expressions for projects / phases
OCL Expressions for Invoice Reports
OCL Expressions for Invoice Reports
OCL expressions for downpayments
OCL expressions with date operators
Timsession.allInstances->first.login. Returns the up-to-date logged-in user.objid (until Vertec 6.2.0.6 boldid). Returns the unique object ID number. This number is assigned consecutively for newly created objects and can therefore also be useful for sorting by creation order.creatormodifiercreationDateTimemodifiedDateTimeadresseintrag.person.firma.kontakt.paar.einfacheAdresse.adresseintrag->select(projekte->size>0)adresseintrag->select(stellung.asstring='CEO')adresseintrag->select(stellung.asstring='')adresseintrag->select(stellung.asstring<>'')adresseintrag->select(standardkanton='ZH')person->select(kontakte->size=0)adresseintrag->select(name.sqlLike('%wald%') or name.sqlLike('Treu%'))
The variant sqlLikeCaseInsensitive does the same comparison, but is not case sensitive; “and,” “or” and “not” are allowed (note brackets, always case sensitive).
if self.oclistypeof(Person) then self.oclastype(Person).vorname else if self.oclistypeof(Kontakt) then if self.oclastype(Kontakt).person->notempty then self.oclastype(Kontakt).person.vorname else self.oclastype(Kontakt).vorname endif else '' endif endif
if self.oclistypeof(Person) then self.oclastype(Person).name else if self.oclistypeof(Kontakt) then if self.oclastype(Kontakt).person->notempty then self.oclastype(Kontakt).person.name else self.oclastype(Kontakt).name endif else '' endif endif
if self.oclistypeof(Paar) then if self.oclastype(Paar).personA->notempty and self.oclastype(Paar).personB->notempty then if self.oclastype(Paar).personA.name.asstring = self.oclastype(Paar).personB.name.asstring then self.oclastype(Paar).personA.name else self.oclastype(Paar).personA.name + ' & ' + self.oclastype(Paar).personB.name endif else if self.oclastype(Paar).personA->notempty then if self.oclastype(Paar).personA.name.asstring = self.oclastype(Paar).nameb.asstring then self.oclastype(Paar).personA.name else self.oclastype(Paar).personA.name + ' & ' + self.oclastype(Paar).nameb endif else if self.oclastype(Paar).personB->notempty then if self.oclastype(Paar).namea.asstring = self.oclastype(Paar).personB.name.asstring then self.oclastype(Paar).namea else self.oclastype(Paar).namea + ' & ' + self.oclastype(Paar).personB.name endif else if self.oclastype(Paar).namea.asstring = self.oclastype(Paar).nameb.asstring then self.oclastype(Paar).namea else self.oclastype(Paar).namea + ' & ' + self.oclastype(Paar).nameb endif endif endif endif else if self.oclistypeof(Kontakt) then if self.oclastype(Kontakt).person->notempty then self.oclastype(Kontakt).person.name else self.oclastype(Kontakt).name endif else name endif endif
if self.oclastype(Paar).personA->notempty and self.oclastype(Paar).personB->notempty then self.oclastype(Paar).personA.vorname + ' & ' + self.oclastype(Paar).personB.vorname else if self.oclastype(Paar).personA->notempty then self.oclastype(Paar).personA.vorname + ' & ' + self.oclastype(Paar).vornameb else if self.oclastype(Paar).personB->notempty then self.oclastype(Paar).vornameA + ' & ' + self.oclastype(Paar).personB.vorname else self.oclastype(Paar).vornameA + ' & ' + self.oclastype(Paar).vornameb endif endif endif
if self.oclastype(Paar).personA->notempty and self.oclastype(Paar).personB->notempty then self.oclastype(Paar).personA.name + ' & ' + self.oclastype(Paar).personB.name else if self.oclastype(Paar).personA->notempty then self.oclastype(Paar).personA.name + ' & ' + self.oclastype(Paar).nameb else if self.oclastype(Paar).personB->notempty then self.oclastype(Paar).nameA + ' & ' + self.oclastype(Paar).personB.name else self.oclastype(Paar).nameA + ' & ' + self.oclastype(Paar).nameb endif endif endif
person->select(aktiv)->select(geburtsdatum.asstring<>'')->select(((date<=encodedate(date.year,geburtsdatum.month,geburtsdatum.day)) and(date>=encodedate(date.year,geburtsdatum.month,geburtsdatum.day).incday(-30)))or((date<=encodedate(date.year+1,geburtsdatum.month,geburtsdatum.day)) and (date>=encodedate(date.year+1, geburtsdatum.month,geburtsdatum.day).incday(-30))))
if ocliskindof(Kontakt) then self->oclastype(Kontakt)->asset->collect(x| if x.person->size>0 then if x.person.ismale then 'Male' else 'Female' endif else if x.ismale then 'Male' else 'Female' endif endif)->first else if ocliskindof(Person) then if oclastype(Person).ismale then 'Male' else 'Female' endif else '' endif endif
projektbearbeiterprojektbearbeiter->select(aktiv)Timsession.allInstances->first.loginprojektbearbeiter->select(eigprojekte->size>0)projektbearbeiter->select(stufe.asstring='Secretary')projektbearbeiter->select(kuerzel.asstring='')projektbearbeiter->select(kuerzel.asstring<>'')projektbearbeiter->groupleistungenb('01.01.2011', '31.12.2011','')
->collect(minutenintoffen + minutenintverrechnet)->sumself->groupleistungenB('1.1.2011', '31.12.2011', '')
->collect(s | (s.minutenextOffen-s.minutenextOffenUnprod+s.minutenextVerrechnet-s.minutenextVerrechnetUnprod)
/ (s.minutenIntVerrechnet+s.minutenIntOffen) *100)->sumprojekt or Projekt.allInstances (case sensitive)projektphase or Projektphase.allInstances (case sensitive).allePhasen.owningProjektprojekt->select(phasen->size=0)projekt->select(phasen->size>0)projekt->select(typ.produktiv)projekt->select(sprache.asstring='FR')projekt->select(aktiv)projekt->select(not aktiv)projekt->select(code->asset->collect(x|Projekt.allinstances->select(code=x)->size)->sum>1)projektphase->select(pauschal)projektphase->select(not verrechenbar)parentphasesubphasenparentlistparentlist->first you can access the top level in the tree.sublistoffertDatumerteiltDatumabschlussDatumabgelehntDatumThe individual status can be queried by a number (e.g. phasen->select(status=1)). The numbers of the individual status are as follows:
0: On offer
1: Accepted
2: Completed
3: Rejected
planMinutenIntsumMinutenIntplanWertExtsumWertExtplanWertIntsumLeistungWertIntplanKostenLeistungsumLeistungWertKostenplanSpesenWertsumSpesenWertplanKostenSpesensumKostenSpesenplanAuslagenWertsumAuslagenWertplanKostenAuslagensumKostenAuslagenplanMinutenIntsumMinutenIntplanWertExtsumWertExtplanWertIntsumWertIntplanKostenLeistungsumKostenLeistungplanSpesenWertsumSpesenWertplanKostenSpesensumKostenSpesenplanAuslagenWertsumAuslagenWertplanKostenAuslagensumKostenAuslagenIn addition to the budget values listed above, phase assignments have the following additional values:
Editor assignment |
|
| Allocation of activities |
|
| Expense type allocation |
|
| Expense type assignment |
|
buchungsbeleg->oclAsType(Beleg).buchungenFrom here you can now access the different values such as the
buchungsbeleg->oclastype(Beleg).buchungen->select(isthaben).betrag->sumrechnungvorschusslink->select(betragnetto<>0)->collect
(vorschuesse.bezeichnung + ': ' + betragnetto.asstring)->listtostring(' / ')Displays the designation of the downpayments and the respective amount, e.g. in a list column.
vorschuesseAufRechnungvorschuesseTo learn how to build Word reports, see Word reports. To learn what each field on the invoice means, see The invoice in OCL.
rechnungsadresstextdatumnummervon.asstringbis.asstringrechnungsbriefanrederechnungsgrussformelprojektprojekt.betreffendpauschalpauschalbetragleistwertextrabattBetragrabattProzenttotalRabattBetragleistmwstsatzleistmwstleistwertextmitmwstpauschalspesenbetrageffpauschalspesenbetragpauschalspesenprozentspesenextspesenext - pauschalspesenbetrageffspesenmwstspesenmwstsatzspesenextmitmwstauslagenextauslagenmwstspesenmwstsatzauslagenextmitmwstvorschussbetragvorschussmwstvorschussbetrag + vorschussmwstleistmwstsatzleistspesenextmitmwst + vorschussbetrag + vorschussmwsttotalwaehrungprojekt.projektleitertotal.floor.asstringif oclisKindOf(Container) then oclAsType(Container).eintraege
->list->oclAsType(Rechnung)->ordermulti('if xRechnungsadresse
->isEmpty then projekt.kunde.oclastype(Adresseintrag) else
xRechnungsadresse.oclastype(Adresseintrag) endif.standardplz')
else self->asset endifExpressions that query a condition, i.e. return YES or NO. Usually band expressions for 'cond’ bands (see Word reports).
von.asstring <> '' or bis.asstring <> ''(not pauschal) and (leistwertext <> 0)rabattrabattBetrag > 0rabattProzent > 0leistmwst > 0pauschalspesenpauschalspesenbetrag > 0pauschalspesenprozent > 0usespesenspesenext > 0(spesenext > 0) and usespesenspesenmwst > 0auslagenext > 0auslagenmwst > 0((spesenext > 0) and usespesen) or (auslagenext > 0)vorschussbetrag > 0vorschusseffektiv > 0vorschusseffektivmwst > 0vorschusseffektivmwstleistungen->orderby(boldid)->select(x|x.boldid=self.leistungen ->orderby(boldid)->select(ansatzext=x.ansatzext)->first.boldid)
Technically speaking, the expression makes a list of services, where each one has a different rate.
Within such a band you can then filter the services, e.g. with:
leistungen->select(bndAnsatz.ansatz=ansatz).wertext->sum
leistungen->orderby(boldid)->select(x|x.boldid=self.leistungen ->orderby(boldid)->select((ansatzext=x.ansatzext) and (typ=x.typ)) ->first.boldid)
Filter with:
leistungen->select(bndTaetigkeit.typ=typ) ->select(bndTaetigkeit.ansatz=ansatz).wertext->sum
rechnungvorschusslink->select(betragnetto<>0)->collect
(rechnungen.nummer.asstring + ': ' + betrag.asstring)->listtostring(' / ')Displays the invoice number and the respective amount, for example in a list column.
For information on the OCL date operators, click here.
nowdateOCL expression that calculates the calendar week:
date->asset->collect(x|(x.mondayofweek.incday(3).dateToFloat - encodedate(x.mondayofweek.incday(3).year,1,1).dateToFloat + 7).floor div 7)->first
Instead of date, any date value can be used.
OCL expressions that calculate the start date (date of Monday of this week) for any calendar week (of any year):
date.firstOfYear.incDay(3).mondayOfWeek.incDay(7*(kw-1))
date.firstOfYear.incDay(3).mondayOfWeek.incDay(7*(12-1))
encodeDate(jahr, 1, 4).mondayOfWeek.incDay(7*(kw-1))
encodeDate(2026, 1, 4).mondayOfWeek.incDay(7*(12-1))
formatdatetime: To format date and time values, the operator formatdatetime can be used. For example, this query represents the current time, in the format hours.minutes: now.formatdatetime('hh.mm'). For more information about formatdatetime, see OCL.
encodedate: For date queries, the operator encodeDate is used. Example: folder containing all invoices created in 2018: rechnung->select(datum >= encodeDate(2018,01,01)). For more information about encodeDate, see OCL.
rechnung->select(not bezahlt)->select(faelligdatum<=date.incday(-30))
person->select(aktiv)->select(geburtsdatum.asstring<>'')->select( ((date<=encodedate(date.year,geburtsdatum.month,geburtsdatum.day)) and(date>=encodedate(date.year,geburtsdatum.month,geburtsdatum.day) .incday(-30)))or((date<=encodedate(date.year+1,geburtsdatum.month, geburtsdatum.day)) and (date>=encodedate(date.year+1, geburtsdatum.month,geburtsdatum.day).incday(-30))))
adresseintrag->select(creationDateTime >= date.incDay(-360))