32 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
55 $this->family =
"financial";
57 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
62 $this->version =
'dolibarr';
64 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
65 $this->picto =
'payment';
68 $this->dirs = array(
"/salaries/temp");
71 $this->config_page_url = array(
'salaries.php@salaries');
74 $this->hidden =
false;
75 $this->depends = array();
76 $this->requiredby = array();
77 $this->conflictwith = array();
78 $this->phpmin = array(7, 0);
79 $this->langfiles = array(
"salaries",
"bills");
82 $this->
const = array();
83 $this->
const[0] = array(
84 "SALARIES_ACCOUNTING_ACCOUNT_PAYMENT",
88 $this->
const[1] = array(
89 "SALARIES_ACCOUNTING_ACCOUNT_CHARGE",
95 $this->boxes = array();
98 $this->rights = array();
99 $this->rights_class =
'salaries';
103 $this->rights[$r][0] = 511;
104 $this->rights[$r][1] =
'Read employee salaries and payments (yours and your subordinates)';
105 $this->rights[$r][2] =
'r';
106 $this->rights[$r][3] = 0;
107 $this->rights[$r][4] =
'read';
108 $this->rights[$r][5] =
'';
111 $this->rights[$r][0] = 512;
112 $this->rights[$r][1] =
'Create/modify payments of empoyee salaries';
113 $this->rights[$r][2] =
'w';
114 $this->rights[$r][3] = 0;
115 $this->rights[$r][4] =
'write';
116 $this->rights[$r][5] =
'';
119 $this->rights[$r][0] = 514;
120 $this->rights[$r][1] =
'Delete payments of employee salary';
121 $this->rights[$r][2] =
'd';
122 $this->rights[$r][3] = 0;
123 $this->rights[$r][4] =
'delete';
124 $this->rights[$r][5] =
'';
127 $this->rights[$r][0] = 517;
128 $this->rights[$r][1] =
'Read salaries and payments of all employees';
129 $this->rights[$r][2] =
'r';
130 $this->rights[$r][3] = 0;
131 $this->rights[$r][4] =
'readall';
134 $this->rights[$r][0] = 519;
135 $this->rights[$r][1] =
'Export payments of employee salaries';
136 $this->rights[$r][2] =
'r';
137 $this->rights[$r][3] = 0;
138 $this->rights[$r][4] =
'export';
139 $this->rights[$r][5] =
'';
153 $this->export_code[$r] = $this->rights_class.
'_'.$r;
154 $this->export_label[$r] =
'SalariesAndPayments';
155 $this->export_permission[$r] = array(array(
"salaries",
"export"));
156 $this->export_fields_array[$r] = array(
'u.firstname'=>
"Firstname",
'u.lastname'=>
"Lastname",
'u.login'=>
"Login",
'u.salary'=>
'CurrentSalary',
'p.datep'=>
'DatePayment',
'p.datesp'=>
'DateStartPeriod',
'p.dateep'=>
'DateEndPeriod',
'p.amount'=>
'AmountPayment',
'p.num_payment'=>
'Numero',
'p.label'=>
'Label',
'p.note'=>
'Note');
157 $this->export_TypeFields_array[$r] = array(
'u.firstname'=>
"Text",
'u.lastname'=>
"Text",
'u.login'=>
'Text',
'u.salary'=>
"Numeric",
'p.datep'=>
'Date',
'p.datesp'=>
'Date',
'p.dateep'=>
'Date',
'p.amount'=>
'Numeric',
'p.num_payment'=>
'Numeric',
'p.label'=>
'Text');
158 $this->export_entities_array[$r] = array(
'u.firstname'=>
'user',
'u.lastname'=>
'user',
'u.login'=>
'user',
'u.salary'=>
'user',
'p.datep'=>
'payment',
'p.datesp'=>
'payment',
'p.dateep'=>
'payment',
'p.amount'=>
'payment',
'p.label'=>
'payment',
'p.note'=>
'payment',
'p.num_payment'=>
'payment');
160 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
161 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'user as u';
162 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'payment_salary as p ON p.fk_user = u.rowid';
163 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement as cp ON p.fk_typepayment = cp.id';
164 $this->export_sql_end[$r] .=
' AND u.entity IN ('.getEntity(
'user').
')';
176 public function init($options =
'')
181 $this->
remove($options);
185 return $this->
_init($sql, $options);
_init($array_sql, $options='')
Enables a module.
Class to manage salaries module.
__construct($db)
Constructor.
init($options='')
Function called when module is enabled.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.