Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW : allow to save a parent warehouse
# Conflicts: # htdocs/product/stock/card.php
- Loading branch information
1 parent
d78f204
commit 416311a
Showing
6 changed files
with
43 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,12 @@ | |
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'; | ||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; | ||
|
||
$langs->load("products"); | ||
$langs->load("stocks"); | ||
$langs->load("companies"); | ||
$langs->load("categories"); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
atm-gauthier
Author
Contributor
|
||
|
||
$action=GETPOST('action'); | ||
$cancel=GETPOST('cancel'); | ||
|
@@ -64,6 +66,7 @@ | |
if ($action == 'add' && $user->rights->stock->creer) | ||
{ | ||
$object->ref = GETPOST("ref"); | ||
$object->fk_parent = GETPOST("fk_parent"); | ||
$object->libelle = GETPOST("libelle"); | ||
$object->description = GETPOST("desc"); | ||
$object->statut = GETPOST("statut"); | ||
|
@@ -128,6 +131,7 @@ | |
if ($object->fetch($id)) | ||
{ | ||
$object->libelle = GETPOST("libelle"); | ||
$object->fk_parent = GETPOST("fk_parent"); | ||
$object->description = GETPOST("desc"); | ||
$object->statut = GETPOST("statut"); | ||
$object->lieu = GETPOST("lieu"); | ||
|
@@ -166,6 +170,7 @@ | |
|
||
$productstatic=new Product($db); | ||
$form=new Form($db); | ||
$formproduct=new FormProduct($db); | ||
$formcompany=new FormCompany($db); | ||
|
||
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; | ||
|
@@ -189,6 +194,11 @@ | |
print '<tr><td class="titlefieldcreate 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="'.(!empty($object->lieu)?$object->lieu:'').'"></td></tr>'; | ||
|
||
// Parent entrepot | ||
print '<tr><td>'.$langs->trans("AddIn").'</td><td>'; | ||
print $formproduct->selectWarehouses('', 'fk_parent', '', 1); | ||
print '</td></tr>'; | ||
|
||
// Description | ||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">'; | ||
|
@@ -346,6 +356,16 @@ | |
|
||
//print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$object->lieu.'</td></tr>'; | ||
|
||
// Parent entrepot | ||
$e = new Entrepot($db); | ||
if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0) { | ||
|
||
print '<tr><td>'.$langs->trans("ParentWarehouse").'</td><td>'; | ||
print $e->getNomUrl(3); | ||
print '</td></tr>'; | ||
|
||
} | ||
|
||
// Description | ||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'.nl2br($object->description).'</td></tr>'; | ||
|
||
|
@@ -623,6 +643,11 @@ | |
print '<tr><td width="20%" class="fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="libelle" size="20" value="'.$object->libelle.'"></td></tr>'; | ||
|
||
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3"><input name="lieu" size="40" value="'.$object->lieu.'"></td></tr>'; | ||
|
||
// Parent entrepot | ||
print '<tr><td>'.$langs->trans("AddIn").'</td><td>'; | ||
print $formproduct->selectWarehouses('', 'fk_parent', '', 1, 0, 0, '', 0, 0, array(), 'minwidth200', array($object->id)); | ||
print '</td></tr>'; | ||
|
||
// Description | ||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why do you load categories on product stock card ?
is there a relation between parent warehouse and categories ?
or is it better to "filter by categories" on stock or product stock's cards ?