1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

Working on projects

This commit is contained in:
Hillel Coren 2017-12-25 12:24:39 +02:00
parent f1052ef377
commit 565df2fe98
4 changed files with 42 additions and 5 deletions

View File

@ -58,7 +58,7 @@ class AccountPresenter extends Presenter
*/
public function taskRate()
{
if ($this->entity->task_rate) {
if (floatval($this->entity->task_rate)) {
return Utils::roundSignificant($this->entity->task_rate);
} else {
return '';
@ -249,7 +249,7 @@ class AccountPresenter extends Presenter
} else {
$url = SITE_URL;
}
$url .= '/client/login';
if (Utils::isNinja()) {

View File

@ -108,10 +108,23 @@ class ClientPresenter extends EntityPresenter
*/
public function taskRate()
{
if ($this->entity->task_rate) {
if (floatval($this->entity->task_rate)) {
return Utils::roundSignificant($this->entity->task_rate);
} else {
return '';
}
}
/**
* @return string
*/
public function defaultTaskRate()
{
if ($rate = $this->taskRate()) {
return $rate;
} else {
return $this->entity->account->present()->taskRate;
}
}
}

View File

@ -23,4 +23,28 @@ class ProjectPresenter extends EntityPresenter
return $data;
}
/**
* @return string
*/
public function taskRate()
{
if (floatval($this->entity->task_rate)) {
return Utils::roundSignificant($this->entity->task_rate);
} else {
return '';
}
}
/**
* @return string
*/
public function defaultTaskRate()
{
if ($rate = $this->taskRate()) {
return $rate;
} else {
return $this->entity->client->present()->defaultTaskRate;
}
}
}

View File

@ -66,8 +66,8 @@
@if ($project->budgeted_hours)
{{ trans('texts.budgeted_hours') . ': ' . $project->budgeted_hours }}<br/>
@endif
@if (floatval($project->task_rate))
{{ trans('texts.task_rate') . ': ' . Utils::formatMoney($project->task_rate) }}<br/>
@if ($project->present()->defaultTaskRate)
{{ trans('texts.task_rate') . ': ' . $project->present()->defaultTaskRate }}<br/>
@endif
</div>