26 if (!defined(
'NOTOKENRENEWAL')) {
27 define(
'NOTOKENRENEWAL', 1);
29 if (!defined(
'NOREQUIREMENU')) {
30 define(
'NOREQUIREMENU',
'1');
32 if (!defined(
'NOREQUIREHTML')) {
33 define(
'NOREQUIREHTML',
'1');
35 if (!defined(
'NOREQUIREAJAX')) {
36 define(
'NOREQUIREAJAX',
'1');
38 if (!defined(
'NOREQUIRESOC')) {
39 define(
'NOREQUIRESOC',
'1');
43 require
'../../main.inc.php';
44 require_once DOL_DOCUMENT_ROOT.
'/salaries/class/salary.class.php';
55 $fk_user =
GETPOST(
'fk_user',
'int');
56 $return_arr = array();
58 if (!empty(
GETPOST(
'fk_user',
'int'))) {
59 $sql =
"SELECT s.amount, s.rowid FROM ".MAIN_DB_PREFIX.
"salary as s";
60 $sql .=
" WHERE s.fk_user = ".((int) $fk_user);
61 $sql .=
" AND s.paye = 1";
62 $sql .= $db->order(
"s.dateep",
"DESC");
66 $obj = $db->fetch_object(
$resql);
67 $label =
"Salary amount";
68 $row_array[
'label'] = $label;
69 $row_array[
'value'] =
price2num($obj->amount,
'MT');
70 $row_array[
'key'] =
"Amount";
72 array_push($return_arr, $row_array);
73 echo json_encode($return_arr);
75 echo json_encode(array(
'nom'=>
'Error',
'label'=>
'Error',
'key'=>
'Error',
'value'=>
'Error'));
78 echo json_encode(array(
'nom'=>
'ErrorBadParameter',
'label'=>
'ErrorBadParameter',
'key'=>
'ErrorBadParameter',
'value'=>
'ErrorBadParameter'));
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.