X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=WEB-INF%2Ftemplates%2Fexpenses.tpl;h=45a8ef274dc57347350a6366cafaa2d09431af4e;hb=eb300930267977a1caac0355200467e4bdf8b655;hp=d210507999b28999f44dc1708c1a29ca295a5ea8;hpb=9082c911245bc87179d1668a0098f473ecb8bf76;p=timetracker.git
diff --git a/WEB-INF/templates/expenses.tpl b/WEB-INF/templates/expenses.tpl
index d2105079..45a8ef27 100644
--- a/WEB-INF/templates/expenses.tpl
+++ b/WEB-INF/templates/expenses.tpl
@@ -86,6 +86,7 @@ function recalculateCost() {
var comment_control = document.getElementById("item_name");
var cost_control = document.getElementById("cost");
+ var replaceDecimalMark = ("." != "{$user->getDecimalMark()}");
// Calculate cost.
var dropdown = document.getElementById("predefined_expense");
@@ -98,8 +99,15 @@ function recalculateCost() {
var quantity = quantity_control.value;
if (isNaN(quantity))
cost_control.value = "";
- else
- cost_control.value = (quantity_control.value * defined_expenses[dropdown.selectedIndex - 1][2]).toFixed(2);
+ else {
+ var expenseCost = defined_expenses[dropdown.selectedIndex - 1][2];
+ if (replaceDecimalMark)
+ expenseCost = expenseCost.replace("{$user->getDecimalMark()}", ".");
+ var newCost = (quantity_control.value * expenseCost).toFixed(2);
+ if (replaceDecimalMark)
+ newCost = newCost.replace(".", "{$user->getDecimalMark()}");
+ cost_control.value = newCost;
+ }
}
}
@@ -109,10 +117,10 @@ function recalculateCost() {
-{if $on_behalf_control}
+{if $user_dropdown}
{$i18n.label.user}: |
- {$forms.expensesForm.onBehalfUser.control} |
+ {$forms.expensesForm.user.control} |
{/if}
{if $user->isPluginEnabled('cl')}
@@ -121,14 +129,13 @@ function recalculateCost() {
{$forms.expensesForm.client.control} |
{/if}
-{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+{if $show_project}
{$i18n.label.project} (*): |
{$forms.expensesForm.project.control} |
{/if}
{if $predefined_expenses}
-
{$i18n.label.expense}: |
{$forms.expensesForm.predefined_expense.control} |
@@ -144,7 +151,7 @@ function recalculateCost() {
{$i18n.label.cost} (*): |
- {$forms.expensesForm.cost.control} {$user->currency|escape} |
+ {$forms.expensesForm.cost.control} {$user->getCurrency()|escape} |
|
@@ -171,7 +178,7 @@ function recalculateCost() {
{if $user->isPluginEnabled('cl')}
{/if}
- {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+ {if $show_project}
{/if}
@@ -179,11 +186,11 @@ function recalculateCost() {
{foreach $expense_items as $item}
-
+
{if $user->isPluginEnabled('cl')}
{$item.client|escape} |
{/if}
- {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+ {if $show_project}
{$item.project|escape} |
{/if}
{$item.item|escape} |
@@ -194,7 +201,7 @@ function recalculateCost() {
- {$i18n.label.day_total}: {$user->currency|escape} {$day_total} |
+ {$i18n.label.day_total}: {$user->getCurrency()|escape} {$day_total} |
{/if}