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
a7fc2b37
Commit
a7fc2b37
authored
10 years ago
by
Cédric Gross
Browse files
Options
Downloads
Patches
Plain Diff
Fix / Improve : [ bug #1747 ] Remove creation of batch 'Undefined'
parent
baa247ea
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
+2
-0
2 additions, 0 deletions
ChangeLog
htdocs/product/stock/product.php
+66
-7
66 additions, 7 deletions
htdocs/product/stock/product.php
with
68 additions
and
7 deletions
ChangeLog
+
2
−
0
View file @
a7fc2b37
...
...
@@ -7,6 +7,8 @@ English Dolibarr ChangeLog
For users:
- New: Use new combobox.
- New: Add hidden option MAXTABS_IN_CARD.
- Fix / Improve : [ bug #1747 ] Remove creation of batch 'Undefined'
For translators:
- Update language files.
...
...
This diff is collapsed.
Click to expand it.
htdocs/product/stock/product.php
+
66
−
7
View file @
a7fc2b37
...
...
@@ -6,7 +6,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador.gpcsolutions.fr>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014
Cédric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2014
-2015
Cédric Gross <c.gross@kreiz-it.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -239,7 +239,45 @@ if ($action == "transfert_stock" && ! $cancel)
}
}
if
(
$action
==
'updateline'
&&
GETPOST
(
'save'
)
==
$langs
->
trans
(
'Save'
))
{
$pdluo
=
new
Productbatch
(
$db
);
$result
=
$pdluo
->
fetch
(
GETPOST
(
'pdluoid'
,
'int'
));
if
(
$result
>
0
)
{
if
(
$pdluo
->
id
)
{
if
((
!
GETPOST
(
"sellby"
))
&&
(
!
GETPOST
(
"eatby"
))
&&
(
!
GETPOST
(
"batch_number"
)))
{
setEventMessage
(
$langs
->
trans
(
"ErrorFieldRequired"
,
$langs
->
transnoentitiesnoconv
(
"atleast1batchfield"
)),
'errors'
);
}
else
{
$d_eatby
=
dol_mktime
(
12
,
0
,
0
,
$_POST
[
'eatbymonth'
],
$_POST
[
'eatbyday'
],
$_POST
[
'eatbyyear'
]);
$d_sellby
=
dol_mktime
(
12
,
0
,
0
,
$_POST
[
'sellbymonth'
],
$_POST
[
'sellbyday'
],
$_POST
[
'sellbyyear'
]);
$pdluo
->
batch
=
GETPOST
(
"batch_number"
,
'san_alpha'
);
$pdluo
->
eatby
=
$d_eatby
;
$pdluo
->
sellby
=
$d_sellby
;
$result
=
$pdluo
->
update
(
$user
);
if
(
$result
<
0
)
{
setEventMessages
(
$pdluo
->
error
,
$pdluo
->
errors
,
'errors'
);
}
}
}
else
{
setEventMessages
(
$langs
->
trans
(
'BatchInformationNotfound'
),
null
,
'errors'
);
}
}
else
{
setEventMessages
(
$pdluo
->
error
,
null
,
'errors'
);
}
header
(
"Location: product.php?id="
.
$id
);
exit
;
}
/*
* View
*/
...
...
@@ -663,7 +701,27 @@ if ($resql)
if
(
$details
<
0
)
dol_print_error
(
$db
);
foreach
(
$details
as
$pdluo
)
{
print
"
\n
"
.
'<tr><td></td>'
;
if
(
$action
==
'editline'
&&
GETPOST
(
'lineid'
,
int
)
==
$pdluo
->
id
)
{
//Current line edit
print
"
\n
"
.
'<tr><td colspan="9">'
;
print
'<form action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'" method="POST"><input type="hidden" name="pdluoid" value="'
.
$pdluo
->
id
.
'"><input type="hidden" name="action" value="updateline"><input type="hidden" name="id" value="'
.
$id
.
'"><table class="noborder" width="100%"><tr><td width="10%"></td>'
;
print
'<td align="right" width="10%"><input type="text" name="batch_number" value="'
.
$pdluo
->
batch
.
'"></td>'
;
print
'<td align="right" width="10%">'
;
$form
->
select_date
(
$pdluo
->
eatby
,
'eatby'
,
''
,
''
,
1
,
""
);
print
'</td>'
;
print
'<td align="right" width="10%">'
;
$form
->
select_date
(
$pdluo
->
sellby
,
'sellby'
,
''
,
''
,
1
,
""
);
print
'</td>'
;
print
'<td align="right" width="10%">'
.
$pdluo
->
qty
.
(
$pdluo
->
qty
<
0
?
' '
.
img_warning
()
:
''
)
.
'</td>'
;
print
'<td colspan="4"><input type="submit" class="button" id="savelinebutton" name="save" value="'
.
$langs
->
trans
(
"Save"
)
.
'">'
;
print
'<input type="submit" class="button" id="cancellinebutton" name="Cancel" value="'
.
$langs
->
trans
(
"Cancel"
)
.
'"></td></tr>'
;
print
'</table></form>'
;
}
else
{
print
"
\n
"
.
'<tr><td align="right">'
;
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$id
.
'&action=editline&lineid='
.
$pdluo
->
id
.
'#'
.
$pdluo
->
id
.
'">'
;
print
img_edit
()
.
'</a></td>'
;
print
'<td align="right">'
.
$pdluo
->
batch
.
'</td>'
;
print
'<td align="right">'
.
dol_print_date
(
$pdluo
->
eatby
,
'day'
)
.
'</td>'
;
print
'<td align="right">'
.
dol_print_date
(
$pdluo
->
sellby
,
'day'
)
.
'</td>'
;
...
...
@@ -671,6 +729,7 @@ if ($resql)
print
'<td colspan="4"></td></tr>'
;
}
}
}
$i
++
;
$var
=!
$var
;
}
...
...
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