add checkbox to ask detail on line desc
This commit is contained in:
parent
d2f3d134df
commit
009fa41762
@ -274,6 +274,7 @@ NewInter=New intervention
|
|||||||
OneLinePerTask=One line per task
|
OneLinePerTask=One line per task
|
||||||
OneLinePerPeriod=One line per period
|
OneLinePerPeriod=One line per period
|
||||||
OneLinePerTimeSpentLine=One line for each time spent declaration
|
OneLinePerTimeSpentLine=One line for each time spent declaration
|
||||||
|
AddDetailDateAndDuration=With date and duration into line description
|
||||||
RefTaskParent=Ref. Parent Task
|
RefTaskParent=Ref. Parent Task
|
||||||
ProfitIsCalculatedWith=Profit is calculated using
|
ProfitIsCalculatedWith=Profit is calculated using
|
||||||
AddPersonToTask=Add also to tasks
|
AddPersonToTask=Add also to tasks
|
||||||
|
|||||||
@ -449,6 +449,7 @@ if ($action == 'confirm_generateinvoice') {
|
|||||||
}
|
}
|
||||||
} elseif ($generateinvoicemode == 'onelineperperiod') { // One line for each time spent line
|
} elseif ($generateinvoicemode == 'onelineperperiod') { // One line for each time spent line
|
||||||
$arrayoftasks = array();
|
$arrayoftasks = array();
|
||||||
|
$withdetail=GETPOST('detail_time_duration', 'alpha');
|
||||||
foreach ($toselect as $key => $value) {
|
foreach ($toselect as $key => $value) {
|
||||||
// Get userid, timepent
|
// Get userid, timepent
|
||||||
$object->fetchTimeSpent($value);
|
$object->fetchTimeSpent($value);
|
||||||
@ -462,7 +463,7 @@ if ($action == 'confirm_generateinvoice') {
|
|||||||
$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
|
$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
|
||||||
$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
|
$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
|
||||||
$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username.($object->timespent_note ? ' - '.$object->timespent_note : ''); // TODO Add user name in note
|
$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username.($object->timespent_note ? ' - '.$object->timespent_note : ''); // TODO Add user name in note
|
||||||
if (!empty($conf->global->PROJECT_TIME_SPENT_INTO_INVOICE_ADD_TIME_DT)) {
|
if (!empty($withdetail)) {
|
||||||
$arrayoftasks[$object->timespent_id]['note'] .= "\n";
|
$arrayoftasks[$object->timespent_id]['note'] .= "\n";
|
||||||
if (!empty($object->timespent_withhour)) {
|
if (!empty($object->timespent_withhour)) {
|
||||||
$arrayoftasks[$object->timespent_id]['note'] .= $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour);
|
$arrayoftasks[$object->timespent_id]['note'] .= $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour);
|
||||||
@ -1103,6 +1104,25 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
|
|||||||
'onelineperperiod'=>'OneLinePerTimeSpentLine',
|
'onelineperperiod'=>'OneLinePerTimeSpentLine',
|
||||||
);
|
);
|
||||||
print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
|
print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
|
||||||
|
print "\n".'<script type="text/javascript">';
|
||||||
|
print '
|
||||||
|
$(document).ready(function () {
|
||||||
|
setDetailVisibility();
|
||||||
|
$("#generateinvoicemode").change(function() {
|
||||||
|
setDetailVisibility();
|
||||||
|
});
|
||||||
|
function setDetailVisibility() {
|
||||||
|
generateinvoicemode = $("#generateinvoicemode option:selected").val();
|
||||||
|
if (generateinvoicemode=="onelineperperiod") {
|
||||||
|
$("#detail_time_duration").show();
|
||||||
|
} else {
|
||||||
|
$("#detail_time_duration").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
';
|
||||||
|
print '</script>'."\n";
|
||||||
|
print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user