forked from Wavyzz/dolibarr
NEW Implementing Billable tasks on projects using new attribute "billable" (#30092)
* Implementing Billable task function on projects using new attribute in #30014 * added billable to Task->initAsSpecimen() * default billable to 1 in initAsSpecimen * set billable to 1 in ProjectTest::testTaskCreate * Moving attribut usage in usage_bill_time condition of project * PPDoc * fusion * pre-commit + typo --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
committed by
GitHub
parent
3ddd6cceba
commit
b0cd32bf68
@@ -5,7 +5,8 @@
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Vincent de Grandpré <vincent@de-grandpre.quebec>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -691,6 +692,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
$taskstatic->planned_workload = $lines[$i]->planned_workload;
|
||||
$taskstatic->duration_effective = $lines[$i]->duration_effective;
|
||||
$taskstatic->budget_amount = $lines[$i]->budget_amount;
|
||||
$taskstatic->billable = $lines[$i]->billable;
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
@@ -932,6 +934,17 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Billable
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.billable']['checked'])) {
|
||||
print '<td class="center">';
|
||||
if ($lines[$i]->billable) {
|
||||
print '<span>'.$langs->trans('Yes').'</span>';
|
||||
} else {
|
||||
print '<span>'.$langs->trans('No').'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
$extrafieldsobjectkey = $taskstatic->table_element;
|
||||
$extrafieldsobjectprefix = 'efpt.';
|
||||
|
||||
Reference in New Issue
Block a user