2015-02-14 18:39:45 +01:00
< ? php
2018-11-27 11:36:31 +01:00
/* Copyright ( C ) 2011 Dimitri Mouillard < dmouillard @ teclib . com >
* Copyright ( C ) 2015 Laurent Destailleur < eldy @ users . sourceforge . net >
2019-01-28 21:39:22 +01:00
* Copyright ( C ) 2015 Alexandre Spangaro < aspangaro @ open - dsi . fr >
2018-12-04 14:29:47 +01:00
* Copyright ( C ) 2018 Nicolas ZABOURI < info @ inovea - conseil . com >
2024-03-02 16:38:35 +01:00
* Copyright ( c ) 2018 - 2024 Frédéric France < frederic . france @ free . fr >
2020-10-15 09:40:50 +02:00
* Copyright ( C ) 2016 - 2020 Ferran Marcet < fmarcet @ 2 byte . es >
2025-02-03 11:24:16 +01:00
* Copyright ( C ) 2024 - 2025 MDW < mdeweerd @ users . noreply . github . com >
2024-03-12 21:44:49 +01:00
* Copyright ( C ) 2024 Frédéric France < frederic . france @ free . fr >
2015-03-07 15:34:58 +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
* the Free Software Foundation ; either version 3 of the License , or
* ( 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
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2015-03-07 15:34:58 +01:00
*/
2015-03-17 11:23:45 +01:00
/**
* \file htdocs / expensereport / class / expensereport . class . php
* \ingroup expensereport
* \brief File to manage Expense Reports
*/
2019-12-18 15:20:36 +01:00
require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php' ;
2024-09-23 03:34:00 +02:00
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereportline.class.php' ;
2019-12-18 15:20:36 +01:00
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport_ik.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport_rule.class.php' ;
2015-02-14 18:39:45 +01:00
2024-01-06 16:11:04 +01:00
2015-02-14 18:39:45 +01:00
/**
* Class to manage Trips and Expenses
*/
class ExpenseReport extends CommonObject
{
2020-09-08 21:27:28 +02:00
/**
2018-08-22 11:48:26 +02:00
* @ var string ID to identify managed object
*/
2019-12-18 15:20:36 +01:00
public $element = 'expensereport' ;
2018-08-29 15:37:35 +02:00
2020-09-08 21:27:28 +02:00
/**
2018-08-22 12:04:50 +02:00
* @ var string Name of table without prefix where object is stored
*/
2019-12-18 15:20:36 +01:00
public $table_element = 'expensereport' ;
2018-08-29 15:37:35 +02:00
2020-12-05 23:53:55 +01:00
/**
* @ var string table element line name
*/
2020-09-08 21:27:28 +02:00
public $table_element_line = 'expensereport_det' ;
2020-12-05 23:53:55 +01:00
/**
* @ var string Fieldname with ID of parent key if this field has a parent
*/
2020-09-08 21:27:28 +02:00
public $fk_element = 'fk_expensereport' ;
2019-10-30 09:58:19 +01:00
2020-09-08 21:27:28 +02:00
/**
* @ var string String with name of icon for myobject . Must be the part after the 'object_' into object_myobject . png
*/
public $picto = 'trip' ;
2015-06-29 13:12:37 +02:00
2023-02-08 21:30:55 +01:00
/**
* @ var ExpenseReportLine [] array of expensereport lines
*/
2020-09-08 21:27:28 +02:00
public $lines = array ();
2017-07-08 17:57:35 +02:00
2023-02-08 21:30:55 +01:00
/**
* @ var ExpenseReportLine expensereport lines
*/
public $line ;
2024-03-12 21:44:49 +01:00
/**
* @ var int | string
*/
2020-09-08 21:27:28 +02:00
public $date_debut ;
2017-07-08 17:57:35 +02:00
2024-03-12 21:44:49 +01:00
/**
* @ var int | string
*/
2020-09-08 21:27:28 +02:00
public $date_fin ;
2015-06-29 13:12:37 +02:00
2023-11-14 01:52:42 +01:00
/**
* @ var int | string
*/
public $date_approbation ;
/**
* @ var int ID
*/
public $fk_user ;
2024-03-12 21:44:49 +01:00
/**
* @ var int ID
*/
2023-11-14 01:52:42 +01:00
public $user_approve_id ;
2020-09-08 21:27:28 +02:00
/**
2021-02-03 19:36:02 +01:00
* 0 = draft , 2 = validated ( attente approb ), 4 = canceled , 5 = approved , 6 = paid , 99 = denied
2020-09-08 21:27:28 +02:00
*
* @ var int Status
*/
public $status ;
2020-10-02 12:54:56 +02:00
/**
2021-02-03 19:36:02 +01:00
* 0 = draft , 2 = validated ( attente approb ), 4 = canceled , 5 = approved , 6 = paid , 99 = denied
2020-10-02 12:54:56 +02:00
*
* @ var int Status
2024-09-30 10:05:24 +02:00
* @ deprecated Use $status
2020-10-02 12:54:56 +02:00
*/
2020-09-08 21:27:28 +02:00
public $fk_statut ;
2020-02-25 14:16:40 +01:00
2024-03-17 21:20:36 +01:00
/**
* @ var int ID
*/
2020-09-08 21:27:28 +02:00
public $fk_c_paiement ;
2024-03-17 21:20:36 +01:00
/**
* @ var int ID
*/
2023-06-27 01:14:54 +02:00
public $modepaymentid ;
2024-09-30 10:05:24 +02:00
/**
* @ var int
*/
2020-09-08 21:27:28 +02:00
public $paid ;
2024-03-17 21:20:36 +01:00
2024-03-12 21:44:49 +01:00
// Paiement
2024-03-17 21:20:36 +01:00
/**
* @ var string Firstname Lastname
*/
2024-03-12 21:44:49 +01:00
public $user_paid_infos ;
2015-06-29 13:12:37 +02:00
2024-03-17 21:20:36 +01:00
/**
* @ var string Firstname Lastname
*/
2020-09-08 21:27:28 +02:00
public $user_author_infos ;
2024-03-17 21:20:36 +01:00
/**
* @ var string Firstname Lastname
*/
2020-09-08 21:27:28 +02:00
public $user_validator_infos ;
2015-02-14 18:39:45 +01:00
2024-09-30 10:05:24 +02:00
/**
* @ var string
*/
2020-12-12 19:49:13 +01:00
public $rule_warning_message ;
2020-09-08 21:27:28 +02:00
// ACTIONS
2015-06-29 13:12:37 +02:00
2020-09-08 21:27:28 +02:00
// Create
2024-03-12 21:44:49 +01:00
/**
* @ var int | string
*/
2020-09-08 21:27:28 +02:00
public $date_create ;
2023-02-08 21:30:55 +01:00
/**
* @ var int ID of user creator
*/
public $fk_user_creat ;
/**
* @ var int ID of user who reclaim expense report
*/
2020-09-08 21:27:28 +02:00
public $fk_user_author ; // Note fk_user_author is not the 'author' but the guy the expense report is for.
2015-06-29 13:12:37 +02:00
2020-09-08 21:27:28 +02:00
// Update
2024-03-12 21:44:49 +01:00
/**
* @ var int | string
*/
2019-02-25 20:35:59 +01:00
public $date_modif ;
2024-03-12 21:44:49 +01:00
/**
* @ var int ID
*/
2020-09-08 21:27:28 +02:00
public $fk_user_modif ;
2017-07-08 17:57:35 +02:00
2020-09-08 21:27:28 +02:00
// Refus
2024-03-12 21:44:49 +01:00
/**
* @ var int | string
*/
2020-09-08 21:27:28 +02:00
public $date_refuse ;
2024-03-12 21:44:49 +01:00
/**
* @ var string
*/
2020-09-08 21:27:28 +02:00
public $detail_refuse ;
2024-03-12 21:44:49 +01:00
/**
* @ var int ID
*/
2020-09-08 21:27:28 +02:00
public $fk_user_refuse ;
2015-06-29 13:12:37 +02:00
2020-09-08 21:27:28 +02:00
// Annulation
2024-03-12 21:44:49 +01:00
/**
* @ var int | string
*/
2020-09-08 21:27:28 +02:00
public $date_cancel ;
2024-03-12 21:44:49 +01:00
/**
* @ var string
*/
2020-09-08 21:27:28 +02:00
public $detail_cancel ;
2023-02-08 21:30:55 +01:00
/**
* @ var int ID of user who cancel expense report
*/
2020-09-08 21:27:28 +02:00
public $fk_user_cancel ;
2015-06-29 13:12:37 +02:00
2023-02-08 21:30:55 +01:00
/**
* @ var int User that is defined to approve
*/
public $fk_user_validator ;
2018-03-19 17:20:44 +01:00
2023-02-08 21:30:55 +01:00
/**
* Validation date
* @ var int
* @ deprecated
* @ see $date_valid
*/
2022-05-22 01:43:45 +02:00
public $datevalid ;
2023-02-08 21:30:55 +01:00
/**
* Validation date
* @ var int
*/
public $date_valid ;
/**
* @ var int ID of User making validation
*/
2020-09-08 21:27:28 +02:00
public $fk_user_valid ;
2024-03-12 21:44:49 +01:00
/**
2024-03-17 21:20:36 +01:00
* @ var string Firstname Lastname
2024-03-12 21:44:49 +01:00
*/
2020-09-08 21:27:28 +02:00
public $user_valid_infos ;
2015-06-29 13:12:37 +02:00
2020-09-08 21:27:28 +02:00
// Approve
2024-03-12 21:44:49 +01:00
/**
* @ var int | string
*/
2020-09-08 21:27:28 +02:00
public $date_approve ;
2015-06-29 13:12:37 +02:00
2024-03-12 21:44:49 +01:00
/**
* @ var int ID User that has approved
*/
public $fk_user_approve ;
2015-06-29 13:12:37 +02:00
2024-09-30 10:05:24 +02:00
/**
* @ var float | int
* @ deprecated See $total_localtax1
*/
2021-09-22 15:11:18 +02:00
public $localtax1 ; // for backward compatibility (real field should be total_localtax1 defined into CommonObject)
2024-09-30 10:05:24 +02:00
/**
* @ var float | int
* @ deprecated See $total_localtax2
*/
2021-09-22 15:11:18 +02:00
public $localtax2 ; // for backward compatibility (real field should be total_localtax2 defined into CommonObject)
2020-09-08 21:27:28 +02:00
/**
2018-10-04 09:33:30 +02:00
* Draft status
2017-06-15 11:08:53 +02:00
*/
const STATUS_DRAFT = 0 ;
2015-06-29 13:12:37 +02:00
2017-06-15 11:08:53 +02:00
/**
* Validated ( need to be paid )
*/
const STATUS_VALIDATED = 2 ;
2015-06-29 13:12:37 +02:00
2019-03-07 11:09:04 +01:00
/**
* Classified canceled
*/
const STATUS_CANCELED = 4 ;
2017-06-15 11:08:53 +02:00
/**
* Classified approved
*/
const STATUS_APPROVED = 5 ;
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
/**
* Classified paid .
*/
const STATUS_CLOSED = 6 ;
2017-08-22 10:11:32 +02:00
2023-02-08 21:30:55 +01:00
/**
* Classified refused
*/
const STATUS_REFUSED = 99 ;
2017-08-22 10:11:32 +02:00
2019-12-18 15:20:36 +01:00
public $fields = array (
2024-03-11 22:05:24 +01:00
'rowid' => array ( 'type' => 'integer' , 'label' => 'ID' , 'enabled' => 1 , 'visible' => - 1 , 'notnull' => 1 , 'position' => 10 ),
'ref' => array ( 'type' => 'varchar(50)' , 'label' => 'Ref' , 'enabled' => 1 , 'visible' => - 1 , 'notnull' => 1 , 'showoncombobox' => 1 , 'position' => 15 ),
'entity' => array ( 'type' => 'integer' , 'label' => 'Entity' , 'default' => '1' , 'enabled' => 1 , 'visible' => - 2 , 'notnull' => 1 , 'position' => 20 ),
'ref_number_int' => array ( 'type' => 'integer' , 'label' => 'Ref number int' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 25 ),
2025-01-12 18:00:01 +01:00
'ref_ext' => array ( 'type' => 'integer' , 'label' => 'RefExt' , 'enabled' => 1 , 'visible' => 0 , 'position' => 30 ),
2024-03-11 22:05:24 +01:00
'total_ht' => array ( 'type' => 'double(24,8)' , 'label' => 'Total ht' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 35 ),
'total_tva' => array ( 'type' => 'double(24,8)' , 'label' => 'Total tva' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 40 ),
'localtax1' => array ( 'type' => 'double(24,8)' , 'label' => 'Localtax1' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 45 ),
'localtax2' => array ( 'type' => 'double(24,8)' , 'label' => 'Localtax2' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 50 ),
'total_ttc' => array ( 'type' => 'double(24,8)' , 'label' => 'Total ttc' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 55 ),
'date_debut' => array ( 'type' => 'date' , 'label' => 'Date debut' , 'enabled' => 1 , 'visible' => - 1 , 'notnull' => 1 , 'position' => 60 ),
'date_fin' => array ( 'type' => 'date' , 'label' => 'Date fin' , 'enabled' => 1 , 'visible' => - 1 , 'notnull' => 1 , 'position' => 65 ),
'date_valid' => array ( 'type' => 'datetime' , 'label' => 'Date valid' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 75 ),
'date_approve' => array ( 'type' => 'datetime' , 'label' => 'Date approve' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 80 ),
'date_refuse' => array ( 'type' => 'datetime' , 'label' => 'Date refuse' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 85 ),
'date_cancel' => array ( 'type' => 'datetime' , 'label' => 'Date cancel' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 90 ),
'fk_user_author' => array ( 'type' => 'integer' , 'label' => 'Fk user author' , 'enabled' => 1 , 'visible' => - 1 , 'notnull' => 1 , 'position' => 100 ),
'fk_user_modif' => array ( 'type' => 'integer' , 'label' => 'Fk user modif' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 105 ),
'fk_user_valid' => array ( 'type' => 'integer' , 'label' => 'Fk user valid' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 110 ),
'fk_user_validator' => array ( 'type' => 'integer' , 'label' => 'Fk user validator' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 115 ),
'fk_user_approve' => array ( 'type' => 'integer' , 'label' => 'Fk user approve' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 120 ),
'fk_user_refuse' => array ( 'type' => 'integer' , 'label' => 'Fk user refuse' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 125 ),
'fk_user_cancel' => array ( 'type' => 'integer' , 'label' => 'Fk user cancel' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 130 ),
'fk_c_paiement' => array ( 'type' => 'integer' , 'label' => 'Fk c paiement' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 140 ),
'paid' => array ( 'type' => 'integer' , 'label' => 'Paid' , 'enabled' => 1 , 'visible' => - 1 , 'notnull' => 1 , 'position' => 145 ),
'note_public' => array ( 'type' => 'html' , 'label' => 'Note public' , 'enabled' => 1 , 'visible' => 0 , 'position' => 150 ),
'note_private' => array ( 'type' => 'html' , 'label' => 'Note private' , 'enabled' => 1 , 'visible' => 0 , 'position' => 155 ),
'detail_refuse' => array ( 'type' => 'varchar(255)' , 'label' => 'Detail refuse' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 160 ),
'detail_cancel' => array ( 'type' => 'varchar(255)' , 'label' => 'Detail cancel' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 165 ),
'integration_compta' => array ( 'type' => 'integer' , 'label' => 'Integration compta' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 170 ),
'fk_bank_account' => array ( 'type' => 'integer' , 'label' => 'Fk bank account' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 175 ),
'fk_multicurrency' => array ( 'type' => 'integer' , 'label' => 'Fk multicurrency' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 185 ),
'multicurrency_code' => array ( 'type' => 'varchar(255)' , 'label' => 'Multicurrency code' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 190 ),
'multicurrency_tx' => array ( 'type' => 'double(24,8)' , 'label' => 'Multicurrency tx' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 195 ),
'multicurrency_total_ht' => array ( 'type' => 'double(24,8)' , 'label' => 'Multicurrency total ht' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 200 ),
'multicurrency_total_tva' => array ( 'type' => 'double(24,8)' , 'label' => 'Multicurrency total tva' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 205 ),
'multicurrency_total_ttc' => array ( 'type' => 'double(24,8)' , 'label' => 'Multicurrency total ttc' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 210 ),
'extraparams' => array ( 'type' => 'varchar(255)' , 'label' => 'Extraparams' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 220 ),
'date_create' => array ( 'type' => 'datetime' , 'label' => 'Date create' , 'enabled' => 1 , 'visible' => - 1 , 'notnull' => 1 , 'position' => 300 ),
'tms' => array ( 'type' => 'timestamp' , 'label' => 'Tms' , 'enabled' => 1 , 'visible' => - 1 , 'notnull' => 1 , 'position' => 305 ),
'import_key' => array ( 'type' => 'varchar(14)' , 'label' => 'ImportId' , 'enabled' => 1 , 'visible' => - 1 , 'position' => 1000 ),
'model_pdf' => array ( 'type' => 'varchar(255)' , 'label' => 'Model pdf' , 'enabled' => 1 , 'visible' => 0 , 'position' => 1010 ),
'fk_statut' => array ( 'type' => 'integer' , 'label' => 'Fk statut' , 'enabled' => 1 , 'visible' => - 1 , 'notnull' => 1 , 'position' => 500 ),
2019-10-24 11:16:06 +02:00
);
2017-06-15 11:08:53 +02:00
/**
2020-09-08 21:27:28 +02:00
* Constructor
*
2024-01-13 19:48:41 +01:00
* @ param DoliDB $db Handler access base de donnees
2020-09-08 21:27:28 +02:00
*/
public function __construct ( $db )
{
$this -> db = $db ;
$this -> total_ht = 0 ;
$this -> total_ttc = 0 ;
$this -> total_tva = 0 ;
2021-09-22 15:11:18 +02:00
$this -> total_localtax1 = 0 ;
$this -> total_localtax2 = 0 ;
$this -> localtax1 = 0 ; // For backward compatibility
$this -> localtax2 = 0 ; // For backward compatibility
2020-09-08 21:27:28 +02:00
$this -> modepaymentid = 0 ;
// List of language codes for status
2023-11-24 10:10:24 +01:00
$this -> labelStatusShort = array ( 0 => 'Draft' , 2 => 'Validated' , 4 => 'Canceled' , 5 => 'Approved' , 6 => 'Paid' , 99 => 'Refused' );
$this -> labelStatus = array ( 0 => 'Draft' , 2 => 'ValidatedWaitingApproval' , 4 => 'Canceled' , 5 => 'Approved' , 6 => 'Paid' , 99 => 'Refused' );
2025-01-12 18:00:01 +01:00
$this -> fields [ 'ref_ext' ][ 'visible' ] = getDolGlobalInt ( 'MAIN_LIST_SHOW_REF_EXT' );
2020-09-08 21:27:28 +02:00
}
/**
* Create object in database
*
* @ param User $user User that create
* @ param int $notrigger Disable triggers
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
public function create ( $user , $notrigger = 0 )
{
global $conf , $langs ;
$now = dol_now ();
$error = 0 ;
// Check parameters
2021-02-25 22:45:02 +01:00
if ( empty ( $this -> date_debut ) || empty ( $this -> date_fin )) {
2020-09-08 21:27:28 +02:00
$this -> error = $langs -> trans ( 'ErrorFieldRequired' , $langs -> transnoentitiesnoconv ( 'Date' ));
return - 1 ;
}
$fuserid = $this -> fk_user_author ; // Note fk_user_author is not the 'author' but the guy the expense report is for.
2021-02-25 22:45:02 +01:00
if ( empty ( $fuserid )) {
$fuserid = $user -> id ;
}
2020-09-08 21:27:28 +02:00
$this -> db -> begin ();
$sql = " INSERT INTO " . MAIN_DB_PREFIX . $this -> table_element . " ( " ;
$sql .= " ref " ;
$sql .= " ,total_ht " ;
$sql .= " ,total_ttc " ;
$sql .= " ,total_tva " ;
$sql .= " ,date_debut " ;
$sql .= " ,date_fin " ;
$sql .= " ,date_create " ;
2021-02-04 12:05:28 +01:00
$sql .= " ,fk_user_creat " ;
2020-09-08 21:27:28 +02:00
$sql .= " ,fk_user_author " ;
$sql .= " ,fk_user_validator " ;
$sql .= " ,fk_user_approve " ;
$sql .= " ,fk_user_modif " ;
$sql .= " ,fk_statut " ;
$sql .= " ,fk_c_paiement " ;
$sql .= " ,paid " ;
$sql .= " ,note_public " ;
$sql .= " ,note_private " ;
$sql .= " ,entity " ;
$sql .= " ) VALUES( " ;
$sql .= " '(PROV)' " ;
2021-09-03 21:25:17 +02:00
$sql .= " , " . price2num ( $this -> total_ht , 'MT' );
$sql .= " , " . price2num ( $this -> total_ttc , 'MT' );
$sql .= " , " . price2num ( $this -> total_tva , 'MT' );
2020-09-08 21:27:28 +02:00
$sql .= " , ' " . $this -> db -> idate ( $this -> date_debut ) . " ' " ;
$sql .= " , ' " . $this -> db -> idate ( $this -> date_fin ) . " ' " ;
$sql .= " , ' " . $this -> db -> idate ( $now ) . " ' " ;
2021-09-03 21:25:17 +02:00
$sql .= " , " . (( int ) $user -> id );
$sql .= " , " . (( int ) $fuserid );
$sql .= " , " . ( $this -> fk_user_validator > 0 ? (( int ) $this -> fk_user_validator ) : " null " );
$sql .= " , " . ( $this -> fk_user_approve > 0 ? (( int ) $this -> fk_user_approve ) : " null " );
$sql .= " , " . ( $this -> fk_user_modif > 0 ? (( int ) $this -> fk_user_modif ) : " null " );
$sql .= " , " . ( $this -> fk_statut > 1 ? (( int ) $this -> fk_statut ) : 0 );
$sql .= " , " . ( $this -> modepaymentid ? (( int ) $this -> modepaymentid ) : " null " );
2020-09-08 21:27:28 +02:00
$sql .= " , 0 " ;
$sql .= " , " . ( $this -> note_public ? " ' " . $this -> db -> escape ( $this -> note_public ) . " ' " : " null " );
$sql .= " , " . ( $this -> note_private ? " ' " . $this -> db -> escape ( $this -> note_private ) . " ' " : " null " );
2021-09-03 21:25:17 +02:00
$sql .= " , " . (( int ) $conf -> entity );
2020-09-08 21:27:28 +02:00
$sql .= " ) " ;
$result = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $result ) {
2020-09-08 21:27:28 +02:00
$this -> id = $this -> db -> last_insert_id ( MAIN_DB_PREFIX . $this -> table_element );
$this -> ref = '(PROV' . $this -> id . ')' ;
2021-03-14 12:20:23 +01:00
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this -> table_element . " SET ref=' " . $this -> db -> escape ( $this -> ref ) . " ' WHERE rowid= " . (( int ) $this -> id );
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( ! $resql ) {
2020-09-08 21:27:28 +02:00
$this -> error = $this -> db -> lasterror ();
$error ++ ;
}
2021-02-25 22:45:02 +01:00
if ( ! $error ) {
if ( is_array ( $this -> lines ) && count ( $this -> lines ) > 0 ) {
foreach ( $this -> lines as $line ) {
2020-09-08 21:27:28 +02:00
// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
//if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object.
if ( ! is_object ( $line )) {
$line = ( object ) $line ;
$newndfline = new ExpenseReportLine ( $this -> db );
$newndfline -> fk_expensereport = $line -> fk_expensereport ;
$newndfline -> fk_c_type_fees = $line -> fk_c_type_fees ;
$newndfline -> fk_project = $line -> fk_project ;
$newndfline -> vatrate = $line -> vatrate ;
$newndfline -> vat_src_code = $line -> vat_src_code ;
2021-09-22 15:11:18 +02:00
$newndfline -> localtax1_tx = $line -> localtax1_tx ;
$newndfline -> localtax2_tx = $line -> localtax2_tx ;
$newndfline -> localtax1_type = $line -> localtax1_type ;
$newndfline -> localtax2_type = $line -> localtax2_type ;
2020-09-08 21:27:28 +02:00
$newndfline -> comments = $line -> comments ;
$newndfline -> qty = $line -> qty ;
$newndfline -> value_unit = $line -> value_unit ;
$newndfline -> total_ht = $line -> total_ht ;
$newndfline -> total_ttc = $line -> total_ttc ;
$newndfline -> total_tva = $line -> total_tva ;
2021-09-22 15:11:18 +02:00
$newndfline -> total_localtax1 = $line -> total_localtax1 ;
$newndfline -> total_localtax2 = $line -> total_localtax2 ;
2020-09-08 21:27:28 +02:00
$newndfline -> date = $line -> date ;
$newndfline -> rule_warning_message = $line -> rule_warning_message ;
$newndfline -> fk_c_exp_tax_cat = $line -> fk_c_exp_tax_cat ;
$newndfline -> fk_ecm_files = $line -> fk_ecm_files ;
} else {
$newndfline = $line ;
}
//$newndfline=new ExpenseReportLine($this->db);
$newndfline -> fk_expensereport = $this -> id ;
$result = $newndfline -> insert ();
2021-02-25 22:45:02 +01:00
if ( $result < 0 ) {
2020-09-08 21:27:28 +02:00
$this -> error = $newndfline -> error ;
2021-02-08 20:44:40 +01:00
$this -> errors = $newndfline -> errors ;
2020-09-08 21:27:28 +02:00
$error ++ ;
break ;
}
}
}
}
2021-02-25 22:45:02 +01:00
if ( ! $error ) {
2020-09-08 21:27:28 +02:00
$result = $this -> insertExtraFields ();
2021-02-25 22:45:02 +01:00
if ( $result < 0 ) {
$error ++ ;
}
2020-09-08 21:27:28 +02:00
}
2021-02-25 22:45:02 +01:00
if ( ! $error ) {
2022-11-26 16:28:58 +01:00
$result = $this -> update_price ( 1 );
2021-02-25 22:45:02 +01:00
if ( $result > 0 ) {
if ( ! $notrigger ) {
2017-02-02 11:42:38 +01:00
// Call trigger
2019-12-18 15:20:36 +01:00
$result = $this -> call_trigger ( 'EXPENSE_REPORT_CREATE' , $user );
2017-02-02 11:42:38 +01:00
if ( $result < 0 ) {
$error ++ ;
}
// End call triggers
}
2021-02-25 22:45:02 +01:00
if ( empty ( $error )) {
2017-02-02 11:42:38 +01:00
$this -> db -> commit ();
return $this -> id ;
2020-05-21 15:05:19 +02:00
} else {
2017-02-02 11:42:38 +01:00
$this -> db -> rollback ();
return - 4 ;
}
2020-09-08 21:27:28 +02:00
} else {
$this -> db -> rollback ();
return - 3 ;
}
} else {
dol_syslog ( get_class ( $this ) . " ::create error " . $this -> error , LOG_ERR );
$this -> db -> rollback ();
return - 2 ;
}
} else {
$this -> error = $this -> db -> lasterror () . " sql= " . $sql ;
$this -> db -> rollback ();
return - 1 ;
}
}
/**
* Load an object from its id and create a new one in database
*
2019-04-25 12:11:32 +02:00
* @ param User $user User making the clone
2020-09-08 21:27:28 +02:00
* @ param int $fk_user_author Id of new user
* @ return int New id of clone
*/
public function createFromClone ( User $user , $fk_user_author )
{
global $hookmanager ;
$error = 0 ;
2021-02-25 22:45:02 +01:00
if ( empty ( $fk_user_author )) {
$fk_user_author = $user -> id ;
}
2020-09-08 21:27:28 +02:00
$this -> db -> begin ();
// get extrafields so they will be clone
//foreach($this->lines as $line)
2023-12-04 12:12:12 +01:00
//$line->fetch_optionals();
2020-09-08 21:27:28 +02:00
// Load source object
$objFrom = clone $this ;
$this -> id = 0 ;
$this -> ref = '' ;
$this -> status = 0 ;
2020-10-07 15:01:28 +02:00
$this -> fk_statut = 0 ; // deprecated
2020-09-08 21:27:28 +02:00
// Clear fields
2023-02-08 21:30:55 +01:00
$this -> fk_user_creat = $user -> id ;
$this -> fk_user_author = $fk_user_author ; // Note fk_user_author is not the 'author' but the guy the expense report is for.
2024-01-30 22:24:24 +01:00
$this -> fk_user_valid = 0 ;
2020-09-08 21:27:28 +02:00
$this -> date_create = '' ;
2023-02-08 21:30:55 +01:00
$this -> date_creation = '' ;
$this -> date_validation = '' ;
2020-09-08 21:27:28 +02:00
2020-10-02 12:54:56 +02:00
// Remove link on lines to a joined file
2021-02-25 22:45:02 +01:00
if ( is_array ( $this -> lines ) && count ( $this -> lines ) > 0 ) {
foreach ( $this -> lines as $key => $line ) {
2020-10-02 12:54:56 +02:00
$this -> lines [ $key ] -> fk_ecm_files = 0 ;
}
}
2020-09-08 21:27:28 +02:00
// Create clone
$this -> context [ 'createfromclone' ] = 'createfromclone' ;
$result = $this -> create ( $user );
2021-02-25 22:45:02 +01:00
if ( $result < 0 ) {
$error ++ ;
}
2020-09-08 21:27:28 +02:00
2021-02-25 22:45:02 +01:00
if ( ! $error ) {
2020-09-08 21:27:28 +02:00
// Hook of thirdparty module
2021-02-25 22:45:02 +01:00
if ( is_object ( $hookmanager )) {
2024-03-11 22:05:24 +01:00
$parameters = array ( 'objFrom' => $objFrom );
2020-09-08 21:27:28 +02:00
$action = '' ;
$reshook = $hookmanager -> executeHooks ( 'createFrom' , $parameters , $this , $action ); // Note that $action and $object may have been modified by some hooks
2021-02-25 22:45:02 +01:00
if ( $reshook < 0 ) {
2023-02-24 16:57:39 +01:00
$this -> setErrorsFromObject ( $hookmanager );
2021-02-25 22:45:02 +01:00
$error ++ ;
}
2020-09-08 21:27:28 +02:00
}
}
unset ( $this -> context [ 'createfromclone' ]);
// End
2021-02-25 22:45:02 +01:00
if ( ! $error ) {
2020-09-08 21:27:28 +02:00
$this -> db -> commit ();
return $this -> id ;
} else {
$this -> db -> rollback ();
return - 1 ;
}
}
/**
* update
*
* @ param User $user User making change
2017-02-27 02:14:37 +01:00
* @ param int $notrigger Disable triggers
2020-09-08 21:27:28 +02:00
* @ param User $userofexpensereport New user we want to have the expense report on .
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
public function update ( $user , $notrigger = 0 , $userofexpensereport = null )
{
2017-02-02 11:42:38 +01:00
$error = 0 ;
$this -> db -> begin ();
2017-07-08 18:32:34 +02:00
2020-09-08 21:27:28 +02:00
$sql = " UPDATE " . MAIN_DB_PREFIX . $this -> table_element . " SET " ;
2024-10-29 02:18:17 +01:00
$sql .= " total_ht = " . (( float ) $this -> total_ht );
$sql .= " , total_ttc = " . (( float ) $this -> total_ttc );
$sql .= " , total_tva = " . (( float ) $this -> total_tva );
2020-09-08 21:27:28 +02:00
$sql .= " , date_debut = ' " . $this -> db -> idate ( $this -> date_debut ) . " ' " ;
$sql .= " , date_fin = ' " . $this -> db -> idate ( $this -> date_fin ) . " ' " ;
2021-02-25 22:45:02 +01:00
if ( $userofexpensereport && is_object ( $userofexpensereport )) {
2020-09-20 02:30:53 +02:00
$sql .= " , fk_user_author = " . ( $userofexpensereport -> id > 0 ? $userofexpensereport -> id : " null " ); // Note fk_user_author is not the 'author' but the guy the expense report is for.
2020-09-08 21:27:28 +02:00
}
$sql .= " , fk_user_validator = " . ( $this -> fk_user_validator > 0 ? $this -> fk_user_validator : " null " );
$sql .= " , fk_user_valid = " . ( $this -> fk_user_valid > 0 ? $this -> fk_user_valid : " null " );
$sql .= " , fk_user_approve = " . ( $this -> fk_user_approve > 0 ? $this -> fk_user_approve : " null " );
2024-10-29 02:18:17 +01:00
$sql .= " , fk_user_modif = " . (( int ) $user -> id );
2020-09-08 21:27:28 +02:00
$sql .= " , fk_statut = " . ( $this -> fk_statut >= 0 ? $this -> fk_statut : '0' );
$sql .= " , fk_c_paiement = " . ( $this -> fk_c_paiement > 0 ? $this -> fk_c_paiement : " null " );
$sql .= " , note_public = " . ( ! empty ( $this -> note_public ) ? " ' " . $this -> db -> escape ( $this -> note_public ) . " ' " : " '' " );
$sql .= " , note_private = " . ( ! empty ( $this -> note_private ) ? " ' " . $this -> db -> escape ( $this -> note_private ) . " ' " : " '' " );
$sql .= " , detail_refuse = " . ( ! empty ( $this -> detail_refuse ) ? " ' " . $this -> db -> escape ( $this -> detail_refuse ) . " ' " : " '' " );
2021-08-27 16:33:03 +02:00
$sql .= " WHERE rowid = " . (( int ) $this -> id );
2020-09-08 21:27:28 +02:00
2021-08-27 22:42:04 +02:00
dol_syslog ( get_class ( $this ) . " ::update " , LOG_DEBUG );
2020-09-08 21:27:28 +02:00
$result = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $result ) {
2024-12-03 20:34:47 +01:00
$result = $this -> insertExtraFields ();
if ( $result < 0 ) {
$error ++ ;
2024-12-01 23:24:27 +01:00
}
if ( ! $error && ! $notrigger ) {
2017-02-02 11:42:38 +01:00
// Call trigger
2022-04-02 10:31:58 +02:00
$result = $this -> call_trigger ( 'EXPENSE_REPORT_MODIFY' , $user );
2017-02-02 11:42:38 +01:00
if ( $result < 0 ) {
$error ++ ;
}
// End call triggers
}
2024-12-03 20:34:47 +01:00
if ( ! $error ) {
2017-02-02 11:42:38 +01:00
$this -> db -> commit ();
return 1 ;
2020-05-21 15:05:19 +02:00
} else {
2017-02-02 11:42:38 +01:00
$this -> db -> rollback ();
2019-12-18 15:20:36 +01:00
$this -> error = $this -> db -> error ();
2017-02-02 11:42:38 +01:00
return - 2 ;
}
2020-09-08 21:27:28 +02:00
} else {
2017-02-02 11:42:38 +01:00
$this -> db -> rollback ();
2020-09-08 21:27:28 +02:00
$this -> error = $this -> db -> error ();
return - 1 ;
}
}
/**
* Load an object from database
*
* @ param int $id Id { @ min 1 }
* @ param string $ref Ref { @ name ref }
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
public function fetch ( $id , $ref = '' )
{
2020-12-12 19:49:13 +01:00
$sql = " SELECT d.rowid, d.entity, d.ref, d.note_public, d.note_private, " ; // DEFAULT
2020-09-08 21:27:28 +02:00
$sql .= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel, " ; // ACTIONS
$sql .= " d.date_refuse, d.date_cancel, " ; // ACTIONS
2021-09-22 15:11:18 +02:00
$sql .= " d.total_ht, d.total_ttc, d.total_tva, " ;
$sql .= " d.localtax1 as total_localtax1, d.localtax2 as total_localtax2, " ;
2020-09-08 21:27:28 +02:00
$sql .= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, " ; // DATES (datetime)
2021-02-04 12:05:28 +01:00
$sql .= " d.fk_user_creat, d.fk_user_author, d.fk_user_modif, d.fk_user_validator, " ;
2020-09-08 21:27:28 +02:00
$sql .= " d.fk_user_valid, d.fk_user_approve, " ;
$sql .= " d.fk_statut as status, d.fk_c_paiement, d.paid " ;
$sql .= " FROM " . MAIN_DB_PREFIX . $this -> table_element . " as d " ;
2021-02-25 22:45:02 +01:00
if ( $ref ) {
$sql .= " WHERE d.ref = ' " . $this -> db -> escape ( $ref ) . " ' " ;
2025-01-15 09:10:11 +01:00
$sql .= " AND d.entity IN ( " . getEntity ( 'expensereport' ) . " ) " ;
2021-02-25 22:45:02 +01:00
} else {
2021-03-14 11:48:39 +01:00
$sql .= " WHERE d.rowid = " . (( int ) $id );
2021-02-25 22:45:02 +01:00
}
2020-09-08 21:27:28 +02:00
//$sql.= $restrict;
2021-08-27 22:42:04 +02:00
dol_syslog ( get_class ( $this ) . " ::fetch " , LOG_DEBUG );
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $resql ) {
2020-09-08 21:27:28 +02:00
$obj = $this -> db -> fetch_object ( $resql );
2021-02-25 22:45:02 +01:00
if ( $obj ) {
2020-09-08 21:27:28 +02:00
$this -> id = $obj -> rowid ;
$this -> ref = $obj -> ref ;
2020-12-12 19:49:13 +01:00
$this -> entity = $obj -> entity ;
2020-09-08 21:27:28 +02:00
$this -> total_ht = $obj -> total_ht ;
$this -> total_tva = $obj -> total_tva ;
$this -> total_ttc = $obj -> total_ttc ;
2021-09-22 15:11:18 +02:00
$this -> localtax1 = $obj -> total_localtax1 ; // For backward compatibility
$this -> localtax2 = $obj -> total_localtax2 ; // For backward compatibility
$this -> total_localtax1 = $obj -> total_localtax1 ;
$this -> total_localtax2 = $obj -> total_localtax2 ;
2020-09-08 21:27:28 +02:00
$this -> note_public = $obj -> note_public ;
$this -> note_private = $obj -> note_private ;
$this -> detail_refuse = $obj -> detail_refuse ;
$this -> detail_cancel = $obj -> detail_cancel ;
$this -> date_debut = $this -> db -> jdate ( $obj -> date_debut );
$this -> date_fin = $this -> db -> jdate ( $obj -> date_fin );
$this -> date_valid = $this -> db -> jdate ( $obj -> date_valid );
$this -> date_approve = $this -> db -> jdate ( $obj -> date_approve );
$this -> date_create = $this -> db -> jdate ( $obj -> date_create );
$this -> date_modif = $this -> db -> jdate ( $obj -> date_modif );
$this -> date_refuse = $this -> db -> jdate ( $obj -> date_refuse );
$this -> date_cancel = $this -> db -> jdate ( $obj -> date_cancel );
2021-02-04 12:05:28 +01:00
$this -> fk_user_creat = $obj -> fk_user_creat ;
2020-09-08 21:27:28 +02:00
$this -> fk_user_author = $obj -> fk_user_author ; // Note fk_user_author is not the 'author' but the guy the expense report is for.
$this -> fk_user_modif = $obj -> fk_user_modif ;
$this -> fk_user_validator = $obj -> fk_user_validator ;
$this -> fk_user_valid = $obj -> fk_user_valid ;
$this -> fk_user_refuse = $obj -> fk_user_refuse ;
$this -> fk_user_cancel = $obj -> fk_user_cancel ;
$this -> fk_user_approve = $obj -> fk_user_approve ;
$user_author = new User ( $this -> db );
2021-02-25 22:45:02 +01:00
if ( $this -> fk_user_author > 0 ) {
$user_author -> fetch ( $this -> fk_user_author );
}
2020-09-08 21:27:28 +02:00
$this -> user_author_infos = dolGetFirstLastname ( $user_author -> firstname , $user_author -> lastname );
$user_approver = new User ( $this -> db );
2021-02-25 22:45:02 +01:00
if ( $this -> fk_user_approve > 0 ) {
$user_approver -> fetch ( $this -> fk_user_approve );
} elseif ( $this -> fk_user_validator > 0 ) {
$user_approver -> fetch ( $this -> fk_user_validator ); // For backward compatibility
}
2020-09-08 21:27:28 +02:00
$this -> user_validator_infos = dolGetFirstLastname ( $user_approver -> firstname , $user_approver -> lastname );
$this -> fk_statut = $obj -> status ; // deprecated
$this -> status = $obj -> status ;
$this -> fk_c_paiement = $obj -> fk_c_paiement ;
$this -> paid = $obj -> paid ;
2021-02-25 22:45:02 +01:00
if ( $this -> status == self :: STATUS_APPROVED || $this -> status == self :: STATUS_CLOSED ) {
2020-09-08 21:27:28 +02:00
$user_valid = new User ( $this -> db );
2021-02-25 22:45:02 +01:00
if ( $this -> fk_user_valid > 0 ) {
$user_valid -> fetch ( $this -> fk_user_valid );
}
2020-09-08 21:27:28 +02:00
$this -> user_valid_infos = dolGetFirstLastname ( $user_valid -> firstname , $user_valid -> lastname );
}
2020-10-15 09:40:50 +02:00
$this -> fetch_optionals ();
2020-09-08 21:27:28 +02:00
$result = $this -> fetch_lines ();
return $result ;
} else {
return 0 ;
}
} else {
$this -> error = $this -> db -> lasterror ();
return - 1 ;
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2021-02-09 10:26:17 +01:00
/**
2023-10-09 10:22:49 +02:00
* Classify the expense report as paid
2021-02-09 10:26:17 +01:00
*
* @ deprecated
* @ see setPaid ()
* @ param int $id Id of expense report
* @ param user $fuser User making change
* @ param int $notrigger Disable triggers
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2021-02-09 10:26:17 +01:00
*/
public function set_paid ( $id , $fuser , $notrigger = 0 )
{
// phpcs:enable
dol_syslog ( get_class ( $this ) . " ::set_paid is deprecated, use setPaid instead " , LOG_NOTICE );
return $this -> setPaid ( $id , $fuser , $notrigger );
}
2020-09-08 21:27:28 +02:00
/**
* Classify the expense report as paid
*
* @ param int $id Id of expense report
* @ param user $fuser User making change
2017-02-02 11:42:38 +01:00
* @ param int $notrigger Disable triggers
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
2021-02-09 10:26:17 +01:00
public function setPaid ( $id , $fuser , $notrigger = 0 )
2020-09-08 21:27:28 +02:00
{
2017-02-02 11:42:38 +01:00
$error = 0 ;
$this -> db -> begin ();
2017-07-08 18:32:34 +02:00
2020-09-08 21:27:28 +02:00
$sql = " UPDATE " . MAIN_DB_PREFIX . " expensereport " ;
$sql .= " SET fk_statut = " . self :: STATUS_CLOSED . " , paid=1 " ;
2021-03-30 17:53:25 +02:00
$sql .= " WHERE rowid = " . (( int ) $id ) . " AND fk_statut = " . self :: STATUS_APPROVED ;
2015-06-29 13:12:37 +02:00
2023-10-09 10:22:49 +02:00
dol_syslog ( get_class ( $this ) . " ::setPaid " , LOG_DEBUG );
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $resql ) {
if ( $this -> db -> affected_rows ( $resql )) {
if ( ! $notrigger ) {
2017-02-02 11:42:38 +01:00
// Call trigger
2019-12-18 15:20:36 +01:00
$result = $this -> call_trigger ( 'EXPENSE_REPORT_PAID' , $fuser );
2017-02-02 11:42:38 +01:00
if ( $result < 0 ) {
$error ++ ;
}
// End call triggers
}
2017-07-08 18:32:34 +02:00
2021-02-25 22:45:02 +01:00
if ( empty ( $error )) {
2017-02-02 11:42:38 +01:00
$this -> db -> commit ();
return 1 ;
2020-05-21 15:05:19 +02:00
} else {
2017-02-02 11:42:38 +01:00
$this -> db -> rollback ();
2019-12-18 15:20:36 +01:00
$this -> error = $this -> db -> error ();
2017-02-02 11:42:38 +01:00
return - 2 ;
}
2020-09-08 21:27:28 +02:00
} else {
2017-02-02 11:42:38 +01:00
$this -> db -> commit ();
2020-09-08 21:27:28 +02:00
return 0 ;
}
} else {
2017-02-02 11:42:38 +01:00
$this -> db -> rollback ();
2020-09-08 21:27:28 +02:00
dol_print_error ( $this -> db );
return - 1 ;
}
}
2017-08-29 19:44:35 +02:00
2020-09-08 21:27:28 +02:00
/**
* Returns the label status
*
* @ param int $mode 0 = long label , 1 = short label , 2 = Picto + short label , 3 = Picto , 4 = Picto + long label , 5 = Short label + Picto
* @ return string Label
*/
public function getLibStatut ( $mode = 0 )
{
return $this -> LibStatut ( $this -> status , $mode );
}
2017-08-29 19:44:35 +02:00
2020-09-08 21:27:28 +02:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
2020-10-02 12:54:56 +02:00
* Returns the label of a status
2020-09-08 21:27:28 +02:00
*
2020-10-02 12:54:56 +02:00
* @ param int $status ID status
2020-09-08 21:27:28 +02:00
* @ param int $mode 0 = long label , 1 = short label , 2 = Picto + short label , 3 = Picto , 4 = Picto + long label , 5 = Short label + Picto , 6 = Long label + Picto
* @ return string Label
*/
public function LibStatut ( $status , $mode = 0 )
{
// phpcs:enable
global $langs ;
2017-08-29 19:44:35 +02:00
2023-11-24 10:10:24 +01:00
$labelStatus = $langs -> transnoentitiesnoconv ( $this -> labelStatus [ $status ]);
$labelStatusShort = $langs -> transnoentitiesnoconv ( $this -> labelStatusShort [ $status ]);
2017-08-29 19:44:35 +02:00
2023-11-24 10:10:24 +01:00
$statuslogo = array ( 0 => 'status0' , 2 => 'status1' , 4 => 'status6' , 5 => 'status4' , 6 => 'status6' , 99 => 'status5' );
$statusType = $statuslogo [ $status ];
2017-08-29 19:44:35 +02:00
2020-09-08 21:27:28 +02:00
return dolGetStatus ( $labelStatus , $labelStatusShort , '' , $statusType , $mode );
}
2016-04-29 12:26:41 +02:00
2017-07-08 18:32:34 +02:00
2020-09-08 21:27:28 +02:00
/**
* Load information on object
*
* @ param int $id Id of object
* @ return void
*/
public function info ( $id )
{
global $conf ;
2017-08-27 17:52:44 +02:00
2020-09-08 21:27:28 +02:00
$sql = " SELECT f.rowid, " ;
$sql .= " f.date_create as datec, " ;
$sql .= " f.tms as date_modification, " ;
$sql .= " f.date_valid as datev, " ;
$sql .= " f.date_approve as datea, " ;
2021-02-04 12:05:28 +01:00
$sql .= " f.fk_user_creat as fk_user_creation, " ;
2022-09-27 11:22:20 +02:00
$sql .= " f.fk_user_author as fk_user_author, " ;
2020-09-08 21:27:28 +02:00
$sql .= " f.fk_user_modif as fk_user_modification, " ;
$sql .= " f.fk_user_valid, " ;
$sql .= " f.fk_user_approve " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " expensereport as f " ;
2021-03-14 11:48:39 +01:00
$sql .= " WHERE f.rowid = " . (( int ) $id );
2020-09-08 21:27:28 +02:00
$sql .= " AND f.entity = " . $conf -> entity ;
2017-08-29 19:44:35 +02:00
2024-03-15 13:50:23 +01:00
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $resql ) {
if ( $this -> db -> num_rows ( $resql )) {
2020-09-08 21:27:28 +02:00
$obj = $this -> db -> fetch_object ( $resql );
2019-07-28 22:26:55 +02:00
2020-09-08 21:27:28 +02:00
$this -> id = $obj -> rowid ;
2017-08-27 17:52:44 +02:00
2020-09-08 21:27:28 +02:00
$this -> date_creation = $this -> db -> jdate ( $obj -> datec );
$this -> date_modification = $this -> db -> jdate ( $obj -> date_modification );
$this -> date_validation = $this -> db -> jdate ( $obj -> datev );
$this -> date_approbation = $this -> db -> jdate ( $obj -> datea );
2017-08-27 17:52:44 +02:00
2023-10-24 11:37:29 +02:00
$this -> user_creation_id = $obj -> fk_user_author ;
$this -> user_creation_id = $obj -> fk_user_creation ;
$this -> user_validation_id = $obj -> fk_user_valid ;
$this -> user_modification_id = $obj -> fk_user_modification ;
$this -> user_approve_id = $obj -> fk_user_approve ;
2020-09-08 21:27:28 +02:00
}
$this -> db -> free ( $resql );
} else {
dol_print_error ( $this -> db );
}
}
/**
* Initialise an instance with random values .
* Used to build previews or test instances .
* id must be 0 if object instance is a specimen .
*
2024-03-02 16:38:35 +01:00
* @ return int
2020-09-08 21:27:28 +02:00
*/
public function initAsSpecimen ()
{
2024-03-15 13:50:23 +01:00
global $user , $langs ;
2020-09-08 21:27:28 +02:00
$now = dol_now ();
2024-01-13 19:48:41 +01:00
// Initialise parameters
2020-09-08 21:27:28 +02:00
$this -> id = 0 ;
$this -> ref = 'SPECIMEN' ;
$this -> specimen = 1 ;
2020-12-12 19:49:13 +01:00
$this -> entity = 1 ;
2020-09-08 21:27:28 +02:00
$this -> date_create = $now ;
$this -> date_debut = $now ;
$this -> date_fin = $now ;
$this -> date_valid = $now ;
$this -> date_approve = $now ;
$type_fees_id = 2 ; // TF_TRIP
$this -> status = 5 ;
$this -> fk_user_author = $user -> id ;
$this -> fk_user_validator = $user -> id ;
$this -> fk_user_valid = $user -> id ;
$this -> fk_user_approve = $user -> id ;
$this -> note_private = 'Private note' ;
$this -> note_public = 'SPECIMEN' ;
2024-11-21 19:40:52 +01:00
$nbp = min ( 1000 , GETPOSTINT ( 'nblines' ) ? GETPOSTINT ( 'nblines' ) : 5 ); // We can force the nb of lines to test from command line (but not more than 1000)
2020-09-08 21:27:28 +02:00
$xnbp = 0 ;
while ( $xnbp < $nbp ) {
$line = new ExpenseReportLine ( $this -> db );
$line -> comments = $langs -> trans ( " Comment " ) . " " . $xnbp ;
$line -> date = ( $now - 3600 * ( 1 + $xnbp ));
$line -> total_ht = 100 ;
$line -> total_tva = 20 ;
$line -> total_ttc = 120 ;
$line -> qty = 1 ;
$line -> vatrate = 20 ;
$line -> value_unit = 120 ;
$line -> fk_expensereport = 0 ;
$line -> type_fees_code = 'TRA' ;
$line -> fk_c_type_fees = $type_fees_id ;
$line -> projet_ref = 'ABC' ;
$this -> lines [ $xnbp ] = $line ;
$xnbp ++ ;
$this -> total_ht += $line -> total_ht ;
$this -> total_tva += $line -> total_tva ;
$this -> total_ttc += $line -> total_ttc ;
}
2024-03-02 16:38:35 +01:00
return 1 ;
2020-09-08 21:27:28 +02:00
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* fetch_line_by_project
*
* @ param int $projectid Project id
* @ param User $user User
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
2024-03-15 13:50:23 +01:00
public function fetch_line_by_project ( $projectid , $user )
2020-09-08 21:27:28 +02:00
{
// phpcs:enable
2024-03-15 13:50:23 +01:00
global $langs ;
2020-09-08 21:27:28 +02:00
$langs -> load ( 'trips' );
2023-11-27 12:32:53 +01:00
if ( $user -> hasRight ( 'expensereport' , 'lire' )) {
2020-09-08 21:27:28 +02:00
$sql = " SELECT de.fk_expensereport, de.date, de.comments, de.total_ht, de.total_ttc " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " expensereport_det as de " ;
2021-03-30 19:12:07 +02:00
$sql .= " WHERE de.fk_projet = " . (( int ) $projectid );
2020-09-08 21:27:28 +02:00
2021-08-27 22:42:04 +02:00
dol_syslog ( get_class ( $this ) . " ::fetch " , LOG_DEBUG );
2020-09-20 02:30:53 +02:00
$result = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $result ) {
2020-09-20 02:30:53 +02:00
$num = $this -> db -> num_rows ( $result );
2020-09-08 21:27:28 +02:00
$i = 0 ;
$total_HT = 0 ;
$total_TTC = 0 ;
2021-02-25 22:45:02 +01:00
while ( $i < $num ) {
2020-09-20 02:30:53 +02:00
$objp = $this -> db -> fetch_object ( $result );
2020-09-08 21:27:28 +02:00
2020-10-02 12:54:56 +02:00
$sql2 = " SELECT d.rowid, d.fk_user_author, d.ref, d.fk_statut as status " ;
2020-09-08 21:27:28 +02:00
$sql2 .= " FROM " . MAIN_DB_PREFIX . " expensereport as d " ;
2020-09-20 02:30:53 +02:00
$sql2 .= " WHERE d.rowid = " . (( int ) $objp -> fk_expensereport );
2020-09-08 21:27:28 +02:00
2020-09-20 02:30:53 +02:00
$result2 = $this -> db -> query ( $sql2 );
$obj = $this -> db -> fetch_object ( $result2 );
2020-09-08 21:27:28 +02:00
$objp -> fk_user_author = $obj -> fk_user_author ;
$objp -> ref = $obj -> ref ;
2020-10-02 12:54:56 +02:00
$objp -> fk_c_expensereport_status = $obj -> status ;
2020-09-08 21:27:28 +02:00
$objp -> rowid = $obj -> rowid ;
2024-03-22 00:56:30 +01:00
$total_HT += $objp -> total_ht ;
$total_TTC += $objp -> total_ttc ;
2020-09-20 02:30:53 +02:00
$author = new User ( $this -> db );
2020-09-08 21:27:28 +02:00
$author -> fetch ( $objp -> fk_user_author );
print '<tr>' ;
print '<td><a href="' . DOL_URL_ROOT . '/expensereport/card.php?id=' . $objp -> rowid . '">' . $objp -> ref_num . '</a></td>' ;
print '<td class="center">' . dol_print_date ( $objp -> date , 'day' ) . '</td>' ;
print '<td>' . $author -> getNomUrl ( 1 ) . '</td>' ;
print '<td>' . $objp -> comments . '</td>' ;
print '<td class="right">' . price ( $objp -> total_ht ) . '</td>' ;
print '<td class="right">' . price ( $objp -> total_ttc ) . '</td>' ;
print '<td class="right">' ;
switch ( $objp -> fk_c_expensereport_status ) {
case 4 :
print img_picto ( $langs -> trans ( 'StatusOrderCanceled' ), 'statut5' );
break ;
case 1 :
print $langs -> trans ( 'Draft' ) . ' ' . img_picto ( $langs -> trans ( 'Draft' ), 'statut0' );
break ;
case 2 :
print $langs -> trans ( 'TripForValid' ) . ' ' . img_picto ( $langs -> trans ( 'TripForValid' ), 'statut3' );
break ;
case 5 :
print $langs -> trans ( 'TripForPaid' ) . ' ' . img_picto ( $langs -> trans ( 'TripForPaid' ), 'statut3' );
break ;
case 6 :
print $langs -> trans ( 'TripPaid' ) . ' ' . img_picto ( $langs -> trans ( 'TripPaid' ), 'statut4' );
break ;
}
/*
2021-02-25 22:45:02 +01:00
if ( $status == 4 ) return img_picto ( $langs -> trans ( 'StatusOrderCanceled' ), 'statut5' );
if ( $status == 1 ) return img_picto ( $langs -> trans ( 'StatusOrderDraft' ), 'statut0' );
if ( $status == 2 ) return img_picto ( $langs -> trans ( 'StatusOrderValidated' ), 'statut1' );
if ( $status == 2 ) return img_picto ( $langs -> trans ( 'StatusOrderOnProcess' ), 'statut3' );
if ( $status == 5 ) return img_picto ( $langs -> trans ( 'StatusOrderToBill' ), 'statut4' );
if ( $status == 6 ) return img_picto ( $langs -> trans ( 'StatusOrderOnProcess' ), 'statut6' );
*/
2020-09-08 21:27:28 +02:00
print '</td>' ;
print '</tr>' ;
$i ++ ;
}
print '<tr class="liste_total"><td colspan="4">' . $langs -> trans ( " Number " ) . ': ' . $i . '</td>' ;
print '<td class="right" width="100">' . $langs -> trans ( " TotalHT " ) . ' : ' . price ( $total_HT ) . '</td>' ;
print '<td class="right" width="100">' . $langs -> trans ( " TotalTTC " ) . ' : ' . price ( $total_TTC ) . '</td>' ;
print '<td> </td>' ;
print '</tr>' ;
} else {
2020-09-20 02:30:53 +02:00
$this -> error = $this -> db -> lasterror ();
2020-09-08 21:27:28 +02:00
return - 1 ;
}
}
2023-01-06 19:24:57 +01:00
return 0 ;
2020-09-08 21:27:28 +02:00
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* fetch_lines
*
2023-12-06 15:46:39 +01:00
* @ return int Return integer < 0 if OK , > 0 if KO
2020-09-08 21:27:28 +02:00
*/
public function fetch_lines ()
{
// phpcs:enable
$this -> lines = array ();
$sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,' ;
2021-09-23 02:41:53 +02:00
$sql .= " de. " . $this -> fk_element . " , de.fk_c_type_fees, de.fk_c_exp_tax_cat, de.fk_projet as fk_project, " ;
2021-09-22 15:11:18 +02:00
$sql .= ' de.tva_tx, de.vat_src_code,' ;
$sql .= ' de.localtax1_tx, de.localtax2_tx, de.localtax1_type, de.localtax2_type,' ;
$sql .= ' de.fk_ecm_files,' ;
2020-09-08 21:27:28 +02:00
$sql .= ' de.total_ht, de.total_tva, de.total_ttc,' ;
2021-10-21 22:57:50 +02:00
$sql .= ' de.total_localtax1, de.total_localtax2, de.rule_warning_message,' ;
2023-08-06 01:14:36 +02:00
$sql .= ' ctf.code as code_type_fees, ctf.label as label_type_fees, ctf.accountancy_code as accountancy_code_type_fees,' ;
2020-09-08 21:27:28 +02:00
$sql .= ' p.ref as ref_projet, p.title as title_projet' ;
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this -> table_element_line . ' as de' ;
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_type_fees as ctf ON de.fk_c_type_fees = ctf.id' ;
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'projet as p ON de.fk_projet = p.rowid' ;
2021-08-28 01:45:53 +02:00
$sql .= " WHERE de. " . $this -> fk_element . " = " . (( int ) $this -> id );
2023-11-27 11:41:05 +01:00
if ( getDolGlobalString ( 'EXPENSEREPORT_LINES_SORTED_BY_ROWID' )) {
2020-09-08 21:27:28 +02:00
$sql .= ' ORDER BY de.rang ASC, de.rowid ASC' ;
} else {
$sql .= ' ORDER BY de.rang ASC, de.date ASC' ;
}
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $resql ) {
2020-09-08 21:27:28 +02:00
$num = $this -> db -> num_rows ( $resql );
$i = 0 ;
2021-02-25 22:45:02 +01:00
while ( $i < $num ) {
2020-09-08 21:27:28 +02:00
$objp = $this -> db -> fetch_object ( $resql );
$deplig = new ExpenseReportLine ( $this -> db );
$deplig -> rowid = $objp -> rowid ;
$deplig -> id = $objp -> rowid ;
$deplig -> comments = $objp -> comments ;
$deplig -> qty = $objp -> qty ;
$deplig -> value_unit = $objp -> value_unit ;
$deplig -> date = $objp -> date ;
$deplig -> dates = $this -> db -> jdate ( $objp -> date );
$deplig -> fk_expensereport = $objp -> fk_expensereport ;
$deplig -> fk_c_type_fees = $objp -> fk_c_type_fees ;
$deplig -> fk_c_exp_tax_cat = $objp -> fk_c_exp_tax_cat ;
$deplig -> fk_projet = $objp -> fk_project ; // deprecated
$deplig -> fk_project = $objp -> fk_project ;
$deplig -> fk_ecm_files = $objp -> fk_ecm_files ;
$deplig -> total_ht = $objp -> total_ht ;
$deplig -> total_tva = $objp -> total_tva ;
$deplig -> total_ttc = $objp -> total_ttc ;
2021-09-22 15:11:18 +02:00
$deplig -> total_localtax1 = $objp -> total_localtax1 ;
2021-09-23 03:20:15 +02:00
$deplig -> total_localtax2 = $objp -> total_localtax2 ;
2020-09-08 21:27:28 +02:00
$deplig -> type_fees_code = empty ( $objp -> code_type_fees ) ? 'TF_OTHER' : $objp -> code_type_fees ;
2023-08-06 01:14:36 +02:00
$deplig -> type_fees_libelle = $objp -> label_type_fees ;
2021-12-16 15:41:23 +01:00
$deplig -> type_fees_accountancy_code = $objp -> accountancy_code_type_fees ;
2021-09-22 15:11:18 +02:00
$deplig -> tva_tx = $objp -> tva_tx ;
2020-09-08 21:27:28 +02:00
$deplig -> vatrate = $objp -> tva_tx ;
2021-09-22 15:11:18 +02:00
$deplig -> vat_src_code = $objp -> vat_src_code ;
$deplig -> localtax1_tx = $objp -> localtax1_tx ;
$deplig -> localtax2_tx = $objp -> localtax2_tx ;
$deplig -> localtax1_type = $objp -> localtax1_type ;
$deplig -> localtax2_type = $objp -> localtax2_type ;
2020-09-08 21:27:28 +02:00
$deplig -> projet_ref = $objp -> ref_projet ;
$deplig -> projet_title = $objp -> title_projet ;
2021-10-21 22:57:50 +02:00
$deplig -> rule_warning_message = $objp -> rule_warning_message ;
2020-09-08 21:27:28 +02:00
$deplig -> rang = $objp -> rang ;
$this -> lines [ $i ] = $deplig ;
$i ++ ;
}
$this -> db -> free ( $resql );
return 1 ;
} else {
$this -> error = $this -> db -> lasterror ();
dol_syslog ( get_class ( $this ) . " ::fetch_lines: Error " . $this -> error , LOG_ERR );
return - 3 ;
}
}
/**
2020-11-25 15:29:18 +01:00
* Delete object in database
2020-09-08 21:27:28 +02:00
*
2024-09-29 21:52:31 +02:00
* @ param ? User $user User that delete
* @ param int < 0 , 1 > $notrigger 0 = launch triggers after , 1 = disable triggers
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
2024-09-29 21:52:31 +02:00
public function delete ( $user = null , $notrigger = 0 )
2020-09-08 21:27:28 +02:00
{
2020-11-25 15:29:18 +01:00
global $conf ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php' ;
2020-10-31 14:32:18 +01:00
2020-11-25 15:29:18 +01:00
$error = 0 ;
2020-10-31 14:32:18 +01:00
2020-11-25 13:04:26 +01:00
$this -> db -> begin ();
2020-10-31 14:32:18 +01:00
2020-11-25 15:29:18 +01:00
if ( ! $notrigger ) {
// Call trigger
2022-04-02 16:08:04 +02:00
$result = $this -> call_trigger ( 'EXPENSE_REPORT_DELETE' , $user );
2021-02-25 22:45:02 +01:00
if ( $result < 0 ) {
$error ++ ;
}
2020-11-25 15:29:18 +01:00
// End call triggers
}
// Delete extrafields of lines and lines
if ( ! $error && ! empty ( $this -> table_element_line )) {
$tabletodelete = $this -> table_element_line ;
2021-03-30 19:12:07 +02:00
//$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id).")";
$sql = " DELETE FROM " . MAIN_DB_PREFIX . $tabletodelete . " WHERE " . $this -> fk_element . " = " . (( int ) $this -> id );
2020-12-01 02:41:19 +01:00
if ( ! $this -> db -> query ( $sql )) {
2020-11-25 15:29:18 +01:00
$error ++ ;
$this -> error = $this -> db -> lasterror ();
2020-11-26 09:16:16 +01:00
$this -> errors [] = $this -> error ;
2020-11-25 15:29:18 +01:00
dol_syslog ( get_class ( $this ) . " ::delete error " . $this -> error , LOG_ERR );
}
}
2020-11-26 09:16:16 +01:00
if ( ! $error ) {
// Delete linked object
$res = $this -> deleteObjectLinked ();
2021-02-25 22:45:02 +01:00
if ( $res < 0 ) {
$error ++ ;
}
2020-11-26 09:16:16 +01:00
}
if ( ! $error ) {
// Delete linked contacts
$res = $this -> delete_linked_contact ();
2021-02-25 22:45:02 +01:00
if ( $res < 0 ) {
$error ++ ;
}
2020-11-26 09:16:16 +01:00
}
2020-11-25 15:29:18 +01:00
// Removed extrafields of object
if ( ! $error ) {
$result = $this -> deleteExtraFields ();
if ( $result < 0 ) {
$error ++ ;
dol_syslog ( get_class ( $this ) . " ::delete error " . $this -> error , LOG_ERR );
}
}
// Delete main record
if ( ! $error ) {
2021-03-30 19:12:07 +02:00
$sql = " DELETE FROM " . MAIN_DB_PREFIX . $this -> table_element . " WHERE rowid = " . (( int ) $this -> id );
2020-11-25 15:29:18 +01:00
$res = $this -> db -> query ( $sql );
2020-12-01 02:41:19 +01:00
if ( ! $res ) {
2020-11-25 15:29:18 +01:00
$error ++ ;
2020-11-26 09:16:16 +01:00
$this -> error = $this -> db -> lasterror ();
$this -> errors [] = $this -> error ;
2020-11-25 15:29:18 +01:00
dol_syslog ( get_class ( $this ) . " ::delete error " . $this -> error , LOG_ERR );
}
}
// Delete record into ECM index and physically
if ( ! $error ) {
2020-11-26 09:16:16 +01:00
$res = $this -> deleteEcmFiles ( 0 ); // Deleting files physically is done later with the dol_delete_dir_recursive
2023-11-13 12:24:47 +01:00
$res = $this -> deleteEcmFiles ( 1 ); // Deleting files physically is done later with the dol_delete_dir_recursive
2020-12-01 02:41:19 +01:00
if ( ! $res ) {
2020-11-25 15:29:18 +01:00
$error ++ ;
}
}
if ( ! $error ) {
// We remove directory
$ref = dol_sanitizeFileName ( $this -> ref );
2020-11-26 09:16:16 +01:00
if ( $conf -> expensereport -> multidir_output [ $this -> entity ] && ! empty ( $this -> ref )) {
$dir = $conf -> expensereport -> multidir_output [ $this -> entity ] . " / " . $ref ;
2020-11-25 15:29:18 +01:00
$file = $dir . " / " . $ref . " .pdf " ;
if ( file_exists ( $file )) {
dol_delete_preview ( $this );
if ( ! dol_delete_file ( $file , 0 , 0 , 0 , $this )) {
$this -> error = 'ErrorFailToDeleteFile' ;
2020-11-26 09:16:16 +01:00
$this -> errors [] = $this -> error ;
2020-11-25 15:29:18 +01:00
$this -> db -> rollback ();
return 0 ;
}
}
if ( file_exists ( $dir )) {
$res = @ dol_delete_dir_recursive ( $dir );
if ( ! $res ) {
$this -> error = 'ErrorFailToDeleteDir' ;
2020-11-26 09:16:16 +01:00
$this -> errors [] = $this -> error ;
2020-11-25 15:29:18 +01:00
$this -> db -> rollback ();
return 0 ;
}
}
}
}
if ( ! $error ) {
dol_syslog ( get_class ( $this ) . " ::delete " . $this -> id . " by " . $user -> id , LOG_DEBUG );
$this -> db -> commit ();
return 1 ;
} else {
$this -> db -> rollback ();
return - 1 ;
}
2020-12-01 02:41:19 +01:00
}
2020-09-08 21:27:28 +02:00
/**
* Set to status validate
*
* @ param User $fuser User
* @ param int $notrigger Disable triggers
2023-12-06 15:46:39 +01:00
* @ return int Return integer < 0 if KO , 0 if nothing done , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
public function setValidate ( $fuser , $notrigger = 0 )
{
global $conf , $langs , $user ;
$error = 0 ;
$now = dol_now ();
// Protection
2021-02-25 22:45:02 +01:00
if ( $this -> status == self :: STATUS_VALIDATED ) {
2024-01-13 19:48:41 +01:00
dol_syslog ( get_class ( $this ) . " ::valid action abandoned: already validated " , LOG_WARNING );
2020-09-08 21:27:28 +02:00
return 0 ;
}
$this -> date_valid = $now ; // Required for the getNextNum later.
// Define new ref
2021-02-25 22:45:02 +01:00
if ( ! $error && ( preg_match ( '/^[\(]?PROV/i' , $this -> ref ) || empty ( $this -> ref ))) { // empty should not happened, but when it occurs, the test save life
2020-09-08 21:27:28 +02:00
$num = $this -> getNextNumRef ();
} else {
$num = $this -> ref ;
}
2021-02-25 22:45:02 +01:00
if ( empty ( $num ) || $num < 0 ) {
return - 1 ;
}
2020-09-08 21:27:28 +02:00
$this -> newref = dol_sanitizeFileName ( $num );
$this -> db -> begin ();
// Validate
$sql = " UPDATE " . MAIN_DB_PREFIX . $this -> table_element ;
2020-09-20 02:30:53 +02:00
$sql .= " SET ref = ' " . $this -> db -> escape ( $num ) . " ', " ;
2020-09-08 21:27:28 +02:00
$sql .= " fk_statut = " . self :: STATUS_VALIDATED . " , " ;
2023-09-11 17:51:38 +02:00
$sql .= " date_valid = ' " . $this -> db -> idate ( $this -> date_valid ) . " ', " ;
$sql .= " fk_user_valid = " . (( int ) $user -> id );
2021-08-27 16:33:03 +02:00
$sql .= " WHERE rowid = " . (( int ) $this -> id );
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $resql ) {
if ( ! $error && ! $notrigger ) {
2020-09-08 21:27:28 +02:00
// Call trigger
$result = $this -> call_trigger ( 'EXPENSE_REPORT_VALIDATE' , $fuser );
if ( $result < 0 ) {
$error ++ ;
}
// End call triggers
}
2021-02-25 22:45:02 +01:00
if ( ! $error ) {
2020-09-08 21:27:28 +02:00
$this -> oldref = $this -> ref ;
// Rename directory if dir was a temporary ref
2021-02-25 22:45:02 +01:00
if ( preg_match ( '/^[\(]?PROV/i' , $this -> ref )) {
2020-09-08 21:27:28 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php' ;
// Now we rename also files into index
$sql = 'UPDATE ' . MAIN_DB_PREFIX . " ecm_files set filename = CONCAT(' " . $this -> db -> escape ( $this -> newref ) . " ', SUBSTR(filename, " . ( strlen ( $this -> ref ) + 1 ) . " )), filepath = 'expensereport/ " . $this -> db -> escape ( $this -> newref ) . " ' " ;
2023-09-11 17:51:38 +02:00
$sql .= " WHERE filename LIKE ' " . $this -> db -> escape ( $this -> ref ) . " %' AND filepath = 'expensereport/ " . $this -> db -> escape ( $this -> ref ) . " ' AND entity = " . (( int ) $this -> entity );
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( ! $resql ) {
2023-12-04 12:12:12 +01:00
$error ++ ;
$this -> error = $this -> db -> lasterror ();
2021-02-25 22:45:02 +01:00
}
2023-10-31 19:28:11 +01:00
$sql = 'UPDATE ' . MAIN_DB_PREFIX . " ecm_files set filepath = 'expensereport/ " . $this -> db -> escape ( $this -> newref ) . " ' " ;
$sql .= " WHERE filepath = 'expensereport/ " . $this -> db -> escape ( $this -> ref ) . " ' and entity = " . $conf -> entity ;
$resql = $this -> db -> query ( $sql );
if ( ! $resql ) {
2023-12-04 12:12:12 +01:00
$error ++ ;
$this -> error = $this -> db -> lasterror ();
2023-10-31 19:28:11 +01:00
}
2020-09-08 21:27:28 +02:00
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
$oldref = dol_sanitizeFileName ( $this -> ref );
$newref = dol_sanitizeFileName ( $num );
2022-07-04 17:14:01 +02:00
$dirsource = $conf -> expensereport -> multidir_output [ $this -> entity ] . '/' . $oldref ;
$dirdest = $conf -> expensereport -> multidir_output [ $this -> entity ] . '/' . $newref ;
2021-02-25 22:45:02 +01:00
if ( ! $error && file_exists ( $dirsource )) {
2020-09-08 21:27:28 +02:00
dol_syslog ( get_class ( $this ) . " ::setValidate() rename dir " . $dirsource . " into " . $dirdest );
2021-02-25 22:45:02 +01:00
if ( @ rename ( $dirsource , $dirdest )) {
2020-09-08 21:27:28 +02:00
dol_syslog ( " Rename ok " );
// Rename docs starting with $oldref with $newref
2022-07-04 17:14:01 +02:00
$listoffiles = dol_dir_list ( $dirdest , 'files' , 1 , '^' . preg_quote ( $oldref , '/' ));
2021-02-25 22:45:02 +01:00
foreach ( $listoffiles as $fileentry ) {
2020-09-08 21:27:28 +02:00
$dirsource = $fileentry [ 'name' ];
$dirdest = preg_replace ( '/^' . preg_quote ( $oldref , '/' ) . '/' , $newref , $dirsource );
$dirsource = $fileentry [ 'path' ] . '/' . $dirsource ;
$dirdest = $fileentry [ 'path' ] . '/' . $dirdest ;
@ rename ( $dirsource , $dirdest );
}
}
}
}
}
// Set new ref and current status
2021-02-25 22:45:02 +01:00
if ( ! $error ) {
2020-09-08 21:27:28 +02:00
$this -> ref = $num ;
2020-10-02 12:54:56 +02:00
$this -> status = self :: STATUS_VALIDATED ;
2020-09-08 21:27:28 +02:00
}
2021-02-25 22:45:02 +01:00
if ( empty ( $error )) {
2020-09-08 21:27:28 +02:00
$this -> db -> commit ();
return 1 ;
} else {
$this -> db -> rollback ();
$this -> error = $this -> db -> error ();
return - 2 ;
}
} else {
$this -> db -> rollback ();
$this -> error = $this -> db -> lasterror ();
return - 1 ;
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* set_save_from_refuse
*
* @ param User $fuser User
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
public function set_save_from_refuse ( $fuser )
{
// phpcs:enable
// Sélection de la date de début de la NDF
$sql = 'SELECT date_debut' ;
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this -> table_element ;
2021-08-27 23:36:06 +02:00
$sql .= " WHERE rowid = " . (( int ) $this -> id );
2020-09-08 21:27:28 +02:00
$result = $this -> db -> query ( $sql );
$objp = $this -> db -> fetch_object ( $result );
$this -> date_debut = $this -> db -> jdate ( $objp -> date_debut );
2021-02-25 22:45:02 +01:00
if ( $this -> status != self :: STATUS_VALIDATED ) {
2020-09-08 21:27:28 +02:00
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this -> table_element ;
$sql .= " SET fk_statut = " . self :: STATUS_VALIDATED ;
2021-08-27 23:36:06 +02:00
$sql .= " WHERE rowid = " . (( int ) $this -> id );
2020-09-08 21:27:28 +02:00
2021-08-27 22:42:04 +02:00
dol_syslog ( get_class ( $this ) . " ::set_save_from_refuse " , LOG_DEBUG );
2020-09-08 21:27:28 +02:00
2021-02-25 22:45:02 +01:00
if ( $this -> db -> query ( $sql )) {
2020-09-08 21:27:28 +02:00
return 1 ;
} else {
$this -> error = $this -> db -> lasterror ();
return - 1 ;
}
} else {
dol_syslog ( get_class ( $this ) . " ::set_save_from_refuse expensereport already with save status " , LOG_WARNING );
}
2023-01-06 19:24:57 +01:00
return 0 ;
2020-09-08 21:27:28 +02:00
}
/**
* Set status to approved
*
* @ param User $fuser User
* @ param int $notrigger Disable triggers
2023-12-06 15:46:39 +01:00
* @ return int Return integer < 0 if KO , 0 if nothing done , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
public function setApproved ( $fuser , $notrigger = 0 )
{
$now = dol_now ();
$error = 0 ;
// date approval
$this -> date_approve = $now ;
2021-02-25 22:45:02 +01:00
if ( $this -> status != self :: STATUS_APPROVED ) {
2020-09-08 21:27:28 +02:00
$this -> db -> begin ();
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this -> table_element ;
2021-03-30 03:37:54 +02:00
$sql .= " SET ref = ' " . $this -> db -> escape ( $this -> ref ) . " ', fk_statut = " . self :: STATUS_APPROVED . " , fk_user_approve = " . (( int ) $fuser -> id ) . " , " ;
2020-09-08 21:27:28 +02:00
$sql .= " date_approve=' " . $this -> db -> idate ( $this -> date_approve ) . " ' " ;
2021-08-27 23:36:06 +02:00
$sql .= " WHERE rowid = " . (( int ) $this -> id );
2021-02-25 22:45:02 +01:00
if ( $this -> db -> query ( $sql )) {
if ( ! $notrigger ) {
2020-09-08 21:27:28 +02:00
// Call trigger
$result = $this -> call_trigger ( 'EXPENSE_REPORT_APPROVE' , $fuser );
if ( $result < 0 ) {
$error ++ ;
}
// End call triggers
}
2021-02-25 22:45:02 +01:00
if ( empty ( $error )) {
2020-09-08 21:27:28 +02:00
$this -> db -> commit ();
return 1 ;
} else {
$this -> db -> rollback ();
$this -> error = $this -> db -> error ();
return - 2 ;
}
} else {
$this -> db -> rollback ();
$this -> error = $this -> db -> lasterror ();
return - 1 ;
}
} else {
dol_syslog ( get_class ( $this ) . " ::setApproved expensereport already with approve status " , LOG_WARNING );
}
return 0 ;
}
/**
* setDeny
*
* @ param User $fuser User
* @ param string $details Details
* @ param int $notrigger Disable triggers
* @ return int
*/
public function setDeny ( $fuser , $details , $notrigger = 0 )
{
$now = dol_now ();
$error = 0 ;
// date de refus
2021-02-25 22:45:02 +01:00
if ( $this -> status != self :: STATUS_REFUSED ) {
2020-09-08 21:27:28 +02:00
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this -> table_element ;
2021-03-30 03:37:54 +02:00
$sql .= " SET ref = ' " . $this -> db -> escape ( $this -> ref ) . " ', fk_statut = " . self :: STATUS_REFUSED . " , fk_user_refuse = " . (( int ) $fuser -> id ) . " , " ;
2020-09-08 21:27:28 +02:00
$sql .= " date_refuse=' " . $this -> db -> idate ( $now ) . " ', " ;
$sql .= " detail_refuse=' " . $this -> db -> escape ( $details ) . " ', " ;
$sql .= " fk_user_approve = NULL " ;
2021-08-27 23:36:06 +02:00
$sql .= " WHERE rowid = " . (( int ) $this -> id );
2021-02-25 22:45:02 +01:00
if ( $this -> db -> query ( $sql )) {
2020-10-07 15:01:28 +02:00
$this -> fk_statut = 99 ; // deprecated
2020-10-02 12:54:56 +02:00
$this -> status = 99 ;
2020-09-08 21:27:28 +02:00
$this -> fk_user_refuse = $fuser -> id ;
$this -> detail_refuse = $details ;
$this -> date_refuse = $now ;
2021-02-25 22:45:02 +01:00
if ( ! $notrigger ) {
2020-09-08 21:27:28 +02:00
// Call trigger
$result = $this -> call_trigger ( 'EXPENSE_REPORT_DENY' , $fuser );
if ( $result < 0 ) {
$error ++ ;
}
// End call triggers
}
2021-02-25 22:45:02 +01:00
if ( empty ( $error )) {
2020-09-08 21:27:28 +02:00
$this -> db -> commit ();
return 1 ;
} else {
$this -> db -> rollback ();
$this -> error = $this -> db -> error ();
return - 2 ;
}
} else {
$this -> db -> rollback ();
$this -> error = $this -> db -> lasterror ();
return - 1 ;
}
} else {
dol_syslog ( get_class ( $this ) . " ::setDeny expensereport already with refuse status " , LOG_WARNING );
}
2023-01-06 19:24:57 +01:00
return 0 ;
2020-09-08 21:27:28 +02:00
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* set_unpaid
*
2021-02-09 09:55:48 +01:00
* @ deprecated
* @ see setUnpaid ()
2020-09-08 21:27:28 +02:00
* @ param User $fuser User
* @ param int $notrigger Disable triggers
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
public function set_unpaid ( $fuser , $notrigger = 0 )
{
// phpcs:enable
2021-02-09 09:55:48 +01:00
dol_syslog ( get_class ( $this ) . " ::set_unpaid is deprecated, use setUnpaid instead " , LOG_NOTICE );
return $this -> setUnpaid ( $fuser , $notrigger );
}
/**
* set_unpaid
*
* @ param User $fuser User
* @ param int $notrigger Disable triggers
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2021-02-09 09:55:48 +01:00
*/
public function setUnpaid ( $fuser , $notrigger = 0 )
{
2017-02-02 11:42:38 +01:00
$error = 0 ;
2017-07-08 18:32:34 +02:00
2021-02-25 22:45:02 +01:00
if ( $this -> paid ) {
2017-02-02 11:42:38 +01:00
$this -> db -> begin ();
2017-07-08 18:32:34 +02:00
2020-09-08 21:27:28 +02:00
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this -> table_element ;
$sql .= " SET paid = 0, fk_statut = " . self :: STATUS_APPROVED ;
2021-08-27 23:36:06 +02:00
$sql .= " WHERE rowid = " . (( int ) $this -> id );
2015-06-18 06:12:05 +02:00
2021-08-27 22:42:04 +02:00
dol_syslog ( get_class ( $this ) . " ::set_unpaid " , LOG_DEBUG );
2015-06-29 13:12:37 +02:00
2021-02-25 22:45:02 +01:00
if ( $this -> db -> query ( $sql )) {
if ( ! $notrigger ) {
2017-02-02 11:42:38 +01:00
// Call trigger
2019-12-18 15:20:36 +01:00
$result = $this -> call_trigger ( 'EXPENSE_REPORT_UNPAID' , $fuser );
2017-02-02 11:42:38 +01:00
if ( $result < 0 ) {
$error ++ ;
}
// End call triggers
}
2017-07-08 18:32:34 +02:00
2021-02-25 22:45:02 +01:00
if ( empty ( $error )) {
2017-02-02 11:42:38 +01:00
$this -> db -> commit ();
return 1 ;
2020-05-21 15:05:19 +02:00
} else {
2017-02-02 11:42:38 +01:00
$this -> db -> rollback ();
2019-12-18 15:20:36 +01:00
$this -> error = $this -> db -> error ();
2017-02-02 11:42:38 +01:00
return - 2 ;
}
2020-05-21 15:05:19 +02:00
} else {
2017-02-02 11:42:38 +01:00
$this -> db -> rollback ();
2019-12-18 15:20:36 +01:00
$this -> error = $this -> db -> error ();
2017-02-02 11:42:38 +01:00
return - 1 ;
}
2020-09-08 21:27:28 +02:00
} else {
dol_syslog ( get_class ( $this ) . " ::set_unpaid expensereport already with unpaid status " , LOG_WARNING );
}
2023-01-06 19:24:57 +01:00
return 0 ;
2020-09-08 21:27:28 +02:00
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* set_cancel
*
* @ param User $fuser User
* @ param string $detail Detail
2017-02-02 11:42:38 +01:00
* @ param int $notrigger Disable triggers
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
public function set_cancel ( $fuser , $detail , $notrigger = 0 )
{
// phpcs:enable
2017-02-02 11:42:38 +01:00
$error = 0 ;
2020-09-08 21:27:28 +02:00
$this -> date_cancel = $this -> db -> idate ( dol_now ());
2021-02-25 22:45:02 +01:00
if ( $this -> status != self :: STATUS_CANCELED ) {
2017-02-02 11:42:38 +01:00
$this -> db -> begin ();
2017-07-08 18:32:34 +02:00
2020-09-08 21:27:28 +02:00
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this -> table_element ;
2021-03-30 03:37:54 +02:00
$sql .= " SET fk_statut = " . self :: STATUS_CANCELED . " , fk_user_cancel = " . (( int ) $fuser -> id );
2020-09-08 21:27:28 +02:00
$sql .= " , date_cancel=' " . $this -> db -> idate ( $this -> date_cancel ) . " ' " ;
2022-12-28 16:20:35 +01:00
$sql .= " , detail_cancel=' " . $this -> db -> escape ( $detail ) . " ' " ;
2021-08-27 23:36:06 +02:00
$sql .= " WHERE rowid = " . (( int ) $this -> id );
2015-06-29 13:12:37 +02:00
2021-08-27 22:42:04 +02:00
dol_syslog ( get_class ( $this ) . " ::set_cancel " , LOG_DEBUG );
2015-06-29 13:12:37 +02:00
2021-02-25 22:45:02 +01:00
if ( $this -> db -> query ( $sql )) {
if ( ! $notrigger ) {
2017-02-02 11:42:38 +01:00
// Call trigger
2019-12-18 15:20:36 +01:00
$result = $this -> call_trigger ( 'EXPENSE_REPORT_CANCEL' , $fuser );
2017-02-02 11:42:38 +01:00
if ( $result < 0 ) {
$error ++ ;
}
// End call triggers
}
2017-07-08 18:32:34 +02:00
2021-02-25 22:45:02 +01:00
if ( empty ( $error )) {
2017-02-02 11:42:38 +01:00
$this -> db -> commit ();
return 1 ;
2020-05-21 15:05:19 +02:00
} else {
2017-02-02 11:42:38 +01:00
$this -> db -> rollback ();
2019-12-18 15:20:36 +01:00
$this -> error = $this -> db -> error ();
2017-02-02 11:42:38 +01:00
return - 2 ;
}
2020-09-08 21:27:28 +02:00
} else {
2017-02-02 11:42:38 +01:00
$this -> db -> rollback ();
2020-09-08 21:27:28 +02:00
$this -> error = $this -> db -> error ();
return - 1 ;
}
} else {
dol_syslog ( get_class ( $this ) . " ::set_cancel expensereport already with cancel status " , LOG_WARNING );
}
2022-12-28 16:20:35 +01:00
return 0 ;
2020-09-08 21:27:28 +02:00
}
/**
* Return next reference of expense report not already used
*
2024-01-30 22:24:24 +01:00
* @ return string | int <- 2 , - 1 > free ref , or < 0 if error
2020-09-08 21:27:28 +02:00
*/
public function getNextNumRef ()
{
global $langs , $conf ;
$langs -> load ( " trips " );
2023-11-27 11:41:05 +01:00
if ( getDolGlobalString ( 'EXPENSEREPORT_ADDON' )) {
2020-09-08 21:27:28 +02:00
$mybool = false ;
2023-11-27 12:32:53 +01:00
$file = getDolGlobalString ( 'EXPENSEREPORT_ADDON' ) . " .php " ;
2024-01-05 04:18:53 +01:00
$classname = getDolGlobalString ( 'EXPENSEREPORT_ADDON' );
2017-07-08 17:57:35 +02:00
2020-09-08 21:27:28 +02:00
// Include file with class
$dirmodels = array_merge ( array ( '/' ), ( array ) $conf -> modules_parts [ 'models' ]);
2021-02-25 22:45:02 +01:00
foreach ( $dirmodels as $reldir ) {
2020-09-08 21:27:28 +02:00
$dir = dol_buildpath ( $reldir . " core/modules/expensereport/ " );
// Load file with numbering class (if found)
2024-03-21 13:21:30 +01:00
$mybool = (( bool ) @ include_once $dir . $file ) || $mybool ;
2020-09-08 21:27:28 +02:00
}
2024-03-22 00:56:30 +01:00
if ( ! $mybool ) {
2024-01-20 09:22:38 +01:00
dol_print_error ( null , " Failed to include file " . $file );
2020-09-08 21:27:28 +02:00
return '' ;
}
$obj = new $classname ();
2024-08-29 13:34:24 +02:00
'@phan-var-force ModeleNumRefExpenseReport $obj' ;
2020-09-08 21:27:28 +02:00
$numref = $obj -> getNextValue ( $this );
2021-02-25 22:45:02 +01:00
if ( $numref != " " ) {
2020-09-08 21:27:28 +02:00
return $numref ;
} else {
$this -> error = $obj -> error ;
$this -> errors = $obj -> errors ;
//dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
return - 1 ;
}
} else {
$this -> error = " Error_EXPENSEREPORT_ADDON_NotDefined " ;
return - 2 ;
}
}
2023-02-14 21:00:34 +01:00
/**
* getTooltipContentArray
2024-09-23 03:24:19 +02:00
* @ param array < string , mixed > $params params to construct tooltip data
2023-02-14 21:00:34 +01:00
* @ since v18
2024-09-23 03:24:19 +02:00
* @ return array { picto ? : string , ref ? : string , refsupplier ? : string , label ? : string , date ? : string , date_echeance ? : string , amountht ? : string , total_ht ? : string , totaltva ? : string , amountlt1 ? : string , amountlt2 ? : string , amountrevenustamp ? : string , totalttc ? : string } | array { optimize : string }
2023-02-14 21:00:34 +01:00
*/
public function getTooltipContentArray ( $params )
{
global $conf , $langs ;
2024-04-04 11:00:35 +02:00
$langs -> load ( 'trips' );
2023-02-22 01:09:23 +01:00
$nofetch = ! empty ( $params [ 'nofetch' ]);
2023-02-14 21:00:34 +01:00
$moretitle = $params [ 'moretitle' ] ? ? '' ;
2023-02-22 01:09:23 +01:00
$datas = array ();
2023-02-14 21:00:34 +01:00
$datas [ 'picto' ] = img_picto ( '' , $this -> picto ) . ' <u class="paddingrightonly">' . $langs -> trans ( " ExpenseReport " ) . '</u>' ;
if ( isset ( $this -> status )) {
$datas [ 'picto' ] .= ' ' . $this -> getLibStatut ( 5 );
}
if ( $moretitle ) {
$datas [ 'picto' ] .= ' - ' . $moretitle ;
}
if ( ! empty ( $this -> ref )) {
$datas [ 'ref' ] = '<br><b>' . $langs -> trans ( 'Ref' ) . ':</b> ' . $this -> ref ;
}
if ( ! empty ( $this -> total_ht )) {
$datas [ 'total_ht' ] = '<br><b>' . $langs -> trans ( 'AmountHT' ) . ':</b> ' . price ( $this -> total_ht , 0 , $langs , 0 , - 1 , - 1 , $conf -> currency );
}
if ( ! empty ( $this -> total_tva )) {
$datas [ 'total_tva' ] = '<br><b>' . $langs -> trans ( 'VAT' ) . ':</b> ' . price ( $this -> total_tva , 0 , $langs , 0 , - 1 , - 1 , $conf -> currency );
}
if ( ! empty ( $this -> total_ttc )) {
$datas [ 'total_ttc' ] = '<br><b>' . $langs -> trans ( 'AmountTTC' ) . ':</b> ' . price ( $this -> total_ttc , 0 , $langs , 0 , - 1 , - 1 , $conf -> currency );
}
return $datas ;
}
2020-09-08 21:27:28 +02:00
/**
2024-08-07 01:20:43 +02:00
* Return clickable name ( with picto eventually )
2020-09-08 21:27:28 +02:00
*
2024-09-30 10:05:24 +02:00
* @ param int < 0 , 2 > $withpicto 0 = No picto , 1 = Include picto into link , 2 = Only picto
* @ param string $option Where points the link ( '' , 'document' , .. )
* @ param int $max Max length of shown ref
* @ param int < 0 , 1 > $short 1 = Return just URL
* @ param string $moretitle Add more text to title tooltip
* @ param int < 0 , 1 > $notooltip 1 = Disable tooltip
* @ param int <- 1 , 1 > $save_lastsearch_value - 1 = Auto , 0 = No save of lastsearch_values when clicking , 1 = Save lastsearch_values whenclicking
2020-09-08 21:27:28 +02:00
* @ return string String with URL
*/
2021-05-21 18:53:09 +02:00
public function getNomUrl ( $withpicto = 0 , $option = '' , $max = 0 , $short = 0 , $moretitle = '' , $notooltip = 0 , $save_lastsearch_value = - 1 )
2020-09-08 21:27:28 +02:00
{
2024-03-15 13:50:23 +01:00
global $langs , $hookmanager ;
2020-09-08 21:27:28 +02:00
$result = '' ;
$url = DOL_URL_ROOT . '/expensereport/card.php?id=' . $this -> id ;
2021-02-25 22:45:02 +01:00
if ( $short ) {
return $url ;
}
2020-09-08 21:27:28 +02:00
2023-02-14 21:00:34 +01:00
$params = [
'id' => $this -> id ,
'objecttype' => $this -> element ,
'option' => $option ,
'moretitle' => $moretitle ,
'nofetch' => 1 ,
];
$classfortooltip = 'classfortooltip' ;
$dataparams = '' ;
if ( getDolGlobalInt ( 'MAIN_ENABLE_AJAX_TOOLTIP' )) {
$classfortooltip = 'classforajaxtooltip' ;
2023-04-03 19:51:40 +02:00
$dataparams = ' data-params="' . dol_escape_htmltag ( json_encode ( $params )) . '"' ;
$label = '' ;
} else {
$label = implode ( $this -> getTooltipContentArray ( $params ));
2021-02-25 22:45:02 +01:00
}
2020-09-08 21:27:28 +02:00
2021-05-21 18:53:09 +02:00
if ( $option != 'nolink' ) {
// Add param to save lastsearch_values or not
2020-09-08 21:27:28 +02:00
$add_save_lastsearch_values = ( $save_lastsearch_value == 1 ? 1 : 0 );
2023-09-10 17:41:22 +02:00
if ( $save_lastsearch_value == - 1 && isset ( $_SERVER [ " PHP_SELF " ]) && preg_match ( '/list\.php/' , $_SERVER [ " PHP_SELF " ])) {
2021-05-21 18:53:09 +02:00
$add_save_lastsearch_values = 1 ;
}
if ( $add_save_lastsearch_values ) {
$url .= '&save_lastsearch_values=1' ;
}
2021-02-25 22:45:02 +01:00
}
2020-09-08 21:27:28 +02:00
$ref = $this -> ref ;
2021-02-25 22:45:02 +01:00
if ( empty ( $ref )) {
$ref = $this -> id ;
}
2020-09-08 21:27:28 +02:00
$linkclose = '' ;
2021-02-25 22:45:02 +01:00
if ( empty ( $notooltip )) {
2023-11-27 11:41:05 +01:00
if ( getDolGlobalString ( 'MAIN_OPTIMIZEFORTEXTBROWSER' )) {
2020-09-08 21:27:28 +02:00
$label = $langs -> trans ( " ShowExpenseReport " );
2025-01-09 01:41:24 +01:00
$linkclose .= ' alt="' . dolPrintHTMLForAttribute ( $label ) . '"' ;
2020-09-08 21:27:28 +02:00
}
2025-01-09 01:41:24 +01:00
$linkclose .= ( $label ? ' title="' . dolPrintHTMLForAttribute ( $label ) . '"' : ' title="tocomplete"' );
2023-04-03 19:51:40 +02:00
$linkclose .= $dataparams . ' class="' . $classfortooltip . '"' ;
2020-09-08 21:27:28 +02:00
}
$linkstart = '<a href="' . $url . '"' ;
$linkstart .= $linkclose . '>' ;
$linkend = '</a>' ;
2015-06-29 13:12:37 +02:00
2020-09-08 21:27:28 +02:00
$result .= $linkstart ;
2021-02-25 22:45:02 +01:00
if ( $withpicto ) {
2023-09-12 10:26:19 +02:00
$result .= img_object (( $notooltip ? '' : $label ), ( $this -> picto ? $this -> picto : 'generic' ), ( $notooltip ? (( $withpicto != 2 ) ? 'class="paddingright"' : '' ) : 'class="' . (( $withpicto != 2 ) ? 'paddingright ' : '' ) . '"' ), 0 , 0 , $notooltip ? 0 : 1 );
2021-02-25 22:45:02 +01:00
}
if ( $withpicto != 2 ) {
2021-05-21 18:53:09 +02:00
$result .= ( $max ? dol_trunc ( $ref , $max ) : $ref );
2021-02-25 22:45:02 +01:00
}
2020-09-08 21:27:28 +02:00
$result .= $linkend ;
2017-08-27 10:48:58 +02:00
2021-11-22 19:57:26 +01:00
global $action ;
2022-02-15 19:04:18 +01:00
$hookmanager -> initHooks ( array ( $this -> element . 'dao' ));
2024-03-11 22:05:24 +01:00
$parameters = array ( 'id' => $this -> id , 'getnomurl' => & $result );
2021-11-22 19:57:26 +01:00
$reshook = $hookmanager -> executeHooks ( 'getNomUrl' , $parameters , $this , $action ); // Note that $action and $object may have been modified by some hooks
if ( $reshook > 0 ) {
$result = $hookmanager -> resPrint ;
} else {
$result .= $hookmanager -> resPrint ;
}
2020-09-08 21:27:28 +02:00
return $result ;
}
2017-08-27 10:48:58 +02:00
2020-09-08 21:27:28 +02:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Update total of an expense report when you add a line .
*
2023-01-04 11:36:46 +01:00
* @ param string $ligne_total_ht Amount without taxes
2020-09-08 21:27:28 +02:00
* @ param string $ligne_total_tva Amount of all taxes
2023-01-04 11:36:46 +01:00
* @ return int
2020-09-08 21:27:28 +02:00
*/
public function update_totaux_add ( $ligne_total_ht , $ligne_total_tva )
{
// phpcs:enable
2024-03-22 00:56:30 +01:00
$this -> total_ht += ( float ) $ligne_total_ht ;
$this -> total_tva += ( float ) $ligne_total_tva ;
$this -> total_ttc += $this -> total_tva ;
2020-09-08 21:27:28 +02:00
$sql = " UPDATE " . MAIN_DB_PREFIX . $this -> table_element . " SET " ;
2024-10-29 02:18:17 +01:00
$sql .= " total_ht = " . (( float ) $this -> total_ht );
$sql .= " , total_ttc = " . (( float ) $this -> total_ttc );
$sql .= " , total_tva = " . (( float ) $this -> total_tva );
2021-08-27 16:33:03 +02:00
$sql .= " WHERE rowid = " . (( int ) $this -> id );
2020-09-08 21:27:28 +02:00
$result = $this -> db -> query ( $sql );
2021-09-13 01:36:18 +02:00
if ( $result ) {
2020-09-08 21:27:28 +02:00
return 1 ;
2021-09-13 01:36:18 +02:00
} else {
2020-09-08 21:27:28 +02:00
$this -> error = $this -> db -> error ();
return - 1 ;
2021-09-13 01:36:18 +02:00
}
2020-09-08 21:27:28 +02:00
}
2017-08-27 10:48:58 +02:00
2017-06-15 11:08:53 +02:00
/**
2021-09-23 02:41:53 +02:00
* Add expense report line
2017-08-22 10:11:32 +02:00
*
2019-03-22 17:43:53 +01:00
* @ param float $qty Qty
2021-09-22 15:11:18 +02:00
* @ param double $up Unit price ( price with tax )
2019-03-22 17:43:53 +01:00
* @ param int $fk_c_type_fees Type payment
2024-03-15 13:50:23 +01:00
* @ param int <- 1 , 0 >| string $vatrate Vat rate ( Can be '10' or '10 (ABC)' )
2019-03-22 17:43:53 +01:00
* @ param string $date Date
* @ param string $comments Description
* @ param int $fk_project Project id
* @ param int $fk_c_exp_tax_cat Car category id
* @ param int $type Type line
2019-03-22 18:03:08 +01:00
* @ param int $fk_ecm_files Id of ECM file to link to this expensereport line
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2017-06-15 11:08:53 +02:00
*/
2020-09-08 21:27:28 +02:00
public function addline ( $qty = 0 , $up = 0 , $fk_c_type_fees = 0 , $vatrate = 0 , $date = '' , $comments = '' , $fk_project = 0 , $fk_c_exp_tax_cat = 0 , $type = 0 , $fk_ecm_files = 0 )
2017-06-15 11:08:53 +02:00
{
2024-03-15 13:50:23 +01:00
global $langs , $mysoc ;
2017-06-15 11:08:53 +02:00
2020-09-08 21:27:28 +02:00
dol_syslog ( get_class ( $this ) . " ::addline qty= $qty , up= $up , fk_c_type_fees= $fk_c_type_fees , vatrate= $vatrate , date= $date , fk_project= $fk_project , type= $type , comments= $comments " , LOG_DEBUG );
2017-08-22 10:11:32 +02:00
2024-12-16 14:00:04 +01:00
if ( $this -> status == self :: STATUS_DRAFT || $this -> status == self :: STATUS_REFUSED ) {
2021-02-25 22:45:02 +01:00
if ( empty ( $qty )) {
$qty = 0 ;
}
if ( empty ( $fk_c_type_fees ) || $fk_c_type_fees < 0 ) {
$fk_c_type_fees = 0 ;
}
if ( empty ( $fk_c_exp_tax_cat ) || $fk_c_exp_tax_cat < 0 ) {
$fk_c_exp_tax_cat = 0 ;
}
if ( empty ( $vatrate ) || $vatrate < 0 ) {
$vatrate = 0 ;
}
if ( empty ( $date )) {
$date = '' ;
}
if ( empty ( $fk_project )) {
$fk_project = 0 ;
}
2018-12-03 12:28:17 +01:00
2024-06-04 14:46:54 +02:00
$qty = ( float ) price2num ( $qty );
2019-12-18 15:20:36 +01:00
if ( ! preg_match ( '/\s*\((.*)\)/' , $vatrate )) {
$vatrate = price2num ( $vatrate ); // $txtva can have format '5.0 (XXX)' or '5'
2018-12-03 12:28:17 +01:00
}
$up = price2num ( $up );
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
$this -> db -> begin ();
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
$this -> line = new ExpenseReportLine ( $this -> db );
2021-09-22 15:11:18 +02:00
// We don't know seller and buyer for expense reports
$seller = $mysoc ; // We use same than current company (expense report are often done in same country)
$seller -> tva_assuj = 1 ; // Most seller uses vat
$buyer = new Societe ( $this -> db );
$localtaxes_type = getLocalTaxesFromRate ( $vatrate , 0 , $buyer , $seller );
2018-12-04 14:54:58 +01:00
$vat_src_code = '' ;
2020-11-27 14:24:15 +01:00
$reg = array ();
2021-02-25 22:45:02 +01:00
if ( preg_match ( '/\s*\((.*)\)/' , $vatrate , $reg )) {
2018-04-10 14:38:41 +02:00
$vat_src_code = $reg [ 1 ];
2019-12-18 15:20:36 +01:00
$vatrate = preg_replace ( '/\s*\(.*\)/' , '' , $vatrate ); // Remove code into vatrate.
2018-04-10 14:38:41 +02:00
}
2019-01-27 11:55:16 +01:00
$vatrate = preg_replace ( '/\*/' , '' , $vatrate );
2018-04-10 14:38:41 +02:00
2024-07-03 02:30:53 +02:00
$tmp = calcul_price_total ( $qty , $up , 0 , ( float ) price2num ( $vatrate ), - 1 , - 1 , 0 , 'TTC' , 0 , $type , $seller , $localtaxes_type );
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
$this -> line -> value_unit = $up ;
2021-09-22 15:11:18 +02:00
2019-03-07 11:09:04 +01:00
$this -> line -> vat_src_code = $vat_src_code ;
2017-06-15 11:08:53 +02:00
$this -> line -> vatrate = price2num ( $vatrate );
2021-09-22 15:11:18 +02:00
$this -> line -> localtax1_tx = $localtaxes_type [ 1 ];
$this -> line -> localtax2_tx = $localtaxes_type [ 3 ];
$this -> line -> localtax1_type = $localtaxes_type [ 0 ];
$this -> line -> localtax2_type = $localtaxes_type [ 2 ];
2024-11-04 12:32:13 +01:00
$this -> line -> total_ttc = ( float ) $tmp [ 2 ];
$this -> line -> total_ht = ( float ) $tmp [ 0 ];
$this -> line -> total_tva = ( float ) $tmp [ 1 ];
$this -> line -> total_localtax1 = ( float ) $tmp [ 9 ];
$this -> line -> total_localtax2 = ( float ) $tmp [ 10 ];
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
$this -> line -> fk_expensereport = $this -> id ;
$this -> line -> qty = $qty ;
$this -> line -> date = $date ;
$this -> line -> fk_c_type_fees = $fk_c_type_fees ;
$this -> line -> fk_c_exp_tax_cat = $fk_c_exp_tax_cat ;
$this -> line -> comments = $comments ;
2019-12-18 15:20:36 +01:00
$this -> line -> fk_projet = $fk_project ; // deprecated
2019-03-24 12:15:19 +01:00
$this -> line -> fk_project = $fk_project ;
2017-08-22 10:11:32 +02:00
2019-03-22 17:43:53 +01:00
$this -> line -> fk_ecm_files = $fk_ecm_files ;
2017-06-15 11:08:53 +02:00
$this -> applyOffset ();
$this -> checkRules ( $type , $seller );
2017-08-22 10:11:32 +02:00
2019-12-18 15:20:36 +01:00
$result = $this -> line -> insert ( 0 , true );
2021-02-25 22:45:02 +01:00
if ( $result > 0 ) {
2022-11-26 16:28:58 +01:00
$result = $this -> update_price ( 1 ); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
2021-02-25 22:45:02 +01:00
if ( $result > 0 ) {
2020-09-08 21:27:28 +02:00
$this -> db -> commit ();
return $this -> line -> id ;
} else {
$this -> db -> rollback ();
return - 1 ;
}
} else {
$this -> error = $this -> line -> error ;
dol_syslog ( get_class ( $this ) . " ::addline error= " . $this -> error , LOG_ERR );
$this -> db -> rollback ();
return - 2 ;
}
2020-05-21 15:05:19 +02:00
} else {
2020-09-08 21:27:28 +02:00
dol_syslog ( get_class ( $this ) . " ::addline status of expense report must be Draft to allow use of ->addline() " , LOG_ERR );
2024-12-16 14:00:04 +01:00
$this -> error = 'ErrorExpenseNotDraftAndNotRefused' ;
2020-09-08 21:27:28 +02:00
return - 3 ;
}
2017-06-15 11:08:53 +02:00
}
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
/**
* Check constraint of rules and update price if needed
2017-08-22 10:11:32 +02:00
*
2021-09-22 15:11:18 +02:00
* @ param int $type Type of line
* @ param string $seller Seller , but actually he is unknown
2023-01-04 11:36:46 +01:00
* @ return boolean true or false
2017-06-15 11:08:53 +02:00
*/
2019-03-02 00:14:22 +01:00
public function checkRules ( $type = 0 , $seller = '' )
2017-06-15 11:08:53 +02:00
{
2024-03-15 13:50:23 +01:00
global $conf , $db , $langs , $mysoc ;
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
$langs -> load ( 'trips' );
2017-08-22 10:11:32 +02:00
2021-09-22 15:11:18 +02:00
// We don't know seller and buyer for expense reports
if ( ! is_object ( $seller )) {
$seller = $mysoc ; // We use same than current company (expense report are often done in same country)
$seller -> tva_assuj = 1 ; // Most seller uses vat
}
2021-09-27 15:41:58 +02:00
$expensereportrule = new ExpenseReportRule ( $db );
$rulestocheck = $expensereportrule -> getAllRule ( $this -> line -> fk_c_type_fees , $this -> line -> date , $this -> fk_user_author );
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
$violation = 0 ;
$rule_warning_message_tab = array ();
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
$current_total_ttc = $this -> line -> total_ttc ;
$new_current_total_ttc = $this -> line -> total_ttc ;
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
// check if one is violated
2021-02-25 22:45:02 +01:00
foreach ( $rulestocheck as $rule ) {
if ( in_array ( $rule -> code_expense_rules_type , array ( 'EX_DAY' , 'EX_MON' , 'EX_YEA' ))) {
$amount_to_test = $this -> line -> getExpAmount ( $rule , $this -> fk_user_author , $rule -> code_expense_rules_type );
} else {
$amount_to_test = $current_total_ttc ; // EX_EXP
}
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
$amount_to_test = $amount_to_test - $current_total_ttc + $new_current_total_ttc ; // if amount as been modified by a previous rule
2017-08-22 10:11:32 +02:00
2021-02-25 22:45:02 +01:00
if ( $amount_to_test > $rule -> amount ) {
2017-06-15 11:08:53 +02:00
$violation ++ ;
2017-08-22 10:11:32 +02:00
2021-02-25 22:45:02 +01:00
if ( $rule -> restrictive ) {
2017-06-15 11:08:53 +02:00
$this -> error = 'ExpenseReportConstraintViolationError' ;
$this -> errors [] = $this -> error ;
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
$new_current_total_ttc -= $amount_to_test - $rule -> amount ; // ex, entered 16€, limit 12€, subtracts 4€;
2021-10-21 23:50:20 +02:00
$rule_warning_message_tab [] = $langs -> trans ( 'ExpenseReportConstraintViolationError' , $rule -> id , price ( $amount_to_test , 0 , $langs , 1 , - 1 , - 1 , $conf -> currency ), price ( $rule -> amount , 0 , $langs , 1 , - 1 , - 1 , $conf -> currency ));
2020-05-21 15:05:19 +02:00
} else {
2017-06-15 11:08:53 +02:00
$this -> error = 'ExpenseReportConstraintViolationWarning' ;
$this -> errors [] = $this -> error ;
2017-08-22 10:11:32 +02:00
2021-10-21 23:50:20 +02:00
$rule_warning_message_tab [] = $langs -> trans ( 'ExpenseReportConstraintViolationWarning' , $rule -> id , price ( $amount_to_test , 0 , $langs , 1 , - 1 , - 1 , $conf -> currency ), price ( $rule -> amount , 0 , $langs , 1 , - 1 , - 1 , $conf -> currency ));
2020-09-08 21:27:28 +02:00
}
2024-01-13 19:48:41 +01:00
// No break, we should test if another rule is violated
2020-09-08 21:27:28 +02:00
}
}
$this -> line -> rule_warning_message = implode ( '\n' , $rule_warning_message_tab );
2021-02-25 22:45:02 +01:00
if ( $violation > 0 ) {
2020-09-08 21:27:28 +02:00
$tmp = calcul_price_total ( $this -> line -> qty , $new_current_total_ttc / $this -> line -> qty , 0 , $this -> line -> vatrate , 0 , 0 , 0 , 'TTC' , 0 , $type , $seller );
$this -> line -> value_unit = $tmp [ 5 ];
2024-11-04 12:32:13 +01:00
$this -> line -> total_ttc = ( float ) $tmp [ 2 ];
$this -> line -> total_ht = ( float ) $tmp [ 0 ];
$this -> line -> total_tva = ( float ) $tmp [ 1 ];
$this -> line -> total_localtax1 = ( float ) $tmp [ 9 ];
$this -> line -> total_localtax2 = ( float ) $tmp [ 10 ];
2020-09-08 21:27:28 +02:00
return false ;
2021-02-25 22:45:02 +01:00
} else {
return true ;
}
2020-09-08 21:27:28 +02:00
}
/**
* Method to apply the offset if needed
*
2021-09-22 15:11:18 +02:00
* @ param int $type Type of line
* @ param string $seller Seller , but actually he is unknown
* @ return boolean True = applied , False = not applied
2020-09-08 21:27:28 +02:00
*/
2021-09-22 15:11:18 +02:00
public function applyOffset ( $type = 0 , $seller = '' )
2020-09-08 21:27:28 +02:00
{
2024-03-15 13:50:23 +01:00
global $mysoc ;
2020-09-08 21:27:28 +02:00
2023-11-27 11:41:05 +01:00
if ( ! getDolGlobalString ( 'MAIN_USE_EXPENSE_IK' )) {
2021-02-25 22:45:02 +01:00
return false ;
}
2020-09-08 21:27:28 +02:00
$userauthor = new User ( $this -> db );
2021-02-25 22:45:02 +01:00
if ( $userauthor -> fetch ( $this -> fk_user_author ) <= 0 ) {
2020-09-08 21:27:28 +02:00
$this -> error = 'ErrorCantFetchUser' ;
$this -> errors [] = 'ErrorCantFetchUser' ;
return false ;
}
2021-09-22 15:11:18 +02:00
// We don't know seller and buyer for expense reports
if ( ! is_object ( $seller )) {
$seller = $mysoc ; // We use same than current company (expense report are often done in same country)
$seller -> tva_assuj = 1 ; // Most seller uses vat
}
2021-10-21 22:57:50 +02:00
$expenseik = new ExpenseReportIk ( $this -> db );
2021-09-27 15:41:58 +02:00
$range = $expenseik -> getRangeByUser ( $userauthor , $this -> line -> fk_c_exp_tax_cat );
2020-09-08 21:27:28 +02:00
2021-02-25 22:45:02 +01:00
if ( empty ( $range )) {
2020-09-08 21:27:28 +02:00
$this -> error = 'ErrorNoRangeAvailable' ;
$this -> errors [] = 'ErrorNoRangeAvailable' ;
return false ;
}
2023-11-27 11:41:05 +01:00
if ( getDolGlobalString ( 'MAIN_EXPENSE_APPLY_ENTIRE_OFFSET' )) {
2021-02-25 22:45:02 +01:00
$ikoffset = $range -> ikoffset ;
} else {
$ikoffset = $range -> ikoffset / 12 ; // The amount of offset is a global value for the year
}
2020-09-08 21:27:28 +02:00
// Test if ikoffset has been applied for the current month
2021-02-25 22:45:02 +01:00
if ( ! $this -> offsetAlreadyGiven ()) {
2020-09-08 21:27:28 +02:00
$new_up = $range -> coef + ( $ikoffset / $this -> line -> qty );
$tmp = calcul_price_total ( $this -> line -> qty , $new_up , 0 , $this -> line -> vatrate , 0 , 0 , 0 , 'TTC' , 0 , $type , $seller );
$this -> line -> value_unit = $tmp [ 5 ];
2024-11-04 12:32:13 +01:00
$this -> line -> total_ttc = ( float ) $tmp [ 2 ];
$this -> line -> total_ht = ( float ) $tmp [ 0 ];
$this -> line -> total_tva = ( float ) $tmp [ 1 ];
$this -> line -> total_localtax1 = ( float ) $tmp [ 9 ];
$this -> line -> total_localtax2 = ( float ) $tmp [ 10 ];
2020-09-08 21:27:28 +02:00
return true ;
}
return false ;
}
/**
* If the sql find any rows then the ikoffset is already given ( ikoffset is applied at the first expense report line )
*
* @ return bool
*/
public function offsetAlreadyGiven ()
{
$sql = 'SELECT e.rowid FROM ' . MAIN_DB_PREFIX . 'expensereport e' ;
2021-08-28 01:45:53 +02:00
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . " expensereport_det d ON (e.rowid = d.fk_expensereport) " ;
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . " c_type_fees f ON (d.fk_c_type_fees = f.id AND f.code = 'EX_KME') " ;
$sql .= " WHERE e.fk_user_author = " . ( int ) $this -> fk_user_author ;
$sql .= " AND YEAR(d.date) = ' " . dol_print_date ( $this -> line -> date , '%Y' ) . " ' AND MONTH(d.date) = ' " . dol_print_date ( $this -> line -> date , '%m' ) . " ' " ;
2021-02-25 22:45:02 +01:00
if ( ! empty ( $this -> line -> id )) {
2021-08-28 01:45:53 +02:00
$sql .= ' AND d.rowid <> ' . (( int ) $this -> line -> id );
2021-02-25 22:45:02 +01:00
}
2020-09-08 21:27:28 +02:00
2021-09-22 15:11:18 +02:00
dol_syslog ( get_class ( $this ) . " ::offsetAlreadyGiven " );
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $resql ) {
2020-09-08 21:27:28 +02:00
$num = $this -> db -> num_rows ( $resql );
2021-02-25 22:45:02 +01:00
if ( $num > 0 ) {
return true ;
}
2020-09-08 21:27:28 +02:00
} else {
dol_print_error ( $this -> db );
}
return false ;
}
/**
2022-03-31 16:26:36 +02:00
* Update an expense report line .
2020-09-08 21:27:28 +02:00
*
* @ param int $rowid Line to edit
* @ param int $type_fees_id Type payment
* @ param int $projet_id Project id
* @ param double $vatrate Vat rate . Can be '8.5' or '8.5* (8.5NPROM...)'
* @ param string $comments Description
* @ param float $qty Qty
2021-09-22 15:11:18 +02:00
* @ param double $value_unit Unit price ( with taxes )
2020-09-08 21:27:28 +02:00
* @ param int $date Date
* @ param int $expensereport_id Expense report id
* @ param int $fk_c_exp_tax_cat Id of category of car
* @ param int $fk_ecm_files Id of ECM file to link to this expensereport line
2022-03-31 16:26:36 +02:00
* @ param int $notrigger 1 = No trigger
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
2022-03-29 14:31:17 +02:00
public function updateline ( $rowid , $type_fees_id , $projet_id , $vatrate , $comments , $qty , $value_unit , $date , $expensereport_id , $fk_c_exp_tax_cat = 0 , $fk_ecm_files = 0 , $notrigger = 0 )
2020-09-08 21:27:28 +02:00
{
global $user , $mysoc ;
2021-02-25 22:45:02 +01:00
if ( $this -> status == self :: STATUS_DRAFT || $this -> status == self :: STATUS_REFUSED ) {
2020-09-08 21:27:28 +02:00
$this -> db -> begin ();
2022-09-23 09:56:54 +02:00
$error = 0 ;
2020-09-08 21:27:28 +02:00
$type = 0 ; // TODO What if type is service ?
// We don't know seller and buyer for expense reports
2021-09-22 15:11:18 +02:00
$seller = $mysoc ; // We use same than current company (expense report are often done in same country)
$seller -> tva_assuj = 1 ; // Most seller uses vat
$seller -> localtax1_assuj = $mysoc -> localtax1_assuj ; // We don't know, we reuse the state of company
$seller -> localtax2_assuj = $mysoc -> localtax1_assuj ; // We don't know, we reuse the state of company
2020-09-08 21:27:28 +02:00
$buyer = new Societe ( $this -> db );
$localtaxes_type = getLocalTaxesFromRate ( $vatrate , 0 , $buyer , $seller );
// Clean vat code
2020-11-27 15:45:12 +01:00
$reg = array ();
2020-09-08 21:27:28 +02:00
$vat_src_code = '' ;
2024-03-19 21:29:00 +01:00
if ( preg_match ( '/\((.*)\)/' , ( string ) $vatrate , $reg )) {
2020-09-08 21:27:28 +02:00
$vat_src_code = $reg [ 1 ];
2024-03-19 21:29:00 +01:00
$vatrate = preg_replace ( '/\s*\(.*\)/' , '' , ( string ) $vatrate ); // Remove code into vatrate.
2020-09-08 21:27:28 +02:00
}
$vatrate = preg_replace ( '/\*/' , '' , $vatrate );
2024-07-03 02:30:53 +02:00
$tmp = calcul_price_total ( $qty , $value_unit , 0 , ( float ) price2num ( $vatrate ), - 1 , - 1 , 0 , 'TTC' , 0 , $type , $seller , $localtaxes_type );
2020-09-08 21:27:28 +02:00
// calcul total of line
2024-07-03 02:30:53 +02:00
// $total_ttc = price2num($qty*$value_unit, 'MT');
2020-09-08 21:27:28 +02:00
2024-03-22 00:56:30 +01:00
$tx_tva = 1 + ( float ) $vatrate / 100 ;
2020-09-08 21:27:28 +02:00
$this -> line = new ExpenseReportLine ( $this -> db );
$this -> line -> comments = $comments ;
$this -> line -> qty = $qty ;
$this -> line -> value_unit = $value_unit ;
$this -> line -> date = $date ;
$this -> line -> fk_expensereport = $expensereport_id ;
$this -> line -> fk_c_type_fees = $type_fees_id ;
$this -> line -> fk_c_exp_tax_cat = $fk_c_exp_tax_cat ;
$this -> line -> fk_projet = $projet_id ; // deprecated
$this -> line -> fk_project = $projet_id ;
$this -> line -> vat_src_code = $vat_src_code ;
$this -> line -> vatrate = price2num ( $vatrate );
$this -> line -> localtax1_tx = $localtaxes_type [ 1 ];
$this -> line -> localtax2_tx = $localtaxes_type [ 3 ];
$this -> line -> localtax1_type = $localtaxes_type [ 0 ];
$this -> line -> localtax2_type = $localtaxes_type [ 2 ];
2024-11-04 12:32:13 +01:00
$this -> line -> total_ttc = ( float ) $tmp [ 2 ];
$this -> line -> total_ht = ( float ) $tmp [ 0 ];
$this -> line -> total_tva = ( float ) $tmp [ 1 ];
$this -> line -> total_localtax1 = ( float ) $tmp [ 9 ];
$this -> line -> total_localtax2 = ( float ) $tmp [ 10 ];
2021-09-22 15:11:18 +02:00
2020-09-08 21:27:28 +02:00
$this -> line -> fk_ecm_files = $fk_ecm_files ;
2021-07-05 19:50:16 +02:00
$this -> line -> id = (( int ) $rowid );
2020-09-08 21:27:28 +02:00
// Select des infos sur le type fees
2023-08-06 01:14:36 +02:00
$sql = " SELECT c.code as code_type_fees, c.label as label_type_fees " ;
2020-09-08 21:27:28 +02:00
$sql .= " FROM " . MAIN_DB_PREFIX . " c_type_fees as c " ;
2021-03-30 19:12:07 +02:00
$sql .= " WHERE c.id = " . (( int ) $type_fees_id );
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $resql ) {
2020-09-08 21:27:28 +02:00
$objp_fees = $this -> db -> fetch_object ( $resql );
$this -> line -> type_fees_code = $objp_fees -> code_type_fees ;
2023-08-06 01:14:36 +02:00
$this -> line -> type_fees_libelle = $objp_fees -> label_type_fees ;
2020-09-08 21:27:28 +02:00
$this -> db -> free ( $resql );
}
2024-01-13 19:48:41 +01:00
// Select des information du projet
2020-09-08 21:27:28 +02:00
$sql = " SELECT p.ref as ref_projet, p.title as title_projet " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " projet as p " ;
2021-03-30 19:12:07 +02:00
$sql .= " WHERE p.rowid = " . (( int ) $projet_id );
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
if ( $resql ) {
$objp_projet = $this -> db -> fetch_object ( $resql );
$this -> line -> projet_ref = $objp_projet -> ref_projet ;
$this -> line -> projet_title = $objp_projet -> title_projet ;
$this -> db -> free ( $resql );
}
$this -> applyOffset ();
$this -> checkRules ();
2022-09-23 09:56:54 +02:00
2024-10-19 01:14:20 +02:00
$result = $this -> line -> update ( $user , $notrigger );
2022-09-23 09:56:54 +02:00
if ( $result < 0 ) {
$error ++ ;
}
2022-03-29 14:31:17 +02:00
2022-09-23 09:56:54 +02:00
if ( ! $error ) {
2020-09-08 21:27:28 +02:00
$this -> db -> commit ();
return 1 ;
} else {
$this -> error = $this -> line -> error ;
$this -> errors = $this -> line -> errors ;
$this -> db -> rollback ();
return - 2 ;
}
}
2022-12-28 16:20:35 +01:00
return 0 ;
2020-09-08 21:27:28 +02:00
}
/**
* deleteline
*
2024-03-15 13:50:23 +01:00
* @ param int $rowid Row id
* @ param User | string $fuser User
* @ param int < 0 , 1 > $notrigger 1 = No trigger
2024-03-18 19:31:28 +01:00
* @ return int <- 1 , 1 > Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
2024-02-02 23:46:12 +01:00
public function deleteLine ( $rowid , $fuser = '' , $notrigger = 0 )
2020-09-08 21:27:28 +02:00
{
2024-03-11 22:05:24 +01:00
$error = 0 ;
2022-03-29 14:31:17 +02:00
2020-09-08 21:27:28 +02:00
$this -> db -> begin ();
2022-03-29 14:31:17 +02:00
if ( ! $notrigger ) {
// Call triggers
$result = $this -> call_trigger ( 'EXPENSE_REPORT_DET_DELETE' , $fuser );
if ( $result < 0 ) {
$error ++ ;
}
// End call triggers
}
$sql = ' DELETE FROM ' . MAIN_DB_PREFIX . $this -> table_element_line ;
2021-03-29 15:32:09 +02:00
$sql .= ' WHERE rowid = ' . (( int ) $rowid );
2020-09-08 21:27:28 +02:00
dol_syslog ( get_class ( $this ) . " ::deleteline sql= " . $sql );
$result = $this -> db -> query ( $sql );
2022-03-29 14:31:17 +02:00
2023-12-04 12:12:12 +01:00
if ( ! $result || $error > 0 ) {
2020-09-08 21:27:28 +02:00
$this -> error = $this -> db -> error ();
dol_syslog ( get_class ( $this ) . " ::deleteline Error " . $this -> error , LOG_ERR );
$this -> db -> rollback ();
return - 1 ;
}
2022-11-26 16:28:58 +01:00
$this -> update_price ( 1 );
2021-09-22 15:11:18 +02:00
2020-09-08 21:27:28 +02:00
$this -> db -> commit ();
return 1 ;
}
/**
2024-12-06 12:21:00 +01:00
* periodExists
2020-09-08 21:27:28 +02:00
*
* @ param User $fuser User
* @ param integer $date_debut Start date
* @ param integer $date_fin End date
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
2024-12-06 12:21:00 +01:00
public function periodExists ( $fuser , $date_debut , $date_fin )
2020-09-08 21:27:28 +02:00
{
2024-01-15 15:11:27 +01:00
global $conf ;
2020-09-08 21:27:28 +02:00
$sql = " SELECT rowid, date_debut, date_fin " ;
$sql .= " FROM " . MAIN_DB_PREFIX . $this -> table_element ;
2024-01-15 15:11:27 +01:00
$sql .= " WHERE entity = " . (( int ) $conf -> entity ); // not shared, only for the current entity
$sql .= " AND fk_user_author = " . (( int ) $fuser -> id );
2020-09-08 21:27:28 +02:00
2024-12-06 12:21:00 +01:00
dol_syslog ( get_class ( $this ) . " ::periodExists sql= " . $sql );
2020-09-08 21:27:28 +02:00
$result = $this -> db -> query ( $sql );
if ( $result ) {
2023-12-04 12:12:12 +01:00
$num_rows = $this -> db -> num_rows ( $result );
$i = 0 ;
2020-09-08 21:27:28 +02:00
2021-02-25 22:45:02 +01:00
if ( $num_rows > 0 ) {
2020-09-08 21:27:28 +02:00
$date_d_form = $date_debut ;
$date_f_form = $date_fin ;
2021-02-25 22:45:02 +01:00
while ( $i < $num_rows ) {
2020-09-08 21:27:28 +02:00
$objp = $this -> db -> fetch_object ( $result );
$date_d_req = $this -> db -> jdate ( $objp -> date_debut ); // 3
$date_f_req = $this -> db -> jdate ( $objp -> date_fin ); // 4
2021-02-25 22:45:02 +01:00
if ( ! ( $date_f_form < $date_d_req || $date_d_form > $date_f_req )) {
2021-10-04 08:51:31 +02:00
return $objp -> rowid ;
2021-02-25 22:45:02 +01:00
}
2020-09-08 21:27:28 +02:00
$i ++ ;
}
2021-09-30 16:51:31 +02:00
return 0 ;
2020-09-08 21:27:28 +02:00
} else {
return 0 ;
}
} else {
$this -> error = $this -> db -> lasterror ();
2024-12-06 12:21:00 +01:00
dol_syslog ( get_class ( $this ) . " ::periodExists Error " . $this -> error , LOG_ERR );
2020-09-08 21:27:28 +02:00
return - 1 ;
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of people with permission to validate expense reports .
* Search for permission " approve expense report "
*
2024-09-30 10:05:24 +02:00
* @ return int [] | int <- 1 , - 1 > Array of user ids , < 0 if KO
2020-09-08 21:27:28 +02:00
*/
public function fetch_users_approver_expensereport ()
{
// phpcs:enable
$users_validator = array ();
$sql = " SELECT DISTINCT ur.fk_user " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " user_rights as ur, " . MAIN_DB_PREFIX . " rights_def as rd " ;
$sql .= " WHERE ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve' " ; // Permission 'Approve';
2022-01-07 15:50:30 +01:00
$sql .= " UNION " ;
2020-09-08 21:27:28 +02:00
$sql .= " SELECT DISTINCT ugu.fk_user " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " usergroup_user as ugu, " . MAIN_DB_PREFIX . " usergroup_rights as ur, " . MAIN_DB_PREFIX . " rights_def as rd " ;
$sql .= " WHERE ugu.fk_usergroup = ur.fk_usergroup AND ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve' " ; // Permission 'Approve';
//print $sql;
dol_syslog ( get_class ( $this ) . " ::fetch_users_approver_expensereport sql= " . $sql );
$result = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $result ) {
2023-12-04 12:12:12 +01:00
$num_rows = $this -> db -> num_rows ( $result );
$i = 0 ;
2021-02-25 22:45:02 +01:00
while ( $i < $num_rows ) {
2020-09-08 21:27:28 +02:00
$objp = $this -> db -> fetch_object ( $result );
array_push ( $users_validator , $objp -> fk_user );
$i ++ ;
}
return $users_validator ;
} else {
$this -> error = $this -> db -> lasterror ();
dol_syslog ( get_class ( $this ) . " ::fetch_users_approver_expensereport Error " . $this -> error , LOG_ERR );
return - 1 ;
}
}
/**
2024-01-13 19:48:41 +01:00
* Create a document onto disk according to template module .
2020-09-08 21:27:28 +02:00
*
* @ param string $modele Force le mnodele a utiliser ( '' to not force )
2024-01-13 19:48:41 +01:00
* @ param Translate $outputlangs object lang a utiliser pour traduction
2024-09-30 10:05:24 +02:00
* @ param int < 0 , 1 > $hidedetails Hide details of lines
* @ param int < 0 , 1 > $hidedesc Hide description
* @ param int < 0 , 1 > $hideref Hide ref
* @ param ? array < string , mixed > $moreparams Array to provide more information
2020-09-08 21:27:28 +02:00
* @ return int 0 if KO , 1 if OK
*/
public function generateDocument ( $modele , $outputlangs , $hidedetails = 0 , $hidedesc = 0 , $hideref = 0 , $moreparams = null )
{
2020-12-13 13:34:21 +01:00
$outputlangs -> load ( " trips " );
2020-09-08 21:27:28 +02:00
2020-10-31 14:32:18 +01:00
if ( ! dol_strlen ( $modele )) {
2020-12-13 13:34:21 +01:00
if ( ! empty ( $this -> model_pdf )) {
$modele = $this -> model_pdf ;
2023-11-27 11:41:05 +01:00
} elseif ( getDolGlobalString ( 'EXPENSEREPORT_ADDON_PDF' )) {
2024-01-05 04:18:53 +01:00
$modele = getDolGlobalString ( 'EXPENSEREPORT_ADDON_PDF' );
2020-10-31 14:32:18 +01:00
}
}
2020-10-23 08:07:00 +02:00
2020-10-21 13:41:17 +02:00
if ( ! empty ( $modele )) {
$modelpath = " core/modules/expensereport/doc/ " ;
2015-06-29 13:12:37 +02:00
2020-10-21 13:41:17 +02:00
return $this -> commonGenerateDocument ( $modelpath , $modele , $outputlangs , $hidedetails , $hidedesc , $hideref , $moreparams );
} else {
return 0 ;
2020-09-08 21:27:28 +02:00
}
2020-10-31 14:32:18 +01:00
}
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
/**
* List of types
*
2024-09-30 10:05:24 +02:00
* @ param int < 0 , 1 > $active Active or not
* @ return array < string , string >
2020-09-08 21:27:28 +02:00
*/
public function listOfTypes ( $active = 1 )
{
global $langs ;
$ret = array ();
$sql = " SELECT id, code, label " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " c_type_fees " ;
2021-03-30 19:12:07 +02:00
$sql .= " WHERE active = " . (( int ) $active );
2020-09-08 21:27:28 +02:00
dol_syslog ( get_class ( $this ) . " ::listOfTypes " , LOG_DEBUG );
$result = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $result ) {
2020-09-08 21:27:28 +02:00
$num = $this -> db -> num_rows ( $result );
$i = 0 ;
2021-02-25 22:45:02 +01:00
while ( $i < $num ) {
2020-09-08 21:27:28 +02:00
$obj = $this -> db -> fetch_object ( $result );
2021-02-02 10:53:59 +01:00
$ret [ $obj -> code ] = (( $langs -> transnoentitiesnoconv ( $obj -> code ) != $obj -> code ) ? $langs -> transnoentitiesnoconv ( $obj -> code ) : $obj -> label );
2020-09-08 21:27:28 +02:00
$i ++ ;
2017-06-15 11:08:53 +02:00
}
2020-09-08 21:27:28 +02:00
} else {
dol_print_error ( $this -> db );
2017-06-15 11:08:53 +02:00
}
2020-09-08 21:27:28 +02:00
return $ret ;
}
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
/**
2024-01-13 19:48:41 +01:00
* Load the indicators this -> nb for the state board
2020-09-08 21:27:28 +02:00
*
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2020-09-08 21:27:28 +02:00
*/
2024-01-18 18:55:53 +01:00
public function loadStateBoard ()
2020-09-08 21:27:28 +02:00
{
2024-03-15 13:50:23 +01:00
global $user ;
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
$this -> nb = array ();
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
$sql = " SELECT count(ex.rowid) as nb " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " expensereport as ex " ;
$sql .= " WHERE ex.fk_statut > 0 " ;
$sql .= " AND ex.entity IN ( " . getEntity ( 'expensereport' ) . " ) " ;
2023-11-27 12:32:53 +01:00
if ( ! $user -> hasRight ( 'expensereport' , 'readall' )) {
2020-09-08 21:27:28 +02:00
$userchildids = $user -> getAllChildIds ( 1 );
Qual: Apply automatic phan fixes (deprecations, unneeded imports) (#28154)
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
2024-02-13 21:46:12 +01:00
$sql .= " AND (ex.fk_user_author IN ( " . $this -> db -> sanitize ( implode ( ',' , $userchildids )) . " ) " ;
$sql .= " OR ex.fk_user_validator IN ( " . $this -> db -> sanitize ( implode ( ',' , $userchildids )) . " )) " ;
2020-09-08 21:27:28 +02:00
}
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
if ( $resql ) {
while ( $obj = $this -> db -> fetch_object ( $resql )) {
$this -> nb [ " expensereports " ] = $obj -> nb ;
}
$this -> db -> free ( $resql );
return 1 ;
} else {
dol_print_error ( $this -> db );
$this -> error = $this -> db -> error ();
return - 1 ;
}
2017-06-15 11:08:53 +02:00
}
2020-09-08 21:27:28 +02:00
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
2017-06-15 11:08:53 +02:00
/**
2020-09-08 21:27:28 +02:00
* Load indicators for dashboard ( this -> nbtodo and this -> nbtodolate )
2017-08-22 10:11:32 +02:00
*
2024-01-13 19:48:41 +01:00
* @ param User $user Object user
2020-09-08 21:27:28 +02:00
* @ param string $option 'topay' or 'toapprove'
2023-12-06 15:46:39 +01:00
* @ return WorkboardResponse | int Return integer < 0 if KO , WorkboardResponse if OK
2017-06-15 11:08:53 +02:00
*/
2020-09-08 21:27:28 +02:00
public function load_board ( $user , $option = 'topay' )
2017-06-15 11:08:53 +02:00
{
2020-09-08 21:27:28 +02:00
// phpcs:enable
global $conf , $langs ;
2017-08-22 10:11:32 +02:00
2021-02-25 22:45:02 +01:00
if ( $user -> socid ) {
return - 1 ; // protection pour eviter appel par utilisateur externe
}
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
$now = dol_now ();
$sql = " SELECT ex.rowid, ex.date_valid " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " expensereport as ex " ;
2021-02-25 22:45:02 +01:00
if ( $option == 'toapprove' ) {
$sql .= " WHERE ex.fk_statut = " . self :: STATUS_VALIDATED ;
} else {
$sql .= " WHERE ex.fk_statut = " . self :: STATUS_APPROVED ;
}
2020-09-08 21:27:28 +02:00
$sql .= " AND ex.entity IN ( " . getEntity ( 'expensereport' ) . " ) " ;
2023-11-27 12:32:53 +01:00
if ( ! $user -> hasRight ( 'expensereport' , 'readall' )) {
2020-09-08 21:27:28 +02:00
$userchildids = $user -> getAllChildIds ( 1 );
Qual: Apply automatic phan fixes (deprecations, unneeded imports) (#28154)
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
2024-02-13 21:46:12 +01:00
$sql .= " AND (ex.fk_user_author IN ( " . $this -> db -> sanitize ( implode ( ',' , $userchildids )) . " ) " ;
$sql .= " OR ex.fk_user_validator IN ( " . $this -> db -> sanitize ( implode ( ',' , $userchildids )) . " )) " ;
2017-06-15 11:08:53 +02:00
}
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $resql ) {
2020-09-08 21:27:28 +02:00
$langs -> load ( " trips " );
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
$response = new WorkboardResponse ();
2021-02-25 22:45:02 +01:00
if ( $option == 'toapprove' ) {
2020-09-08 21:27:28 +02:00
$response -> warning_delay = $conf -> expensereport -> approve -> warning_delay / 60 / 60 / 24 ;
$response -> label = $langs -> trans ( " ExpenseReportsToApprove " );
$response -> labelShort = $langs -> trans ( " ToApprove " );
2020-10-02 12:54:56 +02:00
$response -> url = DOL_URL_ROOT . '/expensereport/list.php?mainmenu=hrm&statut=' . self :: STATUS_VALIDATED ;
2020-09-08 21:27:28 +02:00
} else {
$response -> warning_delay = $conf -> expensereport -> payment -> warning_delay / 60 / 60 / 24 ;
$response -> label = $langs -> trans ( " ExpenseReportsToPay " );
$response -> labelShort = $langs -> trans ( " StatusToPay " );
2020-10-02 12:54:56 +02:00
$response -> url = DOL_URL_ROOT . '/expensereport/list.php?mainmenu=hrm&statut=' . self :: STATUS_APPROVED ;
2020-09-08 21:27:28 +02:00
}
$response -> img = img_object ( '' , " trip " );
2017-08-22 10:11:32 +02:00
2021-02-25 22:45:02 +01:00
while ( $obj = $this -> db -> fetch_object ( $resql )) {
2020-09-08 21:27:28 +02:00
$response -> nbtodo ++ ;
2017-08-22 10:11:32 +02:00
2021-02-25 22:45:02 +01:00
if ( $option == 'toapprove' ) {
2020-09-08 21:27:28 +02:00
if ( $this -> db -> jdate ( $obj -> date_valid ) < ( $now - $conf -> expensereport -> approve -> warning_delay )) {
$response -> nbtodolate ++ ;
}
} else {
if ( $this -> db -> jdate ( $obj -> date_valid ) < ( $now - $conf -> expensereport -> payment -> warning_delay )) {
$response -> nbtodolate ++ ;
}
}
}
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
return $response ;
} else {
dol_print_error ( $this -> db );
$this -> error = $this -> db -> error ();
return - 1 ;
2017-06-15 11:08:53 +02:00
}
}
2017-08-22 10:11:32 +02:00
2017-06-15 11:08:53 +02:00
/**
2020-09-08 21:27:28 +02:00
* Return if an expense report is late or not
2017-08-22 10:11:32 +02:00
*
2020-09-08 21:27:28 +02:00
* @ param string $option 'topay' or 'toapprove'
* @ return boolean True if late , False if not late
2017-06-15 11:08:53 +02:00
*/
2020-09-08 21:27:28 +02:00
public function hasDelay ( $option )
2017-06-15 11:08:53 +02:00
{
2020-09-08 21:27:28 +02:00
global $conf ;
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
// Only valid expenses reports
2021-02-25 22:45:02 +01:00
if ( $option == 'toapprove' && $this -> status != 2 ) {
return false ;
}
if ( $option == 'topay' && $this -> status != 5 ) {
return false ;
}
2017-08-22 10:11:32 +02:00
2020-09-08 21:27:28 +02:00
$now = dol_now ();
2021-02-04 11:56:53 +01:00
if ( $option == 'toapprove' ) {
2021-05-27 22:50:56 +02:00
return ( ! empty ( $this -> datevalid ) ? $this -> datevalid : $this -> date_valid ) < ( $now - $conf -> expensereport -> approve -> warning_delay );
2021-02-04 11:56:53 +01:00
} else {
2021-05-27 22:50:56 +02:00
return ( ! empty ( $this -> datevalid ) ? $this -> datevalid : $this -> date_valid ) < ( $now - $conf -> expensereport -> payment -> warning_delay );
2021-02-04 11:56:53 +01:00
}
2017-06-15 11:08:53 +02:00
}
2015-06-29 13:12:37 +02:00
2020-09-08 21:27:28 +02:00
/**
2020-12-14 10:44:51 +01:00
* Return if object was dispatched into bookkeeping
2020-09-08 21:27:28 +02:00
*
2023-12-06 15:46:39 +01:00
* @ return int Return integer < 0 if KO , 0 = no , 1 = yes
2020-09-08 21:27:28 +02:00
*/
public function getVentilExportCompta ()
{
$alreadydispatched = 0 ;
2015-06-29 13:12:37 +02:00
2020-09-08 21:27:28 +02:00
$type = 'expense_report' ;
2015-06-29 13:12:37 +02:00
2021-03-30 19:12:07 +02:00
$sql = " SELECT COUNT(ab.rowid) as nb FROM " . MAIN_DB_PREFIX . " accounting_bookkeeping as ab WHERE ab.doc_type=' " . $this -> db -> escape ( $type ) . " ' AND ab.fk_doc = " . (( int ) $this -> id );
2020-09-08 21:27:28 +02:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $resql ) {
2020-09-08 21:27:28 +02:00
$obj = $this -> db -> fetch_object ( $resql );
2021-02-25 22:45:02 +01:00
if ( $obj ) {
2020-09-08 21:27:28 +02:00
$alreadydispatched = $obj -> nb ;
}
} else {
$this -> error = $this -> db -> lasterror ();
return - 1 ;
2020-05-22 00:33:30 +02:00
}
2015-08-17 05:29:12 +02:00
2021-02-25 22:45:02 +01:00
if ( $alreadydispatched ) {
2020-09-08 21:27:28 +02:00
return 1 ;
2020-05-22 00:33:30 +02:00
}
2020-09-08 21:27:28 +02:00
return 0 ;
}
2018-12-04 23:16:41 +01:00
/**
* Return amount of payments already done
2018-12-05 11:10:42 +01:00
*
2018-12-04 23:16:41 +01:00
* @ return int Amount of payment already done , < 0 if KO
*/
public function getSumPayments ()
{
2019-12-18 15:20:36 +01:00
$table = 'payment_expensereport' ;
$field = 'fk_expensereport' ;
2018-12-04 23:16:41 +01:00
$sql = 'SELECT sum(amount) as amount' ;
2019-12-18 15:20:36 +01:00
$sql .= ' FROM ' . MAIN_DB_PREFIX . $table ;
2021-08-28 00:55:51 +02:00
$sql .= " WHERE " . $field . " = " . (( int ) $this -> id );
2018-12-04 23:16:41 +01:00
dol_syslog ( get_class ( $this ) . " ::getSumPayments " , LOG_DEBUG );
2019-12-18 15:20:36 +01:00
$resql = $this -> db -> query ( $sql );
2021-02-25 22:45:02 +01:00
if ( $resql ) {
2018-12-04 23:16:41 +01:00
$obj = $this -> db -> fetch_object ( $resql );
$this -> db -> free ( $resql );
2020-11-25 15:29:18 +01:00
return ( empty ( $obj -> amount ) ? 0 : $obj -> amount );
2020-05-21 15:05:19 +02:00
} else {
2019-12-18 15:20:36 +01:00
$this -> error = $this -> db -> lasterror ();
2018-12-04 23:16:41 +01:00
return - 1 ;
}
}
2022-05-23 16:41:05 +02:00
/**
2024-01-13 19:48:41 +01:00
* \brief Compute the cost of the kilometers expense based on the number of kilometers and the vehicle category
2022-05-23 16:41:05 +02:00
*
2024-01-13 19:48:41 +01:00
* @ param int $fk_cat Category of the vehicle used
2022-12-28 02:54:35 +01:00
* @ param float $qty Number of kilometers
* @ param float $tva VAT rate
2023-12-06 15:46:39 +01:00
* @ return int Return integer < 0 if KO , total ttc if OK
2022-05-23 16:41:05 +02:00
*/
2022-05-23 20:01:19 +02:00
public function computeTotalKm ( $fk_cat , $qty , $tva )
2022-05-23 16:41:05 +02:00
{
2022-12-28 02:54:35 +01:00
global $langs , $db , $conf ;
2022-05-23 19:59:54 +02:00
2022-05-24 08:15:28 +02:00
$cumulYearQty = 0 ;
2022-05-23 16:41:05 +02:00
$ranges = array ();
$coef = 0 ;
2022-05-24 08:15:28 +02:00
2022-05-23 16:41:05 +02:00
2022-05-23 16:55:40 +02:00
if ( $fk_cat < 0 ) {
2022-05-23 16:41:05 +02:00
$this -> error = $langs -> trans ( 'ErrorBadParameterCat' );
return - 1 ;
}
2022-05-23 16:55:40 +02:00
if ( $qty <= 0 ) {
2022-05-23 16:41:05 +02:00
$this -> error = $langs -> trans ( 'ErrorBadParameterQty' );
return - 1 ;
}
$currentUser = new User ( $db );
$currentUser -> fetch ( $this -> fk_user );
2024-08-02 10:36:43 +02:00
$currentUser -> loadRights ( 'expensereport' );
2022-05-23 16:41:05 +02:00
//Clean
2024-03-22 01:12:40 +01:00
$qty = ( float ) price2num ( $qty );
2022-05-23 16:41:05 +02:00
2023-11-18 12:10:04 +01:00
$sql = " SELECT r.range_ik, t.ikoffset, t.coef " ;
2022-05-30 15:46:21 +02:00
$sql .= " FROM " . MAIN_DB_PREFIX . " expensereport_ik t " ;
2022-05-23 16:41:05 +02:00
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " c_exp_tax_range r ON r.rowid = t.fk_range " ;
2022-05-30 15:46:21 +02:00
$sql .= " WHERE t.fk_c_exp_tax_cat = " . ( int ) $fk_cat ;
2022-05-23 16:41:05 +02:00
$sql .= " ORDER BY r.range_ik ASC " ;
2022-05-23 20:03:08 +02:00
2022-05-23 16:41:05 +02:00
dol_syslog ( " expenseReport::computeTotalkm sql= " . $sql , LOG_DEBUG );
$result = $this -> db -> query ( $sql );
2022-05-23 16:55:40 +02:00
if ( $result ) {
2022-05-24 08:26:08 +02:00
if ( $conf -> global -> EXPENSEREPORT_CALCULATE_MILEAGE_EXPENSE_COEFFICIENT_ON_CURRENT_YEAR ) {
2022-05-24 08:15:28 +02:00
$arrayDate = dol_getdate ( dol_now ());
$sql = " SELECT count(n.qty) as cumul FROM " . MAIN_DB_PREFIX . " expensereport_det n " ;
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " expensereport e ON e.rowid = n.fk_expensereport " ;
2022-05-24 09:06:57 +02:00
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " c_type_fees tf ON tf.id = n.fk_c_type_fees " ;
2024-03-11 22:05:24 +01:00
$sql .= " WHERE e.fk_user_author = " . ( int ) $this -> fk_user_author ;
$sql .= " AND YEAR(n.date) = " . ( int ) $arrayDate [ 'year' ];
$sql .= " AND tf.code = 'EX_KME' " ;
$sql .= " AND e.fk_statut = " . ( int ) ExpenseReport :: STATUS_VALIDATED ;
2022-05-24 09:06:57 +02:00
2022-05-24 08:15:28 +02:00
$resql = $this -> db -> query ( $sql );
2022-05-24 08:26:08 +02:00
if ( $resql ) {
2022-05-24 08:15:28 +02:00
$obj = $this -> db -> fetch_object ( $resql );
$cumulYearQty = $obj -> cumul ;
}
2023-11-18 12:10:04 +01:00
2024-03-22 01:12:40 +01:00
$qty += ( float ) $cumulYearQty ;
2022-05-24 08:15:28 +02:00
}
2022-05-23 16:41:05 +02:00
$num = $this -> db -> num_rows ( $result );
2022-05-23 16:55:40 +02:00
if ( $num ) {
for ( $i = 0 ; $i < $num ; $i ++ ) {
2022-05-23 16:41:05 +02:00
$obj = $this -> db -> fetch_object ( $result );
$ranges [ $i ] = $obj ;
}
2024-09-30 10:05:24 +02:00
'@phan-var-force Object[] $ranges' ;
2022-05-23 16:41:05 +02:00
2022-05-23 16:55:40 +02:00
for ( $i = 0 ; $i < $num ; $i ++ ) {
if ( $i < ( $num - 1 )) {
2024-09-29 21:52:31 +02:00
// @phan-suppress-next-line PhanTypeInvalidDimOffset
2024-03-11 22:05:24 +01:00
if ( $qty > $ranges [ $i ] -> range_ik && $qty < $ranges [ $i + 1 ] -> range_ik ) {
2022-05-23 16:55:40 +02:00
$coef = $ranges [ $i ] -> coef ;
2023-11-13 20:49:58 +01:00
$offset = $ranges [ $i ] -> ikoffset ;
2022-05-23 16:41:05 +02:00
}
2022-05-23 16:55:40 +02:00
} else {
2022-05-24 08:15:28 +02:00
if ( $qty > $ranges [ $i ] -> range_ik ) {
2022-05-23 16:55:40 +02:00
$coef = $ranges [ $i ] -> coef ;
2023-11-13 20:49:58 +01:00
$offset = $ranges [ $i ] -> ikoffset ;
2022-05-23 16:41:05 +02:00
}
}
2022-05-23 16:55:40 +02:00
}
2022-05-23 16:41:05 +02:00
$total_ht = $coef ;
return $total_ht ;
2022-05-23 16:55:40 +02:00
} else {
2022-05-23 16:41:05 +02:00
$this -> error = $langs -> trans ( 'TaxUndefinedForThisCategory' );
2022-05-30 15:53:37 +02:00
return 0 ;
2022-05-23 16:41:05 +02:00
}
2022-05-23 16:55:40 +02:00
} else {
2022-05-23 16:41:05 +02:00
$this -> error = $this -> db -> error () . " sql= " . $sql ;
return - 1 ;
}
}
2023-01-17 11:31:40 +01:00
/**
2024-03-22 01:12:40 +01:00
* Return clickable link of object ( with optional picto )
2023-01-17 11:31:40 +01:00
*
2024-08-22 03:31:04 +02:00
* @ param string $option Where point the link ( 0 => main card , 1 , 2 => shipment , 'nolink' => No link )
2025-02-03 11:24:16 +01:00
* @ param ? array < string , mixed > $arraydata Array of data
2024-08-22 03:31:04 +02:00
* @ return string HTML Code for Kanban thumb .
2023-01-17 11:31:40 +01:00
*/
2023-01-18 22:27:52 +01:00
public function getKanbanView ( $option = '' , $arraydata = null )
2023-01-17 11:31:40 +01:00
{
2023-03-07 22:04:40 +01:00
global $langs ;
2025-02-03 11:24:16 +01:00
if ( $arraydata === null ) {
$arraydata = array ();
}
2023-03-07 22:04:40 +01:00
$selected = ( empty ( $arraydata [ 'selected' ]) ? 0 : $arraydata [ 'selected' ]);
2023-01-17 11:31:40 +01:00
$return = '<div class="box-flex-item box-flex-grow-zero">' ;
$return .= '<div class="info-box info-box-sm">' ;
$return .= '<span class="info-box-icon bg-infobox-action">' ;
$return .= img_picto ( '' , $this -> picto );
$return .= '</span>' ;
$return .= '<div class="info-box-content">' ;
2023-05-11 11:03:26 +02:00
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . ( method_exists ( $this , 'getNomUrl' ) ? $this -> getNomUrl ( 1 ) : $this -> ref ) . '</span>' ;
2023-10-17 15:43:56 +02:00
if ( $selected >= 0 ) {
$return .= '<input id="cb' . $this -> id . '" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="' . $this -> id . '"' . ( $selected ? ' checked="checked"' : '' ) . '>' ;
}
2024-09-30 10:05:24 +02:00
if ( array_key_exists ( 'userauthor' , $arraydata ) && $arraydata [ 'userauthor' ] instanceof User ) {
2024-01-06 16:11:04 +01:00
$return .= '<br><span class="info-box-label">' . $arraydata [ 'userauthor' ] -> getNomUrl ( - 1 ) . '</span>' ;
2023-01-17 11:31:40 +01:00
}
if ( property_exists ( $this , 'date_debut' ) && property_exists ( $this , 'date_fin' )) {
$return .= '<br><span class="info-box-label">' . dol_print_date ( $this -> date_debut , 'day' ) . '</span>' ;
$return .= ' <span class="opacitymedium">' . $langs -> trans ( " To " ) . '</span> ' ;
$return .= '<span class="info-box-label">' . dol_print_date ( $this -> date_fin , 'day' ) . '</span>' ;
}
if ( method_exists ( $this , 'getLibStatut' )) {
2023-12-19 11:51:48 +01:00
$return .= '<br><div class="info-box-status">' . $this -> getLibStatut ( 3 ) . '</div>' ;
2023-01-17 11:31:40 +01:00
}
$return .= '</div>' ;
$return .= '</div>' ;
$return .= '</div>' ;
return $return ;
}
2015-02-14 18:39:45 +01:00
}