Fix: problem with create

This commit is contained in:
Regis Houssin 2011-05-09 07:42:16 +00:00
parent d6180592ca
commit 7416eeea9b
2 changed files with 10 additions and 17 deletions

View File

@ -839,7 +839,7 @@ class CommandeFournisseur extends Commande
$sql.= ", fk_statut"; $sql.= ", fk_statut";
$sql.= ", source"; $sql.= ", source";
$sql.= ", model_pdf"; $sql.= ", model_pdf";
$sql.= ", fk_mode_reglement"; //$sql.= ", fk_mode_reglement";
$sql.= ") "; $sql.= ") ";
$sql.= " VALUES ("; $sql.= " VALUES (";
$sql.= "''"; $sql.= "''";
@ -850,7 +850,7 @@ class CommandeFournisseur extends Commande
$sql.= ", 0"; $sql.= ", 0";
$sql.= ", 0"; $sql.= ", 0";
$sql.= ", '".$conf->global->COMMANDE_SUPPLIER_ADDON_PDF."'"; $sql.= ", '".$conf->global->COMMANDE_SUPPLIER_ADDON_PDF."'";
$sql.= ", ".$this->mode_reglement_id; //$sql.= ", ".$this->mode_reglement_id;
$sql.= ")"; $sql.= ")";
dol_syslog("CommandeFournisseur::Create sql=".$sql); dol_syslog("CommandeFournisseur::Create sql=".$sql);

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* *
@ -48,20 +48,17 @@ $langs->load('deliveries');
$langs->load('products'); $langs->load('products');
$langs->load('stocks'); $langs->load('stocks');
$comclientid = GETPOST("comid"); $id = GETPOST("id");
$socid = GETPOST("socid"); $ref = GETPOST("ref");
$action = GETPOST('action'); $action = GETPOST("action");
$comclientid = GETPOST("comid");
$socid = GETPOST("socid");
$projectid = GETPOST("projectid");
// Security check // Security check
$id = GETPOST("id");
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'commande_fournisseur', $id,''); $result = restrictedArea($user, 'commande_fournisseur', $id,'');
// Recuperation de l'id de projet
$projectid = 0;
if ($_GET["projectid"]) $projectid = $_GET["projectid"];
$mesg=''; $mesg='';
@ -576,8 +573,7 @@ if ($action == 'create')
} }
$id=$orderid; $id=$orderid;
$_GET['id']=$id;
$_REQUEST['id']=$id;
$db->commit(); $db->commit();
} }
else else
@ -797,9 +793,6 @@ $productstatic = new Product($db);
$now=dol_now(); $now=dol_now();
$id = $_REQUEST['id'];
$ref= $_REQUEST['ref'];
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
//if ($mesg) print $mesg.'<br>'; //if ($mesg) print $mesg.'<br>';