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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
7cab558e
Commit
7cab558e
authored
10 years ago
by
Juanjo Menent
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Showing system error if not enough stock of product into orders
creation with lines
parent
41b09d8c
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
ChangeLog
+1
-0
1 addition, 0 deletions
ChangeLog
htdocs/commande/class/commande.class.php
+15
-5
15 additions, 5 deletions
htdocs/commande/class/commande.class.php
with
16 additions
and
5 deletions
ChangeLog
+
1
−
0
View file @
7cab558e
...
@@ -30,6 +30,7 @@ English Dolibarr ChangeLog
...
@@ -30,6 +30,7 @@ English Dolibarr ChangeLog
- Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key
- Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key
- Fix: Bad SEPA xml file creation
- Fix: Bad SEPA xml file creation
- Fix: [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment
- Fix: [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment
- Fix: Showing system error if not enough stock of product into orders creation with lines
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
...
...
This diff is collapsed.
Click to expand it.
htdocs/commande/class/commande.class.php
+
15
−
5
View file @
7cab558e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-201
3
Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-201
5
Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
...
@@ -101,6 +101,11 @@ class Commande extends CommonOrder
...
@@ -101,6 +101,11 @@ class Commande extends CommonOrder
var
$nbtodo
;
var
$nbtodo
;
var
$nbtodolate
;
var
$nbtodolate
;
/**
* ERR Not engouch stock
*/
const
STOCK_NOT_ENOUGH_FOR_ORDER
=
-
3
;
/**
/**
* Constructor
* Constructor
...
@@ -733,9 +738,12 @@ class Commande extends CommonOrder
...
@@ -733,9 +738,12 @@ class Commande extends CommonOrder
$this
->
lines
[
$i
]
->
array_options
$this
->
lines
[
$i
]
->
array_options
);
);
if
(
$result
<
0
)
if
(
$result
<
0
)
{
if
(
$result
!=
self
::
STOCK_NOT_ENOUGH_FOR_ORDER
)
{
{
$this
->
error
=
$this
->
db
->
lasterror
();
$this
->
error
=
$this
->
db
->
lasterror
();
dol_print_error
(
$this
->
db
);
dol_print_error
(
$this
->
db
);
}
$this
->
db
->
rollback
();
$this
->
db
->
rollback
();
return
-
1
;
return
-
1
;
}
}
...
@@ -1169,10 +1177,12 @@ class Commande extends CommonOrder
...
@@ -1169,10 +1177,12 @@ class Commande extends CommonOrder
$result
=
$product
->
fetch
(
$fk_product
);
$result
=
$product
->
fetch
(
$fk_product
);
$product_type
=
$product
->
type
;
$product_type
=
$product
->
type
;
if
(
$conf
->
global
->
STOCK_MUST_BE_ENOUGH_FOR_ORDER
&&
$product_type
==
0
&&
$product
->
stock_reel
<
$qty
)
{
if
(
$conf
->
global
->
STOCK_MUST_BE_ENOUGH_FOR_ORDER
&&
$product_type
==
0
&&
$product
->
stock_reel
<
$qty
)
{
$this
->
error
=
$langs
->
trans
(
'ErrorStockIsNotEnough'
);
$this
->
error
=
$langs
->
trans
(
'ErrorStockIsNotEnough'
);
dol_syslog
(
get_class
(
$this
)
.
"::addline error=Product "
.
$product
->
ref
.
": "
.
$this
->
error
,
LOG_ERR
);
$this
->
db
->
rollback
();
$this
->
db
->
rollback
();
return
-
3
;
return
self
::
STOCK_NOT_ENOUGH_FOR_ORDER
;
}
}
}
}
...
...
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