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
3461b193
Commit
3461b193
authored
11 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge pull request #1378 from KreizIT/fix
Fix bug on stock calculation for replenishment: wrong order in ifsql.
parents
5f65b2a9
911c43c8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/product/stock/replenish.php
+2
-2
2 additions, 2 deletions
htdocs/product/stock/replenish.php
with
2 additions
and
2 deletions
htdocs/product/stock/replenish.php
+
2
−
2
View file @
3461b193
...
@@ -176,7 +176,7 @@ $sql = 'SELECT p.rowid, p.ref, p.label, p.price,';
...
@@ -176,7 +176,7 @@ $sql = 'SELECT p.rowid, p.ref, p.label, p.price,';
$sql
.
=
' p.price_ttc, p.price_base_type,p.fk_product_type,'
;
$sql
.
=
' p.price_ttc, p.price_base_type,p.fk_product_type,'
;
$sql
.
=
' p.tms as datem, p.duration, p.tobuy, p.seuil_stock_alerte,'
;
$sql
.
=
' p.tms as datem, p.duration, p.tobuy, p.seuil_stock_alerte,'
;
$sql
.
=
' p.desiredstock,'
;
$sql
.
=
' p.desiredstock,'
;
$sql
.
=
' SUM('
.
$db
->
ifsql
(
"s.reel IS NULL"
,
"s.reel"
,
"0"
)
.
') as stock_physique'
;
$sql
.
=
' SUM('
.
$db
->
ifsql
(
"s.reel IS NULL"
,
"0"
,
"s.reel"
)
.
') as stock_physique'
;
$sql
.
=
' FROM '
.
MAIN_DB_PREFIX
.
'product as p'
;
$sql
.
=
' FROM '
.
MAIN_DB_PREFIX
.
'product as p'
;
$sql
.
=
' LEFT JOIN '
.
MAIN_DB_PREFIX
.
'product_stock as s'
;
$sql
.
=
' LEFT JOIN '
.
MAIN_DB_PREFIX
.
'product_stock as s'
;
$sql
.
=
' ON p.rowid = s.fk_product'
;
$sql
.
=
' ON p.rowid = s.fk_product'
;
...
@@ -219,7 +219,7 @@ $sql.= ' HAVING p.desiredstock > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel
...
@@ -219,7 +219,7 @@ $sql.= ' HAVING p.desiredstock > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel
$sql
.
=
' AND p.desiredstock > 0'
;
$sql
.
=
' AND p.desiredstock > 0'
;
if
(
$salert
==
'on'
)
// Option to see when stock is lower than alert
if
(
$salert
==
'on'
)
// Option to see when stock is lower than alert
{
{
$sql
.
=
' AND SUM('
.
$db
->
ifsql
(
"s.reel IS NULL"
,
"s.reel"
,
"0"
)
.
') < p.seuil_stock_alerte AND p.seuil_stock_alerte is not NULL'
;
$sql
.
=
' AND SUM('
.
$db
->
ifsql
(
"s.reel IS NULL"
,
"0"
,
"s.reel"
)
.
') < p.seuil_stock_alerte AND p.seuil_stock_alerte is not NULL'
;
$alertchecked
=
'checked="checked"'
;
$alertchecked
=
'checked="checked"'
;
}
}
$sql
.
=
$db
->
order
(
$sortfield
,
$sortorder
);
$sql
.
=
$db
->
order
(
$sortfield
,
$sortorder
);
...
...
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