Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
f232ae91
Commit
f232ae91
authored
8 years ago
by
aspangaro
Browse files
Options
Downloads
Patches
Plain Diff
Fix Expense report | VAT disable in Dolibarr, traduction of code_libelle & presentation
parent
dd2e4375
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/expensereport/card.php
+17
-11
17 additions, 11 deletions
htdocs/expensereport/card.php
htdocs/expensereport/info.php
+1
-1
1 addition, 1 deletion
htdocs/expensereport/info.php
with
18 additions
and
12 deletions
htdocs/expensereport/card.php
+
17
−
11
View file @
f232ae91
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2015
Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015
-2016
Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
*
*
* This program is free software; you can redistribute it and/or modify
* 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
* it under the terms of the GNU General Public License as published by
...
@@ -831,6 +831,7 @@ if ($action == "addline" && $user->rights->expensereport->creer)
...
@@ -831,6 +831,7 @@ if ($action == "addline" && $user->rights->expensereport->creer)
$object_ligne
=
new
ExpenseReportLine
(
$db
);
$object_ligne
=
new
ExpenseReportLine
(
$db
);
$vatrate
=
GETPOST
(
'vatrate'
);
$object_ligne
->
comments
=
GETPOST
(
'comments'
);
$object_ligne
->
comments
=
GETPOST
(
'comments'
);
$qty
=
GETPOST
(
'qty'
,
'int'
);
$qty
=
GETPOST
(
'qty'
,
'int'
);
if
(
empty
(
$qty
))
$qty
=
1
;
if
(
empty
(
$qty
))
$qty
=
1
;
...
@@ -843,21 +844,25 @@ if ($action == "addline" && $user->rights->expensereport->creer)
...
@@ -843,21 +844,25 @@ if ($action == "addline" && $user->rights->expensereport->creer)
$object_ligne
->
fk_c_type_fees
=
GETPOST
(
'fk_c_type_fees'
);
$object_ligne
->
fk_c_type_fees
=
GETPOST
(
'fk_c_type_fees'
);
$object_ligne
->
fk_c_tva
=
GETPOST
(
'fk_c_tva'
);
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
if
(
empty
(
$vatrate
))
$vatrate
=
"0.000"
;
$object_ligne
->
vatrate
=
price2num
(
$vatrate
);
$object_ligne
->
vatrate
=
price2num
(
$vatrate
);
$object_ligne
->
fk_projet
=
$fk_projet
;
$object_ligne
->
fk_projet
=
$fk_projet
;
if
(
!
GETPOST
(
'fk_c_type_fees'
)
>
0
)
if
(
!
GETPOST
(
'fk_c_type_fees'
)
>
0
)
{
{
$error
++
;
$error
++
;
setEventMessages
(
$langs
->
trans
(
"ErrorFieldRequired"
,
$langs
->
transnoentitiesnoconv
(
"Type"
)),
null
,
'errors'
);
setEventMessages
(
$langs
->
trans
(
"ErrorFieldRequired"
,
$langs
->
transnoentitiesnoconv
(
"Type"
)),
null
,
'errors'
);
$action
=
''
;
$action
=
''
;
}
}
if
(
GETPOST
(
'vatrate'
)
<
0
||
GETPOST
(
'vatrate'
)
==
''
)
if
(
$vatrate
<
0
||
$vatrate
==
''
)
{
{
$error
++
;
$error
++
;
setEventMessages
(
$langs
->
trans
(
"ErrorFieldRequired"
,
$langs
->
transnoentitiesnoconv
(
"V
at
"
)),
null
,
'errors'
);
setEventMessages
(
$langs
->
trans
(
"ErrorFieldRequired"
,
$langs
->
transnoentitiesnoconv
(
"V
AT
"
)),
null
,
'errors'
);
$action
=
''
;
$action
=
''
;
}
}
...
@@ -1096,7 +1101,7 @@ if ($action == 'create')
...
@@ -1096,7 +1101,7 @@ if ($action == 'create')
print
'<table class="border" width="100%">'
;
print
'<table class="border" width="100%">'
;
print
'<tbody>'
;
print
'<tbody>'
;
print
'<tr>'
;
print
'<tr>'
;
print
'<td class="fieldrequired">'
.
$langs
->
trans
(
"DateStart"
)
.
'</td>'
;
print
'<td class="
titlefieldcreate
fieldrequired">'
.
$langs
->
trans
(
"DateStart"
)
.
'</td>'
;
print
'<td>'
;
print
'<td>'
;
$form
->
select_date
(
$date_start
?
$date_start
:-
1
,
'date_debut'
,
0
,
0
,
0
,
''
,
1
,
1
);
$form
->
select_date
(
$date_start
?
$date_start
:-
1
,
'date_debut'
,
0
,
0
,
0
,
''
,
1
,
1
);
print
'</td>'
;
print
'</td>'
;
...
@@ -1211,7 +1216,7 @@ else
...
@@ -1211,7 +1216,7 @@ else
$linkback
=
'<a href="'
.
DOL_URL_ROOT
.
'/expensereport/list.php'
.
(
!
empty
(
$socid
)
?
'?socid='
.
$socid
:
''
)
.
'">'
.
$langs
->
trans
(
"BackToList"
)
.
'</a>'
;
$linkback
=
'<a href="'
.
DOL_URL_ROOT
.
'/expensereport/list.php'
.
(
!
empty
(
$socid
)
?
'?socid='
.
$socid
:
''
)
.
'">'
.
$langs
->
trans
(
"BackToList"
)
.
'</a>'
;
// Ref
// Ref
print
'<tr><td
width="25%
">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td>'
;
print
'<tr><td
class="titlefield
">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td>'
;
print
$form
->
showrefnav
(
$object
,
'ref'
,
$linkback
,
1
,
'ref'
,
'ref'
,
''
);
print
$form
->
showrefnav
(
$object
,
'ref'
,
$linkback
,
1
,
'ref'
,
'ref'
,
''
);
print
'</td></tr>'
;
print
'</td></tr>'
;
...
@@ -1374,7 +1379,7 @@ else
...
@@ -1374,7 +1379,7 @@ else
$linkback
=
'<a href="'
.
DOL_URL_ROOT
.
'/expensereport/list.php'
.
(
!
empty
(
$socid
)
?
'?socid='
.
$socid
:
''
)
.
'">'
.
$langs
->
trans
(
"BackToList"
)
.
'</a>'
;
$linkback
=
'<a href="'
.
DOL_URL_ROOT
.
'/expensereport/list.php'
.
(
!
empty
(
$socid
)
?
'?socid='
.
$socid
:
''
)
.
'">'
.
$langs
->
trans
(
"BackToList"
)
.
'</a>'
;
// Ref
// Ref
print
'<tr><td
width="25%
">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td colspan="2">'
;
print
'<tr><td
class="titlefield
">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td colspan="2">'
;
print
$form
->
showrefnav
(
$object
,
'ref'
,
$linkback
,
1
,
'ref'
,
'ref'
,
''
);
print
$form
->
showrefnav
(
$object
,
'ref'
,
$linkback
,
1
,
'ref'
,
'ref'
,
''
);
print
'</td></tr>'
;
print
'</td></tr>'
;
...
@@ -1683,7 +1688,8 @@ else
...
@@ -1683,7 +1688,8 @@ else
}
}
print
'</td>'
;
print
'</td>'
;
}
}
print
'<td style="text-align:center;">'
.
$langs
->
trans
(
"TF_"
.
strtoupper
(
empty
(
$objp
->
type_fees_libelle
)
?
'OTHER'
:
$objp
->
type_fees_libelle
))
.
'</td>'
;
// print '<td style="text-align:center;">'.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).'</td>';
print
'<td style="text-align:center;">'
.
(
$langs
->
trans
((
$objp
->
type_fees_code
))
==
$objp
->
type_fees_code
?
$objp
->
type_fees_libelle
:
$langs
->
trans
((
$objp
->
type_fees_code
)))
.
'</td>'
;
print
'<td style="text-align:left;">'
.
$objp
->
comments
.
'</td>'
;
print
'<td style="text-align:left;">'
.
$objp
->
comments
.
'</td>'
;
print
'<td style="text-align:right;">'
.
vatrate
(
$objp
->
vatrate
,
true
)
.
'</td>'
;
print
'<td style="text-align:right;">'
.
vatrate
(
$objp
->
vatrate
,
true
)
.
'</td>'
;
print
'<td style="text-align:right;">'
.
price
(
$objp
->
value_unit
)
.
'</td>'
;
print
'<td style="text-align:right;">'
.
price
(
$objp
->
value_unit
)
.
'</td>'
;
...
@@ -1789,7 +1795,7 @@ else
...
@@ -1789,7 +1795,7 @@ else
print
'<td align="center">'
.
$langs
->
trans
(
'Date'
)
.
'</td>'
;
print
'<td align="center">'
.
$langs
->
trans
(
'Date'
)
.
'</td>'
;
if
(
!
empty
(
$conf
->
projet
->
enabled
))
print
'<td>'
.
$langs
->
trans
(
'Project'
)
.
'</td>'
;
if
(
!
empty
(
$conf
->
projet
->
enabled
))
print
'<td>'
.
$langs
->
trans
(
'Project'
)
.
'</td>'
;
print
'<td align="center">'
.
$langs
->
trans
(
'Type'
)
.
'</td>'
;
print
'<td align="center">'
.
$langs
->
trans
(
'Type'
)
.
'</td>'
;
print
'<td>'
.
$langs
->
trans
(
'Description'
)
.
'</td>'
;
print
'<td
colspan="2"
>'
.
$langs
->
trans
(
'Description'
)
.
'</td>'
;
print
'<td align="right">'
.
$langs
->
trans
(
'VAT'
)
.
'</td>'
;
print
'<td align="right">'
.
$langs
->
trans
(
'VAT'
)
.
'</td>'
;
print
'<td align="right">'
.
$langs
->
trans
(
'PriceUTTC'
)
.
'</td>'
;
print
'<td align="right">'
.
$langs
->
trans
(
'PriceUTTC'
)
.
'</td>'
;
print
'<td align="right">'
.
$langs
->
trans
(
'Qty'
)
.
'</td>'
;
print
'<td align="right">'
.
$langs
->
trans
(
'Qty'
)
.
'</td>'
;
...
@@ -1807,7 +1813,7 @@ else
...
@@ -1807,7 +1813,7 @@ else
// Select project
// Select project
if
(
!
empty
(
$conf
->
projet
->
enabled
))
if
(
!
empty
(
$conf
->
projet
->
enabled
))
{
{
print
'<td>'
;
print
'<td
align="center"
>'
;
$formproject
->
select_projects
(
-
1
,
$fk_projet
,
'fk_projet'
,
0
,
0
,
1
,
1
);
$formproject
->
select_projects
(
-
1
,
$fk_projet
,
'fk_projet'
,
0
,
0
,
1
,
1
);
print
'</td>'
;
print
'</td>'
;
}
}
...
@@ -1818,7 +1824,7 @@ else
...
@@ -1818,7 +1824,7 @@ else
print
'</td>'
;
print
'</td>'
;
// Add comments
// Add comments
print
'<td>'
;
print
'<td
colspan="2"
>'
;
print
'<textarea class="flat_ndf centpercent" name="comments">'
.
$comments
.
'</textarea>'
;
print
'<textarea class="flat_ndf centpercent" name="comments">'
.
$comments
.
'</textarea>'
;
print
'</td>'
;
print
'</td>'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/expensereport/info.php
+
1
−
1
View file @
f232ae91
...
@@ -40,7 +40,7 @@ $result = restrictedArea($user, 'expensereport', $id, '');
...
@@ -40,7 +40,7 @@ $result = restrictedArea($user, 'expensereport', $id, '');
* View
* View
*/
*/
llxHeader
();
llxHeader
(
''
,
$langs
->
trans
(
"ExpenseReport"
)
);
if
(
$id
)
if
(
$id
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment