2011-01-23 19:04:53 +01:00
< ? php
2018-10-19 18:20:06 +02:00
/* Copyright ( C ) 2003 - 2005 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
* Copyright ( C ) 2004 - 2010 Laurent Destailleur < eldy @ users . sourceforge . net >
* Copyright ( C ) 2004 Eric Seigne < eric . seigne @ ryxeo . com >
2018-10-27 14:43:12 +02:00
* Copyright ( C ) 2005 - 2012 Regis Houssin < regis . houssin @ inodbox . com >
2018-10-19 18:20:06 +02:00
* Copyright ( C ) 2015 Marcos García < marcosgdf @ gmail . com >
* Copyright ( C ) 2016 Charlie Benke < charlie @ patas - monkey . com >
* Copyright ( C ) 2018 Frédéric France < frederic . france @ netlogic . fr >
2011-01-23 19:04:53 +01:00
*
* 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
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2011-01-23 19:04:53 +01:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2011-08-01 01:45:11 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2011-01-23 19:04:53 +01:00
* or see http :// www . gnu . org /
*/
/**
2011-03-08 10:59:41 +01:00
* \file htdocs / core / class / commondocgenerator . class . php
2011-01-23 19:04:53 +01:00
* \ingroup core
* \brief File of parent class for documents generators
*/
/**
2014-09-18 11:13:23 +02:00
* Parent class for documents generators
2011-01-23 19:04:53 +01:00
*/
2011-08-23 00:11:53 +02:00
abstract class CommonDocGenerator
2011-01-23 19:04:53 +01:00
{
2018-09-21 08:49:05 +02:00
/**
* @ var string Error code ( or message )
*/
public $error = '' ;
2018-10-18 21:47:10 +02:00
/**
* @ var string [] Array of error strings
*/
public $errors = array ();
2018-10-06 12:34:51 +02:00
/**
* @ var DoliDB Database handler .
*/
2015-07-06 16:59:03 +02:00
protected $db ;
2016-09-23 10:51:31 +02:00
2015-07-06 13:18:51 +02:00
/**
* Constructor
*
* @ param DoliDB $db Database handler
*/
2018-08-15 18:14:02 +02:00
public function __construct ( $db )
{
$this -> db = $db ;
}
2011-01-23 19:04:53 +01:00
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2011-01-23 19:04:53 +01:00
/**
* Define array with couple subtitution key => subtitution value
*
2012-03-19 17:18:11 +01:00
* @ param User $user User
* @ param Translate $outputlangs Language object for output
* @ return array Array of substitution key -> code
2011-01-23 19:04:53 +01:00
*/
2019-02-25 22:27:04 +01:00
public function get_substitutionarray_user ( $user , $outputlangs )
2011-01-23 19:04:53 +01:00
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
2011-01-23 19:04:53 +01:00
global $conf ;
2016-10-28 14:22:06 +02:00
$logotouse = $conf -> user -> dir_output . '/' . get_exdir ( $user -> id , 2 , 0 , 1 , $user , 'user' ) . '/' . $user -> photo ;
2011-01-23 19:04:53 +01:00
return array (
'myuser_lastname' => $user -> lastname ,
'myuser_firstname' => $user -> firstname ,
2019-01-27 11:55:16 +01:00
'myuser_fullname' => $user -> getFullName ( $outputlangs , 1 ),
2011-03-01 12:02:06 +01:00
'myuser_login' => $user -> login ,
2012-09-02 22:12:56 +02:00
'myuser_phone' => $user -> office_phone ,
2013-03-29 16:18:55 +01:00
'myuser_address' => $user -> address ,
'myuser_zip' => $user -> zip ,
'myuser_town' => $user -> town ,
'myuser_country' => $user -> country ,
'myuser_country_code' => $user -> country_code ,
'myuser_state' => $user -> state ,
'myuser_state_code' => $user -> state_code ,
'myuser_fax' => $user -> office_fax ,
2011-01-23 19:04:53 +01:00
'myuser_mobile' => $user -> user_mobile ,
2012-09-02 22:12:56 +02:00
'myuser_email' => $user -> email ,
2016-10-28 14:22:06 +02:00
'myuser_logo' => $logotouse ,
2015-10-28 11:27:39 +01:00
'myuser_job' => $user -> job ,
2012-09-03 10:17:58 +02:00
'myuser_web' => '' // url not exist in $user object
2011-01-23 19:04:53 +01:00
);
}
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2011-01-23 19:04:53 +01:00
/**
* Define array with couple subtitution key => subtitution value
*
2012-03-19 17:18:11 +01:00
* @ param Societe $mysoc Object thirdparty
* @ param Translate $outputlangs Language object for output
* @ return array Array of substitution key -> code
2011-01-23 19:04:53 +01:00
*/
2019-02-25 22:27:04 +01:00
public function get_substitutionarray_mysoc ( $mysoc , $outputlangs )
2011-01-23 19:04:53 +01:00
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
2011-01-23 19:04:53 +01:00
global $conf ;
if ( empty ( $mysoc -> forme_juridique ) && ! empty ( $mysoc -> forme_juridique_code ))
{
$mysoc -> forme_juridique = getFormeJuridiqueLabel ( $mysoc -> forme_juridique_code );
}
2012-07-23 10:29:58 +02:00
if ( empty ( $mysoc -> country ) && ! empty ( $mysoc -> country_code ))
{
$mysoc -> country = $outputlangs -> transnoentitiesnoconv ( " Country " . $mysoc -> country_code );
}
2012-07-23 11:01:36 +02:00
if ( empty ( $mysoc -> state ) && ! empty ( $mysoc -> state_code ))
{
2019-01-27 11:55:16 +01:00
$mysoc -> state = getState ( $mysoc -> state_code , 0 );
2012-07-23 11:01:36 +02:00
}
2011-01-23 19:04:53 +01:00
$logotouse = $conf -> mycompany -> dir_output . '/logos/thumbs/' . $mysoc -> logo_small ;
return array (
'mycompany_logo' => $logotouse ,
'mycompany_name' => $mysoc -> name ,
'mycompany_email' => $mysoc -> email ,
'mycompany_phone' => $mysoc -> phone ,
'mycompany_fax' => $mysoc -> fax ,
'mycompany_address' => $mysoc -> address ,
'mycompany_zip' => $mysoc -> zip ,
'mycompany_town' => $mysoc -> town ,
2012-07-23 10:29:58 +02:00
'mycompany_country' => $mysoc -> country ,
'mycompany_country_code' => $mysoc -> country_code ,
'mycompany_state' => $mysoc -> state ,
'mycompany_state_code' => $mysoc -> state_code ,
'mycompany_web' => $mysoc -> url ,
2011-01-23 19:04:53 +01:00
'mycompany_juridicalstatus' => $mysoc -> forme_juridique ,
2014-03-13 12:22:53 +01:00
'mycompany_managers' => $mysoc -> managers ,
2014-05-10 18:47:00 +02:00
'mycompany_capital' => $mysoc -> capital ,
2011-12-07 11:59:41 +01:00
'mycompany_barcode' => $mysoc -> barcode ,
2011-01-23 19:04:53 +01:00
'mycompany_idprof1' => $mysoc -> idprof1 ,
'mycompany_idprof2' => $mysoc -> idprof2 ,
'mycompany_idprof3' => $mysoc -> idprof3 ,
'mycompany_idprof4' => $mysoc -> idprof4 ,
2012-07-23 10:29:58 +02:00
'mycompany_idprof5' => $mysoc -> idprof5 ,
'mycompany_idprof6' => $mysoc -> idprof6 ,
'mycompany_vatnumber' => $mysoc -> tva_intra ,
2015-06-03 06:48:15 +02:00
'mycompany_object' => $mysoc -> object ,
2014-10-23 13:08:39 +02:00
'mycompany_note_private' => $mysoc -> note_private ,
2016-02-07 16:20:07 +01:00
//'mycompany_note_public'=>$mysoc->note_public, // Only private not exists for "mysoc" but both for thirdparties
2011-01-23 19:04:53 +01:00
);
}
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2011-02-20 23:09:42 +01:00
/**
* Define array with couple subtitution key => subtitution value
*
2012-03-19 17:18:11 +01:00
* @ param Object $object Object
* @ param Translate $outputlangs Language object for output
* @ return array Array of substitution key -> code
2011-02-20 23:09:42 +01:00
*/
2019-02-25 22:27:04 +01:00
public function get_substitutionarray_thirdparty ( $object , $outputlangs )
2011-02-20 23:09:42 +01:00
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
2011-02-20 23:09:42 +01:00
global $conf ;
2014-05-01 16:43:40 +02:00
2012-07-23 10:29:58 +02:00
if ( empty ( $object -> country ) && ! empty ( $object -> country_code ))
{
$object -> country = $outputlangs -> transnoentitiesnoconv ( " Country " . $object -> country_code );
}
2014-04-23 11:41:49 +02:00
if ( empty ( $object -> state ) && ! empty ( $object -> state_code ))
2012-07-23 10:29:58 +02:00
{
2019-01-27 11:55:16 +01:00
$object -> state = getState ( $object -> state_code , 0 );
2012-07-23 10:29:58 +02:00
}
2013-02-16 03:41:11 +01:00
$array_thirdparty = array (
2011-02-20 23:09:42 +01:00
'company_name' => $object -> name ,
2015-06-16 12:04:11 +02:00
'company_name_alias' => $object -> name_alias ,
2011-02-20 23:09:42 +01:00
'company_email' => $object -> email ,
'company_phone' => $object -> phone ,
'company_fax' => $object -> fax ,
'company_address' => $object -> address ,
'company_zip' => $object -> zip ,
'company_town' => $object -> town ,
2012-07-23 10:29:58 +02:00
'company_country' => $object -> country ,
'company_country_code' => $object -> country_code ,
'company_state' => $object -> state ,
'company_state_code' => $object -> state_code ,
'company_web' => $object -> url ,
2011-12-07 11:59:41 +01:00
'company_barcode' => $object -> barcode ,
2011-02-20 23:09:42 +01:00
'company_vatnumber' => $object -> tva_intra ,
'company_customercode' => $object -> code_client ,
'company_suppliercode' => $object -> code_fournisseur ,
'company_customeraccountancycode' => $object -> code_compta ,
'company_supplieraccountancycode' => $object -> code_compta_fournisseur ,
'company_juridicalstatus' => $object -> forme_juridique ,
2014-10-23 13:08:39 +02:00
'company_outstanding_limit' => $object -> outstanding_limit ,
2011-02-20 23:09:42 +01:00
'company_capital' => $object -> capital ,
'company_idprof1' => $object -> idprof1 ,
'company_idprof2' => $object -> idprof2 ,
'company_idprof3' => $object -> idprof3 ,
'company_idprof4' => $object -> idprof4 ,
2012-07-23 10:29:58 +02:00
'company_idprof5' => $object -> idprof5 ,
'company_idprof6' => $object -> idprof6 ,
2014-01-16 00:07:45 +01:00
'company_note_public' => $object -> note_public ,
2014-02-12 18:58:12 +01:00
'company_note_private' => $object -> note_private ,
2014-02-28 07:06:38 +01:00
'company_default_bank_iban' => $object -> bank_account -> iban ,
'company_default_bank_bic' => $object -> bank_account -> bic
2011-02-20 23:09:42 +01:00
);
2013-02-16 03:41:11 +01:00
2013-02-17 21:14:00 +01:00
// Retrieve extrafields
2013-02-16 03:41:11 +01:00
if ( is_array ( $object -> array_options ) && count ( $object -> array_options ))
{
2013-06-16 21:31:21 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php' ;
2013-02-17 21:14:00 +01:00
$extrafields = new ExtraFields ( $this -> db );
2019-01-27 11:55:16 +01:00
$extralabels = $extrafields -> fetch_name_optionals_label ( 'societe' , true );
2018-02-21 14:48:25 +01:00
$object -> fetch_optionals ();
2013-03-07 03:24:22 +01:00
2013-02-17 21:14:00 +01:00
foreach ( $extrafields -> attribute_label as $key => $label )
2013-02-16 03:41:11 +01:00
{
2013-02-18 00:58:40 +01:00
if ( $extrafields -> attribute_type [ $key ] == 'price' )
{
2019-01-27 11:55:16 +01:00
$object -> array_options [ 'options_' . $key ] = price ( $object -> array_options [ 'options_' . $key ], 0 , $outputlangs , 0 , 0 , - 1 , $conf -> currency );
2013-02-18 00:58:40 +01:00
}
2019-01-27 10:49:34 +01:00
elseif ( $extrafields -> attribute_type [ $key ] == 'select' || $extrafields -> attribute_type [ $key ] == 'checkbox' )
2013-03-07 03:24:22 +01:00
{
2013-02-18 15:47:40 +01:00
$object -> array_options [ 'options_' . $key ] = $extrafields -> attribute_param [ $key ][ 'options' ][ $object -> array_options [ 'options_' . $key ]];
}
2014-05-01 16:43:40 +02:00
$array_thirdparty = array_merge ( $array_thirdparty , array ( 'company_options_' . $key => $object -> array_options [ 'options_' . $key ]));
2014-04-30 10:36:23 +02:00
}
}
return $array_thirdparty ;
}
2014-05-01 16:43:40 +02:00
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2014-04-30 10:36:23 +02:00
/**
* Define array with couple subtitution key => subtitution value
*
2018-10-24 03:30:06 +02:00
* @ param Contact $object contact
2014-04-30 10:36:23 +02:00
* @ param Translate $outputlangs object for output
2018-10-24 03:30:06 +02:00
* @ param array $array_key Name of the key for return array
* @ return array Array of substitution key -> code
2014-04-30 10:36:23 +02:00
*/
2019-02-25 22:27:04 +01:00
public function get_substitutionarray_contact ( $object , $outputlangs , $array_key = 'object' )
2018-08-13 17:26:32 +02:00
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
2014-04-30 10:36:23 +02:00
global $conf ;
2014-05-01 16:43:40 +02:00
if ( empty ( $object -> country ) && ! empty ( $object -> country_code ))
2014-04-30 10:36:23 +02:00
{
$object -> country = $outputlangs -> transnoentitiesnoconv ( " Country " . $object -> country_code );
}
2014-05-01 16:43:40 +02:00
if ( empty ( $object -> state ) && ! empty ( $object -> state_code ))
2014-04-30 10:36:23 +02:00
{
$object -> state = getState ( $object -> state_code , 0 );
}
2014-05-01 16:43:40 +02:00
2014-04-30 10:36:23 +02:00
$array_contact = array (
2014-04-30 19:18:51 +02:00
$array_key . '_fullname' => $object -> getFullName ( $outputlangs , 1 ),
$array_key . '_lastname' => $object -> lastname ,
$array_key . '_firstname' => $object -> firstname ,
$array_key . '_address' => $object -> address ,
$array_key . '_zip' => $object -> zip ,
$array_key . '_town' => $object -> town ,
$array_key . '_state_id' => $object -> state_id ,
$array_key . '_state_code' => $object -> state_code ,
$array_key . '_state' => $object -> state ,
$array_key . '_country_id' => $object -> country_id ,
$array_key . '_country_code' => $object -> country_code ,
$array_key . '_country' => $object -> country ,
$array_key . '_poste' => $object -> poste ,
$array_key . '_socid' => $object -> socid ,
$array_key . '_statut' => $object -> statut ,
$array_key . '_code' => $object -> code ,
$array_key . '_email' => $object -> email ,
$array_key . '_jabberid' => $object -> jabberid ,
$array_key . '_phone_pro' => $object -> phone_pro ,
$array_key . '_phone_perso' => $object -> phone_perso ,
$array_key . '_phone_mobile' => $object -> phone_mobile ,
$array_key . '_fax' => $object -> fax ,
$array_key . '_birthday' => $object -> birthday ,
$array_key . '_default_lang' => $object -> default_lang ,
$array_key . '_note_public' => $object -> note_public ,
2014-05-01 16:43:40 +02:00
$array_key . '_note_private' => $object -> note_private
2014-04-30 10:36:23 +02:00
);
2014-05-01 16:43:40 +02:00
2014-04-30 10:36:23 +02:00
// Retrieve extrafields
2014-05-10 18:47:00 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php' ;
$extrafields = new ExtraFields ( $this -> db );
$extralabels = $extrafields -> fetch_name_optionals_label ( 'socpeople' , true );
2018-02-21 14:48:25 +01:00
$object -> fetch_optionals ();
2014-06-06 16:08:42 +02:00
foreach ( $extrafields -> attribute_label as $key => $label )
2014-05-10 18:47:00 +02:00
{
2014-06-06 16:08:42 +02:00
if ( $extrafields -> attribute_type [ $key ] == 'price' )
2014-05-10 18:47:00 +02:00
{
$object -> array_options [ 'options_' . $key ] = price ( $object -> array_options [ 'options_' . $key ], 0 , $outputlangs , 0 , 0 , - 1 , $conf -> currency );
}
2016-09-23 10:51:31 +02:00
elseif ( $extrafields -> attribute_type [ $key ] == 'select' || $extrafields -> attribute_type [ $key ] == 'checkbox' )
2014-04-30 10:36:23 +02:00
{
2014-05-10 18:47:00 +02:00
$object -> array_options [ 'options_' . $key ] = $extrafields -> attribute_param [ $key ][ 'options' ][ $object -> array_options [ 'options_' . $key ]];
2014-04-30 10:36:23 +02:00
}
2014-05-10 18:47:00 +02:00
$array_contact = array_merge ( $array_contact , array ( $array_key . '_options_' . $key => $object -> array_options [ 'options_' . $key ]));
2014-04-30 10:36:23 +02:00
}
return $array_contact ;
}
2014-05-01 16:43:40 +02:00
2013-03-23 18:04:46 +01:00
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2013-03-30 14:27:13 +01:00
/**
* Define array with couple subtitution key => subtitution value
*
* @ param Translate $outputlangs Language object for output
* @ return array Array of substitution key -> code
*/
2019-02-25 22:27:04 +01:00
public function get_substitutionarray_other ( $outputlangs )
2013-03-30 14:27:13 +01:00
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
2013-03-30 14:27:13 +01:00
global $conf ;
2013-03-29 16:18:55 +01:00
$now = dol_now ( 'gmt' ); // gmt
2013-03-30 14:27:13 +01:00
$array_other = array (
2017-03-10 12:45:56 +01:00
// Date in default language
2019-01-27 11:55:16 +01:00
'current_date' => dol_print_date ( $now , 'day' , 'tzuser' ),
'current_datehour' => dol_print_date ( $now , 'dayhour' , 'tzuser' ),
'current_server_date' => dol_print_date ( $now , 'day' , 'tzserver' ),
'current_server_datehour' => dol_print_date ( $now , 'dayhour' , 'tzserver' ),
2017-03-10 12:45:56 +01:00
// Date in requested output language
2019-01-27 11:55:16 +01:00
'current_date_locale' => dol_print_date ( $now , 'day' , 'tzuser' , $outputlangs ),
'current_datehour_locale' => dol_print_date ( $now , 'dayhour' , 'tzuser' , $outputlangs ),
'current_server_date_locale' => dol_print_date ( $now , 'day' , 'tzserver' , $outputlangs ),
'current_server_datehour_locale' => dol_print_date ( $now , 'dayhour' , 'tzserver' , $outputlangs ),
2013-03-30 14:27:13 +01:00
);
2013-03-29 16:18:55 +01:00
2018-02-24 14:23:52 +01:00
foreach ( $conf -> global as $key => $val )
{
2018-03-04 11:09:53 +01:00
if ( preg_match ( '/(_pass|password|secret|_key|key$)/i' , $key )) $newval = '*****forbidden*****' ;
2018-02-24 14:23:52 +01:00
else $newval = $val ;
$array_other [ '__[' . $key . ']__' ] = $newval ;
}
2013-03-30 14:27:13 +01:00
return $array_other ;
2013-03-29 16:18:55 +01:00
}
2013-06-08 18:12:32 +02:00
2014-05-07 13:22:02 +02:00
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2014-05-07 13:22:02 +02:00
/**
* Define array with couple substitution key => substitution value
*
* @ param Object $object Main object to use as data source
* @ param Translate $outputlangs Lang object to use for output
2016-07-26 22:22:55 +02:00
* @ param string $array_key Name of the key for return array
2014-05-07 13:22:02 +02:00
* @ return array Array of substitution
*/
2019-02-25 22:27:04 +01:00
public function get_substitutionarray_object ( $object , $outputlangs , $array_key = 'object' )
2014-05-07 13:22:02 +02:00
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
2014-05-07 13:22:02 +02:00
global $conf ;
2013-03-23 18:04:46 +01:00
2017-05-05 17:28:33 +02:00
$sumpayed = $sumdeposit = $sumcreditnote = '' ;
2019-02-06 09:01:24 +01:00
$already_payed_all = 0 ;
$remain_to_pay = 0 ;
2014-05-07 13:22:02 +02:00
if ( $object -> element == 'facture' )
{
$invoice_source = new Facture ( $this -> db );
if ( $object -> fk_facture_source > 0 )
{
$invoice_source -> fetch ( $object -> fk_facture_source );
}
$sumpayed = $object -> getSommePaiement ();
2017-05-05 17:28:33 +02:00
$sumdeposit = $object -> getSumDepositsUsed ();
$sumcreditnote = $object -> getSumCreditNotesUsed ();
2019-02-06 09:01:24 +01:00
$already_payed_all = $sumpayed + $sumdeposit + $sumcreditnote ;
$remain_to_pay = $sumpayed - $sumdeposit - $sumcreditnote ;
2014-05-07 13:22:02 +02:00
}
2013-03-23 18:04:46 +01:00
2018-02-24 15:31:30 +01:00
$date = ( $object -> element == 'contrat' ? $object -> date_contrat : $object -> date );
2014-05-07 13:22:02 +02:00
$resarray = array (
$array_key . '_id' => $object -> id ,
$array_key . '_ref' => $object -> ref ,
$array_key . '_ref_ext' => $object -> ref_ext ,
2018-02-24 13:41:01 +01:00
$array_key . '_ref_customer' => ( ! empty ( $object -> ref_client ) ? $object -> ref_client : ( empty ( $object -> ref_customer ) ? '' : $object -> ref_customer )),
$array_key . '_ref_supplier' => ( ! empty ( $object -> ref_fournisseur ) ? $object -> ref_fournisseur : ( empty ( $object -> ref_supplier ) ? '' : $object -> ref_supplier )),
2014-05-07 13:22:02 +02:00
$array_key . '_source_invoice_ref' => $invoice_source -> ref ,
2017-03-10 12:45:56 +01:00
// Dates
2019-01-27 11:55:16 +01:00
$array_key . '_hour' => dol_print_date ( $date , 'hour' ),
$array_key . '_date' => dol_print_date ( $date , 'day' ),
$array_key . '_date_rfc' => dol_print_date ( $date , 'dayrfc' ),
$array_key . '_date_limit' => ( ! empty ( $object -> date_lim_reglement ) ? dol_print_date ( $object -> date_lim_reglement , 'day' ) : '' ),
$array_key . '_date_end' => ( ! empty ( $object -> fin_validite ) ? dol_print_date ( $object -> fin_validite , 'day' ) : '' ),
$array_key . '_date_creation' => dol_print_date ( $object -> date_creation , 'day' ),
$array_key . '_date_modification' => ( ! empty ( $object -> date_modification ) ? dol_print_date ( $object -> date_modification , 'day' ) : '' ),
$array_key . '_date_validation' => ( ! empty ( $object -> date_validation ) ? dol_print_date ( $object -> date_validation , 'dayhour' ) : '' ),
$array_key . '_date_delivery_planed' => ( ! empty ( $object -> date_livraison ) ? dol_print_date ( $object -> date_livraison , 'day' ) : '' ),
$array_key . '_date_close' => ( ! empty ( $object -> date_cloture ) ? dol_print_date ( $object -> date_cloture , 'dayhour' ) : '' ),
2017-03-10 12:45:56 +01:00
2014-05-07 13:22:02 +02:00
$array_key . '_payment_mode_code' => $object -> mode_reglement_code ,
$array_key . '_payment_mode' => ( $outputlangs -> transnoentitiesnoconv ( 'PaymentType' . $object -> mode_reglement_code ) != 'PaymentType' . $object -> mode_reglement_code ? $outputlangs -> transnoentitiesnoconv ( 'PaymentType' . $object -> mode_reglement_code ) : $object -> mode_reglement ),
$array_key . '_payment_term_code' => $object -> cond_reglement_code ,
2018-04-10 15:24:57 +02:00
$array_key . '_payment_term' => ( $outputlangs -> transnoentitiesnoconv ( 'PaymentCondition' . $object -> cond_reglement_code ) != 'PaymentCondition' . $object -> cond_reglement_code ? $outputlangs -> transnoentitiesnoconv ( 'PaymentCondition' . $object -> cond_reglement_code ) : ( $object -> cond_reglement_doc ? $object -> cond_reglement_doc : $object -> cond_reglement )),
2014-05-07 13:22:02 +02:00
$array_key . '_total_ht_locale' => price ( $object -> total_ht , 0 , $outputlangs ),
2016-12-09 13:04:05 +01:00
$array_key . '_total_vat_locale' => ( ! empty ( $object -> total_vat ) ? price ( $object -> total_vat , 0 , $outputlangs ) : price ( $object -> total_tva , 0 , $outputlangs )),
2014-05-07 13:22:02 +02:00
$array_key . '_total_localtax1_locale' => price ( $object -> total_localtax1 , 0 , $outputlangs ),
$array_key . '_total_localtax2_locale' => price ( $object -> total_localtax2 , 0 , $outputlangs ),
$array_key . '_total_ttc_locale' => price ( $object -> total_ttc , 0 , $outputlangs ),
2017-08-18 11:30:13 +02:00
2014-05-07 13:22:02 +02:00
$array_key . '_total_ht' => price2num ( $object -> total_ht ),
2016-12-09 13:04:05 +01:00
$array_key . '_total_vat' => ( ! empty ( $object -> total_vat ) ? price2num ( $object -> total_vat ) : price2num ( $object -> total_tva )),
2014-05-07 13:22:02 +02:00
$array_key . '_total_localtax1' => price2num ( $object -> total_localtax1 ),
$array_key . '_total_localtax2' => price2num ( $object -> total_localtax2 ),
$array_key . '_total_ttc' => price2num ( $object -> total_ttc ),
2017-07-07 10:54:54 +02:00
$array_key . '_multicurrency_code' => price2num ( $object -> multicurrency_code ),
$array_key . '_multicurrency_tx' => price2num ( $object -> multicurrency_tx ),
$array_key . '_multicurrency_total_ht' => price2num ( $object -> multicurrency_total_ht ),
$array_key . '_multicurrency_total_tva' => price2num ( $object -> multicurrency_total_tva ),
$array_key . '_multicurrency_total_ttc' => price2num ( $object -> multicurrency_total_ttc ),
$array_key . '_multicurrency_total_ht_locale' => price ( $object -> multicurrency_total_ht , 0 , $outputlangs ),
$array_key . '_multicurrency_total_tva_locale' => price ( $object -> multicurrency_total_tva , 0 , $outputlangs ),
$array_key . '_multicurrency_total_ttc_locale' => price ( $object -> multicurrency_total_ttc , 0 , $outputlangs ),
2014-05-07 13:22:02 +02:00
$array_key . '_note_private' => $object -> note ,
2014-10-12 16:19:00 +02:00
$array_key . '_note_public' => $object -> note_public ,
$array_key . '_note' => $object -> note_public , // For backward compatibility
2017-07-07 10:54:54 +02:00
2014-05-07 13:22:02 +02:00
// Payments
2017-05-05 17:28:33 +02:00
$array_key . '_already_payed_locale' => price ( $sumpayed , 0 , $outputlangs ),
$array_key . '_already_payed' => price2num ( $sumpayed ),
$array_key . '_already_deposit_locale' => price ( $sumdeposit , 0 , $outputlangs ),
$array_key . '_already_deposit' => price2num ( $sumdeposit ),
$array_key . '_already_creditnote_locale' => price ( $sumcreditnote , 0 , $outputlangs ),
$array_key . '_already_creditnote' => price2num ( $sumcreditnote ),
2017-07-07 10:54:54 +02:00
2019-02-06 09:01:24 +01:00
$array_key . '_already_payed_all_locale' => price ( price2num ( $already_payed_all , 'MT' ), 0 , $outputlangs ),
$array_key . '_already_payed_all' => price2num ( $already_payed_all , 'MT' ),
2017-07-07 10:54:54 +02:00
2017-05-05 17:28:33 +02:00
// Remain to pay with all know infrmation (except open direct debit requests)
2019-02-06 09:01:24 +01:00
$array_key . '_remain_to_pay_locale' => price ( price2num ( $object -> total_ttc - $remain_to_pay , 'MT' ), 0 , $outputlangs ),
$array_key . '_remain_to_pay' => price2num ( $object -> total_ttc - $remain_to_pay , 'MT' )
2014-05-07 13:22:02 +02:00
);
2013-03-23 18:04:46 +01:00
2017-08-18 11:30:13 +02:00
if ( method_exists ( $object , 'getTotalDiscount' )) {
$resarray [ $array_key . '_total_discount_ht_locale' ] = price ( $object -> getTotalDiscount (), 0 , $outputlangs );
$resarray [ $array_key . '_total_discount_ht' ] = price2num ( $object -> getTotalDiscount ());
} else {
$resarray [ $array_key . '_total_discount_ht_locale' ] = '' ;
$resarray [ $array_key . '_total_discount_ht' ] = '' ;
}
2017-09-30 15:40:17 +02:00
// Fetch project information if there is a project assigned to this object
2017-10-02 00:34:55 +02:00
if ( $object -> element != " project " && ! empty ( $object -> fk_project ) && $object -> fk_project > 0 )
2017-09-30 15:40:17 +02:00
{
2017-10-02 00:36:15 +02:00
if ( ! is_object ( $object -> project ))
2017-09-30 15:40:17 +02:00
{
$object -> fetch_projet ();
}
2018-02-14 21:14:24 +01:00
2017-09-30 15:40:17 +02:00
$resarray [ $array_key . '_project_ref' ] = $object -> project -> ref ;
$resarray [ $array_key . '_project_title' ] = $object -> project -> title ;
$resarray [ $array_key . '_project_description' ] = $object -> project -> description ;
$resarray [ $array_key . '_project_date_start' ] = dol_print_date ( $object -> project -> date_start , 'day' );
$resarray [ $array_key . '_project_date_end' ] = dol_print_date ( $object -> project -> date_end , 'day' );
}
2014-05-07 13:22:02 +02:00
// Add vat by rates
2017-08-18 11:35:20 +02:00
if ( is_array ( $object -> lines ) && count ( $object -> lines ) > 0 )
2014-05-07 13:22:02 +02:00
{
2019-01-24 21:08:13 +01:00
$totalUp = 0 ;
2017-08-18 11:35:20 +02:00
foreach ( $object -> lines as $line )
{
// $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility
if ( empty ( $resarray [ $array_key . '_total_vat_' . $line -> tva_tx ])) $resarray [ $array_key . '_total_vat_' . $line -> tva_tx ] = 0 ;
$resarray [ $array_key . '_total_vat_' . $line -> tva_tx ] += $line -> total_tva ;
$resarray [ $array_key . '_total_vat_locale_' . $line -> tva_tx ] = price ( $resarray [ $array_key . '_total_vat_' . $line -> tva_tx ]);
// $vatformated is vat without not expected chars (so 20, or 8.5 or 5.99 for example)
$vatformated = vatrate ( $line -> tva_tx );
if ( empty ( $resarray [ $array_key . '_total_vat_' . $vatformated ])) $resarray [ $array_key . '_total_vat_' . $vatformated ] = 0 ;
$resarray [ $array_key . '_total_vat_' . $vatformated ] += $line -> total_tva ;
$resarray [ $array_key . '_total_vat_locale_' . $vatformated ] = price ( $resarray [ $array_key . '_total_vat_' . $vatformated ]);
2019-02-13 11:32:00 +01:00
2019-01-24 21:08:13 +01:00
$totalUp += $line -> subprice * $line -> qty ;
}
2019-02-13 11:32:00 +01:00
2019-01-24 21:08:13 +01:00
// @GS: Calculate total up and total discount percentage
2019-01-26 14:17:01 +01:00
// Note that this added fields correspond to nothing in Dolibarr (Dolibarr manage discount on lines not globally)
2019-01-24 21:08:13 +01:00
$resarray [ 'object_total_up' ] = $totalUp ;
$resarray [ 'object_total_up_locale' ] = price ( $resarray [ 'object_total_up' ], 0 , $outputlangs );
if ( method_exists ( $object , 'getTotalDiscount' )) {
$resarray [ 'object_total_discount' ] = round ( 100 / $totalUp * $object -> getTotalDiscount (), 2 );
$resarray [ 'object_total_discount_locale' ] = price ( $resarray [ 'object_total_discount' ], 0 , $outputlangs );
2017-08-18 11:35:20 +02:00
}
2014-05-07 13:22:02 +02:00
}
2019-02-13 11:32:00 +01:00
2014-05-07 13:22:02 +02:00
// Retrieve extrafields
if ( is_array ( $object -> array_options ) && count ( $object -> array_options ))
{
2014-06-06 16:08:42 +02:00
$extrafieldkey = $object -> element ;
2013-03-23 18:04:46 +01:00
2014-05-07 13:22:02 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php' ;
$extrafields = new ExtraFields ( $this -> db );
2019-01-27 11:55:16 +01:00
$extralabels = $extrafields -> fetch_name_optionals_label ( $extrafieldkey , true );
2018-02-21 14:48:25 +01:00
$object -> fetch_optionals ();
2014-05-07 13:22:02 +02:00
2019-01-27 11:55:16 +01:00
$resarray = $this -> fill_substitutionarray_with_extrafields ( $object , $resarray , $extrafields , $array_key , $outputlangs );
2014-05-07 13:22:02 +02:00
}
2019-02-13 11:32:00 +01:00
2014-05-07 13:22:02 +02:00
return $resarray ;
}
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2014-05-07 13:22:02 +02:00
/**
* Define array with couple substitution key => substitution value
*
2018-09-16 10:28:41 +02:00
* @ param Object $line Object line
2014-05-07 13:22:02 +02:00
* @ param Translate $outputlangs Lang object to use for output
* @ return array Return a substitution array
*/
2019-02-25 22:27:04 +01:00
public function get_substitutionarray_lines ( $line , $outputlangs )
2014-05-07 13:22:02 +02:00
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
2014-05-07 13:22:02 +02:00
global $conf ;
2015-01-12 18:18:43 +01:00
$resarray = array (
2019-01-27 11:55:16 +01:00
'line_fulldesc' => doc_getlinedesc ( $line , $outputlangs ),
2014-05-07 13:22:02 +02:00
'line_product_ref' => $line -> product_ref ,
2018-08-07 11:45:56 +02:00
'line_product_ref_fourn' => $line -> ref_fourn , // for supplier doc lines
2014-05-07 13:22:02 +02:00
'line_product_label' => $line -> product_label ,
2016-07-29 16:21:28 +02:00
'line_product_type' => $line -> product_type ,
2014-05-07 13:22:02 +02:00
'line_desc' => $line -> desc ,
2019-01-27 11:55:16 +01:00
'line_vatrate' => vatrate ( $line -> tva_tx , true , $line -> info_bits ),
2019-03-19 15:21:07 +01:00
'line_localtax1_rate' => vatrate ( $line -> localtax1_tx ),
'line_localtax2_rate' => vatrate ( $line -> localtax1_tx ),
2019-03-19 15:18:43 +01:00
'line_up' => price2num ( $line -> subprice ),
2014-05-07 13:22:02 +02:00
'line_up_locale' => price ( $line -> subprice , 0 , $outputlangs ),
2019-01-24 21:08:13 +01:00
'line_total_up' => price2num ( $line -> subprice * $line -> qty ),
'line_total_up_locale' => price ( $line -> subprice * $line -> qty , 0 , $outputlangs ),
2014-05-07 13:22:02 +02:00
'line_qty' => $line -> qty ,
'line_discount_percent' => ( $line -> remise_percent ? $line -> remise_percent . '%' : '' ),
'line_price_ht' => price2num ( $line -> total_ht ),
'line_price_ttc' => price2num ( $line -> total_ttc ),
'line_price_vat' => price2num ( $line -> total_tva ),
'line_price_ht_locale' => price ( $line -> total_ht , 0 , $outputlangs ),
'line_price_ttc_locale' => price ( $line -> total_ttc , 0 , $outputlangs ),
'line_price_vat_locale' => price ( $line -> total_tva , 0 , $outputlangs ),
2017-03-10 12:47:31 +01:00
// Dates
2017-03-10 12:45:56 +01:00
'line_date_start' => dol_print_date ( $line -> date_start , 'day' , 'tzuser' ),
'line_date_start_locale' => dol_print_date ( $line -> date_start , 'day' , 'tzuser' , $outputlangs ),
'line_date_start_rfc' => dol_print_date ( $line -> date_start , 'dayrfc' , 'tzuser' ),
'line_date_end' => dol_print_date ( $line -> date_end , 'day' , 'tzuser' ),
'line_date_end_locale' => dol_print_date ( $line -> date_end , 'day' , 'tzuser' , $outputlangs ),
'line_date_end_rfc' => dol_print_date ( $line -> date_end , 'dayrfc' , 'tzuser' ),
2017-07-07 10:54:54 +02:00
'line_multicurrency_code' => price2num ( $line -> multicurrency_code ),
'line_multicurrency_subprice' => price2num ( $line -> multicurrency_subprice ),
'line_multicurrency_total_ht' => price2num ( $line -> multicurrency_total_ht ),
'line_multicurrency_total_tva' => price2num ( $line -> multicurrency_total_tva ),
'line_multicurrency_total_ttc' => price2num ( $line -> multicurrency_total_ttc ),
'line_multicurrency_subprice_locale' => price ( $line -> multicurrency_subprice , 0 , $outputlangs ),
'line_multicurrency_total_ht_locale' => price ( $line -> multicurrency_total_ht , 0 , $outputlangs ),
'line_multicurrency_total_tva_locale' => price ( $line -> multicurrency_total_tva , 0 , $outputlangs ),
'line_multicurrency_total_ttc_locale' => price ( $line -> multicurrency_total_ttc , 0 , $outputlangs ),
2014-05-07 13:22:02 +02:00
);
2018-02-14 21:14:24 +01:00
2019-02-24 20:06:55 +01:00
// Units
2017-10-22 04:12:46 +02:00
if ( $conf -> global -> PRODUCT_USE_UNITS )
{
2017-10-22 04:13:49 +02:00
$resarray [ 'line_unit' ] = $outputlangs -> trans ( $line -> getLabelOfUnit ( 'long' ));
$resarray [ 'line_unit_short' ] = $outputlangs -> trans ( $line -> getLabelOfUnit ( 'short' ));
2017-10-22 04:12:46 +02:00
}
2015-01-12 18:18:43 +01:00
// Retrieve extrafields
$extrafieldkey = $line -> element ;
$array_key = " line " ;
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php' ;
$extrafields = new ExtraFields ( $this -> db );
2019-01-27 11:55:16 +01:00
$extralabels = $extrafields -> fetch_name_optionals_label ( $extrafieldkey , true );
2018-02-21 14:48:25 +01:00
$line -> fetch_optionals ();
2015-01-12 18:18:43 +01:00
2019-02-13 11:32:00 +01:00
$resarray = $this -> fill_substitutionarray_with_extrafields ( $line , $resarray , $extrafields , $array_key , $outputlangs );
2018-02-14 21:14:24 +01:00
2018-02-12 21:38:51 +01:00
// Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
2018-02-14 21:14:24 +01:00
if ( isset ( $line -> fk_product ) && $line -> fk_product > 0 )
2018-02-13 08:41:57 +01:00
{
2018-02-14 21:14:24 +01:00
$tmpproduct = new Product ( $this -> db );
$result = $tmpproduct -> fetch ( $line -> fk_product );
foreach ( $tmpproduct -> array_options as $key => $label )
2018-07-24 17:03:30 +02:00
$resarray [ " line_product_ " . $key ] = $label ;
2018-02-14 21:14:24 +01:00
}
2015-01-12 18:18:43 +01:00
return $resarray ;
2014-05-07 13:22:02 +02:00
}
2014-01-16 00:07:45 +01:00
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2013-07-19 17:27:22 +02:00
/**
* Define array with couple substitution key => substitution value
*
2018-10-24 03:30:06 +02:00
* @ param Expedition $object Main object to use as data source
2013-07-19 17:27:22 +02:00
* @ param Translate $outputlangs Lang object to use for output
2018-10-24 03:30:06 +02:00
* @ param array $array_key Name of the key for return array
2013-07-19 17:27:22 +02:00
* @ return array Array of substitution
*/
2019-02-25 22:27:04 +01:00
public function get_substitutionarray_shipment ( $object , $outputlangs , $array_key = 'object' )
2013-07-19 17:27:22 +02:00
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
2013-07-19 17:27:22 +02:00
global $conf ;
dol_include_once ( '/core/lib/product.lib.php' );
$object -> list_delivery_methods ( $object -> shipping_method_id );
$calculatedVolume = ( $object -> trueWidth * $object -> trueHeight * $object -> trueDepth );
$array_shipment = array (
$array_key . '_id' => $object -> id ,
$array_key . '_ref' => $object -> ref ,
$array_key . '_ref_ext' => $object -> ref_ext ,
$array_key . '_ref_customer' => $object -> ref_customer ,
2019-01-27 11:55:16 +01:00
$array_key . '_date_delivery' => dol_print_date ( $object -> date_delivery , 'day' ),
$array_key . '_hour_delivery' => dol_print_date ( $object -> date_delivery , 'hour' ),
$array_key . '_date_creation' => dol_print_date ( $object -> date_creation , 'day' ),
2013-07-19 17:27:22 +02:00
$array_key . '_total_ht' => price ( $object -> total_ht ),
$array_key . '_total_vat' => price ( $object -> total_tva ),
$array_key . '_total_ttc' => price ( $object -> total_ttc ),
$array_key . '_total_discount_ht' => price ( $object -> getTotalDiscount ()),
$array_key . '_note_private' => $object -> note_private ,
$array_key . '_note' => $object -> note_public ,
$array_key . '_tracking_number' => $object -> tracking_number ,
$array_key . '_tracking_url' => $object -> tracking_url ,
$array_key . '_shipping_method' => $object -> listmeths [ 0 ][ 'libelle' ],
$array_key . '_weight' => $object -> trueWeight . ' ' . measuring_units_string ( $object -> weight_units , 'weight' ),
$array_key . '_width' => $object -> trueWidth . ' ' . measuring_units_string ( $object -> width_units , 'size' ),
$array_key . '_height' => $object -> trueHeight . ' ' . measuring_units_string ( $object -> height_units , 'size' ),
$array_key . '_depth' => $object -> trueDepth . ' ' . measuring_units_string ( $object -> depth_units , 'size' ),
$array_key . '_size' => $calculatedVolume . ' ' . measuring_units_string ( 0 , 'volume' ),
);
// Add vat by rates
foreach ( $object -> lines as $line )
{
if ( empty ( $array_shipment [ $array_key . '_total_vat_' . $line -> tva_tx ])) $array_shipment [ $array_key . '_total_vat_' . $line -> tva_tx ] = 0 ;
$array_shipment [ $array_key . '_total_vat_' . $line -> tva_tx ] += $line -> total_tva ;
}
// Retrieve extrafields
2018-08-28 02:23:34 +02:00
if ( is_array ( $object -> array_options ) && count ( $object -> array_options ))
2013-07-19 17:27:22 +02:00
{
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php' ;
$extrafields = new ExtraFields ( $this -> db );
2019-01-27 11:55:16 +01:00
$extralabels = $extrafields -> fetch_name_optionals_label ( 'expedition' , true );
2018-02-21 14:48:25 +01:00
$object -> fetch_optionals ();
2013-07-19 17:27:22 +02:00
2019-01-27 11:55:16 +01:00
$array_shipment = $this -> fill_substitutionarray_with_extrafields ( $object , $array_shipment , $extrafields , $array_key , $outputlangs );
2018-08-22 17:29:05 +02:00
}
2018-08-28 02:23:34 +02:00
2013-07-19 17:27:22 +02:00
return $array_shipment ;
}
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2013-07-19 17:27:22 +02:00
/**
2018-08-13 17:26:32 +02:00
* Define array with couple substitution key => substitution value
2013-07-19 17:27:22 +02:00
*
2018-08-28 02:23:34 +02:00
* @ param ExpeditionLigne $line Object line
2013-07-19 17:27:22 +02:00
* @ param Translate $outputlangs Lang object to use for output
* @ return array Substitution array
*/
2019-02-25 22:27:04 +01:00
public function get_substitutionarray_shipment_lines ( $line , $outputlangs )
2013-07-19 17:27:22 +02:00
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
global $conf ;
2018-08-28 09:34:53 +02:00
dol_include_once ( '/core/lib/product.lib.php' );
2013-07-19 17:27:22 +02:00
2018-08-22 17:29:05 +02:00
$resarray = array (
2019-01-27 11:55:16 +01:00
'line_fulldesc' => doc_getlinedesc ( $line , $outputlangs ),
2013-07-19 17:27:22 +02:00
'line_product_ref' => $line -> product_ref ,
'line_product_label' => $line -> product_label ,
'line_desc' => $line -> desc ,
2019-01-27 11:55:16 +01:00
'line_vatrate' => vatrate ( $line -> tva_tx , true , $line -> info_bits ),
2013-07-19 17:27:22 +02:00
'line_up' => price ( $line -> subprice ),
2019-02-25 22:27:04 +01:00
'line_total_up' => price ( $line -> subprice * $line -> qty ),
2013-07-19 17:27:22 +02:00
'line_qty' => $line -> qty ,
'line_qty_shipped' => $line -> qty_shipped ,
'line_qty_asked' => $line -> qty_asked ,
'line_discount_percent' => ( $line -> remise_percent ? $line -> remise_percent . '%' : '' ),
'line_price_ht' => price ( $line -> total_ht ),
'line_price_ttc' => price ( $line -> total_ttc ),
'line_price_vat' => price ( $line -> total_tva ),
'line_weight' => empty ( $line -> weight ) ? '' : $line -> weight * $line -> qty_shipped . ' ' . measuring_units_string ( $line -> weight_units , 'weight' ),
'line_length' => empty ( $line -> length ) ? '' : $line -> length * $line -> qty_shipped . ' ' . measuring_units_string ( $line -> length_units , 'size' ),
'line_surface' => empty ( $line -> surface ) ? '' : $line -> surface * $line -> qty_shipped . ' ' . measuring_units_string ( $line -> surface_units , 'surface' ),
'line_volume' => empty ( $line -> volume ) ? '' : $line -> volume * $line -> qty_shipped . ' ' . measuring_units_string ( $line -> volume_units , 'volume' ),
);
2018-08-22 17:29:05 +02:00
2018-08-28 09:34:53 +02:00
// Retrieve extrafields
2018-08-22 17:29:05 +02:00
$extrafieldkey = $line -> element ;
$array_key = " line " ;
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php' ;
$extrafields = new ExtraFields ( $this -> db );
$extralabels = $extrafields -> fetch_name_optionals_label ( $extrafieldkey , true );
2018-08-28 02:23:34 +02:00
$line -> fetch_optionals ();
2018-08-22 17:29:05 +02:00
$resarray = $this -> fill_substitutionarray_with_extrafields ( $line , $resarray , $extrafields , $array_key , $outputlangs );
return $resarray ;
2013-07-19 17:27:22 +02:00
}
2013-03-23 18:04:46 +01:00
2017-07-07 10:54:54 +02:00
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2017-07-07 10:54:54 +02:00
/**
* Define array with couple subtitution key => subtitution value
*
* @ param Object $object Dolibarr Object
* @ param Translate $outputlangs Language object for output
* @ param boolean $recursive Want to fetch child array or child object
* @ return array Array of substitution key -> code
*/
2019-02-25 22:27:04 +01:00
public function get_substitutionarray_each_var_object ( & $object , $outputlangs , $recursive = true )
2018-08-15 18:14:02 +02:00
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
2017-07-07 10:54:54 +02:00
$array_other = array ();
2018-09-06 18:29:01 +02:00
if ( ! empty ( $object )) {
2017-07-07 10:54:54 +02:00
foreach ( $object as $key => $value ) {
2018-09-06 18:29:01 +02:00
if ( ! empty ( $value )) {
if ( ! is_array ( $value ) && ! is_object ( $value )) {
2017-07-07 10:54:54 +02:00
$array_other [ 'object_' . $key ] = $value ;
}
2018-09-06 18:29:01 +02:00
if ( is_array ( $value ) && $recursive ) {
2019-01-27 11:55:16 +01:00
$array_other [ 'object_' . $key ] = $this -> get_substitutionarray_each_var_object ( $value , $outputlangs , false );
2017-07-07 10:54:54 +02:00
}
}
}
}
return $array_other ;
}
2019-02-25 22:27:04 +01:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2013-03-07 03:24:22 +01:00
/**
* Fill array with couple extrafield key => extrafield value
*
* @ param Object $object Object with extrafields ( must have $object -> array_options filled )
* @ param array $array_to_fill Substitution array
* @ param Extrafields $extrafields Extrafields object
2016-01-02 11:51:40 +01:00
* @ param string $array_key Prefix for name of the keys into returned array
2013-03-07 03:24:22 +01:00
* @ param Translate $outputlangs Lang object to use for output
* @ return array Substitution array
*/
2019-02-25 22:27:04 +01:00
public function fill_substitutionarray_with_extrafields ( $object , $array_to_fill , $extrafields , $array_key , $outputlangs )
{
2018-09-06 18:29:01 +02:00
// phpcs:enable
2013-03-07 03:24:22 +01:00
global $conf ;
foreach ( $extrafields -> attribute_label as $key => $label )
{
if ( $extrafields -> attribute_type [ $key ] == 'price' )
{
2013-06-17 11:58:55 +02:00
$object -> array_options [ 'options_' . $key ] = price2num ( $object -> array_options [ 'options_' . $key ]);
2019-01-27 11:55:16 +01:00
$object -> array_options [ 'options_' . $key . '_currency' ] = price ( $object -> array_options [ 'options_' . $key ], 0 , $outputlangs , 0 , 0 , - 1 , $conf -> currency );
2013-03-07 03:24:22 +01:00
//Add value to store price with currency
2019-01-27 11:55:16 +01:00
$array_to_fill = array_merge ( $array_to_fill , array ( $array_key . '_options_' . $key . '_currency' => $object -> array_options [ 'options_' . $key . '_currency' ]));
2013-03-07 03:24:22 +01:00
}
2019-01-27 10:49:34 +01:00
elseif ( $extrafields -> attribute_type [ $key ] == 'select' || $extrafields -> attribute_type [ $key ] == 'checkbox' )
2013-03-07 03:24:22 +01:00
{
$object -> array_options [ 'options_' . $key ] = $extrafields -> attribute_param [ $key ][ 'options' ][ $object -> array_options [ 'options_' . $key ]];
}
2019-01-27 10:49:34 +01:00
elseif ( $extrafields -> attribute_type [ $key ] == 'date' )
2016-09-23 10:51:31 +02:00
{
2015-12-31 18:50:28 +01:00
if ( strlen ( $object -> array_options [ 'options_' . $key ]) > 0 )
{
2016-12-13 09:40:08 +01:00
$date = $object -> array_options [ 'options_' . $key ];
2019-01-27 11:55:16 +01:00
$object -> array_options [ 'options_' . $key ] = dol_print_date ( $date , 'day' ); // using company output language
$object -> array_options [ 'options_' . $key . '_locale' ] = dol_print_date ( $date , 'day' , 'tzserver' , $outputlangs ); // using output language format
$object -> array_options [ 'options_' . $key . '_rfc' ] = dol_print_date ( $date , 'dayrfc' ); // international format
2015-12-31 18:50:28 +01:00
}
else
{
2016-01-01 12:47:27 +01:00
$object -> array_options [ 'options_' . $key ] = '' ;
2016-01-02 11:51:40 +01:00
$object -> array_options [ 'options_' . $key . '_locale' ] = '' ;
2015-12-31 18:50:28 +01:00
$object -> array_options [ 'options_' . $key . '_rfc' ] = '' ;
}
2019-01-27 11:55:16 +01:00
$array_to_fill = array_merge ( $array_to_fill , array ( $array_key . '_options_' . $key . '_locale' => $object -> array_options [ 'options_' . $key . '_locale' ]));
$array_to_fill = array_merge ( $array_to_fill , array ( $array_key . '_options_' . $key . '_rfc' => $object -> array_options [ 'options_' . $key . '_rfc' ]));
2013-03-07 03:24:22 +01:00
}
2019-01-27 10:49:34 +01:00
elseif ( $extrafields -> attribute_type [ $key ] == 'datetime' )
2013-03-07 03:24:22 +01:00
{
2016-12-13 09:40:08 +01:00
$datetime = $object -> array_options [ 'options_' . $key ];
2019-01-27 11:55:16 +01:00
$object -> array_options [ 'options_' . $key ] = ( $datetime != " 0000-00-00 00:00:00 " ? dol_print_date ( $object -> array_options [ 'options_' . $key ], 'dayhour' ) : '' ); // using company output language
$object -> array_options [ 'options_' . $key . '_locale' ] = ( $datetime != " 0000-00-00 00:00:00 " ? dol_print_date ( $object -> array_options [ 'options_' . $key ], 'dayhour' , 'tzserver' , $outputlangs ) : '' ); // using output language format
$object -> array_options [ 'options_' . $key . '_rfc' ] = ( $datetime != " 0000-00-00 00:00:00 " ? dol_print_date ( $object -> array_options [ 'options_' . $key ], 'dayhourrfc' ) : '' ); // international format
$array_to_fill = array_merge ( $array_to_fill , array ( $array_key . '_options_' . $key . '_locale' => $object -> array_options [ 'options_' . $key . '_locale' ]));
$array_to_fill = array_merge ( $array_to_fill , array ( $array_key . '_options_' . $key . '_rfc' => $object -> array_options [ 'options_' . $key . '_rfc' ]));
2013-03-07 03:24:22 +01:00
}
2019-01-27 10:49:34 +01:00
elseif ( $extrafields -> attribute_type [ $key ] == 'link' )
2018-07-24 17:03:30 +02:00
{
$id = $object -> array_options [ 'options_' . $key ];
if ( $id != " " )
{
$param = $extrafields -> attribute_param [ $key ];
$param_list = array_keys ( $param [ 'options' ]); // $param_list='ObjectName:classPath'
$InfoFieldList = explode ( " : " , $param_list [ 0 ]);
$classname = $InfoFieldList [ 0 ];
$classpath = $InfoFieldList [ 1 ];
if ( ! empty ( $classpath ))
{
dol_include_once ( $InfoFieldList [ 1 ]);
if ( $classname && class_exists ( $classname ))
{
$tmpobject = new $classname ( $this -> db );
$tmpobject -> fetch ( $id );
// completely replace the id with the linked object name
$object -> array_options [ 'options_' . $key ] = $tmpobject -> name ;
}
}
}
}
2019-01-27 11:55:16 +01:00
$array_to_fill = array_merge ( $array_to_fill , array ( $array_key . '_options_' . $key => $object -> array_options [ 'options_' . $key ]));
2013-03-07 03:24:22 +01:00
}
2013-03-23 18:04:46 +01:00
2013-03-07 03:24:22 +01:00
return $array_to_fill ;
}
2013-03-23 18:04:46 +01:00
2012-08-08 04:12:20 +02:00
/**
* Rect pdf
*
2018-10-24 03:30:06 +02:00
* @ param TCPDF $pdf Object PDF
2012-09-30 20:49:13 +02:00
* @ param float $x Abscissa of first point
* @ param float $y Ordinate of first point
* @ param float $l ? ?
* @ param float $h ? ?
2012-10-11 09:42:47 +02:00
* @ param int $hidetop 1 = Hide top bar of array and title , 0 = Hide nothing , - 1 = Hide only title
2012-08-08 04:12:20 +02:00
* @ param int $hidebottom Hide bottom
2012-09-30 20:49:13 +02:00
* @ return void
2012-08-08 04:12:20 +02:00
*/
2019-02-25 22:27:04 +01:00
public function printRect ( $pdf , $x , $y , $l , $h , $hidetop = 0 , $hidebottom = 0 )
2012-08-08 04:12:20 +02:00
{
2018-08-15 18:14:02 +02:00
if ( empty ( $hidetop ) || $hidetop ==- 1 ) $pdf -> line ( $x , $y , $x + $l , $y );
$pdf -> line ( $x + $l , $y , $x + $l , $y + $h );
if ( empty ( $hidebottom )) $pdf -> line ( $x + $l , $y + $h , $x , $y + $h );
$pdf -> line ( $x , $y + $h , $x , $y );
2012-08-08 04:12:20 +02:00
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
/**
2019-02-25 22:27:04 +01:00
* uasort callback function to Sort colums fields
2018-06-26 08:03:25 +02:00
*
2019-02-25 22:27:04 +01:00
* @ param array $a PDF lines array fields configs
* @ param array $b PDF lines array fields configs
* @ return int Return compare result
2018-06-26 08:03:25 +02:00
*/
2019-02-25 22:27:04 +01:00
public function columnSort ( $a , $b )
2018-10-24 03:38:12 +02:00
{
2018-06-26 08:03:25 +02:00
if ( empty ( $a [ 'rank' ])){ $a [ 'rank' ] = 0 ; }
if ( empty ( $b [ 'rank' ])){ $b [ 'rank' ] = 0 ; }
if ( $a [ 'rank' ] == $b [ 'rank' ]) {
return 0 ;
}
return ( $a [ 'rank' ] > $b [ 'rank' ]) ? - 1 : 1 ;
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
/**
* Prepare Array Column Field
*
2018-10-24 03:38:12 +02:00
* @ param object $object common object
* @ param Translate $outputlangs langs
* @ param int $hidedetails Do not show line details
* @ param int $hidedesc Do not show desc
* @ param int $hideref Do not show ref
2018-06-26 08:03:25 +02:00
* @ return null
*/
2019-02-25 22:27:04 +01:00
public function prepareArrayColumnField ( $object , $outputlangs , $hidedetails = 0 , $hidedesc = 0 , $hideref = 0 )
2018-10-24 03:38:12 +02:00
{
2018-06-26 08:03:25 +02:00
global $conf ;
2018-10-24 03:38:12 +02:00
2019-01-27 11:55:16 +01:00
$this -> defineColumnField ( $object , $outputlangs , $hidedetails , $hidedesc , $hideref );
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
// Sorting
2019-02-24 20:06:55 +01:00
uasort ( $this -> cols , array ( $this , 'columnSort' ));
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
// Positionning
$curX = $this -> page_largeur - $this -> marge_droite ; // start from right
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
// Array witdh
$arrayWidth = $this -> page_largeur - $this -> marge_droite - $this -> marge_gauche ;
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
// Count flexible column
$totalDefinedColWidth = 0 ;
$countFlexCol = 0 ;
foreach ( $this -> cols as $colKey =>& $colDef )
{
if ( ! $this -> getColumnStatus ( $colKey )) continue ; // continue if desable
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
if ( ! empty ( $colDef [ 'scale' ])){
// In case of column widht is defined by percentage
2019-02-10 10:45:49 +01:00
$colDef [ 'width' ] = abs ( $arrayWidth * $colDef [ 'scale' ] / 100 );
2018-06-26 08:03:25 +02:00
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
if ( empty ( $colDef [ 'width' ])){
$countFlexCol ++ ;
}
else {
$totalDefinedColWidth += $colDef [ 'width' ];
}
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
foreach ( $this -> cols as $colKey =>& $colDef )
{
// setting empty conf with default
if ( ! empty ( $colDef [ 'title' ])){
$colDef [ 'title' ] = array_replace ( $this -> defaultTitlesFieldsStyle , $colDef [ 'title' ]);
}
else {
$colDef [ 'title' ] = $this -> defaultTitlesFieldsStyle ;
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
// setting empty conf with default
if ( ! empty ( $colDef [ 'content' ])){
$colDef [ 'content' ] = array_replace ( $this -> defaultContentsFieldsStyle , $colDef [ 'content' ]);
}
else {
$colDef [ 'content' ] = $this -> defaultContentsFieldsStyle ;
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
if ( $this -> getColumnStatus ( $colKey ))
{
// In case of flexible column
if ( empty ( $colDef [ 'width' ])){
$colDef [ 'width' ] = abs (( $arrayWidth - $totalDefinedColWidth )) / $countFlexCol ;
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
// Set positions
$lastX = $curX ;
$curX = $lastX - $colDef [ 'width' ];
$colDef [ 'xStartPos' ] = $curX ;
$colDef [ 'xEndPos' ] = $lastX ;
}
}
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
/**
2019-02-24 20:06:55 +01:00
* get column content width from column key
2018-06-26 08:03:25 +02:00
*
2019-02-24 20:06:55 +01:00
* @ param string $colKey the column key
* @ return float width in mm
2018-06-26 08:03:25 +02:00
*/
2019-02-25 22:27:04 +01:00
public function getColumnContentWidth ( $colKey )
2018-06-26 08:03:25 +02:00
{
$colDef = $this -> cols [ $colKey ];
return $colDef [ 'width' ] - $colDef [ 'content' ][ 'padding' ][ 3 ] - $colDef [ 'content' ][ 'padding' ][ 1 ];
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
/**
2019-02-25 22:27:04 +01:00
* get column content X ( abscissa ) left position from column key
2018-06-26 08:03:25 +02:00
*
2019-02-25 22:27:04 +01:00
* @ param string $colKey the column key
* @ return float X position in mm
2018-06-26 08:03:25 +02:00
*/
2019-02-25 22:27:04 +01:00
public function getColumnContentXStart ( $colKey )
2018-06-26 08:03:25 +02:00
{
$colDef = $this -> cols [ $colKey ];
return $colDef [ 'xStartPos' ] + $colDef [ 'content' ][ 'padding' ][ 3 ];
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
/**
* get column position rank from column key
*
* @ param string $colKey the column key
* @ return int rank on success and - 1 on error
*/
2019-02-25 22:27:04 +01:00
public function getColumnRank ( $colKey )
2018-06-26 08:03:25 +02:00
{
if ( ! isset ( $this -> cols [ $colKey ][ 'rank' ])) return - 1 ;
return $this -> cols [ $colKey ][ 'rank' ];
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
/**
2019-02-25 22:27:04 +01:00
* get column position rank from column key
2018-06-26 08:03:25 +02:00
*
2019-02-25 22:27:04 +01:00
* @ param string $newColKey the new column key
* @ param array $defArray a single column definition array
* @ param string $targetCol target column used to place the new column beside
* @ param bool $insertAfterTarget insert before or after target column ?
* @ return int new rank on success and - 1 on error
2018-06-26 08:03:25 +02:00
*/
2019-02-25 22:27:04 +01:00
public function insertNewColumnDef ( $newColKey , $defArray , $targetCol = false , $insertAfterTarget = false )
2018-06-26 08:03:25 +02:00
{
// prepare wanted rank
$rank = - 1 ;
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
// try to get rank from target column
if ( ! empty ( $targetCol )){
$rank = $this -> getColumnRank ( $targetCol );
if ( $rank >= 0 && $insertAfterTarget ){ $rank ++ ; }
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
// get rank from new column definition
if ( $rank < 0 && ! empty ( $defArray [ 'rank' ])){
$rank = $defArray [ 'rank' ];
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
// error: no rank
if ( $rank < 0 ){ return - 1 ; }
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
foreach ( $this -> cols as $colKey =>& $colDef )
{
if ( $rank <= $colDef [ 'rank' ])
{
$colDef [ 'rank' ] = $colDef [ 'rank' ] + 1 ;
}
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
$defArray [ 'rank' ] = $rank ;
$this -> cols [ $newColKey ] = $defArray ; // array_replace is used to preserve keys
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
return $rank ;
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
/**
2019-02-24 20:06:55 +01:00
* print standard column content
2018-06-26 08:03:25 +02:00
*
2019-02-24 20:06:55 +01:00
* @ param PDF $pdf pdf object
* @ param float $curY curent Y position
* @ param string $colKey the column key
* @ param string $columnText column text
* @ return int new rank on success and - 1 on error
2018-06-26 08:03:25 +02:00
*/
2019-02-25 22:27:04 +01:00
public function printStdColumnContent ( $pdf , & $curY , $colKey , $columnText = '' )
2018-06-26 08:03:25 +02:00
{
global $hookmanager ;
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
$parameters = array (
2018-10-24 03:39:33 +02:00
'curY' => & $curY ,
2018-06-26 08:03:25 +02:00
'columnText' => $columnText ,
'colKey' => $colKey
);
2019-01-27 11:55:16 +01:00
$reshook = $hookmanager -> executeHooks ( 'printStdColumnContent' , $parameters , $this ); // Note that $action and $object may have been modified by hook
if ( $reshook < 0 ) setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
2018-06-26 08:03:25 +02:00
if ( ! $reshook )
{
if ( empty ( $columnText )) return ;
2019-01-27 11:55:16 +01:00
$pdf -> SetXY ( $this -> getColumnContentXStart ( $colKey ), $curY ); // Set curent position
2018-06-26 08:03:25 +02:00
$colDef = $this -> cols [ $colKey ];
2019-02-10 10:45:49 +01:00
$pdf -> writeHTMLCell ( $this -> getColumnContentWidth ( $colKey ), 2 , $this -> getColumnContentXStart ( $colKey ), $curY , $columnText , 0 , 0 , 0 , true , $colDef [ 'content' ][ 'align' ]);
2018-06-26 08:03:25 +02:00
}
}
2018-10-24 03:38:12 +02:00
2018-06-26 08:03:25 +02:00
/**
2019-02-25 22:27:04 +01:00
* get column status from column key
2018-06-26 08:03:25 +02:00
*
2019-02-25 22:27:04 +01:00
* @ param string $colKey the column key
* @ return float width in mm
2018-06-26 08:03:25 +02:00
*/
2019-02-25 22:27:04 +01:00
public function getColumnStatus ( $colKey )
2018-06-26 08:03:25 +02:00
{
if ( ! empty ( $this -> cols [ $colKey ][ 'status' ])){
return true ;
}
else return false ;
}
2019-04-03 16:19:49 +02:00
/**
2019-04-08 16:00:01 +02:00
* Print standard column content
2019-04-03 16:19:49 +02:00
*
2019-04-08 16:00:01 +02:00
* @ param PDF $pdf Pdf object
* @ param float $tab_top Tab top position
* @ param float $tab_height Default tab height
* @ param Translate $outputlangs Output language
* @ param int $hidetop Hide top
* @ return float Height of col tab titles
2019-04-03 16:19:49 +02:00
*/
2019-04-08 18:02:27 +02:00
public function pdfTabTitles ( & $pdf , $tab_top , $tab_height , $outputlangs , $hidetop = 0 )
2019-04-03 16:19:49 +02:00
{
global $hookmanager ;
foreach ( $this -> cols as $colKey => $colDef ) {
$parameters = array (
'colKey' => $colKey ,
'pdf' => $pdf ,
'outputlangs' => $outputlangs ,
'tab_top' => $tab_top ,
'tab_height' => $tab_height ,
'hidetop' => $hidetop
);
$reshook = $hookmanager -> executeHooks ( 'pdfTabTitles' , $parameters , $this ); // Note that $object may have been modified by hook
if ( $reshook < 0 ) {
setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
} elseif ( empty ( $reshook )) {
if ( ! $this -> getColumnStatus ( $colKey )) continue ;
// get title label
$colDef [ 'title' ][ 'label' ] = ! empty ( $colDef [ 'title' ][ 'label' ]) ? $colDef [ 'title' ][ 'label' ] : $outputlangs -> transnoentities ( $colDef [ 'title' ][ 'textkey' ]);
// Add column separator
if ( ! empty ( $colDef [ 'border-left' ])) {
$pdf -> line ( $colDef [ 'xStartPos' ], $tab_top , $colDef [ 'xStartPos' ], $tab_top + $tab_height );
}
if ( empty ( $hidetop )) {
$pdf -> SetXY ( $colDef [ 'xStartPos' ] + $colDef [ 'title' ][ 'padding' ][ 3 ], $tab_top + $colDef [ 'title' ][ 'padding' ][ 0 ]);
$textWidth = $colDef [ 'width' ] - $colDef [ 'title' ][ 'padding' ][ 3 ] - $colDef [ 'title' ][ 'padding' ][ 1 ];
$pdf -> MultiCell ( $textWidth , 2 , $colDef [ 'title' ][ 'label' ], '' , $colDef [ 'title' ][ 'align' ]);
$this -> tabTitleHeight = max ( $pdf -> GetY () - $tab_top + $colDef [ 'title' ][ 'padding' ][ 2 ], $this -> tabTitleHeight );
}
}
}
return $this -> tabTitleHeight ;
}
2011-01-23 19:04:53 +01:00
}