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
dbae31b9
Commit
dbae31b9
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6
parents
e94ffcea
a6a799c8
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/langs/en_US/productbatch.lang
+1
-0
1 addition, 0 deletions
htdocs/langs/en_US/productbatch.lang
htdocs/langs/fr_FR/productbatch.lang
+3
-1
3 additions, 1 deletion
htdocs/langs/fr_FR/productbatch.lang
htdocs/product/class/product.class.php
+34
-0
34 additions, 0 deletions
htdocs/product/class/product.class.php
with
38 additions
and
1 deletion
htdocs/langs/en_US/productbatch.lang
+
1
−
0
View file @
dbae31b9
...
@@ -16,3 +16,4 @@ printEatby= Eat-by: %s
...
@@ -16,3 +16,4 @@ printEatby= Eat-by: %s
printSellby= Sell-by: %s
printSellby= Sell-by: %s
printQty= Qty: %d
printQty= Qty: %d
AddDispatchBatchLine=Add a line for Shelf Life dispatching
AddDispatchBatchLine=Add a line for Shelf Life dispatching
BatchDefaultNumber= Undefined
\ No newline at end of file
This diff is collapsed.
Click to expand it.
htdocs/langs/fr_FR/productbatch.lang
+
3
−
1
View file @
dbae31b9
...
@@ -15,3 +15,5 @@ printBatch= Lot: %s
...
@@ -15,3 +15,5 @@ printBatch= Lot: %s
printEatby= DLC: %s
printEatby= DLC: %s
printSellby= DLUO: %s
printSellby= DLUO: %s
printQty= Qté: %d
printQty= Qté: %d
AddDispatchBatchLine=Ajouter une ligne de dispatch
BatchDefaultNumber= Indéfini
\ No newline at end of file
This diff is collapsed.
Click to expand it.
htdocs/product/class/product.class.php
+
34
−
0
View file @
dbae31b9
...
@@ -589,6 +589,39 @@ class Product extends CommonObject
...
@@ -589,6 +589,39 @@ class Product extends CommonObject
if
(
$result
>=
0
)
if
(
$result
>=
0
)
{
{
if
(
empty
(
$this
->
oldcopy
))
{
$org
=
new
self
(
$this
->
db
);
$org
->
fetch
(
$this
->
id
);
$this
->
oldcopy
=
$org
;
}
// test if batch management is activated on existing product
if
(
$this
->
hasbatch
()
&&
!
$this
->
oldcopy
->
hasbatch
())
{
$this
->
load_stock
();
foreach
(
$this
->
stock_warehouse
as
$idW
=>
$ObjW
)
{
$qty_batch
=
0
;
foreach
(
$ObjW
->
detail_batch
as
$detail
)
{
$qty_batch
+=
$detail
->
qty
;
}
// Quantities in batch details are not same same as stock quantity
// So we add a default batch record
if
(
$ObjW
->
real
<>
$qty_batch
)
{
$ObjBatch
=
new
Productbatch
(
$this
->
db
);
$ObjBatch
->
batch
=
$langs
->
trans
(
'BatchDefaultNumber'
);
$ObjBatch
->
qty
=
$ObjW
->
real
-
$qty_batch
;
$ObjBatch
->
fk_product_stock
=
$ObjW
->
id
;
if
(
$ObjBatch
->
create
(
$user
,
1
)
<
0
)
{
$error
++
;
$this
->
errors
=
$ObjBatch
->
errors
;
}
}
}
}
// For automatic creation
// For automatic creation
if
(
$this
->
barcode
==
-
1
)
$this
->
barcode
=
$this
->
get_barcode
(
$this
,
$this
->
barcode_type_code
);
if
(
$this
->
barcode
==
-
1
)
$this
->
barcode
=
$this
->
get_barcode
(
$this
,
$this
->
barcode_type_code
);
...
@@ -2918,6 +2951,7 @@ class Product extends CommonObject
...
@@ -2918,6 +2951,7 @@ class Product extends CommonObject
$this
->
stock_warehouse
[
$row
->
fk_entrepot
]
=
new
stdClass
();
$this
->
stock_warehouse
[
$row
->
fk_entrepot
]
=
new
stdClass
();
$this
->
stock_warehouse
[
$row
->
fk_entrepot
]
->
real
=
$row
->
reel
;
$this
->
stock_warehouse
[
$row
->
fk_entrepot
]
->
real
=
$row
->
reel
;
$this
->
stock_warehouse
[
$row
->
fk_entrepot
]
->
pmp
=
$row
->
pmp
;
$this
->
stock_warehouse
[
$row
->
fk_entrepot
]
->
pmp
=
$row
->
pmp
;
$this
->
stock_warehouse
[
$row
->
fk_entrepot
]
->
id
=
$row
->
rowid
;
if
(
$this
->
hasbatch
())
$this
->
stock_warehouse
[
$row
->
fk_entrepot
]
->
detail_batch
=
Productbatch
::
findAll
(
$this
->
db
,
$row
->
rowid
,
1
);
if
(
$this
->
hasbatch
())
$this
->
stock_warehouse
[
$row
->
fk_entrepot
]
->
detail_batch
=
Productbatch
::
findAll
(
$this
->
db
,
$row
->
rowid
,
1
);
$this
->
stock_reel
+=
$row
->
reel
;
$this
->
stock_reel
+=
$row
->
reel
;
$i
++
;
$i
++
;
...
...
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