From 50f0c86a4474e985373be13c030d64e08c7ec9f0 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 6 Dec 2006 15:25:13 +0000 Subject: [PATCH] =?UTF-8?q?Gestion=20de=20la=20cat=E9gorie=20fournisseur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/soc.php | 60 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/htdocs/soc.php b/htdocs/soc.php index 43d3ee6f451..8cee95da1d8 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2006 Rodolphe Quiedeville * Copyright (C) 2003 Brian Fraval * Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2005 Eric Seigne @@ -24,10 +24,10 @@ */ /** - \file htdocs/soc.php - \ingroup societe - \brief Onglet societe d'une societe - \version $Revision$ + \file htdocs/soc.php + \ingroup societe + \brief Onglet societe d'une societe + \version $Revision$ */ require("pre.inc.php"); @@ -62,20 +62,18 @@ if ($user->societe_id > 0) // Protection restriction commercial if (!$user->rights->commercial->client->voir && $socid && !$user->societe_id > 0) { - $sql = "SELECT sc.fk_soc"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE sc.fk_soc = ".$socid." AND sc.fk_user = ".$user->id; - - if ( $db->query($sql) ) - { - if ( $db->num_rows() == 0) accessforbidden(); - } + $sql = "SELECT sc.fk_soc"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE sc.fk_soc = ".$socid." AND sc.fk_user = ".$user->id; + + if ( $db->query($sql) ) + { + if ( $db->num_rows() == 0) accessforbidden(); + } } - +// Initialisation de l'objet Societe $soc = new Societe($db); - - /* * Actions */ @@ -125,6 +123,7 @@ if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"]) $soc->typent_id = $_POST["typent_id"]; $soc->client = $_POST["client"]; $soc->fournisseur = $_POST["fournisseur"]; + $soc->fournisseur_categorie = $_POST["fournisseur_categorie"]; if ($_POST["action"] == 'add') { @@ -207,6 +206,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || * Fiche societe en mode création */ $soc->fournisseur=0; + $soc->fournisseur_categorie = 0; if ($_GET["type"]=='f') { $soc->fournisseur=1; } if ($_GET["type"]=='c') { $soc->client=1; } if ($_GET["type"]=='p') { $soc->client=2; } @@ -232,8 +232,8 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || $soc->ape=$_POST["ape"]; $soc->typent_id=$_POST["typent_id"]; $soc->effectif_id=$_POST["effectif_id"]; - - $soc->tva_assuj = $_POST["assujtva_value"]; + + $soc->tva_assuj = $_POST["assujtva_value"]; $soc->tva_intra_code=$_POST["tva_intra_code"]; $soc->tva_intra_num=$_POST["tva_intra_num"]; } @@ -296,13 +296,29 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || $form->selectyesnonum("fournisseur",$soc->fournisseur); print ''; print ''.$langs->trans('SupplierCode').''; - print '
'; - print ''; + //print '
'; + print ''; + //print ''; //print ''; - print '
'; + //print '
'; print ''; - print ''.$langs->trans('Address').'';