Ajoute onglet mouvement de stock qui concerne un entrepot donné sur fiche entrepot

This commit is contained in:
Laurent Destailleur 2006-08-19 02:30:41 +00:00
parent 4db6af8def
commit 33d2be8924
5 changed files with 118 additions and 62 deletions

View File

@ -23,6 +23,7 @@ LastMovements=Last movements
Units=Units Units=Units
StockCorrection=Stock correction StockCorrection=Stock correction
StockMovement=Transfer StockMovement=Transfer
StockMovements=Stock transferts
NumberOfUnit=Number of units NumberOfUnit=Number of units
TotalStock=Total in stock TotalStock=Total in stock
StockTooLow=Stock too low StockTooLow=Stock too low

View File

@ -23,6 +23,7 @@ LastMovements=Derniers mouvements
Units=Unités Units=Unités
StockCorrection=Correction stock StockCorrection=Correction stock
StockMovement=Transfert StockMovement=Transfert
StockMovements=Mouvements de stock
NumberOfUnit=Nombre de pièces NumberOfUnit=Nombre de pièces
TotalStock=Total en stock TotalStock=Total en stock
StockTooLow=Stock insuffisant StockTooLow=Stock insuffisant

View File

@ -113,13 +113,6 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
} }
} }
llxHeader("","",$langs->trans("WarehouseCard"));
$form=new Form($db);
if ($_POST["cancel"] == $langs->trans("Cancel")) if ($_POST["cancel"] == $langs->trans("Cancel"))
{ {
$_GET["action"] = ''; $_GET["action"] = '';
@ -127,11 +120,16 @@ if ($_POST["cancel"] == $langs->trans("Cancel"))
} }
/* /*
* Affichage fiche en mode création * Affichage fiche en mode création
* *
*/ */
llxHeader("","",$langs->trans("WarehouseCard"));
$form=new Form($db);
if ($_GET["action"] == 'create') if ($_GET["action"] == 'create')
{ {
print "<form action=\"fiche.php\" method=\"post\">\n"; print "<form action=\"fiche.php\" method=\"post\">\n";
@ -139,7 +137,8 @@ if ($_GET["action"] == 'create')
print '<input type="hidden" name="type" value="'.$type.'">'."\n"; print '<input type="hidden" name="type" value="'.$type.'">'."\n";
print_titre($langs->trans("NewWarehouse")); print_titre($langs->trans("NewWarehouse"));
if ($mesg) { if ($mesg)
{
print $mesg; print $mesg;
} }
@ -156,7 +155,7 @@ if ($_GET["action"] == 'create')
{ {
// Editeur wysiwyg // Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('desc',$entrepot->description,200,'dolibarr_notes','In',false); $doleditor=new DolEditor('desc',$entrepot->description,180,'dolibarr_notes','In',false);
$doleditor->Create(); $doleditor->Create();
} }
else else
@ -176,7 +175,7 @@ if ($_GET["action"] == 'create')
$form->select_pays($entrepot->pays_id?$entrepot->pays_id:$mysoc->pays_code, 'pays_id'); $form->select_pays($entrepot->pays_id?$entrepot->pays_id:$mysoc->pays_code, 'pays_id');
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Status").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">';
print '<select name="statut">'; print '<select name="statut">';
print '<option value="0" selected="true">'.$langs->trans("WarehouseClosed").'</option>'; print '<option value="0" selected="true">'.$langs->trans("WarehouseClosed").'</option>';
print '<option value="1">'.$langs->trans("WarehouseOpened").'</option>'; print '<option value="1">'.$langs->trans("WarehouseOpened").'</option>';
@ -196,7 +195,7 @@ else
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
$result = $entrepot->fetch($_GET["id"]); $result = $entrepot->fetch($_GET["id"]);
if (! $result) if ($result < 0)
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
@ -217,6 +216,10 @@ else
$hselected=$h; $hselected=$h;
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/product/stock/mouvement.php?id='.$entrepot->id;
$head[$h][1] = $langs->trans("StockMovements");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id; $head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id;
$head[$h][1] = $langs->trans("Info"); $head[$h][1] = $langs->trans("Info");
$h++; $h++;
@ -244,7 +247,8 @@ else
print $entrepot->pays; print $entrepot->pays;
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>'; // Statut
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>';
print '<tr><td valign="top">'.$langs->trans("NumberOfProducts").'</td><td colspan="3">'; print '<tr><td valign="top">'.$langs->trans("NumberOfProducts").'</td><td colspan="3">';
print $entrepot->nb_products(); print $entrepot->nb_products();
@ -267,6 +271,7 @@ else
print '<tr><td valign="top"><a href="mouvement.php">'.$langs->trans("LastMovement").'</a></td><td colspan="3">'; print '<tr><td valign="top"><a href="mouvement.php">'.$langs->trans("LastMovement").'</a></td><td colspan="3">';
print dolibarr_print_date($row[0]); print dolibarr_print_date($row[0]);
print "</td></tr>"; print "</td></tr>";
print "</table>"; print "</table>";
print '</div>'; print '</div>';
@ -368,8 +373,6 @@ else
dolibarr_print_error($db); dolibarr_print_error($db);
} }
print "</table>\n"; print "</table>\n";
print "</div>\n";
} }
@ -397,7 +400,7 @@ else
{ {
// Editeur wysiwyg // Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('desc',$entrepot->description,200,'dolibarr_notes','In',false); $doleditor=new DolEditor('desc',$entrepot->description,180,'dolibarr_notes','In',false);
$doleditor->Create(); $doleditor->Create();
} }
else else

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,7 +17,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@ -53,6 +52,10 @@ $head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche.php?id='.$entrepot->id;
$head[$h][1] = $langs->trans("WarehouseCard"); $head[$h][1] = $langs->trans("WarehouseCard");
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/product/stock/mouvement.php?id='.$entrepot->id;
$head[$h][1] = $langs->trans("StockMovements");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id; $head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id;
$head[$h][1] = $langs->trans("Info"); $head[$h][1] = $langs->trans("Info");
$hselected=$h; $hselected=$h;

View File

@ -67,13 +67,61 @@ if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
if ($_GET["id"])
{
$entrepot = new Entrepot($db);
$result = $entrepot->fetch($_GET["id"]);
if ($result < 0)
{
dolibarr_print_error($db);
}
}
$i = 0; $i = 0;
$texte = $langs->trans("ListOfStockMovements"); $texte = $langs->trans("ListOfStockMovements");
llxHeader("","",$texte); llxHeader("","",$texte);
print_barre_liste($texte, $page, "mouvement.php", "&sref=$sref&snom=$snom", $sortfield, $sortorder,'',$num);
/*
* Affichage onglets
*/
if ($_GET["id"])
{
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche.php?id='.$entrepot->id;
$head[$h][1] = $langs->trans("WarehouseCard");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/stock/mouvement.php?id='.$entrepot->id;
$head[$h][1] = $langs->trans("StockMovements");
$hselected=$h;
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id;
$head[$h][1] = $langs->trans("Info");
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse").': '.$entrepot->libelle);
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'.$entrepot->libelle.'</td>';
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>';
// Statut
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>';
print "</table>";
print '</div>';
}
print_barre_liste($texte, $page, "mouvement.php", "&sref=$sref&snom=$snom", $sortfield, $sortorder,'',$num);
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Date"),"mouvement.php", "m.datem","","","",$sortfield); print_liste_field_titre($langs->trans("Date"),"mouvement.php", "m.datem","","","",$sortfield);