Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-01-19 09:54:16 +01:00
commit 697f46b6b0
2 changed files with 26 additions and 18 deletions

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* *
* 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
@ -195,7 +195,7 @@ if ($action == 'addline' && $user->rights->contrat->creer)
$ret=$object->fetch($_GET["id"]); $ret=$object->fetch($_GET["id"]);
if ($ret < 0) if ($ret < 0)
{ {
dol_print_error($db,$commande->error); dol_print_error($db,$object->error);
exit; exit;
} }
$ret=$object->fetch_thirdparty(); $ret=$object->fetch_thirdparty();
@ -236,16 +236,16 @@ if ($action == 'addline' && $user->rights->contrat->creer)
$prod = new Product($db); $prod = new Product($db);
$prod->fetch($_POST['idprod']); $prod->fetch($_POST['idprod']);
$tva_tx = get_default_tva($mysoc,$object->client,$prod->id); $tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id);
$tva_npr = get_default_npr($mysoc,$object->client,$prod->id); $tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id);
// On defini prix unitaire // On defini prix unitaire
if ($conf->global->PRODUIT_MULTIPRICES && $object->client->price_level) if ($conf->global->PRODUIT_MULTIPRICES && $object->thirdparty->price_level)
{ {
$pu_ht = $prod->multiprices[$object->client->price_level]; $pu_ht = $prod->multiprices[$object->thirdparty->price_level];
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
$price_min = $prod->multiprices_min[$object->client->price_level]; $price_min = $prod->multiprices_min[$object->thirdparty->price_level];
$price_base_type = $prod->multiprices_base_type[$object->client->price_level]; $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
} }
else else
{ {
@ -282,8 +282,8 @@ if ($action == 'addline' && $user->rights->contrat->creer)
$desc=$_POST['desc']; $desc=$_POST['desc'];
} }
$localtax1_tx=get_localtax($tva_tx,1,$object->client); $localtax1_tx=get_localtax($tva_tx,1,$object->societe);
$localtax2_tx=get_localtax($tva_tx,2,$object->client); $localtax2_tx=get_localtax($tva_tx,2,$object->societe);
$info_bits=0; $info_bits=0;
if ($tva_npr) $info_bits |= 0x01; if ($tva_npr) $info_bits |= 0x01;
@ -342,6 +342,14 @@ if ($action == 'addline' && $user->rights->contrat->creer)
if ($action == 'updateligne' && $user->rights->contrat->creer && ! $_POST["cancel"]) if ($action == 'updateligne' && $user->rights->contrat->creer && ! $_POST["cancel"])
{ {
$ret=$object->fetch($_GET["id"]);
if ($ret < 0)
{
dol_print_error($db,$object->error);
exit;
}
$object->fetch_thirdparty();
$objectline = new ContratLigne($db); $objectline = new ContratLigne($db);
if ($objectline->fetch($_POST["elrowid"])) if ($objectline->fetch($_POST["elrowid"]))
{ {
@ -350,8 +358,8 @@ if ($action == 'updateligne' && $user->rights->contrat->creer && ! $_POST["cance
if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture; if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture;
if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture; if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture;
$localtax1_tx=get_localtax($_POST["eltva_tx"],1,$object->client); $localtax1_tx=get_localtax($_POST["eltva_tx"],1,$object->thirdparty);
$localtax2_tx=get_localtax($_POST["eltva_tx"],2,$object->client); $localtax2_tx=get_localtax($_POST["eltva_tx"],2,$object->thirdparty);
$objectline->description=$_POST["eldesc"]; $objectline->description=$_POST["eldesc"];
$objectline->price_ht=$_POST["elprice"]; $objectline->price_ht=$_POST["elprice"];

View File

@ -63,7 +63,7 @@ $_POST["cancel"] != $langs->trans("Cancel") &&
$current_lang = $langs->getDefaultLang(); $current_lang = $langs->getDefaultLang();
// update de l'objet // update de l'objet
if ( $_POST["lang"] == $current_lang ) if ( $_POST["translang"] == $current_lang )
{ {
$product->libelle = $_POST["libelle"]; $product->libelle = $_POST["libelle"];
$product->description = dol_htmlcleanlastbr($_POST["desc"]); $product->description = dol_htmlcleanlastbr($_POST["desc"]);
@ -71,9 +71,9 @@ $_POST["cancel"] != $langs->trans("Cancel") &&
} }
else else
{ {
$product->multilangs[$_POST["lang"]]["libelle"] = $_POST["libelle"]; $product->multilangs[$_POST["translang"]]["libelle"] = $_POST["libelle"];
$product->multilangs[$_POST["lang"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]); $product->multilangs[$_POST["translang"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
$product->multilangs[$_POST["lang"]]["note"] = dol_htmlcleanlastbr($_POST["note"]); $product->multilangs[$_POST["translang"]]["note"] = dol_htmlcleanlastbr($_POST["note"]);
} }
// sauvegarde en base // sauvegarde en base
@ -240,7 +240,7 @@ if ($_GET["action"] == 'add' && ($user->rights->produit->creer || $user->rights-
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Translation').'</td><td>'; print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Translation').'</td><td>';
print $formadmin->select_language('','lang',0,$product->multilangs); print $formadmin->select_language('','translang',0,$product->multilangs);
print '</td></tr>'; print '</td></tr>';
print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>'; print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
print '<tr><td valign="top" width="15%">'.$langs->trans('Description').'</td><td>'; print '<tr><td valign="top" width="15%">'.$langs->trans('Description').'</td><td>';