parent
612e41a8ca
commit
4ed203bece
2 changed files with 22 additions and 41 deletions
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
|
||||
* Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -75,11 +76,11 @@ class ExpenseReportIk extends CommonObject
|
|||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'index' => 1)
|
||||
,'fk_c_exp_tax_cat' => array('type' => 'integer', 'index' => 1)
|
||||
,'fk_range' => array('type' => 'integer', 'index' => 1)
|
||||
,'coef' => array('type' => 'double')
|
||||
,'ikoffset' => array('type' => 'double')
|
||||
'rowid' => array('type' => 'integer', 'label' => 'ID', 'enabled' => 1, 'index' => 1, 'visible' => -1, 'position' => 10),
|
||||
'fk_c_exp_tax_cat' => array('type' => 'integer', 'label' => 'Tax cat id', 'enabled' => 1, 'index' => 1, 'visible' => -1, 'position' => 20),
|
||||
'fk_range' => array('type' => 'integer', 'label' => 'Tax range id', 'enabled' => 1, 'index' => 1, 'visible' => -1, 'position' => 30),
|
||||
'coef' => array('type' => 'double', 'label' => 'Coef', 'enabled' => 1, 'visible' => -1, 'position' => 40),
|
||||
'ikoffset' => array('type' => 'double', 'label' => 'Offset', 'enabled' => 1, 'visible' => -1, 'position' => 50),
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -120,9 +121,7 @@ class ExpenseReportIk extends CommonObject
|
|||
*/
|
||||
public function fetch($id, $ref = null)
|
||||
{
|
||||
$result = $this->fetchCommon($id, $ref);
|
||||
|
||||
return $result;
|
||||
return $this->fetchCommon($id, $ref);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
|
||||
* Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||
/* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
|
||||
* Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -93,7 +94,6 @@ class ExpenseReportRule extends CommonObject
|
|||
*/
|
||||
public $code_expense_rules_type;
|
||||
|
||||
|
||||
/**
|
||||
* rule for all
|
||||
* @var int
|
||||
|
|
@ -113,17 +113,17 @@ class ExpenseReportRule extends CommonObject
|
|||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'index' => 1)
|
||||
,'dates' => array('type' => 'date')
|
||||
,'datee' => array('type' => 'date')
|
||||
,'amount' => array('type' => 'double')
|
||||
,'restrictive' => array('type' => 'integer')
|
||||
,'fk_user' => array('type' => 'integer')
|
||||
,'fk_usergroup' => array('type' => 'integer')
|
||||
,'fk_c_type_fees' => array('type' => 'integer')
|
||||
,'code_expense_rules_type' => array('type' => 'string')
|
||||
,'is_for_all' => array('type' => 'integer')
|
||||
,'entity' => array('type' => 'integer')
|
||||
'rowid' => array('type' => 'integer', 'index' => 1, 'label' => 'ID', 'enabled' => 1, 'visible' => -1, 'position' => 10),
|
||||
'dates' => array('type' => 'date', 'label' => 'Dates', 'enabled' => 1, 'visible' => -1, 'position' => 20),
|
||||
'datee' => array('type' => 'date', 'label' => 'Datee', 'enabled' => 1, 'visible' => -1, 'position' => 30),
|
||||
'amount' => array('type' => 'double', 'label' => 'Amount', 'enabled' => 1, 'visible' => -1, 'position' => 40),
|
||||
'restrictive' => array('type' => 'integer', 'label' => 'Restrictive', 'enabled' => 1, 'visible' => -1, 'position' => 50),
|
||||
'fk_user' => array('type' => 'integer', 'label' => 'User', 'enabled' => 1, 'visible' => -1, 'position' => 60),
|
||||
'fk_usergroup' => array('type' => 'integer', 'label' => 'Usergroup', 'enabled' => 1, 'visible' => -1, 'position' => 70),
|
||||
'fk_c_type_fees' => array('type' => 'integer', 'label' => 'Type fees', 'enabled' => 1, 'visible' => -1, 'position' => 80),
|
||||
'code_expense_rules_type' => array('type' => 'string', 'label' => 'Expense rule code', 'enabled' => 1, 'visible' => -1, 'position' => 90),
|
||||
'is_for_all' => array('type' => 'integer', 'label' => 'IsForAll', 'enabled' => 1, 'visible' => -1, 'position' => 100),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => -2, 'position' => 110),
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -164,25 +164,7 @@ class ExpenseReportRule extends CommonObject
|
|||
*/
|
||||
public function fetch($id, $ref = null)
|
||||
{
|
||||
$result = $this->fetchCommon($id, $ref);
|
||||
if ($result > 0 && !empty($this->table_element_line)) {
|
||||
$this->fetchLines();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load object lines in memory from the database
|
||||
*
|
||||
* @return int Return integer <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetchLines()
|
||||
{
|
||||
$this->lines = array();
|
||||
|
||||
$result = $this->fetchLinesCommon();
|
||||
return $result;
|
||||
return $this->fetchCommon($id, $ref);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue