Look: Uniformisation look

This commit is contained in:
Laurent Destailleur 2006-03-16 01:25:19 +00:00
parent 993a141e51
commit 2ad207b6ac
3 changed files with 33 additions and 8 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 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>
* *
* This program is free software; you can redistribute it and/or modify * 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 */ /* Mode vue et edition */
/* */ /* */
/* *************************************************************************** */ /* *************************************************************************** */
llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur");
$html = new Form($db);
if ($_GET["id"] > 0) if ($_GET["id"] > 0)
{ {
if ($mesg) print $mesg; if ($mesg) print $mesg;
@ -578,6 +578,8 @@ if ($_GET["id"] > 0)
print "</div>"; print "</div>";
} }
print '<table width="100%"><tr><td width="50%" valign="top">'; print '<table width="100%"><tr><td width="50%" valign="top">';
/* /*
@ -613,6 +615,8 @@ if ($_GET["id"] > 0)
$html->show_documents('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf); $html->show_documents('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf);
print '</td><td width="50%" valign="top">';
/* /*
* *
* *
@ -630,6 +634,7 @@ if ($_GET["id"] > 0)
print "</td></tr>"; print "</td></tr>";
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Send").'"></td></tr></table></form>'; print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Send").'"></td></tr></table></form>';
} }
/* /*
* *
* *
@ -661,6 +666,7 @@ if ($_GET["id"] > 0)
print '</table>'; print '</table>';
print '</form>'; print '</form>';
} }
/* /*
* *
* *

View File

@ -289,7 +289,13 @@ if ($_GET['action'] == 'create' or $_GET['action'] == 'copy')
print '<td align="center"><input type="text" size="8" name="amount'.$i.'" value="'.$value_pu.'"></td>'; print '<td align="center"><input type="text" size="8" name="amount'.$i.'" value="'.$value_pu.'"></td>';
print '<td align="center"><input type="text" size="3" name="qty'.$i.'" value="'.$value_qty.'"></td>'; print '<td align="center"><input type="text" size="3" name="qty'.$i.'" value="'.$value_qty.'"></td>';
print '<td align="center">'; print '<td align="center">';
$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 '</td>'; print '</td>';
print '<td align="center"><input type="text" size="8" name="amountttc'.$i.'" value=""></td></tr>'; print '<td align="center"><input type="text" size="8" name="amountttc'.$i.'" value=""></td></tr>';
} }

View File

@ -1501,7 +1501,7 @@ class Form
global $langs,$conf,$mysoc; global $langs,$conf,$mysoc;
//print $societe_vendeuse."-".$societe_acheteuse; //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) if ($societe_vendeuse->id == $mysoc->id)
{ {
@ -1514,10 +1514,19 @@ class Form
return; 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 // Recherche liste des codes TVA du pays vendeur
$sql = "SELECT t.taux,t.recuperableonly"; $sql = "SELECT t.taux,t.recuperableonly";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva AS t"; $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 .= " AND t.active = 1";
$sql .= " ORDER BY t.taux ASC, t.recuperableonly ASC"; $sql .= " ORDER BY t.taux ASC, t.recuperableonly ASC";
@ -1532,6 +1541,10 @@ class Form
$libtva[ $i ] = $obj->taux.'%'.($obj->recuperableonly ? ' *':''); $libtva[ $i ] = $obj->taux.'%'.($obj->recuperableonly ? ' *':'');
} }
} }
else
{
print '<font class="error">'.$langs->trans("ErrorNoVATRateDefinedForSellerCountry").'</div>';
}
// Définition du taux à présélectionner // Définition du taux à présélectionner
if ($defaulttx == '') $defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$taux_produit); if ($defaulttx == '') $defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$taux_produit);