Gestion de la catégorie fournisseur

This commit is contained in:
Rodolphe Quiedeville 2006-12-06 15:25:13 +00:00
parent 1d36518df9
commit 50f0c86a44

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org> * Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
@ -71,11 +71,9 @@ if (!$user->rights->commercial->client->voir && $socid && !$user->societe_id > 0
if ( $db->num_rows() == 0) accessforbidden(); if ( $db->num_rows() == 0) accessforbidden();
} }
} }
// Initialisation de l'objet Societe
$soc = new Societe($db); $soc = new Societe($db);
/* /*
* Actions * Actions
*/ */
@ -125,6 +123,7 @@ if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"])
$soc->typent_id = $_POST["typent_id"]; $soc->typent_id = $_POST["typent_id"];
$soc->client = $_POST["client"]; $soc->client = $_POST["client"];
$soc->fournisseur = $_POST["fournisseur"]; $soc->fournisseur = $_POST["fournisseur"];
$soc->fournisseur_categorie = $_POST["fournisseur_categorie"];
if ($_POST["action"] == 'add') if ($_POST["action"] == 'add')
{ {
@ -207,6 +206,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
* Fiche societe en mode création * Fiche societe en mode création
*/ */
$soc->fournisseur=0; $soc->fournisseur=0;
$soc->fournisseur_categorie = 0;
if ($_GET["type"]=='f') { $soc->fournisseur=1; } if ($_GET["type"]=='f') { $soc->fournisseur=1; }
if ($_GET["type"]=='c') { $soc->client=1; } if ($_GET["type"]=='c') { $soc->client=1; }
if ($_GET["type"]=='p') { $soc->client=2; } if ($_GET["type"]=='p') { $soc->client=2; }
@ -296,13 +296,29 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
$form->selectyesnonum("fournisseur",$soc->fournisseur); $form->selectyesnonum("fournisseur",$soc->fournisseur);
print '</td>'; print '</td>';
print '<td>'.$langs->trans('SupplierCode').'</td><td>'; print '<td>'.$langs->trans('SupplierCode').'</td><td>';
print '<table class="noborder"><tr><td>'; //print '<table class="noborder"><tr><td>';
print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15"></td><td>'; print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">';
//print '</td><td>';
//print '<input type="image" name="getsuppliercode" value="1" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/refresh.png" class="noborder">'; //print '<input type="image" name="getsuppliercode" value="1" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/refresh.png" class="noborder">';
print '</td></tr></table>'; //print '</td></tr></table>';
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">'; if ($soc->fournisseur)
{
$load = $soc->LoadSupplierCateg();
if ( $load == 0)
{
if (sizeof($soc->SupplierCategories) > 0)
{
print '<tr>';
print '<td>'.$langs->trans('SupplierCategory').'</td><td colspan="3">';
$form->select_array("fournisseur_categorie",$soc->SupplierCategories);
print '</td></tr>';
}
}
}
print '<tr><td>'.$load.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">';
print $soc->adresse; print $soc->adresse;
print '</textarea></td></tr>'; print '</textarea></td></tr>';