Give us contact

Do you prefer to ask us directly?

Call us +420 605 203 938 (the Czech Republic)

or use this contacts

AyMINE

Related links


FI - Finance Management

Support for various field types in reports

How to make reports – automated data formating

Icons

Icons could be stored as the real svg icon or name of the icon that is supported by AyMINE (including icons defined by modules). However, icon type could also defined complex icons created by icon arithmetics methods.

AyMINE server works only with internal icons and does not support the arithmetics that is supported by the application. loaded from object field is prepared for report by function:

stringFunctions::getValidIcon(string|null $iconName, string|null $defIconName = null) : string 

Usage in the getReport (or any other method that generates report):

$obj->icon = stringFunctions::getValidIcon($obj->icon, '<default object icon name>');

The same usage logic have all methods supporting the field conversion.

Markdown formatted text

AyMINE internally uses the markdown format for formated documents. TCPDF doesn't support the markdown format so that all formated texts (internally stored in the fields with mdText type) should be converted.

Markdown the html is converted by the method:

stringFunctions::MDtoHTML(string $markdown) : string 

Conversion methods supports:

  • conversion of the markdown with inserted html tags and images
  • conversion markdown-style defined tables
  • source code in the ` commas.

Markdown format in the AyMINE support storing the system-defined icons in the AyMINE format (@<icon name>SVG). Markdown conversion to the html does not convert the AyMINE icons but report generator converts them automatically. It is usually not necessary to bother about icons conversion. However, when it is for some reason necessary, it can be converted manully calling method:

stringFunctions::parseIconName (
   string &$str,  // string to convert – string is update by method
   fOutputFormat $outFormat = fOutputFormat::htmlReport   // output report format
   ) : void;   // does not return converted string

Date / DateTime

Date and datetime data fields should always be formated to the language-specific format according to the language used for report.

When report is manually defined, method should call the formating method:

Date without time:

$obj->$field = DT::dForHuman (
   $obj->$field,     // value from database to format
   $rep->lang,       // report language
   false);           // true = long date format, false = shor date format

Date with time:

$obj->$field = DT::dtForHuman($obj->$field, $rep->lang, false);

Time intervals could be translated as two date & time values, but better result provide method for time interval formating:

public static function dtInterval ($dtFrom, $dtTo, fLanguage $lang, bool $prefDays = true): string
public static function dInterval ($dtFrom, $dtTo, fLanguage $lang): string

Interval method checks how long is the intervala and makes formated output only for single-day interval, e.g.

5.2.2022 8:00 – 10:00

Optional attribute prefDays says if longer interval than 24 hours are reported only in days and hours/minutes are disregarded.

Counters (Enum type) fields

Counter fields are system-defined or client-defined. (User-defined counters are currently not supported.) Each of them had different usage and data storage.

System counters (type enum)

System counters are defined by application including translation strings and icons related with the fields. Value stored in the field (typically 2 characters, but it could be number or arbitrary string) should always be converted to the readable form, beacuse stored value is not understandable for reader.

Use fucntion langProvider::setEnum to convert the system enum:

langProvider::setEnum (
   string $module,       // module that defines the counter
   string $enum,         // counter name
   string|null &$short,  // short values stored in the object 
   fLanguage $lang,      // language used by report
   enumFormat $enFormat = enumFormat::IT   // output format
): void

Method changes value in the $short to the converted. If value should be stored in another field, use langProvider::setEnum that does not change $ref and returns value

langProvider::getString (
   string $module,
   string $ref,                    // short value from object field
   fLanguage|null $lang = null,    // when $lang not used, method uses the language prefred by logged client
   bool $undefEmpty = false ): string

Counter output format (enumFormat)

Output format is defined by enum record with values:

  • IT – Returns icon and then text description
  • I – Returns only icon related with the counter value
  • T – Returns only text description
  • TI – Return text description followed by icon

Remeber: Icons are returned in the AyMINE format – see more in the section about markdown.

Client-defined counters (type userEnum)

Values from this type of enum are directly placed to the object field. They are placed to the report in the same way as regular string fields. They doesn't support any translation.

Multi-counters (type multiEnum)

Multi-counter of the client-defined fields (type multiUserEnum)

AyMINE application ocasionnally prints the fields from the multiUserEnum fields with icons. Theses icons are used in case that system has defined icon with the same name as is used in the counter field and there is no direct linke to the icon. Theses auto-linked icons are not yet supported by reports

Example: Marks of the attributes like legal Safety are printer in the application: Legal and safety. Both icons has name of the field and are placed automatically to the field name. Ttranslation of the icon names are not yet supported. (e.g. german field value Sicherheits won't get any icon).

Client-defined tree-type enum (type userTreeEnum)

This type of enum doesn't have any support yet