52 $this->family =
"financial";
54 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
59 $this->version =
'dolibarr';
61 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
62 $this->picto =
'payment';
65 $this->dirs = array(
"/salaries/temp");
68 $this->config_page_url = array(
'salaries.php@salaries');
71 $this->hidden =
false;
72 $this->depends = array();
73 $this->requiredby = array();
74 $this->conflictwith = array();
75 $this->phpmin = array(7, 0);
76 $this->langfiles = array(
"salaries",
"bills");
79 $this->
const = array();
80 $this->
const[0] = array(
81 "SALARIES_ACCOUNTING_ACCOUNT_PAYMENT",
85 $this->
const[1] = array(
86 "SALARIES_ACCOUNTING_ACCOUNT_CHARGE",
92 $this->boxes = array();
95 $this->rights = array();
96 $this->rights_class =
'salaries';
100 $this->rights[$r][0] = 511;
101 $this->rights[$r][1] =
'Read employee salaries and payments (yours and your subordinates)';
102 $this->rights[$r][2] =
'r';
103 $this->rights[$r][3] = 0;
104 $this->rights[$r][4] =
'read';
105 $this->rights[$r][5] =
'';
108 $this->rights[$r][0] = 512;
109 $this->rights[$r][1] =
'Create/modify payments of empoyee salaries';
110 $this->rights[$r][2] =
'w';
111 $this->rights[$r][3] = 0;
112 $this->rights[$r][4] =
'write';
113 $this->rights[$r][5] =
'';
116 $this->rights[$r][0] = 514;
117 $this->rights[$r][1] =
'Delete payments of employee salary';
118 $this->rights[$r][2] =
'd';
119 $this->rights[$r][3] = 0;
120 $this->rights[$r][4] =
'delete';
121 $this->rights[$r][5] =
'';
124 $this->rights[$r][0] = 517;
125 $this->rights[$r][1] =
'Read salaries and payments of all employees';
126 $this->rights[$r][2] =
'r';
127 $this->rights[$r][3] = 0;
128 $this->rights[$r][4] =
'readall';
131 $this->rights[$r][0] = 519;
132 $this->rights[$r][1] =
'Export payments of employee salaries';
133 $this->rights[$r][2] =
'r';
134 $this->rights[$r][3] = 0;
135 $this->rights[$r][4] =
'export';
136 $this->rights[$r][5] =
'';
150 $this->export_code[$r] = $this->rights_class.
'_'.$r;
151 $this->export_label[$r] =
'SalariesAndPayments';
152 $this->export_icon[$r] =
'salary';
153 $this->export_permission[$r] = array(array(
"salaries",
"export"));
154 $this->export_fields_array[$r] = array(
's.rowid' =>
'SalaryID',
's.label'=>
'Label',
's.datesp'=>
'DateStartPeriod',
's.dateep'=>
'DateEndPeriod',
's.amount' =>
'SalaryAmount',
's.paye' =>
'Status',
'u.firstname'=>
"Firstname",
'u.lastname'=>
"Lastname",
'u.login'=>
"Login",
'u.salary'=>
'CurrentSalary',
'p.datep'=>
'DatePayment',
'p.amount'=>
'AmountPayment',
'p.num_payment'=>
'Numero',
'p.note'=>
'Note');
155 $this->export_TypeFields_array[$r] = array(
's.rowid' =>
'Numeric',
's.label'=>
'Text',
's.amount' =>
'Numeric',
's.paye' =>
'Numeric',
'u.firstname'=>
"Text",
'u.lastname'=>
"Text",
'u.login'=>
'Text',
'u.salary'=>
"Numeric",
'p.datep'=>
'Date',
's.datesp'=>
'Date',
's.dateep'=>
'Date',
'p.amount'=>
'Numeric',
'p.num_payment'=>
'Numeric');
156 $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');
158 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
159 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'salary as s';
160 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON s.fk_user = u.rowid';
161 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'payment_salary as p ON p.fk_salary = s.rowid';
162 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement as cp ON p.fk_typepayment = cp.id';
163 $this->export_sql_end[$r] .=
' AND s.entity IN ('.getEntity(
'salary').
')';