|
dolibarr 24.0.0-beta
|
Library for common blockedlog functions. More...
Go to the source code of this file.
Functions | |
| getBlockedLogVersionToShow () | |
| Define head array for tabs of blockedlog tools setup pages. | |
| blockedlogadmin_prepare_head ($withtabsetup) | |
| Define head array for tabs of blockedlog tools setup pages. | |
| isRegistrationDataSaved () | |
| Return if the KYC mandatory parameters are set Must be the same fields than the one defined as mandatory into the registration form. | |
| isRegistrationDataSavedAndPushed () | |
| Return if the KYC mandatory parameters are set AND pushed/registered centralized server. | |
| getHashUniqueIdOfRegistration ($algo='sha256') | |
| Return a hash unique identifier of the registration (used to identify the registration of instance without disclosing personal data) | |
| 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, $blockedlogmodulealreadydone=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 | |
| callApiToGetObfuscationKey ($idprof1, $registrationnumber, $force=false) | |
| Call remote API service to get the obfuscation key. | |
| userIsTaxAuditor () | |
| Call remote API service to push the last counter and signature. | |
| pdfWriteBlockedLogSignature (&$pdf, $outputlangs, $page_height, $object, &$w, &$posx, &$posy) | |
| Add some information from the blockedlog module. | |
| migrate_blockedlog_add_end_file () | |
| Migrate an old database to add the .end flag. | |
Library for common blockedlog functions.
Definition in file blockedlog.lib.php.
| blockedlogadmin_prepare_head | ( | $withtabsetup | ) |
Define head array for tabs of blockedlog tools setup pages.
| int | $withtabsetup | Add also the tab "Setup" |
Definition at line 53 of file blockedlog.lib.php.
References $conf, $db, $mysoc, $object, complete_head_from_modules(), dol_dir_list(), getDolGlobalString(), getMultidirOutput(), GETPOST(), and userIsTaxAuditor().
| callApiToGetObfuscationKey | ( | $idprof1, | |
| $registrationnumber, | |||
| $force = false ) |
Call remote API service to get the obfuscation key.
This function is only called by blockedlog->getObfuscationKey();
| string | $idprof1 | Counter ID/value of ne record |
| string | $registrationnumber | Registration number |
| boolean | $force | False. Use true for tests. |
Definition at line 412 of file blockedlog.lib.php.
References $conf, $mysoc, dol_now(), dol_print_date(), dol_sanitizeKeyCode(), dol_syslog(), getBlockedLogVersionToShow(), getDolGlobalString(), getHashUniqueIdOfRegistration(), and getURLContent().
Referenced by BlockedLog\getObfuscationKey().
| getBlockedLogVersionToShow | ( | ) |
Define head array for tabs of blockedlog tools setup pages.
Definition at line 34 of file blockedlog.lib.php.
Referenced by callApiToGetObfuscationKey().
| getHashUniqueIdOfRegistration | ( | $algo = 'sha256' | ) |
Return a hash unique identifier of the registration (used to identify the registration of instance without disclosing personal data)
| string | $algo | Algorithm to use for hash key |
Definition at line 186 of file blockedlog.lib.php.
References $conf, and dol_hash().
Referenced by callApiToGetObfuscationKey(), BlockedLog\getObfuscationKey(), and printCodeForPing().
| 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.
| int<0,1> | $ignoredev Set this to 1 to ignore the fact the version is an alpha or beta version (to avoid return false on such 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. |
Definition at line 204 of file blockedlog.lib.php.
References $mysoc, and isModEnabled().
Referenced by BlockedLog\canBeDisabled(), BlockedLog\canBeEnabled(), modBlockedLog\getDesc(), modBlockedLog\init(), and pdfCertifMentionblockedLog().
| isALNERunningVersion | ( | $blockedlogtestalreadydone = 0, | |
| $blockedlogmodulealreadydone = 0 ) |
Return if the application is executed with the LNE requirements on.
This function can be used to block some features like custom receipts, or to enable others like showing the information "Certified LNE".
| int | $blockedlogtestalreadydone | Test on blockedlog used already done and we suppose it is true. |
| int | $blockedlogmodulealreadydone | Test on blockedlog module already done and we suppose it is true. |
Definition at line 240 of file blockedlog.lib.php.
References isBlockedLogUsed(), and isModEnabled().
Referenced by BlockedLog\buildFinalSignatureHash(), BlockedLog\create(), modBlockedLog\init(), CommonInvoice\is_erasable(), CommonInvoice\isEditable(), CommonInvoice\isReplacable(), migrate_blockedlog_add_end_file(), pdfWriteAlreadyPaid(), pdfWriteBlockedLogSignature(), and dolReceiptPrinter\sendToPrinter().
| isBlockedLogUsed | ( | $ignoresystem = 0 | ) |
Return if the blocked log was already used to block some events.
| int<0,1> | $ignoresystem Ignore system events for the test |
Definition at line 265 of file blockedlog.lib.php.
References $conf, $db, dol_print_error(), dol_syslog(), and isModEnabled().
Referenced by BlockedLog\alreadyUsed(), modBlockedLog\alreadyUsed(), and isALNERunningVersion().
| isRegistrationDataSaved | ( | ) |
Return if the KYC mandatory parameters are set Must be the same fields than the one defined as mandatory into the registration form.
Definition at line 143 of file blockedlog.lib.php.
References $mysoc, and getDolGlobalString().
Referenced by isRegistrationDataSavedAndPushed().
| isRegistrationDataSavedAndPushed | ( | ) |
Return if the KYC mandatory parameters are set AND pushed/registered centralized server.
Definition at line 174 of file blockedlog.lib.php.
References getDolGlobalString(), and isRegistrationDataSaved().
| migrate_blockedlog_add_end_file | ( | ) |
Migrate an old database to add the .end flag.
Definition at line 668 of file blockedlog.lib.php.
References $conf, $db, $mysoc, dol_print_date(), dolChmod(), dolEncrypt(), isALNERunningVersion(), and string.
| pdfCertifMentionblockedLog | ( | & | $pdf, |
| $outputlangs, | |||
| $seller, | |||
| $default_font_size, | |||
| & | $posy, | ||
| $pdftemplate ) |
Add legal mention.
| TCPDF | Object PDF | |
| Translate | $outputlangs | Object lang |
| Societe | $seller | Seller company |
| int | $default_font_size | Default font size |
| float | $posy | Y position |
| CommonDocGenerator | $pdftemplate | PDF template |
Definition at line 315 of file blockedlog.lib.php.
References isALNEQualifiedVersion().
Referenced by pdfCertifMention().
| pdfWriteBlockedLogSignature | ( | & | $pdf, |
| $outputlangs, | |||
| $page_height, | |||
| $object, | |||
| & | $w, | ||
| & | $posx, | ||
| & | $posy ) |
Add some information from the blockedlog module.
| TCPDF | Object PDF | |
| Translate | $outputlangs | Object lang for output |
| float | $page_height | Height of page |
| Facture | $object | Object invoice |
| int | $w | Width for text |
| float | $posx | Pos x |
| float | $posy | Pos y |
Definition at line 614 of file blockedlog.lib.php.
References $db, $object, dol_trunc(), isALNERunningVersion(), and isModEnabled().
Referenced by pdfWriteAdditionnalTitle().
| sumAmountsForUnalterableEvent | ( | $block, | |
| & | $refinvoicefound, | ||
| & | $totalhtamount, | ||
| & | $totalvatamount, | ||
| & | $totalamount, | ||
| & | $total_ht, | ||
| & | $total_vat, | ||
| & | $total_ttc ) |
sumAmountsForUnalterableEvent
| BlockedLog | $block | Object 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_ht | Total HT |
| float | $total_vat | Total VAT |
| float | $total_ttc | Total TTC |
Definition at line 355 of file blockedlog.lib.php.
| userIsTaxAuditor | ( | ) |
Call remote API service to push the last counter and signature.
| int | $id | Counter ID/value of ne record |
| string | $signature | Signature of new record |
| int | $datecreation | Date creation of new record |
| int | $test | Add property test to 1 if it is for test |
| int | $previousid | Counter ID/value of previous record |
| string | $previoussignature | Signature of previous record |
| int | $previousdatecreation | Date creation of previous record |
Definition at line 593 of file blockedlog.lib.php.
References getDolGlobalString().
Referenced by blockedlogadmin_prepare_head().