From 2ad207b6ac7d925a5b679b3ff343b1c22620a40a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Mar 2006 01:25:19 +0000 Subject: [PATCH] Look: Uniformisation look --- htdocs/fourn/commande/fiche.php | 16 +++++++++++----- htdocs/fourn/facture/fiche.php | 8 +++++++- htdocs/html.form.class.php | 17 +++++++++++++++-- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 174a61ec2a4..535af0d0e94 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * * This program is free software; you can redistribute it and/or modify @@ -244,16 +244,16 @@ if ($_GET["action"] == 'create') -llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur"); - -$html = new Form($db); - /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ +llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur"); + +$html = new Form($db); + if ($_GET["id"] > 0) { if ($mesg) print $mesg; @@ -578,6 +578,8 @@ if ($_GET["id"] > 0) print ""; } + + print '"; print '
'; /* @@ -613,6 +615,8 @@ if ($_GET["id"] > 0) $html->show_documents('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf); + print ''; + /* * * @@ -630,6 +634,7 @@ if ($_GET["id"] > 0) print "
'; } + /* * * @@ -661,6 +666,7 @@ if ($_GET["id"] > 0) print ''; print ''; } + /* * * diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 4497be16766..27445b8c8ba 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -289,7 +289,13 @@ if ($_GET['action'] == 'create' or $_GET['action'] == 'copy') print ''; print ''; print ''; - $html->select_tva('tauxtva'.$i,'', '',$mysoc); + $societe=''; + if ($_GET['socid']) + { + $societe=new Societe($db); + $societe->fetch($_GET['socid']); + } + $html->select_tva('tauxtva'.$i,'',$societe,$mysoc); print ''; print ''; } diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index af05cf60627..f8126eb5833 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1501,7 +1501,7 @@ class Form global $langs,$conf,$mysoc; //print $societe_vendeuse."-".$societe_acheteuse; - if (! $societe_vendeuse->pays_code) + if (is_object($societe_vendeuse) && ! $societe_vendeuse->pays_code) { if ($societe_vendeuse->id == $mysoc->id) { @@ -1514,10 +1514,19 @@ class Form return; } + if (is_object($societe_vendeuse->pays_code)) + { + $code_pays=$societe_vendeuse->pays_code; + } + else + { + $code_pays=$mysoc->pays_code; + } + // Recherche liste des codes TVA du pays vendeur $sql = "SELECT t.taux,t.recuperableonly"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva AS t"; - $sql .= " WHERE t.fk_pays = '".$societe_vendeuse->pays_code."'"; + $sql .= " WHERE t.fk_pays = '".$code_pays."'"; $sql .= " AND t.active = 1"; $sql .= " ORDER BY t.taux ASC, t.recuperableonly ASC"; @@ -1532,6 +1541,10 @@ class Form $libtva[ $i ] = $obj->taux.'%'.($obj->recuperableonly ? ' *':''); } } + else + { + print ''.$langs->trans("ErrorNoVATRateDefinedForSellerCountry").''; + } // Définition du taux à présélectionner if ($defaulttx == '') $defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$taux_produit);