25 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL', 1);
26 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
27 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML',
'1');
28 if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
29 if (!defined(
'NOREQUIRESOC')) define(
'NOREQUIRESOC',
'1');
30 if (!defined(
'NOCSRFCHECK')) define(
'NOCSRFCHECK',
'1');
33 require
'../../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport_ik.class.php';
38 $langs->loadlangs(array(
'errors',
'trips'));
49 $fk_expense =
GETPOST(
'fk_expense');
50 $fk_c_exp_tax_cat =
GETPOST(
'fk_c_exp_tax_cat');
53 if (empty($fk_expense) || $fk_expense < 0) echo json_encode(array(
'error' => $langs->transnoentitiesnoconv(
'ErrorBadValueForParameter', $fk_expense,
'fk_expense')));
54 elseif (empty($fk_c_exp_tax_cat) || $fk_c_exp_tax_cat < 0) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat')));
58 if ($expense->fetch($fk_expense) <= 0) echo json_encode(array(
'error' => $langs->transnoentitiesnoconv(
'ErrorRecordNotFound'),
'fk_expense' => $fk_expense));
60 $userauthor =
new User($db);
61 if ($userauthor->fetch($expense->fk_user_author) <= 0) echo json_encode(array(
'error' => $langs->transnoentitiesnoconv(
'ErrorRecordNotFound'),
'fk_user_author' => $expense->fk_user_author));
65 if (empty($range)) echo json_encode(array(
'error' => $langs->transnoentitiesnoconv(
'ErrorRecordNotFound'),
'range' => $range));
67 $ikoffset =
price($range->ikoffset, 0, $langs, 1, -1, -1, $conf->currency);
68 echo json_encode(array(
'up' => $range->coef,
'ikoffset' => $range->ikoffset,
'title' => $langs->transnoentitiesnoconv(
'ExpenseRangeOffset', $offset),
'comment' =>
'offset should be apply on addline or updateline'));
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
static getRangeByUser(User $userauthor, $fk_c_exp_tax_cat)
Return an array of ranges for a user.
Class to manage Dolibarr users.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype= 'text/html', $forcenocache=0)
Show HTTP header.
price($amount, $form=0, $outlangs= '', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code= '')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
if(!GETPOST('transkey', 'alphanohtml')&&!GETPOST('transphrase', 'alphanohtml')) else
View.
Class to manage Trips and Expenses.