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
5320ebc0
Commit
5320ebc0
authored
7 years ago
by
BENKE Charlene
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
getTotalWeightVolume : add conversion Lb & oz to KG
New conversion value : Oz once Little az a wizzard...
parent
1d91ce90
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/class/commonobject.class.php
+12
-3
12 additions, 3 deletions
htdocs/core/class/commonobject.class.php
with
12 additions
and
3 deletions
htdocs/core/class/commonobject.class.php
+
12
−
3
View file @
5320ebc0
...
...
@@ -3097,9 +3097,18 @@ abstract class CommonObject
$trueWeightUnit
=
pow
(
10
,
$weightUnit
);
$totalWeight
+=
$weight
*
$qty
*
$trueWeightUnit
;
}
else
{
$totalWeight
+=
$weight
*
$qty
;
// This may be wrong if we mix different units
else
{
if
(
$weight_units
==
99
)
{
// conversion 1 Livre = 0.45359237 KG
$trueWeightUnit
=
0.45359237
;
$totalWeight
+=
$weight
*
$qty
*
$trueWeightUnit
;
}
elseif
(
$weight_units
==
98
)
{
// conversion 1 once = 0.0283495 KG
$trueWeightUnit
=
0.0283495
;
$totalWeight
+=
$weight
*
$qty
*
$trueWeightUnit
;
}
else
$totalWeight
+=
$weight
*
$qty
;
// This may be wrong if we mix different units
}
if
(
$volume_units
<
50
)
// >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
{
...
...
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