Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(Timetracker): Allow factor 0
Browse files Browse the repository at this point in the history
  • Loading branch information
pschuele committed Jul 19, 2021
1 parent 66dd269 commit 6005711
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 37 deletions.
30 changes: 0 additions & 30 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9680,36 +9680,6 @@ parameters:
count: 1
path: tine20/Timetracker/Model/TimeaccountFilter.php

-
message: "#^PHPDoc tag @property has invalid value \\(Tinebase_DateTime start_date\\)\\: Unexpected token \"start_date\", expected variable at offset 107$#"
count: 1
path: tine20/Timetracker/Model/Timesheet.php

-
message: "#^PHPDoc tag @property has invalid value \\(integer duration\\)\\: Unexpected token \"duration\", expected variable at offset 201$#"
count: 1
path: tine20/Timetracker/Model/Timesheet.php

-
message: "#^PHPDoc tag @property has invalid value \\(string start_time\\)\\: Unexpected token \"start_time\", expected variable at offset 154$#"
count: 1
path: tine20/Timetracker/Model/Timesheet.php

-
message: "#^PHPDoc tag @property has invalid value \\(string timeaccount_id\\)\\: Unexpected token \"timeaccount_id\", expected variable at offset 246$#"
count: 1
path: tine20/Timetracker/Model/Timesheet.php

-
message: "#^Access to an undefined property Timetracker_Model_Timesheet\\:\\:\\$start_date\\.$#"
count: 1
path: tine20/Timetracker/Model/Timesheet.php

-
message: "#^Access to an undefined property Timetracker_Model_Timesheet\\:\\:\\$duration\\.$#"
count: 1
path: tine20/Timetracker/Model/Timesheet.php

-
message: "#^Access to an undefined property Zend_Db_Adapter_Abstract\\:\\:\\$table_prefix\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion tine20/Timetracker/Controller/Timesheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ protected function _calculateTimes(Timetracker_Model_Timesheet $_record)
$_record->start_time = $start->format('H:i');
}

if (empty($_record->accounting_time)) {
if (!isset($_record->accounting_time)) {
$_record->accounting_time = $_record->duration;
}
}
Expand Down
12 changes: 6 additions & 6 deletions tine20/Timetracker/Model/Timesheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
*
* @package Timetracker
*
* @property integer accounting_time
* @property integer duration
* @property Tinebase_DateTime start_date
* @property string start_time
* @property string timeaccount_id
* @property integer $accounting_time
* @property integer $duration
* @property Tinebase_DateTime $start_date
* @property string $start_time
* @property string $timeaccount_id
*/
class Timetracker_Model_Timesheet extends Tinebase_Record_Abstract implements Sales_Model_Billable_Interface
{
Expand Down Expand Up @@ -259,7 +259,7 @@ class Timetracker_Model_Timesheet extends Tinebase_Record_Abstract implements Sa
),
'accounting_time_factor' => array(
'label' => 'Projecttime Accounting factor', // _('Projecttime Accounting factor')
'inputFilters' => array('Zend_Filter_Empty' => 1),
'inputFilters' => array('Zend_Filter_Empty' => 0),
'type' => 'float',
'default' => 1
),
Expand Down

0 comments on commit 6005711

Please sign in to comment.