Debug hidden option MAIN_USE_EXPENSE_IK
This commit is contained in:
parent
f567d41055
commit
86ed4dfa2b
@ -15,6 +15,8 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Rename property $paiementid in API api_supplier_invoices into $payment_mode_id
|
||||
* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you still use old syntax in
|
||||
your email templates.
|
||||
* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom
|
||||
days of holiday.
|
||||
|
||||
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
|
||||
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
|
||||
|
||||
@ -35,13 +35,11 @@ $langs->loadLangs(array("admin", "trips", "errors", "other", "dict"));
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
//Init error
|
||||
$error = false;
|
||||
$message = false;
|
||||
$error = 0;
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
$offset = GETPOST('offset', 'int');
|
||||
$ikoffset = GETPOST('ikoffset', 'int');
|
||||
$coef = GETPOST('coef', 'int');
|
||||
|
||||
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat');
|
||||
@ -59,10 +57,13 @@ if ($action == 'updateik')
|
||||
$expIk->setValues($_POST);
|
||||
$result = $expIk->create($user);
|
||||
|
||||
if ($result > 0) setEventMessages('SetupSaved', null, 'mesgs');
|
||||
|
||||
header('Location: '.$_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
if ($result > 0) {
|
||||
setEventMessages('SetupSaved', null, 'mesgs');
|
||||
header('Location: '.$_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($expIk->error, $expIk->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'delete') // TODO add confirm
|
||||
{
|
||||
$expIk = new ExpenseReportIk($db);
|
||||
@ -81,6 +82,7 @@ if ($action == 'updateik')
|
||||
|
||||
$rangesbycateg = ExpenseReportIk::getAllRanges();
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -90,12 +92,13 @@ llxHeader('', $langs->trans("ExpenseReportsSetup"));
|
||||
$form = new Form($db);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("ExpenseReportsIkSetup"), $linkback, 'title_setup');
|
||||
print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup');
|
||||
|
||||
$head = expensereport_admin_prepare_head();
|
||||
dol_fiche_head($head, 'expenseik', $langs->trans("ExpenseReportsIk"), -1, 'trip');
|
||||
|
||||
echo $langs->trans('ExpenseReportIkDesc');
|
||||
echo '<span class="opacitymedium">'.$langs->trans('ExpenseReportIkDesc').'</span>';
|
||||
print '<br><br>';
|
||||
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
||||
|
||||
@ -136,21 +139,23 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab)
|
||||
echo '<tr class="oddeven">';
|
||||
|
||||
// Label
|
||||
echo '<td width="20%"><b>['.$langs->trans('RangeNum', $tranche++).']</b> - '.$label.'</td>';
|
||||
echo '<td class="nowraponall"><b>['.$langs->trans('RangeNum', $tranche++).']</b> - '.$label.'</td>';
|
||||
|
||||
// Offset
|
||||
echo '<td width="20%">';
|
||||
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) echo '<input type="text" name="offset" value="'.$range->ik->offset.'" />';
|
||||
else echo $range->ik->offset;
|
||||
echo '<td class="nowraponall">';
|
||||
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) echo '<input type="text" class="maxwidth100" name="ikoffset" value="'.$range->ik->ikoffset.'" />';
|
||||
else {
|
||||
echo $range->ik->ikoffset;
|
||||
}
|
||||
echo '</td>';
|
||||
// Coef
|
||||
echo '<td width="20%">';
|
||||
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) echo '<input type="text" name="coef" value="'.$range->ik->coef.'" />';
|
||||
echo '<td class="nowraponall">';
|
||||
if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) echo '<input type="text" class="maxwidth100" name="coef" value="'.$range->ik->coef.'" />';
|
||||
else echo ($range->ik->id > 0 ? $range->ik->coef : $langs->trans('expenseReportCoefUndefined'));
|
||||
echo '</td>';
|
||||
|
||||
// Total for one
|
||||
echo '<td width="30%">'.$langs->trans('expenseReportPrintExample', price($range->ik->offset + 5 * $range->ik->coef)).'</td>';
|
||||
echo '<td class="nowraponall">'.$langs->trans('expenseReportPrintExample', price($range->ik->ikoffset + 5 * $range->ik->coef)).'</td>';
|
||||
|
||||
// Action
|
||||
echo '<td class="right">';
|
||||
@ -161,8 +166,8 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab)
|
||||
echo '<input id="" class="button" name="save" value="'.$langs->trans('Save').'" type="submit" />';
|
||||
echo '<input class="button" value="'.$langs->trans('Cancel').'" onclick="javascript:history.go(-1)" type="button" />';
|
||||
} else {
|
||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$range->ik->id.'&fk_c_exp_tax_cat='.$range->fk_c_exp_tax_cat.'&fk_range='.$range->rowid.'">'.img_edit().'</a>';
|
||||
if (!empty($range->ik->id)) echo '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$range->ik->id.'">'.img_delete().'</a>';
|
||||
echo '<a class="editfielda marginrightonly paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$range->ik->id.'&fk_c_exp_tax_cat='.$range->fk_c_exp_tax_cat.'&fk_range='.$range->rowid.'">'.img_edit().'</a>';
|
||||
if (!empty($range->ik->id)) echo '<a class="paddingleft paddingright" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$range->ik->id.'">'.img_delete().'</a>';
|
||||
// TODO add delete link
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,6 +138,7 @@ $rules = ExpenseReportRule::getAllRule();
|
||||
$tab_apply = array('A' => $langs->trans('All'), 'G' => $langs->trans('Group'), 'U' => $langs->trans('User'));
|
||||
$tab_rules_type = array('EX_DAY' => $langs->trans('Day'), 'EX_MON' => $langs->trans('Month'), 'EX_YEA' => $langs->trans('Year'), 'EX_EXP' => $langs->trans('OnExpense'));
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -147,12 +148,13 @@ llxHeader('', $langs->trans("ExpenseReportsSetup"));
|
||||
$form = new Form($db);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("ExpenseReportsRulesSetup"), $linkback, 'title_setup');
|
||||
print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup');
|
||||
|
||||
$head = expensereport_admin_prepare_head();
|
||||
dol_fiche_head($head, 'expenserules', $langs->trans("ExpenseReportsRules"), -1, 'trip');
|
||||
|
||||
echo $langs->trans('ExpenseReportRulesDesc');
|
||||
echo '<span class="opacitymedium">'.$langs->trans('ExpenseReportRulesDesc').'</span>';
|
||||
print '<br><br>';
|
||||
|
||||
if ($action != 'edit')
|
||||
{
|
||||
@ -164,7 +166,7 @@ if ($action != 'edit')
|
||||
|
||||
echo '<tr class="liste_titre">';
|
||||
echo '<th>'.$langs->trans('ExpenseReportApplyTo').'</th>';
|
||||
echo '<th>'.$langs->trans('ExpenseReportDomain').'</th>';
|
||||
echo '<th>'.$langs->trans('Type').'</th>';
|
||||
echo '<th>'.$langs->trans('ExpenseReportLimitOn').'</th>';
|
||||
echo '<th>'.$langs->trans('ExpenseReportDateStart').'</th>';
|
||||
echo '<th>'.$langs->trans('ExpenseReportDateEnd').'</th>';
|
||||
@ -184,7 +186,7 @@ if ($action != 'edit')
|
||||
echo '<td>'.$form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0).'</td>';
|
||||
echo '<td>'.$form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0).'</td>';
|
||||
echo '<td>'.$form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0).'</td>';
|
||||
echo '<td><input type="text" value="" name="amount" class="amount" />'.$conf->currency.'</td>';
|
||||
echo '<td><input type="text" value="" class="maxwidth100" name="amount" class="amount" /> '.$conf->currency.'</td>';
|
||||
echo '<td>'.$form->selectyesno('restrictive', 0, 1).'</td>';
|
||||
echo '<td class="right"><input type="submit" class="button" value="'.$langs->trans('Add').'" /></td>';
|
||||
echo '</tr>';
|
||||
@ -207,7 +209,7 @@ echo '<table class="noborder centpercent">';
|
||||
|
||||
echo '<tr class="liste_titre">';
|
||||
echo '<th>'.$langs->trans('ExpenseReportApplyTo').'</th>';
|
||||
echo '<th>'.$langs->trans('ExpenseReportDomain').'</th>';
|
||||
echo '<th>'.$langs->trans('Type').'</th>';
|
||||
echo '<th>'.$langs->trans('ExpenseReportLimitOn').'</th>';
|
||||
echo '<th>'.$langs->trans('ExpenseReportDateStart').'</th>';
|
||||
echo '<th>'.$langs->trans('ExpenseReportDateEnd').'</th>';
|
||||
@ -300,11 +302,11 @@ foreach ($rules as $rule)
|
||||
echo '</td>';
|
||||
|
||||
|
||||
echo '<td>';
|
||||
echo '<td class="center">';
|
||||
if ($object->id != $rule->id)
|
||||
{
|
||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$rule->id.'">'.img_edit().'</a> ';
|
||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$rule->id.'">'.img_delete().'</a>';
|
||||
echo '<a class="editfielda paddingright paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$rule->id.'">'.img_edit().'</a> ';
|
||||
echo '<a class="paddingright paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$rule->id.'">'.img_delete().'</a>';
|
||||
} else {
|
||||
echo '<input type="submit" class="button" value="'.$langs->trans('Update').'" /> ';
|
||||
echo '<a href="'.$_SERVER['PHP_SELF'].'" class="button">'.$langs->trans('Cancel').'</a>';
|
||||
|
||||
@ -269,10 +269,10 @@ class CoreObject extends CommonObject
|
||||
/**
|
||||
* Function to create object in database
|
||||
*
|
||||
* @param User $user user object
|
||||
* @param User $user User object
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
public function create(User &$user)
|
||||
public function create(User $user)
|
||||
{
|
||||
if ($this->id > 0) return $this->update($user);
|
||||
|
||||
|
||||
@ -7606,9 +7606,10 @@ class Form
|
||||
* @param string $target htmlname of target select to bind event
|
||||
* @param int $default_selected default category to select if fk_c_type_fees change = EX_KME
|
||||
* @param array $params param to give
|
||||
* @param int $info_admin Show the tooltip help picto to setup list
|
||||
* @return string
|
||||
*/
|
||||
public function selectExpenseCategories($selected = '', $htmlname = 'fk_c_exp_tax_cat', $useempty = 0, $excludeid = array(), $target = '', $default_selected = 0, $params = array())
|
||||
public function selectExpenseCategories($selected = '', $htmlname = 'fk_c_exp_tax_cat', $useempty = 0, $excludeid = array(), $target = '', $default_selected = 0, $params = array(), $info_admin = 1)
|
||||
{
|
||||
global $db, $conf, $langs, $user;
|
||||
|
||||
@ -7629,7 +7630,9 @@ class Form
|
||||
$out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
|
||||
}
|
||||
$out .= '</select>';
|
||||
if (!empty($htmlname) && $user->admin) $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
$out .= ajax_combobox('select_'.$htmlname);
|
||||
|
||||
if (!empty($htmlname) && $user->admin && $info_admin) $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
|
||||
if (!empty($target))
|
||||
{
|
||||
|
||||
@ -615,23 +615,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '',
|
||||
$mois = date("m", $timestampStart);
|
||||
$annee = date("Y", $timestampStart);
|
||||
|
||||
// Check into var $conf->global->HOLIDAY_MORE_DAYS MM-DD,YYYY-MM-DD, ...
|
||||
// Do not use this anymore, use instead the dictionary of public holidays.
|
||||
if (!empty($conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS))
|
||||
{
|
||||
$arrayofdaystring = explode(',', $conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS);
|
||||
foreach ($arrayofdaystring as $daystring)
|
||||
{
|
||||
$tmp = explode('-', $daystring);
|
||||
if ($tmp[2])
|
||||
{
|
||||
if ($tmp[0] == $annee && $tmp[1] == $mois && $tmp[2] == $jour) $ferie = true;
|
||||
} else {
|
||||
if ($tmp[0] == $mois && $tmp[1] == $jour) $ferie = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$country_id = dol_getIdFromCode($db, $country_code, 'c_country', 'code', 'rowid');
|
||||
|
||||
// Loop on public holiday defined into hrm_public_holiday
|
||||
|
||||
@ -133,14 +133,6 @@ function expensereport_admin_prepare_head()
|
||||
$head[$h][2] = 'expensereport';
|
||||
$h++;
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_ik.php";
|
||||
$head[$h][1] = $langs->trans("ExpenseReportsIk");
|
||||
$head[$h][2] = 'expenseik';
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_RULE))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php";
|
||||
@ -149,6 +141,14 @@ function expensereport_admin_prepare_head()
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_ik.php";
|
||||
$head[$h][1] = $langs->trans("ExpenseReportsIk");
|
||||
$head[$h][2] = 'expenseik';
|
||||
$h++;
|
||||
}
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
@ -1835,7 +1835,7 @@ if ($action == 'create')
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($object->fk_statut == 6)
|
||||
if ($object->fk_statut == $object::STATUS_CLOSED)
|
||||
{
|
||||
/* TODO this fields are not yet filled
|
||||
print '<tr>';
|
||||
@ -2029,8 +2029,8 @@ if ($action == 'create')
|
||||
//print '<td class="center">'.$langs->trans('Piece').'</td>';
|
||||
print '<td class="center">'.$langs->trans('Date').'</td>';
|
||||
if (!empty($conf->projet->enabled)) print '<td class="minwidth100imp">'.$langs->trans('Project').'</td>';
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print '<td>'.$langs->trans('CarCategory').'</td>';
|
||||
print '<td class="center">'.$langs->trans('Type').'</td>';
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print '<td>'.$langs->trans('CarCategory').'</td>';
|
||||
print '<td>'.$langs->trans('Description').'</td>';
|
||||
print '<td class="right">'.$langs->trans('VAT').'</td>';
|
||||
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
||||
@ -2080,6 +2080,13 @@ if ($action == 'create')
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Type of fee
|
||||
print '<td class="center">';
|
||||
$labeltype = ($langs->trans(($line->type_fees_code)) == $line->type_fees_code ? $line->type_fees_libelle : $langs->trans($line->type_fees_code));
|
||||
print $labeltype;
|
||||
print '</td>';
|
||||
|
||||
// IK
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
@ -2087,11 +2094,7 @@ if ($action == 'create')
|
||||
print dol_getIdFromCode($db, $line->fk_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label');
|
||||
print '</td>';
|
||||
}
|
||||
// Type of fee
|
||||
print '<td class="center">';
|
||||
$labeltype = ($langs->trans(($line->type_fees_code)) == $line->type_fees_code ? $line->type_fees_libelle : $langs->trans($line->type_fees_code));
|
||||
print $labeltype;
|
||||
print '</td>';
|
||||
|
||||
// Comment
|
||||
print '<td class="left">'.dol_nl2br($line->comments).'</td>';
|
||||
// VAT rate
|
||||
@ -2285,6 +2288,11 @@ if ($action == 'create')
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Select type
|
||||
print '<td class="center">';
|
||||
select_type_fees_id($line->fk_c_type_fees, 'fk_c_type_fees');
|
||||
print '</td>';
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
print '<td class="fk_c_exp_tax_cat">';
|
||||
@ -2293,11 +2301,6 @@ if ($action == 'create')
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Select type
|
||||
print '<td class="center">';
|
||||
select_type_fees_id($line->fk_c_type_fees, 'fk_c_type_fees');
|
||||
print '</td>';
|
||||
|
||||
// Add comments
|
||||
print '<td>';
|
||||
print '<textarea name="comments" class="flat_ndf centpercent">'.dol_escape_htmltag($line->comments, 0, 1).'</textarea>';
|
||||
@ -2344,7 +2347,7 @@ if ($action == 'create')
|
||||
}
|
||||
}
|
||||
|
||||
// Add a line
|
||||
// Add a new line
|
||||
if (($object->fk_statut == ExpenseReport::STATUS_DRAFT || $object->fk_statut == ExpenseReport::STATUS_REFUSED)
|
||||
&& $action != 'editline'
|
||||
&& $user->rights->expensereport->creer)
|
||||
@ -2408,9 +2411,13 @@ if ($action == 'create')
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td></td>';
|
||||
print '<td class="center">'.$langs->trans('Date').'</td>';
|
||||
if (!empty($conf->projet->enabled)) print '<td class="minwidth100imp">'.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).'</td>';
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print '<td>'.$langs->trans('CarCategory').'</td>';
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
print '<td class="minwidth100imp">'.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).'</td>';
|
||||
}
|
||||
print '<td class="center">'.$langs->trans('Type').'</td>';
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
|
||||
print '<td>'.$langs->trans('CarCategory').'</td>';
|
||||
}
|
||||
print '<td>'.$langs->trans('Description').'</td>';
|
||||
print '<td class="right">'.$langs->trans('VAT').'</td>';
|
||||
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
||||
@ -2440,19 +2447,19 @@ if ($action == 'create')
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
print '<td class="fk_c_exp_tax_cat">';
|
||||
$params = array('fk_expense' => $object->id);
|
||||
print $form->selectExpenseCategories('', 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Select type
|
||||
print '<td class="center">';
|
||||
select_type_fees_id($fk_c_type_fees, 'fk_c_type_fees', 1);
|
||||
print '</td>';
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
print '<td class="fk_c_exp_tax_cat">';
|
||||
$params = array('fk_expense' => $object->id);
|
||||
print $form->selectExpenseCategories('', 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params, 0);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Add comments
|
||||
print '<td>';
|
||||
print '<textarea class="flat_ndf centpercent" name="comments" rows="'.ROWS_2.'">'.dol_escape_htmltag($comments, 0, 1).'</textarea>';
|
||||
|
||||
@ -318,3 +318,5 @@ ALTER TABLE llx_facturedet ADD COLUMN ref_ext varchar(255) AFTER multicurrency_t
|
||||
ALTER TABLE llx_c_ticket_category ADD COLUMN fk_parent integer DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE llx_c_ticket_category ADD COLUMN force_severity varchar(32) NULL;
|
||||
|
||||
ALTER TABLE llx_expensereport_ik ADD COLUMN ikoffset double DEFAULT 0 NOT NULL;
|
||||
|
||||
|
||||
@ -25,6 +25,6 @@ CREATE TABLE IF NOT EXISTS llx_expensereport_ik (
|
||||
fk_c_exp_tax_cat integer DEFAULT 0 NOT NULL,
|
||||
fk_range integer DEFAULT 0 NOT NULL,
|
||||
coef double DEFAULT 0 NOT NULL,
|
||||
ikoffset double DEFAULT 0 NOT NULL,
|
||||
ikoffset double DEFAULT 0 NOT NULL,
|
||||
active integer DEFAULT 1
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -1794,7 +1794,6 @@ TypePaymentDesc=0:Customer payment type, 1:Vendor payment type, 2:Both customers
|
||||
IncludePath=Include path (defined into variable %s)
|
||||
ExpenseReportsSetup=Setup of module Expense Reports
|
||||
TemplatePDFExpenseReports=Document templates to generate expense report document
|
||||
ExpenseReportsIkSetup=Setup of module Expense Reports - Milles index
|
||||
ExpenseReportsRulesSetup=Setup of module Expense Reports - Rules
|
||||
ExpenseReportNumberingModules=Expense reports numbering module
|
||||
NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only.
|
||||
|
||||
@ -110,7 +110,7 @@ ExpenseReportPayment=Expense report payment
|
||||
ExpenseReportsToApprove=Expense reports to approve
|
||||
ExpenseReportsToPay=Expense reports to pay
|
||||
ConfirmCloneExpenseReport=Are you sure you want to clone this expense report ?
|
||||
ExpenseReportsIk=Expense report milles index
|
||||
ExpenseReportsIk=Configuration of mileage charges
|
||||
ExpenseReportsRules=Expense report rules
|
||||
ExpenseReportIkDesc=You can modify the calculation of kilometers expense by category and range who they are previously defined. <b>d</b> is the distance in kilometers
|
||||
ExpenseReportRulesDesc=You can create or update any rules of calculation. This part will be used when user will create a new expense report
|
||||
|
||||
@ -242,29 +242,6 @@ class DateLibTest extends PHPUnit\Framework\TestCase
|
||||
$result=num_public_holiday($date1, $date2, 'XX', 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals(2, $result, 'NumPublicHoliday for XX'); // 1 opened day, 2 closed days (even if country unknown)
|
||||
|
||||
|
||||
|
||||
// Add more holiday with constant HOLIDAY_MORE_PUBLIC_HOLIDAYS
|
||||
$conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS='12-13,2019-12-14';
|
||||
|
||||
$date1=dol_mktime(0, 0, 0, 12, 13, 2018);
|
||||
$date2=dol_mktime(0, 0, 0, 12, 13, 2018);
|
||||
$result=num_public_holiday($date1, $date2, 'YY', 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals(1, $result, 'NumPublicHoliday for YY the 2018-12-13'); // 0 opened day, 1 closed days (even if country unknown)
|
||||
|
||||
$date1=dol_mktime(0, 0, 0, 12, 14, 2018);
|
||||
$date2=dol_mktime(0, 0, 0, 12, 14, 2018);
|
||||
$result=num_public_holiday($date1, $date2, 'YY', 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals(0, $result, 'NumPublicHoliday for YY the 2018-12-14'); // 1 opened day, 0 closed days (even if country unknown)
|
||||
|
||||
$date1=dol_mktime(0, 0, 0, 12, 14, 2019);
|
||||
$date2=dol_mktime(0, 0, 0, 12, 14, 2019);
|
||||
$result=num_public_holiday($date1, $date2, 'YY', 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals(1, $result, 'NumPublicHoliday for YY the 2019-12-14'); // 0 opened day, 1 closed days (even if country unknown)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user