From faa2d81a959f910462b07385fd2c4329892252b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Jun 2004 23:40:53 +0000 Subject: [PATCH] Modifications diverses et uniformisation du look et du code pour la partie TVA --- htdocs/compta/tva/fiche.php | 131 +++----------------------------- htdocs/compta/tva/index.php | 74 ++++++++++-------- htdocs/compta/tva/reglement.php | 26 ++++--- htdocs/tva.class.php | 1 + 4 files changed, 69 insertions(+), 163 deletions(-) diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index b961e0267fd..ae03fcc8b9f 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Laurent Destailleur * * 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 @@ -25,21 +26,21 @@ require("../../tva.class.php"); $mesg = ''; -if ($HTTP_POST_VARS["action"] == 'add' && $HTTP_POST_VARS["cancel"] <> 'Annuler') +if ($_POST["action"] == 'add' && $_POST["cancel"] <> 'Annuler') { $tva = new Tva($db); $tva->add_payement(mktime(12,0,0, - $HTTP_POST_VARS["datevmonth"], - $HTTP_POST_VARS["datevday"], - $HTTP_POST_VARS["datevyear"] + $_POST["datevmonth"], + $_POST["datevday"], + $_POST["datevyear"] ), mktime(12,0,0, - $HTTP_POST_VARS["datepmonth"], - $HTTP_POST_VARS["datepday"], - $HTTP_POST_VARS["datepyear"] + $_POST["datepmonth"], + $_POST["datepday"], + $_POST["datepyear"] ), - $HTTP_POST_VARS["amount"] + $_POST["amount"] ); Header ( "Location: reglement.php"); } @@ -58,7 +59,7 @@ if ($action == 'create') print '
Nouveau réglement TVA

'; - print ''; + print '
'; print ""; print ''; - print ''; + print ''; print ''; print '
Date de paiement'; print $html->select_date("","datev"); @@ -66,102 +67,13 @@ if ($action == 'create') print 'Date de valeur'; print $html->select_date("","datep"); print '
Montant
Montant
  '; print '
'; print ''; } -else -{ - if ($id) - { - $product = new Product($db); - $result = $product->fetch($id); - if ( $result ) - { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
Réf :  
Libellé :   
'; - - - print_fiche_titre('Fiche produit : '.$product->ref, $mesg); - - print ''; - print ""; - print ''; - print ''; - print ""; - print ''; - print ''; - print ''; - - print ''; - print ""; - print "
Référence'.$product->ref.''; - if ($product->envente) - { - print "En vente"; - } - else - { - print "Cet article n'est pas en vente"; - } - print '
Libellé$product->labelStatistiques
Prix'.price($product->price).''; - print "Propositions commerciales : ".$product->count_propale(); - print "
Proposé à ".$product->count_propale_client()." clients"; - print "
Factures : ".$product->count_facture(); - print '
Taux TVA'.$product->tva_tx.' %
Description".nl2br($product->description)."
"; - } - - if ($action == 'edit') - { - print '
Edition de la fiche produit : '.$product->ref.'

'; - - print "
\n"; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ""; - print ''; - print '
Référence
Libellé
Prix
Taux TVA'; - $html = new Form($db); - print $html->select_tva("tva_tx", $product->tva_tx); - print '
Statut'; - print '
Description"; - print '
  '; - print '
'; - print '
'; - } - } - else - { - print "Error"; - } -} /* ************************************************************************** */ /* */ @@ -169,27 +81,8 @@ else /* */ /* ************************************************************************** */ -print '
'; -print ''; -print ''; -print ''; +// Aucune action -if ($action == 'create') -{ - print ''; -} -else -{ - print ''; -} -print ''; -print '
----[Editer]-

'; - -if ($id && $action == '') -{ - - -} $db->close(); diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index e6f8c88cb71..c23de29d73a 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -1,6 +1,7 @@ - * Copyright (C) 2004 Éric Seigne + * Copyright (C) 2004 Éric Seigne + * Copyright (C) 2004 Laurent Destailleur * * 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 @@ -66,28 +67,28 @@ function pt ($db, $sql, $date) { $num = $db->num_rows(); $i = 0; $total = 0 ; - print "

"; - print ""; - print ""; - print ""; + print "
$dateMontant
"; + print ""; + print ""; + print ""; print "\n"; - print "\n"; + print "\n"; $var=True; while ($i < $num) { $obj = $db->fetch_object( $i); $var=!$var; - print ""; - print "\n"; + print ""; + print "\n"; $total = $total + $obj->amount; - print "\n"; - print "\n"; + print "\n"; + print "\n"; $i++; } print ""; - print "
$dateMontant 
$obj->dm
$obj->dm".price($obj->amount)."".$total."
".price($obj->amount)."".$total."
Total :".price($total)."euros HT
"; + print ""; $db->free(); } else { print $db->error(); @@ -111,41 +112,49 @@ if ($year == 0 ) { $year_start = $year; } -$textprevyear="Année précédente (" . ($year_current-1) . ")"; +$textprevyear="".img_previous().""; // On n'affiche pas "Année suivante" si c'est dans le futur ! -if(($year < strftime("%Y",time())) && ($year != 0)) - $textnextyear=" - Année suivante (" . ($year_current+1) . ")"; -print_titre( "
TVA Solde : " . price($tva->solde($year)) . " euros $textprevyear $textnextyear
"); +if(($year < strftime("%Y",time())) && ($year != 0)) { + $textnextyear=" ".img_next().""; +} + +print_fiche_titre("TVA Solde : ".price($tva->solde($year_start)),"$textprevyear Année $year_start $textnextyear"); + echo ''; -echo ''; -echo ''; +echo ''; +print_fiche_titre("TVA réglée"); +//echo ''; +echo ''; for ($y = $year_current ; $y >= $year_start ; $y=$y-1 ) { echo '
TVA collectéeTva Réglée
'; +print_fiche_titre("TVA collectée"); +echo ''; +//TVA collectéeTva Réglée
'; - print "

"; - print ""; - print ""; - print ""; - print ""; + print "
Année $yCollectéePayée
"; + print ""; + print ""; + print ""; + print ""; print "\n"; print "\n"; - print "\n"; + print "\n"; $var=True; $total = 0; $subtotal = 0; $i=0; for ($m = 1 ; $m < 13 ; $m++ ) { $var=!$var; - print ""; - print ''; + print ""; + print ''; $x_coll = tva_coll($db, $y, $m); - print ""; + print ""; $x_paye = tva_paye($db, $y, $m); - print ""; + print ""; $diff = $x_coll - $x_paye; $total = $total + $diff; @@ -153,7 +162,7 @@ for ($y = $year_current ; $y >= $year_start ; $y=$y-1 ) { print "\n"; print "\n"; - print "\n"; + print "\n"; $i++; if ($i > 2) { @@ -164,16 +173,17 @@ for ($y = $year_current ; $y >= $year_start ; $y=$y-1 ) { } print ''; print "\n"; - print "
Année $yCollectéePayée  
'.strftime("%b %Y",mktime(0,0,0,$m,1,$y)).'
'.strftime("%b %Y",mktime(0,0,0,$m,1,$y)).'".price($x_coll)."".price($x_coll)."".price($x_paye)."".price($x_paye)."".price($diff)." 
Total :'.price($total).' 
"; + print "

"; + echo ''; + /* * Réglée */ - - print ""; - print "
"; +// print ""; +// print "
"; $sql = "SELECT amount, date_format(f.datev,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."tva as f WHERE f.datev >= '$y-01-01' AND f.datev <= '$y-12-31' "; diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index cf2c0522f21..a80dafa8bbe 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Laurent Destailleur * * 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 @@ -32,7 +33,7 @@ $tva = new Tva($db); print_titre("Réglements TVA"); -$sql = "SELECT amount, date_format(f.datev,'%d-%M-%Y') as dm"; +$sql = "SELECT amount, ".$db->pdate("f.datev")." as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."tva as f "; $sql .= " ORDER BY dm DESC"; @@ -42,30 +43,31 @@ if ($result) $num = $db->num_rows(); $i = 0; $total = 0 ; - print '
'; - print ''; - print ""; - print ""; + print '
'; + print '
DateMontant
'; + print ''; + print ""; + print ""; print "\n"; - print "\n"; - $var=True; + print "\n"; + $var=1; while ($i < $num) { $obj = $db->fetch_object( $i); $var=!$var; - print ""; - print "\n"; + print ""; + print "\n"; $total = $total + $obj->amount; - print ""; - print "\n"; + print ""; + print "\n"; $i++; } print ""; print ""; - print "
DateMontant 
$obj->dm
".dolibarr_print_date($obj->dm)."".price($obj->amount)." 
".price($obj->amount)." 
Total :".price($total)."euros HT
"; + print "
"; $db->free(); } else diff --git a/htdocs/tva.class.php b/htdocs/tva.class.php index 9acf3dbef5a..93457138b0d 100644 --- a/htdocs/tva.class.php +++ b/htdocs/tva.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Laurent Destailleur * * 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