Skip to content

Print Form Expression Examples

Carbon Class

Methods:

  • "Carbon.parse('2021-10-14').addDays(65).format('d.m.Y')": "18.12.2021"

More detailed information about methods can be found here

RusNumberToString Class

Methods:

  • "RusNumberToString.stringify(1200.20)": "одна тысяча двести"
  • "RusNumberToString.getMoney(1200.20)": "одна тысяча двести рублей 20 копеек"
  • "RusNumberToString.getMoney(1200.00, false)": "одна тысяча двести рублей"
  • "RusNumberToString.getMainMoneyName(1200.20)": "рублей"
  • "RusNumberToString.getPartialMoney(1200.20)": "1200 копеек"
  • "RusNumberToString.getPartialMoneyName(1200.20)": "копеек"
  • "RusNumberToString.getProcentName(1200.20)": "процентов"
  • "RusNumberToString.getTextPartialMoney(1200.20)": "одна тысяча двести копеек"
  • "RusNumberToString.getProcent(1200.20, 3)": "одна тысяча двести целых, двести тысячных процента"
  • "RusNumberToString.getNumber(1200.20, 3)": "одна тысяча двести целых двести тысячных"

KazakhNumberToString Class

Methods:

  • "KazakhNumberToString.stringify(1200.20)": "бір мың екі жүз",
  • "KazakhNumberToString.getMoney(1200.20)": "бір мың екі жүз тенге 20 тиын",
  • "KazakhNumberToString.getMoney(1200.00, false)": "бір мың екі жүз тенге",
  • "KazakhNumberToString.getMainMoneyName(1200.20)": "тенге",
  • "KazakhNumberToString.getPartialMoney(1200.20)": "1200 тиын",
  • "KazakhNumberToString.getPartialMoneyName(1200.20)": "тиын",
  • "KazakhNumberToString.getProcentName(1200.20)": "пайыз",
  • "KazakhNumberToString.getTextPartialMoney(1200.20)": "бір мың екі жүз тиын",
  • "KazakhNumberToString.getProcent(1200.20, 3)": "бір мың екі жүз бүтін, екі жүз тысячных пайыз",
  • "KazakhNumberToString.getNumber(1200.20, 3)": "бір мың екі жүз бүтін екі жүз тысячных"

GeorgianNumberToString Class

Str Class

Documentation for methods https://laravel.com/docs/9.x/helpers#strings-method-list

phoneFormat Method

"phoneFormat(995322800011)": "+995 322 80 00 11"

Automatic phone formatting depending on the country code.

Custom variable example:

"formattedPhone": "phoneFormat(f.prop('contract.user.branch.legalEntity.telephone'))"

numberFormat Method

"numberFormat(1222100.10, 3, ',', ' ')": "1 222 100,100" , where:

  • 1st argument - number (1222100.10),
  • 2nd argument - number of significant digits after the decimal point (3)
  • 3rd argument - character for separating the integer part from the fractional part (','),
  • 4th argument - character for separating thousands (' ')

moneyFormat Method

"moneyFormat(1222100.10, 'rub')": "1 222 100,10 ₽"

num2Words Method

"num2Words('RU', 1222100.10, true)": "Один миллион двести двадцать две тысячи сто целых десять миллионов стомиллионных"

  • 1st argument - language
  • 2nd argument - number
  • 3rd argument - start with capital letter (Default - true)

floor Method

"floor(1222100.55)": 1222100

ceil Method

"ceil(1222100.30)": 1222101

round Method

"round(1222100.30)": 1222100

"round(1222100.50)": 1222101

fraction Method

"fraction(1222100.52)": "52"

strUcFirst Method

"strUcFirst(RusNumberToString.getMoney(1200.00, false))": "Одна тысяча двести рублей"

strpos Method

"strpos('var=5;sometext=10;', 'sometext=', 0)": 6

Documentation https://www.php.net/manual/en/function.strpos.php

BarCode Method

php
${BarCode(arg1,arg2):width:height}

Where,

BarCode(client.mobilePhone,CODE_128):300

BarCode(client.mobilePhone,CODE_128):200

QrCode Method

php
${QrCode(arg1)}

Where,

  • arg1 - Field from data that needs to be converted to a QR code

QrCode(client.mobilePhone)

Multiline Variables

Starting from PF release 6.9.0, you can also modify and use multiline variables in settings. The function f.prop('array._.var') returns an array of these variables

TIP

For example, let's assume the following variables exist:

array.0.var: 'Да'
array.1.var: 'Нет'
array.2.var: 'Да'
array.3.var: 'Да'

implode Method

"implode(', ', f.prop('array._.var'))": "Да, Нет, Да, Да"

where arguments:

  1. separator
  2. array of variables to join

array_map Method

"customVar": "array_map([Str,'upper'],f.prop('array._.var'))"

where arguments:

  1. method to call for each array element
  2. array of variables
"customVar.0": "ДА"
"customVar.1": "НЕТ"
"customVar.2": "ДА"
"customVar.3": "ДА"