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
ca335e4f
Commit
ca335e4f
authored
13 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
New: Support zip/town autocompletion on warehouses
parent
8cdbc215
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+1
-0
1 addition, 0 deletions
ChangeLog
htdocs/product/stock/class/entrepot.class.php
+22
-13
22 additions, 13 deletions
htdocs/product/stock/class/entrepot.class.php
htdocs/product/stock/fiche.php
+96
-74
96 additions, 74 deletions
htdocs/product/stock/fiche.php
with
119 additions
and
87 deletions
ChangeLog
+
1
−
0
View file @
ca335e4f
...
...
@@ -26,6 +26,7 @@ For users:
- New: Add hidden option MAIN_DISABLE_PDF_AUTOUPDATE to avoid generating pdf each time data change.
- New: Add hidden option PROJECT_HIDE_UNSELECTABLES to hide project you can't select into combo list.
- New: Add option INVOICE_POSITIVE_CREDIT_NOTE.
- New: Support zip/town autocompletion into warehouses.
- Fix: Can use POS module with several concurrent users.
For developers:
...
...
This diff is collapsed.
Click to expand it.
htdocs/product/stock/class/entrepot.class.php
+
22
−
13
View file @
ca335e4f
...
...
@@ -133,6 +133,9 @@ class Entrepot extends CommonObject
$this
->
cp
=
trim
(
$this
->
cp
);
$this
->
ville
=
$this
->
db
->
escape
(
trim
(
$this
->
ville
));
$this
->
pays_id
=
trim
(
$this
->
pays_id
?
$this
->
pays_id
:
0
);
$this
->
zip
=
trim
(
$this
->
cp
);
$this
->
town
=
$this
->
db
->
escape
(
trim
(
$this
->
ville
));
$this
->
country_id
=
trim
(
$this
->
pays_id
?
$this
->
pays_id
:
0
);
$sql
=
"UPDATE "
.
MAIN_DB_PREFIX
.
"entrepot "
;
$sql
.
=
" SET label = '"
.
$this
->
libelle
.
"'"
;
...
...
@@ -140,9 +143,9 @@ class Entrepot extends CommonObject
$sql
.
=
",statut = "
.
$this
->
statut
;
$sql
.
=
",lieu = '"
.
$this
->
lieu
.
"'"
;
$sql
.
=
",address = '"
.
$this
->
address
.
"'"
;
$sql
.
=
",cp = '"
.
$this
->
c
p
.
"'"
;
$sql
.
=
",ville = '"
.
$this
->
ville
.
"'"
;
$sql
.
=
",fk_pays = "
.
$this
->
pays
_id
;
$sql
.
=
",cp = '"
.
$this
->
zi
p
.
"'"
;
$sql
.
=
",ville = '"
.
$this
->
town
.
"'"
;
$sql
.
=
",fk_pays = "
.
$this
->
country
_id
;
$sql
.
=
" WHERE rowid = "
.
$id
;
$this
->
db
->
begin
();
...
...
@@ -221,7 +224,7 @@ class Entrepot extends CommonObject
*/
function
fetch
(
$id
)
{
$sql
=
"SELECT rowid, label, description, statut, lieu, address, cp
, ville, fk_pays
"
;
$sql
=
"SELECT rowid, label, description, statut, lieu, address, cp
as zip, ville as town, fk_pays as country_id
"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"entrepot"
;
$sql
.
=
" WHERE rowid = "
.
$id
;
...
...
@@ -238,13 +241,16 @@ class Entrepot extends CommonObject
$this
->
statut
=
$obj
->
statut
;
$this
->
lieu
=
$obj
->
lieu
;
$this
->
address
=
$obj
->
address
;
$this
->
cp
=
$obj
->
cp
;
$this
->
ville
=
$obj
->
ville
;
$this
->
pays_id
=
$obj
->
fk_pays
;
if
(
$this
->
pays_id
)
$this
->
cp
=
$obj
->
zip
;
$this
->
ville
=
$obj
->
town
;
$this
->
pays_id
=
$obj
->
country_id
;
$this
->
zip
=
$obj
->
zip
;
$this
->
town
=
$obj
->
town
;
$this
->
country_id
=
$obj
->
country_id
;
if
(
$this
->
country_id
)
{
$sqlp
=
"SELECT code,libelle from "
.
MAIN_DB_PREFIX
.
"c_pays where rowid = "
.
$this
->
pays
_id
;
$sqlp
=
"SELECT code,libelle from "
.
MAIN_DB_PREFIX
.
"c_pays where rowid = "
.
$this
->
country
_id
;
$resql
=
$this
->
db
->
query
(
$sqlp
);
if
(
$resql
)
{
...
...
@@ -256,6 +262,8 @@ class Entrepot extends CommonObject
}
$this
->
pays
=
$objp
->
libelle
;
$this
->
pays_code
=
$objp
->
code
;
$this
->
country
=
$objp
->
libelle
;
$this
->
country_code
=
$objp
->
code
;
}
$this
->
db
->
free
(
$result
);
...
...
@@ -269,9 +277,10 @@ class Entrepot extends CommonObject
}
/*
* \brief Charge les informations d'ordre info dans l'objet entrepot
* \param id id de l'entrepot a charger
/**
* Charge les informations d'ordre info dans l'objet entrepot
*
* @param int $id id de l'entrepot a charger
*/
function
info
(
$id
)
{
...
...
This diff is collapsed.
Click to expand it.
htdocs/product/stock/fiche.php
+
96
−
74
View file @
ca335e4f
...
...
@@ -29,6 +29,7 @@ require_once(DOL_DOCUMENT_ROOT."/product/stock/class/entrepot.class.php");
require_once
(
DOL_DOCUMENT_ROOT
.
"/product/class/product.class.php"
);
require_once
(
DOL_DOCUMENT_ROOT
.
"/core/lib/stock.lib.php"
);
require_once
(
DOL_DOCUMENT_ROOT
.
"/core/lib/product.lib.php"
);
require_once
(
DOL_DOCUMENT_ROOT
.
"/core/class/html.formcompany.class.php"
);
$langs
->
load
(
"products"
);
$langs
->
load
(
"stocks"
);
...
...
@@ -51,20 +52,23 @@ $mesg = '';
// Ajout entrepot
if
(
$action
==
'add'
&&
$user
->
rights
->
stock
->
creer
)
{
$entrepot
=
new
Entrepot
(
$db
);
$entrepot
->
ref
=
$_POST
[
"ref"
];
$entrepot
->
libelle
=
$_POST
[
"libelle"
];
$entrepot
->
description
=
$_POST
[
"desc"
];
$entrepot
->
statut
=
$_POST
[
"statut"
];
$entrepot
->
lieu
=
$_POST
[
"lieu"
];
$entrepot
->
address
=
$_POST
[
"address"
];
$entrepot
->
cp
=
$_POST
[
"cp"
];
$entrepot
->
ville
=
$_POST
[
"ville"
];
$entrepot
->
pays_id
=
$_POST
[
"pays_id"
];
if
(
$entrepot
->
libelle
)
{
$id
=
$entrepot
->
create
(
$user
);
$object
=
new
Entrepot
(
$db
);
$object
->
ref
=
$_POST
[
"ref"
];
$object
->
libelle
=
$_POST
[
"libelle"
];
$object
->
description
=
$_POST
[
"desc"
];
$object
->
statut
=
$_POST
[
"statut"
];
$object
->
lieu
=
$_POST
[
"lieu"
];
$object
->
address
=
$_POST
[
"address"
];
$object
->
cp
=
$_POST
[
"zipcode"
];
$object
->
ville
=
$_POST
[
"town"
];
$object
->
pays_id
=
$_POST
[
"pays_id"
];
$object
->
zip
=
$_POST
[
"zipcode"
];
$object
->
town
=
$_POST
[
"town"
];
$object
->
country_id
=
$_POST
[
"pays_id"
];
if
(
$object
->
libelle
)
{
$id
=
$object
->
create
(
$user
);
if
(
$id
>
0
)
{
header
(
"Location: fiche.php?id="
.
$id
);
...
...
@@ -72,7 +76,7 @@ if ($action == 'add' && $user->rights->stock->creer)
}
$action
=
'create'
;
$mesg
=
'<div class="error">'
.
$
entrepo
t
->
error
.
'</div>'
;
$mesg
=
'<div class="error">'
.
$
objec
t
->
error
.
'</div>'
;
}
else
{
$mesg
=
'<div class="error">'
.
$langs
->
trans
(
"ErrorWarehouseRefRequired"
)
.
'</div>'
;
...
...
@@ -83,9 +87,9 @@ if ($action == 'add' && $user->rights->stock->creer)
// Delete warehouse
if
(
$action
==
'confirm_delete'
&&
$_REQUEST
[
"confirm"
]
==
'yes'
&&
$user
->
rights
->
stock
->
supprimer
)
{
$
entrepo
t
=
new
Entrepot
(
$db
);
$
entrepo
t
->
fetch
(
$_REQUEST
[
"id"
]);
$result
=
$
entrepo
t
->
delete
(
$user
);
$
objec
t
=
new
Entrepot
(
$db
);
$
objec
t
->
fetch
(
$_REQUEST
[
"id"
]);
$result
=
$
objec
t
->
delete
(
$user
);
if
(
$result
>
0
)
{
header
(
"Location: "
.
DOL_URL_ROOT
.
'/product/stock/liste.php'
);
...
...
@@ -93,7 +97,7 @@ if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->right
}
else
{
$mesg
=
'<div class="error">'
.
$
entrepo
t
->
error
.
'</div>'
;
$mesg
=
'<div class="error">'
.
$
objec
t
->
error
.
'</div>'
;
$action
=
''
;
}
}
...
...
@@ -101,19 +105,22 @@ if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->right
// Modification entrepot
if
(
$action
==
'update'
&&
$_POST
[
"cancel"
]
<>
$langs
->
trans
(
"Cancel"
))
{
$
entrepo
t
=
new
Entrepot
(
$db
);
if
(
$
entrepo
t
->
fetch
(
$_POST
[
"id"
]))
$
objec
t
=
new
Entrepot
(
$db
);
if
(
$
objec
t
->
fetch
(
$_POST
[
"id"
]))
{
$entrepot
->
libelle
=
$_POST
[
"libelle"
];
$entrepot
->
description
=
$_POST
[
"desc"
];
$entrepot
->
statut
=
$_POST
[
"statut"
];
$entrepot
->
lieu
=
$_POST
[
"lieu"
];
$entrepot
->
address
=
$_POST
[
"address"
];
$entrepot
->
cp
=
$_POST
[
"cp"
];
$entrepot
->
ville
=
$_POST
[
"ville"
];
$entrepot
->
pays_id
=
$_POST
[
"pays_id"
];
if
(
$entrepot
->
update
(
$_POST
[
"id"
],
$user
)
>
0
)
$object
->
libelle
=
$_POST
[
"libelle"
];
$object
->
description
=
$_POST
[
"desc"
];
$object
->
statut
=
$_POST
[
"statut"
];
$object
->
lieu
=
$_POST
[
"lieu"
];
$object
->
address
=
$_POST
[
"address"
];
$object
->
cp
=
$_POST
[
"zipcode"
];
$object
->
ville
=
$_POST
[
"town"
];
$object
->
pays_id
=
$_POST
[
"pays_id"
];
$object
->
zip
=
$_POST
[
"zipcode"
];
$object
->
town
=
$_POST
[
"town"
];
$object
->
country_id
=
$_POST
[
"pays_id"
];
if
(
$object
->
update
(
$_POST
[
"id"
],
$user
)
>
0
)
{
$action
=
''
;
$_GET
[
"id"
]
=
$_POST
[
"id"
];
...
...
@@ -123,14 +130,14 @@ if ($action == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
{
$action
=
'edit'
;
$_GET
[
"id"
]
=
$_POST
[
"id"
];
$mesg
=
'<div class="error">'
.
$
entrepo
t
->
error
.
'</div>'
;
$mesg
=
'<div class="error">'
.
$
objec
t
->
error
.
'</div>'
;
}
}
else
{
$action
=
'edit'
;
$_GET
[
"id"
]
=
$_POST
[
"id"
];
$mesg
=
'<div class="error">'
.
$
entrepo
t
->
error
.
'</div>'
;
$mesg
=
'<div class="error">'
.
$
objec
t
->
error
.
'</div>'
;
}
}
...
...
@@ -148,6 +155,7 @@ if ($_POST["cancel"] == $langs->trans("Cancel"))
$productstatic
=
new
Product
(
$db
);
$form
=
new
Form
(
$db
);
$formcompany
=
new
FormCompany
(
$db
);
$help_url
=
'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'
;
llxHeader
(
""
,
$langs
->
trans
(
"WarehouseCard"
),
$help_url
);
...
...
@@ -169,25 +177,31 @@ if ($action == 'create')
// Ref
print
'<tr><td width="25%" class="fieldrequired">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td colspan="3"><input name="libelle" size="20" value=""></td></tr>'
;
print
'<tr><td >'
.
$langs
->
trans
(
"LocationSummary"
)
.
'</td><td colspan="3"><input name="lieu" size="40" value="'
.
$
entrepo
t
->
lieu
.
'"></td></tr>'
;
print
'<tr><td >'
.
$langs
->
trans
(
"LocationSummary"
)
.
'</td><td colspan="3"><input name="lieu" size="40" value="'
.
$
objec
t
->
lieu
.
'"></td></tr>'
;
// Description
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"Description"
)
.
'</td><td colspan="3">'
;
// Editeur wysiwyg
require_once
(
DOL_DOCUMENT_ROOT
.
"/core/class/doleditor.class.php"
);
$doleditor
=
new
DolEditor
(
'desc'
,
$
entrepo
t
->
description
,
''
,
180
,
'dolibarr_notes'
,
'In'
,
false
,
true
,
$conf
->
fckeditor
->
enabled
,
5
,
70
);
$doleditor
=
new
DolEditor
(
'desc'
,
$
objec
t
->
description
,
''
,
180
,
'dolibarr_notes'
,
'In'
,
false
,
true
,
$conf
->
fckeditor
->
enabled
,
5
,
70
);
$doleditor
->
Create
();
print
'</td></tr>'
;
print
'<tr><td>'
.
$langs
->
trans
(
'Address'
)
.
'</td><td colspan="3"><textarea name="address" cols="60" rows="3" wrap="soft">'
;
print
$
entrepo
t
->
address
;
print
$
objec
t
->
address
;
print
'</textarea></td></tr>'
;
print
'<tr><td width="25%">'
.
$langs
->
trans
(
'Zip'
)
.
'</td><td width="25%"><input size="6" type="text" name="cp" value="'
.
$entrepot
->
cp
.
'"></td>'
;
print
'<td width="25%">'
.
$langs
->
trans
(
'Town'
)
.
'</td><td width="25%"><input type="text" name="ville" value="'
.
$entrepot
->
ville
.
'"></td></tr>'
;
// Zip / Town
print
'<tr><td>'
.
$langs
->
trans
(
'Zip'
)
.
'</td><td>'
;
print
$formcompany
->
select_ziptown
(
$object
->
zip
,
'zipcode'
,
array
(
'town'
,
'selectpays_id'
,
'departement_id'
),
6
);
print
'</td><td>'
.
$langs
->
trans
(
'Town'
)
.
'</td><td>'
;
print
$formcompany
->
select_ziptown
(
$object
->
town
,
'town'
,
array
(
'zipcode'
,
'selectpays_id'
,
'departement_id'
));
print
'</td></tr>'
;
print
'<tr><td>'
.
$langs
->
trans
(
'Country'
)
.
'</td><td colspan="3">'
;
$form
->
select_pays
(
$entrepot
->
pays_id
?
$entrepot
->
pays_id
:
$mysoc
->
pays_code
,
'pays_id'
);
// Country
print
'<tr><td width="25%">'
.
$langs
->
trans
(
'Country'
)
.
'</td><td colspan="3">'
;
$form
->
select_pays
(
$object
->
country_id
?
$object
->
country_id
:
$mysoc
->
country_code
,
'pays_id'
);
if
(
$user
->
admin
)
print
info_admin
(
$langs
->
trans
(
"YouCanChangeValuesForThisListFromDictionnarySetup"
),
1
);
print
'</td></tr>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"Status"
)
.
'</td><td colspan="3">'
;
...
...
@@ -209,8 +223,8 @@ else
{
dol_htmloutput_mesg
(
$mesg
);
$
entrepo
t
=
new
Entrepot
(
$db
);
$result
=
$
entrepo
t
->
fetch
(
$_GET
[
"id"
]);
$
objec
t
=
new
Entrepot
(
$db
);
$result
=
$
objec
t
->
fetch
(
$_GET
[
"id"
]);
if
(
$result
<
0
)
{
dol_print_error
(
$db
);
...
...
@@ -221,7 +235,7 @@ else
*/
if
(
$action
<>
'edit'
&&
$action
<>
're-edit'
)
{
$head
=
stock_prepare_head
(
$
entrepo
t
);
$head
=
stock_prepare_head
(
$
objec
t
);
dol_fiche_head
(
$head
,
'card'
,
$langs
->
trans
(
"Warehouse"
),
0
,
'stock'
);
...
...
@@ -229,7 +243,7 @@ else
if
(
$action
==
'delete'
)
{
$form
=
new
Form
(
$db
);
$ret
=
$form
->
form_confirm
(
$_SERVER
[
"PHP_SELF"
]
.
"?id="
.
$
entrepo
t
->
id
,
$langs
->
trans
(
"DeleteAWarehouse"
),
$langs
->
trans
(
"ConfirmDeleteWarehouse"
,
$
entrepo
t
->
libelle
),
"confirm_delete"
,
''
,
0
,
2
);
$ret
=
$form
->
form_confirm
(
$_SERVER
[
"PHP_SELF"
]
.
"?id="
.
$
objec
t
->
id
,
$langs
->
trans
(
"DeleteAWarehouse"
),
$langs
->
trans
(
"ConfirmDeleteWarehouse"
,
$
objec
t
->
libelle
),
"confirm_delete"
,
''
,
0
,
2
);
if
(
$ret
==
'html'
)
print
'<br>'
;
}
...
...
@@ -237,34 +251,34 @@ else
// Ref
print
'<tr><td width="25%">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td colspan="3">'
;
print
$form
->
showrefnav
(
$
entrepo
t
,
'id'
,
''
,
1
,
'rowid'
,
'libelle'
);
print
$form
->
showrefnav
(
$
objec
t
,
'id'
,
''
,
1
,
'rowid'
,
'libelle'
);
print
'</td>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"LocationSummary"
)
.
'</td><td colspan="3">'
.
$
entrepo
t
->
lieu
.
'</td></tr>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"LocationSummary"
)
.
'</td><td colspan="3">'
.
$
objec
t
->
lieu
.
'</td></tr>'
;
// Description
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"Description"
)
.
'</td><td colspan="3">'
.
nl2br
(
$
entrepo
t
->
description
)
.
'</td></tr>'
;
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"Description"
)
.
'</td><td colspan="3">'
.
nl2br
(
$
objec
t
->
description
)
.
'</td></tr>'
;
// Address
print
'<tr><td>'
.
$langs
->
trans
(
'Address'
)
.
'</td><td colspan="3">'
;
print
$
entrepo
t
->
address
;
print
$
objec
t
->
address
;
print
'</td></tr>'
;
// Ville
print
'<tr><td width="25%">'
.
$langs
->
trans
(
'Zip'
)
.
'</td><td width="25%">'
.
$
entrepo
t
->
c
p
.
'</td>'
;
print
'<td width="25%">'
.
$langs
->
trans
(
'Town'
)
.
'</td><td width="25%">'
.
$
entrepot
->
ville
.
'</td></tr>'
;
print
'<tr><td width="25%">'
.
$langs
->
trans
(
'Zip'
)
.
'</td><td width="25%">'
.
$
objec
t
->
zi
p
.
'</td>'
;
print
'<td width="25%">'
.
$langs
->
trans
(
'Town'
)
.
'</td><td width="25%">'
.
$
object
->
town
.
'</td></tr>'
;
// Country
print
'<tr><td>'
.
$langs
->
trans
(
'Country'
)
.
'</td><td colspan="3">'
;
$img
=
picto_from_langcode
(
$
entrepot
->
pays
_code
);
$img
=
picto_from_langcode
(
$
object
->
country
_code
);
print
(
$img
?
$img
.
' '
:
''
);
print
$
entrepot
->
pays
;
print
$
object
->
country
;
print
'</td></tr>'
;
// Statut
print
'<tr><td>'
.
$langs
->
trans
(
"Status"
)
.
'</td><td colspan="3">'
.
$
entrepo
t
->
getLibStatut
(
4
)
.
'</td></tr>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"Status"
)
.
'</td><td colspan="3">'
.
$
objec
t
->
getLibStatut
(
4
)
.
'</td></tr>'
;
$calcproducts
=
$
entrepo
t
->
nb_products
();
$calcproducts
=
$
objec
t
->
nb_products
();
// Nb of products
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"NumberOfProducts"
)
.
'</td><td colspan="3">'
;
...
...
@@ -279,7 +293,7 @@ else
// Last movement
$sql
=
"SELECT max(m.datem) as datem"
;
$sql
.
=
" FROM llx_stock_mouvement as m"
;
$sql
.
=
" WHERE m.fk_entrepot = '"
.
$
entrepo
t
->
id
.
"'"
;
$sql
.
=
" WHERE m.fk_entrepot = '"
.
$
objec
t
->
id
.
"'"
;
$resqlbis
=
$db
->
query
(
$sql
);
if
(
$resqlbis
)
{
...
...
@@ -294,7 +308,7 @@ else
if
(
$lastmovementdate
)
{
print
dol_print_date
(
$lastmovementdate
,
'dayhour'
)
.
' '
;
print
'(<a href="'
.
DOL_URL_ROOT
.
'/product/stock/mouvement.php?id='
.
$
entrepo
t
->
id
.
'">'
.
$langs
->
trans
(
"FullList"
)
.
'</a>)'
;
print
'(<a href="'
.
DOL_URL_ROOT
.
'/product/stock/mouvement.php?id='
.
$
objec
t
->
id
.
'">'
.
$langs
->
trans
(
"FullList"
)
.
'</a>)'
;
}
else
{
...
...
@@ -318,12 +332,12 @@ else
if
(
$action
==
''
)
{
if
(
$user
->
rights
->
stock
->
creer
)
print
"<a class=
\"
butAction
\"
href=
\"
fiche.php?action=edit&id="
.
$
entrepo
t
->
id
.
"
\"
>"
.
$langs
->
trans
(
"Modify"
)
.
"</a>"
;
print
"<a class=
\"
butAction
\"
href=
\"
fiche.php?action=edit&id="
.
$
objec
t
->
id
.
"
\"
>"
.
$langs
->
trans
(
"Modify"
)
.
"</a>"
;
else
print
"<a class=
\"
butActionRefused
\"
href=
\"
#
\"
>"
.
$langs
->
trans
(
"Modify"
)
.
"</a>"
;
if
(
$user
->
rights
->
stock
->
supprimer
)
print
"<a class=
\"
butActionDelete
\"
href=
\"
fiche.php?action=delete&id="
.
$
entrepo
t
->
id
.
"
\"
>"
.
$langs
->
trans
(
"Delete"
)
.
"</a>"
;
print
"<a class=
\"
butActionDelete
\"
href=
\"
fiche.php?action=delete&id="
.
$
objec
t
->
id
.
"
\"
>"
.
$langs
->
trans
(
"Delete"
)
.
"</a>"
;
else
print
"<a class=
\"
butActionRefused
\"
href=
\"
#
\"
>"
.
$langs
->
trans
(
"Delete"
)
.
"</a>"
;
}
...
...
@@ -359,7 +373,7 @@ else
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"product_stock ps, "
.
MAIN_DB_PREFIX
.
"product p"
;
$sql
.
=
" WHERE ps.fk_product = p.rowid"
;
$sql
.
=
" AND ps.reel <> 0"
;
// We do not show if stock is 0 (no product in this warehouse)
$sql
.
=
" AND ps.fk_entrepot = "
.
$
entrepo
t
->
id
;
$sql
.
=
" AND ps.fk_entrepot = "
.
$
objec
t
->
id
;
$sql
.
=
$db
->
order
(
$sortfield
,
$sortorder
);
dol_syslog
(
'List products sql='
.
$sql
);
...
...
@@ -426,14 +440,14 @@ else
if
(
$user
->
rights
->
stock
->
mouvement
->
creer
)
{
print
'<td align="center"><a href="'
.
DOL_URL_ROOT
.
'/product/stock/product.php?dwid='
.
$
entrepo
t
->
id
.
'&id='
.
$objp
->
rowid
.
'&action=transfert">'
;
print
'<td align="center"><a href="'
.
DOL_URL_ROOT
.
'/product/stock/product.php?dwid='
.
$
objec
t
->
id
.
'&id='
.
$objp
->
rowid
.
'&action=transfert">'
;
print
img_picto
(
$langs
->
trans
(
"StockMovement"
),
'uparrow.png'
)
.
' '
.
$langs
->
trans
(
"StockMovement"
);
print
"</a></td>"
;
}
if
(
$user
->
rights
->
stock
->
creer
)
{
print
'<td align="center"><a href="'
.
DOL_URL_ROOT
.
'/product/stock/product.php?dwid='
.
$
entrepo
t
->
id
.
'&id='
.
$objp
->
rowid
.
'&action=correction">'
;
print
'<td align="center"><a href="'
.
DOL_URL_ROOT
.
'/product/stock/product.php?dwid='
.
$
objec
t
->
id
.
'&id='
.
$objp
->
rowid
.
'&action=correction">'
;
print
$langs
->
trans
(
"StockCorrection"
);
print
"</a></td>"
;
}
...
...
@@ -475,44 +489,52 @@ else
print
'<form action="fiche.php" method="POST">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="update">'
;
print
'<input type="hidden" name="id" value="'
.
$
entrepo
t
->
id
.
'">'
;
print
'<input type="hidden" name="id" value="'
.
$
objec
t
->
id
.
'">'
;
print
'<table class="border" width="100%">'
;
// Ref
print
'<tr><td width="20%" class="fieldrequired">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td colspan="3"><input name="libelle" size="20" value="'
.
$
entrepo
t
->
libelle
.
'"></td></tr>'
;
print
'<tr><td width="20%" class="fieldrequired">'
.
$langs
->
trans
(
"Ref"
)
.
'</td><td colspan="3"><input name="libelle" size="20" value="'
.
$
objec
t
->
libelle
.
'"></td></tr>'
;
print
'<tr><td width="20%">'
.
$langs
->
trans
(
"LocationSummary"
)
.
'</td><td colspan="3"><input name="lieu" size="40" value="'
.
$
entrepo
t
->
lieu
.
'"></td></tr>'
;
print
'<tr><td width="20%">'
.
$langs
->
trans
(
"LocationSummary"
)
.
'</td><td colspan="3"><input name="lieu" size="40" value="'
.
$
objec
t
->
lieu
.
'"></td></tr>'
;
// Description
print
'<tr><td valign="top">'
.
$langs
->
trans
(
"Description"
)
.
'</td><td colspan="3">'
;
// Editeur wysiwyg
require_once
(
DOL_DOCUMENT_ROOT
.
"/core/class/doleditor.class.php"
);
$doleditor
=
new
DolEditor
(
'desc'
,
$
entrepo
t
->
description
,
''
,
180
,
'dolibarr_notes'
,
'In'
,
false
,
true
,
$conf
->
fckeditor
->
enabled
,
5
,
70
);
$doleditor
=
new
DolEditor
(
'desc'
,
$
objec
t
->
description
,
''
,
180
,
'dolibarr_notes'
,
'In'
,
false
,
true
,
$conf
->
fckeditor
->
enabled
,
5
,
70
);
$doleditor
->
Create
();
print
'</td></tr>'
;
print
'<tr><td>'
.
$langs
->
trans
(
'Address'
)
.
'</td><td colspan="3"><textarea name="address" cols="60" rows="3" wrap="soft">'
;
print
$
entrepo
t
->
address
;
print
$
objec
t
->
address
;
print
'</textarea></td></tr>'
;
print
'<tr><td>'
.
$langs
->
trans
(
'Zip'
)
.
'</td><td><input size="6" type="text" name="cp" value="'
.
$entrepot
->
cp
.
'"></td>'
;
print
'<td>'
.
$langs
->
trans
(
'Town'
)
.
'</td><td><input type="text" name="ville" value="'
.
$entrepot
->
ville
.
'"></td></tr>'
;
// Zip / Town
print
'<tr><td>'
.
$langs
->
trans
(
'Zip'
)
.
'</td><td>'
;
print
$formcompany
->
select_ziptown
(
$object
->
zip
,
'zipcode'
,
array
(
'town'
,
'selectpays_id'
,
'departement_id'
),
6
);
print
'</td><td>'
.
$langs
->
trans
(
'Town'
)
.
'</td><td>'
;
print
$formcompany
->
select_ziptown
(
$object
->
town
,
'town'
,
array
(
'zipcode'
,
'selectpays_id'
,
'departement_id'
));
print
'</td></tr>'
;
print
'<tr><td>'
.
$langs
->
trans
(
'Country'
)
.
'</td><td colspan="3">'
;
$form
->
select_pays
(
$entrepot
->
pays_id
,
'pays_id'
);
// Country
print
'<tr><td width="25%">'
.
$langs
->
trans
(
'Country'
)
.
'</td><td colspan="3">'
;
$form
->
select_pays
(
$object
->
country_id
?
$object
->
country_id
:
$mysoc
->
country_code
,
'pays_id'
);
if
(
$user
->
admin
)
print
info_admin
(
$langs
->
trans
(
"YouCanChangeValuesForThisListFromDictionnarySetup"
),
1
);
print
'</td></tr>'
;
print
'<tr><td width="20%">'
.
$langs
->
trans
(
"Status"
)
.
'</td><td colspan="3">'
;
print
'<select name="statut" class="flat">'
;
print
'<option value="0" '
.
(
$
entrepo
t
->
statut
==
0
?
'selected="selected"'
:
''
)
.
'>'
.
$langs
->
trans
(
"WarehouseClosed"
)
.
'</option>'
;
print
'<option value="1" '
.
(
$
entrepo
t
->
statut
==
0
?
''
:
'selected="selected"'
)
.
'>'
.
$langs
->
trans
(
"WarehouseOpened"
)
.
'</option>'
;
print
'<option value="0" '
.
(
$
objec
t
->
statut
==
0
?
'selected="selected"'
:
''
)
.
'>'
.
$langs
->
trans
(
"WarehouseClosed"
)
.
'</option>'
;
print
'<option value="1" '
.
(
$
objec
t
->
statut
==
0
?
''
:
'selected="selected"'
)
.
'>'
.
$langs
->
trans
(
"WarehouseOpened"
)
.
'</option>'
;
print
'</select>'
;
print
'</td></tr>'
;
print
'<tr><td colspan="4" align="center"><input type="submit" class="button" value="'
.
$langs
->
trans
(
"Save"
)
.
'"> '
;
print
'<input type="submit" class="button" name="cancel" value="'
.
$langs
->
trans
(
"Cancel"
)
.
'"></td></tr>'
;
print
'</table>'
;
print
'<center><br><input type="submit" class="button" value="'
.
$langs
->
trans
(
"Save"
)
.
'"> '
;
print
'<input type="submit" class="button" name="cancel" value="'
.
$langs
->
trans
(
"Cancel"
)
.
'"></center>'
;
print
'</form>'
;
}
...
...
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