--- dolibarrcvs/htdocs/soc.php 2005-09-07 17:52:00.000000000 -0400 +++ dolibarr/htdocs/soc.php 2005-09-12 13:06:44.000000000 -0400 @@ -219,9 +219,9 @@ // Client / Prospect print ''.$langs->trans('ProspectCustomer').''; print ''.$langs->trans('CustomerCode').''; print ''; @@ -357,9 +357,9 @@ // Client / Prospect print ''.$langs->trans('ProspectCustomer').''; print ''.$langs->trans('CustomerCode').''; if ($soc->codeclient_modifiable == 1) --- dolibarrcvs/htdocs/admin/facture.php 2005-08-23 17:52:39.000000000 -0400 +++ dolibarr/htdocs/admin/facture.php 2005-09-12 13:09:54.000000000 -0400 @@ -259,7 +259,7 @@ if ($facture_rib_number_var == $row[0]) { - print ''; + print ''; } else { @@ -297,7 +297,7 @@ if ($facture_chq_number_var == $row[0]) { - print ''; + print ''; } else { --- dolibarrcvs/htdocs/admin/ihm.php 2005-09-12 13:25:42.000000000 -0400 +++ dolibarr/htdocs/admin/ihm.php 2005-09-12 13:29:31.000000000 -0400 @@ -106,7 +106,7 @@ $filelib=eregi_replace('\.php$','',$file); if ($file == $conf->global->MAIN_MENU_BARRETOP) { - print ''; + print ''; } else { @@ -129,7 +129,7 @@ $filelib=eregi_replace('\.php$','',$file); if ($file == $conf->global->MAIN_MENU_BARRELEFT) { - print ''; + print ''; } else { --- dolibarrcvs/htdocs/admin/ldap.php 2005-08-10 17:38:01.000000000 -0400 +++ dolibarr/htdocs/admin/ldap.php 2005-09-12 13:09:21.000000000 -0400 @@ -301,11 +301,11 @@ print ''.$langs->trans("DNContactActive").''; if (defined("LDAP_SERVER_TYPE") && LDAP_SERVER_TYPE == activedirectory) { - print '"; } @@ -96,7 +96,7 @@ echo "\n"; } --- dolibarrcvs/htdocs/categories/edit.php 2005-04-13 08:23:42.000000000 -0400 +++ dolibarr/htdocs/categories/edit.php 2005-09-12 13:11:17.000000000 -0400 @@ -85,7 +85,7 @@ echo ""; } @@ -112,7 +112,7 @@ echo "\n"; } --- dolibarrcvs/htdocs/comm/addpropal.php 2005-09-06 18:53:42.000000000 -0400 +++ dolibarr/htdocs/comm/addpropal.php 2005-09-12 13:13:02.000000000 -0400 @@ -129,7 +129,7 @@ print '"; + $options = ''; while ($i < $num) { $obj = $db->fetch_object($result); --- dolibarrcvs/htdocs/compta/bank/ligne.php 2005-09-10 19:37:24.000000000 -0400 +++ dolibarr/htdocs/compta/bank/ligne.php 2005-09-12 13:13:45.000000000 -0400 @@ -131,7 +131,7 @@ $var=True; $num = $db->num_rows($result); $i = 0; - $options = ""; + $options = ''; while ($i < $num) { $obj = $db->fetch_object($result); --- dolibarrcvs/htdocs/compta/bank/search.php 2005-05-07 12:02:22.000000000 -0400 +++ dolibarr/htdocs/compta/bank/search.php 2005-09-12 13:14:27.000000000 -0400 @@ -112,7 +112,7 @@ $var=True; $num = $db->num_rows($result); $i = 0; - $options = ""; + $options = ''; while ($i < $num) { $obj = $db->fetch_object($result); $options .= "\n"; $i++; --- dolibarrcvs/htdocs/compta/facture.php 2005-09-10 19:37:24.000000000 -0400 +++ dolibarr/htdocs/compta/facture.php 2005-09-12 13:16:53.000000000 -0400 @@ -744,11 +744,11 @@ $html->select_produits('',"idprod$i"); print ''; print ''; - print '%'; + print '%'; print ' '; // Si le module service est actif, on propose des dates de début et fin à la ligne if ($conf->service->enabled) { - print ''; + print ''; print 'Du '; print $html->select_date('',"date_start$i",0,0,1); print '
au '; @@ -777,7 +777,7 @@ if ($num > 0) { print 'Factures récurrentes : '; print ''; - print ''; + print ''; print ''; print ''; --- dolibarrcvs/htdocs/contrat/fiche.php 2005-09-10 19:37:27.000000000 -0400 +++ dolibarr/htdocs/contrat/fiche.php 2005-09-12 13:17:44.000000000 -0400 @@ -345,7 +345,7 @@ $sql .= " ORDER BY p.nbvente DESC LIMIT 20"; if ( $db->query($sql) ) { - $opt = ""; + $opt = ''; if ($result) { $num = $db->num_rows(); $i = 0; --- dolibarrcvs/htdocs/fourn/facture/paiement.php 2005-08-01 10:52:42.000000000 -0400 +++ dolibarr/htdocs/fourn/facture/paiement.php 2005-09-12 13:18:09.000000000 -0400 @@ -178,7 +178,7 @@ print ''; $i++; --- dolibarrcvs/htdocs/fourn/facture/fiche.php 2005-08-14 00:16:02.000000000 -0400 +++ dolibarr/htdocs/fourn/facture/fiche.php 2005-09-12 13:23:53.000000000 -0400 @@ -115,10 +115,11 @@ $_POST["reday"], $_POST["reyear"]); - $tva = 0; - $tva = ($_POST["tva_taux"] * $_POST["amount"]) / 100 ; + $tva = (abs($_POST["tva_taux"]) * $_POST["amount"]) / 100 ; $remise = 0; - $total = $tva + $_POST["amount"] ; + $total = $_POST["amount"] ; + if ( (float)$_POST["tva_taux"] >= 0 ) + $total += $tva; $db->begin(); @@ -153,7 +154,11 @@ } else if (strlen($_POST[$label]) > 0 && empty($_POST[$amount])) { - $ht = $_POST[$amountttc] / (1 + ($_POST[$tauxtva] / 100)); + $ht = $_POST[$amountttc]; + if ( (float)$_POST[$tauxtva] >= 0 ) + { + $ht /= (1 + ($_POST[$tauxtva] / 100)); + } $atleastoneline=1; $ret=$facfou->addline($_POST[$label], $ht, $_POST[$tauxtva], $_POST[$qty], 1); if ($ret < 0) $nberror++; @@ -203,7 +208,9 @@ $facfou->addline($_POST["label"], $_POST["amount"], $_POST["tauxtva"], $_POST["qty"]); else { - $ht = $_POST['amountttc'] / (1 + ($_POST['tauxtva'] / 100)); + $ht = $_POST['amountttc']; + if ( (float)$_POST['tauxtva'] >= 0 ) + $ht /= (1 + ($_POST['tauxtva'] / 100)); $facfou->addline($_POST["label"], $ht, $_POST["tauxtva"], $_POST["qty"]); } $_GET["action"] = "edit"; @@ -259,7 +266,7 @@ if ($_GET["socid"] == $obj->idp) { - print '" selected>'.$obj->nom.''; + print '" selected="true">'.$obj->nom.''; } else { @@ -420,7 +427,7 @@ { print "".''.$fac->lignes[$i][0].""; print ''.price($fac->lignes[$i][1]).""; - print ''.price($fac->lignes[$i][1] * (1+($fac->lignes[$i][2]/100))).""; + print ''.price($fac->lignes[$i][1] * (1+(($fac->lignes[$i][2] >=0 ? $fac->lignes[$i][2] : 0 )/100))).""; print ''.$fac->lignes[$i][3].""; print ''.price($fac->lignes[$i][4]).""; print ''.$fac->lignes[$i][2].""; --- dolibarrcvs/htdocs/lib/functions.inc.php 2005-09-12 00:26:16.000000000 -0400 +++ dolibarr/htdocs/lib/functions.inc.php 2005-09-12 13:20:01.000000000 -0400 @@ -1477,18 +1477,18 @@ function print_duree_select($prefix) { print ' H "; print '\n"; } @@ -1534,12 +1534,21 @@ */ function tva($euros, $taux=19.6) { - $taux = $taux / 100 ; + $taux = abs($taux) / 100 ; return sprintf("%01.2f",($euros * $taux)); } /** + * \brief met en forme la tva non perçue récupérable + * \param tva + * \return result + */ +function affiche_TVA($tva) { + return abs($tva).($tva < 0 ? MENTION_NPR : ''); +} + +/** \brief Fonction qui calcule le montant tva incluse \param euros somme en euro \param taux taux de tva --- dolibarrcvs/htdocs/product/fiche.php 2005-09-12 00:26:17.000000000 -0400 +++ dolibarr/htdocs/product/fiche.php 2005-09-12 13:21:21.000000000 -0400 @@ -104,7 +104,8 @@ { $product->ref = $_POST["ref"]; $product->libelle = $_POST["libelle"]; - $product->price = $_POST["price"]; + if ( isset( $_POST["price"] ) ) + $product->price = $_POST["price"]; $product->tva_tx = $_POST["tva_tx"]; $product->description = $_POST["desc"]; $product->note = $_POST["note"]; @@ -243,7 +244,7 @@ print ''.$langs->trans("Status").''; print ''; if ($product->envente) { - print ''; + print ''; print ''; } else { print ''; - print ''; + print ''; } print ''; if ($product->type == 0 && $conf->stock->enabled) --- dolibarrcvs/htdocs/product/stock/fiche.php 2005-08-13 11:44:43.000000000 -0400 +++ dolibarr/htdocs/product/stock/fiche.php 2005-09-12 13:21:01.000000000 -0400 @@ -155,7 +155,7 @@ print ''.$langs->trans("Status").''; print ''; @@ -314,8 +314,8 @@ print ''.$langs->trans("Status").''; print ''; print '';