mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Qual: Nullable mysoc hint (#31393)
* Qual: Nullable mysoc hint # Qual: Nullable mysoc hint $mysoc can be nullable resulting in issues (#31387) so it is best to detect these cases with static analysis * Prevent null assignment
This commit is contained in:
parent
4b4fe7b128
commit
9677a370e9
|
|
@ -266,7 +266,7 @@ return [
|
|||
'linkedObjectBlock' => '\CommonObject[]', // See htdocs/core/class/html.form.class.php
|
||||
'mainmenu' => 'string',
|
||||
'menumanager' => '\MenuManager',
|
||||
'mysoc' => '\Societe',
|
||||
'mysoc' => '?\Societe',
|
||||
'nblines' => '\int',
|
||||
'objectoffield' => '\CommonObject',
|
||||
'objsoc' => '\Societe',
|
||||
|
|
|
|||
|
|
@ -83,6 +83,10 @@ class doc_generic_asset_odt extends ModelePDFAsset
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -115,11 +115,6 @@ class pdf_standard_asset extends ModelePDFAsset
|
|||
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||
$this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1; // used for notes and other stuff
|
||||
|
|
@ -135,6 +130,16 @@ class pdf_standard_asset extends ModelePDFAsset
|
|||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
$this->situationinvoice = false;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -83,18 +83,22 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
|
||||
// Retrieves transmitter
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define column position
|
||||
$this->posxref = $this->marge_gauche + 1;
|
||||
$this->posxlabel = $this->marge_gauche + 25;
|
||||
$this->posxworkload = $this->marge_gauche + 100;
|
||||
$this->posxdatestart = $this->marge_gauche + 150;
|
||||
$this->posxdateend = $this->marge_gauche + 170;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
// Retrieves issuer
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -94,12 +94,6 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
|
||||
// Retrieves transmitter
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define column position
|
||||
$this->posxref = $this->marge_gauche;
|
||||
|
||||
|
|
@ -112,6 +106,16 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||
$this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT') > 0 ? getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT') : 5);
|
||||
|
||||
$this->heightforfooter = $this->marge_basse + 8;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
// Retrieves issuer
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -78,6 +78,10 @@ class doc_generic_bom_odt extends ModelePDFBom
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -89,16 +89,20 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||
$this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
|
||||
|
||||
// Retrieves transmitter
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define column position
|
||||
$this->line_height = 5;
|
||||
$this->line_per_page = 40;
|
||||
$this->tab_height = 200; //$this->line_height * $this->line_per_page;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
// Retrieves issuer
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -85,6 +85,11 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -120,12 +120,6 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
|
|
@ -161,6 +155,17 @@ class pdf_einstein extends ModelePDFCommandes
|
|||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -125,6 +125,11 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
|
|
|
|||
|
|
@ -82,6 +82,11 @@ class doc_generic_contract_odt extends ModelePDFContract
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -117,14 +117,19 @@ class pdf_strato extends ModelePDFContract
|
|||
$this->option_multilang = 0; // Available in several languages
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -105,6 +105,11 @@ class pdf_storm extends ModelePDFDeliveryOrder
|
|||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
|
|
|
|||
|
|
@ -108,12 +108,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
$this->posxcomm = 112; // customer comment
|
||||
|
|
@ -131,6 +125,17 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||
//$this->posxdiscount-=20;
|
||||
//$this->postotalht-=20;
|
||||
}
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -85,6 +85,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -113,6 +113,11 @@ class pdf_espadon extends ModelePdfExpedition
|
|||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
|
|
|
|||
|
|
@ -102,6 +102,11 @@ class pdf_merou extends ModelePdfExpedition
|
|||
$this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
|
||||
$this->option_logo = 1; // Display logo
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -112,12 +112,6 @@ class pdf_rouget extends ModelePdfExpedition
|
|||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
$this->posxweightvol = $this->page_largeur - $this->marge_droite - 82;
|
||||
|
|
@ -152,6 +146,17 @@ class pdf_rouget extends ModelePdfExpedition
|
|||
$this->posxpicture += ($this->posxqtytoship - $this->posxqtyordered);
|
||||
$this->posxqtyordered = $this->posxqtytoship;
|
||||
}
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -131,13 +131,6 @@ class pdf_standard_expensereport extends ModeleExpenseReport
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxpiece = $this->marge_gauche + 1;
|
||||
$this->posxcomment = $this->marge_gauche + 10;
|
||||
|
|
@ -171,6 +164,18 @@ class pdf_standard_expensereport extends ModeleExpenseReport
|
|||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,12 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
// Recupere emetteur
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieves issuer
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // Par default, si n'etait pas defini
|
||||
|
|
|
|||
|
|
@ -134,12 +134,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
|
|
@ -179,6 +173,17 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
$this->situationinvoice = false;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -225,12 +225,6 @@ class pdf_octopus extends ModelePDFFactures
|
|||
$this->watermark = '';
|
||||
$this->franchise = !$mysoc->tva_assuj; // not used ?
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1; // used for notes and other stuff
|
||||
|
||||
|
|
@ -251,6 +245,17 @@ class pdf_octopus extends ModelePDFFactures
|
|||
} else {
|
||||
dol_syslog("object is empty, do not call getDataSituation...");
|
||||
}
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -159,6 +159,11 @@ class pdf_sponge extends ModelePDFFactures
|
|||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
|
|
|
|||
|
|
@ -107,14 +107,19 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -111,9 +111,6 @@ class pdf_standard_evaluation extends ModelePDFEvaluation
|
|||
$this->option_logo = 1; // Display logo
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
|
||||
// Define position of columns
|
||||
$this->posxnotes = $this->marge_gauche + 1;
|
||||
|
||||
|
|
@ -128,6 +125,14 @@ class pdf_standard_evaluation extends ModelePDFEvaluation
|
|||
$this->posxrequiredrank -= 20;
|
||||
$this->posxresult -= 20;
|
||||
}
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -81,7 +81,12 @@ class doc_generic_member_odt extends ModelePDFMember
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
// Recupere emetteur
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieves issuer
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
|
|
|
|||
|
|
@ -89,12 +89,6 @@ class pdf_standard_movementstock extends ModelePDFMovement
|
|||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_freetext = 0; // Support add of a personalised text
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->wref = 15;
|
||||
$this->posxidref = $this->marge_gauche;
|
||||
|
|
@ -121,6 +115,17 @@ class pdf_standard_movementstock extends ModelePDFMovement
|
|||
$this->posxdiscount -= 20;
|
||||
$this->postotalht -= 20;
|
||||
}
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -84,6 +84,11 @@ class doc_generic_mo_odt extends ModelePDFMo
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -112,14 +112,19 @@ class pdf_vinci extends ModelePDFMo
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support during PDF transition: TODO remove this at the end
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support during PDF transition: TODO remove this at the end
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,11 @@ class doc_generic_product_odt extends ModelePDFProduct
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -98,6 +98,14 @@ class pdf_standard extends ModelePDFProduct
|
|||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_freetext = 0; // Support add of a personalised text
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support during PDF transition: TODO remove this at the end
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -122,6 +122,11 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -114,12 +114,6 @@ class pdf_baleine extends ModelePDFProjects
|
|||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxref = $this->marge_gauche + 1;
|
||||
$this->posxlabel = $this->marge_gauche + 25;
|
||||
|
|
@ -135,6 +129,17 @@ class pdf_baleine extends ModelePDFProjects
|
|||
$this->posxdatestart -= 20;
|
||||
$this->posxdateend -= 20;
|
||||
}
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -134,12 +134,6 @@ class pdf_beluga extends ModelePDFProjects
|
|||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
if ($this->orientation == 'L' || $this->orientation == 'Landscape') {
|
||||
$this->posxref = $this->marge_gauche + 1;
|
||||
|
|
@ -164,6 +158,17 @@ class pdf_beluga extends ModelePDFProjects
|
|||
$this->posxamountttc -= 20;
|
||||
$this->posxstatut -= 20;
|
||||
}
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -108,12 +108,6 @@ class pdf_timespent extends ModelePDFProjects
|
|||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxref = $this->marge_gauche + 1;
|
||||
$this->posxlabel = $this->marge_gauche + 25;
|
||||
|
|
@ -130,6 +124,17 @@ class pdf_timespent extends ModelePDFProjects
|
|||
$this->posxuser -= 20;
|
||||
//$this->posxdateend -= 20;
|
||||
}
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -121,6 +121,11 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -84,6 +84,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -121,12 +121,6 @@ class pdf_azur extends ModelePDFPropales
|
|||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
|
|
@ -162,6 +156,17 @@ class pdf_azur extends ModelePDFPropales
|
|||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -119,12 +119,6 @@ class pdf_cyan extends ModelePDFPropales
|
|||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1; // used for notes and other stuff
|
||||
|
||||
|
|
@ -139,6 +133,17 @@ class pdf_cyan extends ModelePDFPropales
|
|||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -79,6 +79,11 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -88,12 +88,6 @@ class pdf_squille extends ModelePdfReception
|
|||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
$this->posxweightvol = $this->page_largeur - $this->marge_droite - 78;
|
||||
|
|
@ -124,6 +118,17 @@ class pdf_squille extends ModelePdfReception
|
|||
$this->posxpicture += ($this->posxqtytoship - $this->posxqtyordered);
|
||||
$this->posxqtyordered = $this->posxqtytoship;
|
||||
}
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -74,7 +74,12 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||
$this->option_freetext = 0; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
// Retrieves transmitter
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieves issuer
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
|
|
|
|||
|
|
@ -81,6 +81,11 @@ class doc_generic_stock_odt extends ModelePDFStock
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -85,12 +85,6 @@ class pdf_standard_stock extends ModelePDFStock
|
|||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_freetext = 0; // Support add of a personalised text
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->wref = 35;
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
|
|
@ -117,6 +111,17 @@ class pdf_standard_stock extends ModelePDFStock
|
|||
}
|
||||
|
||||
$this->tabTitleHeight = 11;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -119,12 +119,6 @@ class pdf_eagle extends ModelePDFStockTransfer
|
|||
$this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
|
||||
$this->option_logo = 1; // Display logo
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2);
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
$this->posxlot = $this->page_largeur - $this->marge_droite - 135;
|
||||
|
|
@ -162,6 +156,17 @@ class pdf_eagle extends ModelePDFStockTransfer
|
|||
$this->posxpicture += ($this->posxwarehousedestination - $this->posxwarehousesource);
|
||||
$this->posxwarehousesource = $this->posxwarehousedestination;
|
||||
}*/
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2);
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -115,12 +115,6 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2);
|
||||
} // By default, if was not defined
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
|
||||
|
|
@ -132,6 +126,17 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer
|
|||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2);
|
||||
} // By default, if was not defined
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2018-2019 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2019 Tim Otte <otte@meuser.it>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -90,6 +90,11 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Recupere issuer
|
||||
$this->issuer = $mysoc;
|
||||
if (!$this->issuer->country_code) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2018-2019 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2019 Tim Otte <otte@meuser.it>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -90,7 +90,12 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
// Recupere issuer
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Record issuer
|
||||
$this->issuer = $mysoc;
|
||||
if (!$this->issuer->country_code) {
|
||||
$this->issuer->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
|
|
|
|||
|
|
@ -114,12 +114,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support during PDF transition: TODO remove this at the end
|
||||
|
||||
|
|
@ -131,6 +125,17 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -113,12 +113,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
$this->posxdiscount = 162;
|
||||
|
|
@ -156,6 +150,17 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -138,6 +138,11 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments
|
|||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,12 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
// Recupere emetteur
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieves issuer
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
|
||||
|
|
|
|||
|
|
@ -112,12 +112,6 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
||||
$this->watermark = '';
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1;
|
||||
|
||||
|
|
@ -151,6 +145,17 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
|
|||
|
|
@ -113,12 +113,6 @@ class pdf_zenith extends ModelePDFSupplierProposal
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support during PDF transition: TODO remove this at the end
|
||||
|
||||
|
|
@ -130,6 +124,17 @@ class pdf_zenith extends ModelePDFSupplierProposal
|
|||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@ class doc_generic_ticket_odt extends ModelePDFTicket
|
|||
$this->option_freetext = 0; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -81,6 +81,11 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -83,6 +83,11 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,11 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -127,16 +127,9 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1; // used for notes and other stuff
|
||||
|
||||
|
||||
$this->tabTitleHeight = 5; // default height
|
||||
|
||||
// Use new system for position of columns, view $this->defineColumnField()
|
||||
|
|
@ -147,6 +140,17 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -97,6 +97,11 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (!$this->emetteur->country_code) {
|
||||
|
|
|
|||
|
|
@ -151,12 +151,6 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
|
|||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
|
||||
// Define position of columns
|
||||
$this->posxdesc = $this->marge_gauche + 1; // used for notes and other stuff
|
||||
|
||||
|
|
@ -171,6 +165,17 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
|
|||
// $this->atleastoneratenotnull = 0;
|
||||
// $this->atleastonediscount = 0;
|
||||
$this->situationinvoice = false;
|
||||
|
||||
if ($mysoc === null) {
|
||||
dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
if (empty($this->emetteur->country_code)) {
|
||||
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user