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
cc38fbe3
Commit
cc38fbe3
authored
12 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Uniformize code
parent
f9607037
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/core/lib/price.lib.php
+13
-23
13 additions, 23 deletions
htdocs/core/lib/price.lib.php
with
13 additions
and
23 deletions
htdocs/core/lib/price.lib.php
+
13
−
23
View file @
cc38fbe3
...
...
@@ -86,17 +86,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta
$result
[
4
]
=
price2num
(
$result
[
5
]
-
$result3bis
,
'MU'
);
}
// Local taxes 1
if
(
$txlocaltax1
>
0
)
// Local taxes 1
. Local tax1 is a second tax that is added after standard one)
if
(
$txlocaltax1
>
0
)
{
$result
[
14
]
=
price2num
((
$result
[
6
]
*
(
1
+
(
$txlocaltax1
/
100
)))
-
$result
[
6
],
'MT'
);
// amount tax1 for total_ht_without_discount
$result
[
8
]
=
price2num
(
$result
[
8
]
+
$result
[
14
],
'MT'
);
// total_ttc_without_discount + tax1
$result
[
9
]
=
price2num
((
$result
[
0
]
*
(
1
+
(
$txlocaltax1
/
100
)))
-
$result
[
0
],
'MT'
);
// amount tax1 for total_ht
$result
[
2
]
=
price2num
(
$result
[
2
]
+
$result
[
9
]
,
'M
T
'
);
// total_ttc + tax1
$result
[
11
]
=
price2num
(
(
$result
[
3
]
*
(
1
+
(
$txlocaltax1
/
100
)))
-
$pu
,
'M
U
'
);
// amount tax1 for pu_ht
$result
[
11
]
=
price2num
((
$result
[
3
]
*
(
1
+
(
$txlocaltax1
/
100
)))
-
$pu
,
'MT'
);
// amount tax1 for pu_ht
$result
[
5
]
=
price2num
(
$result
[
5
]
+
$result
[
11
],
'MT'
);
// pu_ht + tax1
$result
[
8
]
=
price2num
(
$result
[
8
]
+
$result
[
14
],
'MT'
);
// total_ttc_without_discount + tax1
$result
[
2
]
=
price2num
(
$result
[
2
]
+
$result
[
9
],
'MT'
);
// total_ttc + tax1
$result
[
5
]
=
price2num
(
$result
[
5
]
+
$result
[
11
],
'MU'
);
// pu_ht + tax1
}
else
{
...
...
@@ -105,26 +104,17 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta
$result
[
11
]
=
0
;
}
// Local taxes 2
if
(
$txlocaltax2
>
0
)
// Local taxes 2. Local tax2 is a second tax that is substracted after standard one)
// Example: Country = Spain, localtax2 is IRPF
if
(
$txlocaltax2
>
0
)
{
$result
[
15
]
=
price2num
((
$result
[
6
]
*
(
1
+
(
$txlocaltax2
/
100
)))
-
$result
[
6
],
'MT'
);
// amount tax2 for total_ht_without_discount
$result
[
10
]
=
price2num
((
$result
[
0
]
*
(
1
+
(
$txlocaltax2
/
100
)))
-
$result
[
0
],
'MT'
);
// amount tax2 for total_ht
$result
[
12
]
=
price2num
((
$result
[
3
]
*
(
1
+
(
$txlocaltax2
/
100
)))
-
$pu
,
'M
T
'
);
// amount tax2 for pu_ht
$result
[
12
]
=
price2num
((
$result
[
3
]
*
(
1
+
(
$txlocaltax2
/
100
)))
-
$pu
,
'M
U
'
);
// amount tax2 for pu_ht
//If Country is Spain, localtax2 (IRPF) will be subtracted
if
(
$mysoc
->
country_code
==
'ES'
)
{
$result
[
8
]
=
price2num
(
$result
[
8
]
-
$result
[
15
],
'MT'
);
// total_ttc_without_discount + tax2
$result
[
2
]
=
price2num
(
$result
[
2
]
-
$result
[
10
],
'MT'
);
// total_ttc + tax2
$result
[
5
]
=
price2num
(
$result
[
5
]
-
$result
[
12
],
'MU'
);
// pu_ttc + tax2
}
else
{
$result
[
8
]
=
price2num
(
$result
[
8
]
+
$result
[
15
],
'MT'
);
// total_ttc_without_discount + tax2
$result
[
2
]
=
price2num
(
$result
[
2
]
+
$result
[
10
],
'MT'
);
// total_ttc + tax2
$result
[
5
]
=
price2num
(
$result
[
5
]
+
$result
[
12
],
'MU'
);
// pu_ttc + tax2
}
$result
[
8
]
=
price2num
(
$result
[
8
]
-
$result
[
15
],
'MT'
);
// total_ttc_without_discount + tax2
$result
[
2
]
=
price2num
(
$result
[
2
]
-
$result
[
10
],
'MT'
);
// total_ttc + tax2
$result
[
5
]
=
price2num
(
$result
[
5
]
-
$result
[
12
],
'MU'
);
// pu_ttc + tax2
}
else
{
...
...
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