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
ecb46611
Commit
ecb46611
authored
9 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 3.9
parents
63ebd40c
7b4ebb49
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/product/stock/list.php
+17
-7
17 additions, 7 deletions
htdocs/product/stock/list.php
with
17 additions
and
7 deletions
htdocs/product/stock/list.php
+
17
−
7
View file @
ecb46611
...
...
@@ -68,7 +68,7 @@ $form=new Form($db);
$warehouse
=
new
Entrepot
(
$db
);
$sql
=
"SELECT e.rowid, e.label as ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays,"
;
$sql
.
=
" SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue"
;
$sql
.
=
" SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue
, SUM(ps.reel) as stockqty
"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"entrepot as e"
;
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"product_stock as ps ON e.rowid = ps.fk_entrepot"
;
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"product as p ON ps.fk_product = p.rowid"
;
...
...
@@ -83,6 +83,16 @@ $result=$db->query($sql);
if
(
$result
)
{
$totalnboflines
=
$db
->
num_rows
(
$result
);
// fetch totals
$line
=
$total
=
$totalsell
=
$totalStock
=
0
;
while
(
$line
<
$totalnboflines
)
{
$objp
=
$db
->
fetch_object
(
$result
);
$total
+=
price2num
(
$objp
->
estimatedvalue
,
'MU'
);
$totalsell
+=
price2num
(
$objp
->
sellvalue
,
'MU'
);
$totalStock
+=
$objp
->
stockqty
;
$line
++
;
}
}
$sql
.
=
$db
->
order
(
$sortfield
,
$sortorder
);
$sql
.
=
$db
->
plimit
(
$limit
+
1
,
$offset
);
...
...
@@ -118,6 +128,7 @@ if ($result)
print
"<tr class=
\"
liste_titre
\"
>"
;
print_liste_field_titre
(
$langs
->
trans
(
"Ref"
),
$_SERVER
[
"PHP_SELF"
],
"e.label"
,
""
,
""
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"LocationSummary"
),
$_SERVER
[
"PHP_SELF"
],
"e.lieu"
,
""
,
""
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"PhysicalStock"
),
$_SERVER
[
"PHP_SELF"
],
"stockqty"
,
''
,
''
,
'align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"EstimatedStockValue"
),
$_SERVER
[
"PHP_SELF"
],
"e.valo_pmp"
,
''
,
''
,
'align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"EstimatedStockValueSell"
),
$_SERVER
[
"PHP_SELF"
],
""
,
''
,
''
,
'align="right"'
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Status"
),
$_SERVER
[
"PHP_SELF"
],
"e.statut"
,
''
,
''
,
'align="right"'
,
$sortfield
,
$sortorder
);
...
...
@@ -135,7 +146,7 @@ if ($result)
print
'<input class="flat" type="text" name="search_label" size="10" value="'
.
dol_escape_htmltag
(
$search_label
)
.
'">'
;
print
'</td>'
;
print
'<td class="liste_titre" colspan="
2
">'
;
print
'<td class="liste_titre" colspan="
3
">'
;
print
'</td>'
;
print
'<td class="liste_titre" align="right">'
;
...
...
@@ -152,7 +163,6 @@ if ($result)
if
(
$num
)
{
$entrepot
=
new
Entrepot
(
$db
);
$total
=
$totalsell
=
0
;
$var
=
false
;
while
(
$i
<
min
(
$num
,
$limit
))
{
...
...
@@ -164,6 +174,8 @@ if ($result)
print
'<td>'
.
$entrepot
->
getNomUrl
(
1
)
.
'</td>'
;
// Location
print
'<td>'
.
$objp
->
lieu
.
'</td>'
;
// Stock qty
print
'<td align="right">'
.
price2num
(
$objp
->
stockqty
,
5
)
.
'</td>'
;
// PMP value
print
'<td align="right">'
;
if
(
price2num
(
$objp
->
estimatedvalue
,
'MT'
))
print
price
(
price2num
(
$objp
->
estimatedvalue
,
'MT'
),
1
);
...
...
@@ -185,17 +197,15 @@ if ($result)
print
"</tr>
\n
"
;
$total
+=
price2num
(
$objp
->
estimatedvalue
,
'MU'
);
$totalsell
+=
price2num
(
$objp
->
sellvalue
,
'MU'
);
$var
=!
$var
;
$i
++
;
}
if
(
$totalnboflines
<=
$limit
)
if
(
$totalnboflines
-
$offset
<=
$limit
)
{
print
'<tr class="liste_total">'
;
print
'<td colspan="2" align="right">'
.
$langs
->
trans
(
"Total"
)
.
'</td>'
;
print
'<td align="right">'
.
price2num
(
$totalStock
,
5
)
.
'</td>'
;
print
'<td align="right">'
.
price
(
price2num
(
$total
,
'MT'
),
1
,
$langs
,
0
,
0
,
-
1
,
$conf
->
currency
)
.
'</td>'
;
print
'<td align="right">'
;
if
(
empty
(
$conf
->
global
->
PRODUIT_MULTIPRICES
))
print
price
(
price2num
(
$totalsell
,
'MT'
),
1
,
$langs
,
0
,
0
,
-
1
,
$conf
->
currency
);
...
...
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