dolibarr 23.0.3
blockedlog.lib.php File Reference

Library for common blockedlog functions. More...

Go to the source code of this file.

Functions

 blockedlogadmin_prepare_head ($withtabsetup)
 Define head array for tabs of blockedlog tools setup pages.
 
 isRegistrationDataSaved ()
 Return if the KYC mandatory parameters are set.
 
 getHashUniqueIdOfRegistration ()
 Return a hash unique identifier of the registration.
 
 isALNEQualifiedVersion ($ignoredev=0, $ignoremodule=0)
 Return if the version is a candidate version to get the LNE certification and if the prerequisites are OK in production to be switched to LNE certified mode.
 
 isALNERunningVersion ($blockedlogtestalreadydone=0)
 Return if the application is executed with the LNE requirements on.
 
 isBlockedLogUsed ($ignoresystem=0)
 Return if the blocked log was already used to block some events.
 
 pdfCertifMentionblockedLog (&$pdf, $outputlangs, $seller, $default_font_size, &$posy, $pdftemplate)
 Add legal mention.
 
 sumAmountsForUnalterableEvent ($block, &$refinvoicefound, &$totalhtamount, &$totalvatamount, &$totalamount, &$total_ht, &$total_vat, &$total_ttc)
 sumAmountsForUnalterableEvent
 

Detailed Description

Library for common blockedlog functions.

Definition in file blockedlog.lib.php.

Function Documentation

◆ blockedlogadmin_prepare_head()

blockedlogadmin_prepare_head ( $withtabsetup)

Define head array for tabs of blockedlog tools setup pages.

Parameters
string$withtabsetupAdd also the tab "Setup"
Returns
array<array{0:string,1:string,2:string}> Array of head

Definition at line 31 of file blockedlog.lib.php.

References $object, complete_head_from_modules(), and getDolGlobalString().

◆ getHashUniqueIdOfRegistration()

getHashUniqueIdOfRegistration ( )

Return a hash unique identifier of the registration.

Returns
string Hash unique ID (used to idenfiy the registration without disclosing personal data)

Definition at line 114 of file blockedlog.lib.php.

References dol_hash().

◆ isALNEQualifiedVersion()

isALNEQualifiedVersion ( $ignoredev = 0,
$ignoremodule = 0 )

Return if the version is a candidate version to get the LNE certification and if the prerequisites are OK in production to be switched to LNE certified mode.

The difference with isALNERunningVersion() is that isALNEQualifiedVersion() just checks if it has a sense or not to activate the restrictions (it is not a check to say if we are or not in a mode with restrictions activated, but if we are in a context that has a sense to activate them). It can be used to show warnings or alerts to end users.

Parameters
int<0,1>$ignoredev Set this to 1 to ignore the fact the version is an alpha or beta version
int<0,1>$ignoremodule Set this to 1 to not take into account if module BlockedLog is on, so function can be used during module activation.
Returns
boolean True or false

Definition at line 132 of file blockedlog.lib.php.

References $mysoc, and isModEnabled().

Referenced by BlockedLog\canBeDisabled(), BlockedLog\canBeEnabled(), modBlockedLog\getDesc(), and pdfCertifMentionblockedLog().

◆ isALNERunningVersion()

isALNERunningVersion ( $blockedlogtestalreadydone = 0)

Return if the application is executed with the LNE requirements on.

This function can be used to disable some features like custom receipts, or to enable others like showing the information "Certified LNE".

Parameters
int$blockedlogtestalreadydoneTest on blockedlog used already done
Returns
boolean True or false

Definition at line 166 of file blockedlog.lib.php.

References isBlockedLogUsed(), and isModEnabled().

Referenced by BlockedLog\create(), CommonInvoice\is_erasable(), CommonInvoice\isEditable(), and pdfWriteBlockedLogSignature().

◆ isBlockedLogUsed()

isBlockedLogUsed ( $ignoresystem = 0)

Return if the blocked log was already used to block some events.

Parameters
int<0,1>$ignoresystem Ignore system events for the test
Returns
boolean True if blocked log was already used, false if not

Definition at line 190 of file blockedlog.lib.php.

References dol_print_error(), dol_syslog(), and isModEnabled().

Referenced by BlockedLog\alreadyUsed(), modBlockedLog\alreadyUsed(), and isALNERunningVersion().

◆ isRegistrationDataSaved()

isRegistrationDataSaved ( )

Return if the KYC mandatory parameters are set.

Returns
boolean True or false

Definition at line 85 of file blockedlog.lib.php.

References $mysoc, and getDolGlobalString().

◆ pdfCertifMentionblockedLog()

pdfCertifMentionblockedLog ( & $pdf,
$outputlangs,
$seller,
$default_font_size,
& $posy,
$pdftemplate )

Add legal mention.

Parameters
TCPDF$pdfObject PDF
Translate$outputlangsObject lang
Societe$sellerSeller company
int$default_font_sizeDefault font size
float$posyY position
CommonDocGenerator$pdftemplatePDF template
Returns
int 0 if nothing done, 1 if a mention was printed

Definition at line 240 of file blockedlog.lib.php.

References isALNEQualifiedVersion().

Referenced by pdfCertifMention().

◆ sumAmountsForUnalterableEvent()

sumAmountsForUnalterableEvent ( $block,
& $refinvoicefound,
& $totalhtamount,
& $totalvatamount,
& $totalamount,
& $total_ht,
& $total_vat,
& $total_ttc )

sumAmountsForUnalterableEvent

Parameters
BlockedLog$blockObject BlockedLog
array<string,int>$refinvoicefound Array of ref of invoice already found (to avoid duplicates. Should be useless but just in case of)
array<string,array<string,float>>$totalhtamount Array of total per code event and module
array<string,array<string,float>>$totalvatamount Array of total per code event and module
array<string,array<string,float>>$totalamount Array of total per code event and module
float$total_htTotal HT
float$total_vatTotal VAT
float$total_ttcTotal TTC
Returns
int Return > 0

Definition at line 272 of file blockedlog.lib.php.