dolibarr 25.0.0-alpha
functions_fi.lib.php File Reference

A set of finish functions for Dolibarr This file contains rare functions. More...

Go to the source code of this file.

Functions

 dolFICalculatePaymentReference ($invoice_number, $statut, $use_rf)
 Calculate Creditor Reference RF / FI Bank payment reference number.
 
 dolFIGenerateInvoiceBarcodeData ($recipient_account, $amount, $bank_reference, $due_date)
 Calculate payment Barcode data with FI/RF bank payment reference number.
 
 dolFIGetInvoiceBarcodeData ($object)
 Build the finnish payment barcode data of an invoice.
 
 dolFIFormatVirtualBarcode ($barcodedata)
 Format the finnish payment barcode for reading, as banks print it.
 
 dolFIIsValidReference ($reference)
 Check that a string is a valid finnish national reference.
 

Detailed Description

A set of finish functions for Dolibarr This file contains rare functions.

Definition in file functions_fi.lib.php.

Function Documentation

◆ dolFICalculatePaymentReference()

dolFICalculatePaymentReference ( $invoice_number,
$statut,
$use_rf )

Calculate Creditor Reference RF / FI Bank payment reference number.

Parameters
string$invoice_numberInvoice number to generate payment reference
int$statutInvoice status, if draft (0), no reference generating
int$use_rffalse/(0) generate FI Bank payment reference true/(1) Generate European Reference number based on the global Structured Creditor Reference standard (SEPA RF creditor reference)
Returns
string String Payment reference number or RF creditor reference

Definition at line 38 of file functions_fi.lib.php.

References dol_strlen(), dol_substr(), dol_syslog(), and dolCreditorRefMod97().

Referenced by dolPayRefBuild().

◆ dolFIFormatVirtualBarcode()

dolFIFormatVirtualBarcode ( $barcodedata)

Format the finnish payment barcode for reading, as banks print it.

The virtual barcode is the same 54 digits shown as text, so a payer can type it into an online bank instead of scanning it. Banks group it in blocks of five.

Parameters
string$barcodedataBarcode data from dolFIGenerateInvoiceBarcodeData()
Returns
string Grouped string, or '' when the input is empty

Definition at line 207 of file functions_fi.lib.php.

Referenced by pdf_sponge\write_file().

◆ dolFIGenerateInvoiceBarcodeData()

dolFIGenerateInvoiceBarcodeData ( $recipient_account,
$amount,
$bank_reference,
$due_date )

Calculate payment Barcode data with FI/RF bank payment reference number.

Parameters
string$recipient_accountAccount number for pank payment
string$amountAmount of invoice payment
string$bank_referenceFI Payment reference number or RF creditor reference
int$due_datePayments due to date, as a timestamp
Returns
string String String for FI/RF Payment barcode

Definition at line 91 of file functions_fi.lib.php.

References date.

Referenced by dolFIGetInvoiceBarcodeData().

◆ dolFIGetInvoiceBarcodeData()

dolFIGetInvoiceBarcodeData ( $object)

Build the finnish payment barcode data of an invoice.

Reads the bank account, amount, reference and due date from the invoice so a PDF template or a mail substitution does not have to gather them itself.

Returns an empty string unless everything needed is present and valid, because a barcode built on partial data would still be scanned and paid.

Parameters
CommonInvoice$objectInvoice
Returns
string 54 character barcode data, or '' when not applicable

Definition at line 142 of file functions_fi.lib.php.

References $object, dol_strlen(), dol_strtoupper(), dol_substr(), dol_syslog(), dolFIGenerateInvoiceBarcodeData(), and getDolGlobalInt().

Referenced by pdf_sponge\write_file().

◆ dolFIIsValidReference()

dolFIIsValidReference ( $reference)

Check that a string is a valid finnish national reference.

A finnish reference is 4 to 20 digits. The last digit is a check digit over the preceding ones, weighted 7, 3, 1 from the right.

Parameters
string$referenceReference to check, spaces are ignored
Returns
bool True when the length and the check digit are right

Definition at line 225 of file functions_fi.lib.php.

References dol_strlen().

Referenced by dolPayRefBuild().