diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php new file mode 100644 index 00000000000..a3775d12e46 --- /dev/null +++ b/htdocs/compta/tva/fiche.php @@ -0,0 +1,272 @@ + + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ +require("./pre.inc.php3"); +require("../../tva.class.php3"); + +$db = new Db(); +$mesg = ''; + +if ($HTTP_POST_VARS["action"] == 'add' && $HTTP_POST_VARS["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"] + ), + mktime(12,0,0, + $HTTP_POST_VARS["datepmonth"], + $HTTP_POST_VARS["datepday"], + $HTTP_POST_VARS["datepyear"] + ), + $HTTP_POST_VARS["amount"] + ); + Header ( "Location: reglement.php"); +} + +llxHeader(); + +/* + * + * + */ +$html = new Form($db); +if ($action == 'create') +{ + print "
\n"; + print ''; + + print '
Nouveau réglement TVA

'; + + print ''; + print ""; + print ''; + print ''; + print ''; + print ''; + print '
Date de paiement'; + print $html->select_date("","datev"); + print '
Date de valeur'; + print $html->select_date("","datep"); + print '
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"; + } +} + +/* ************************************************************************** */ +/* */ +/* Barre d'action */ +/* */ +/* ************************************************************************** */ + +print '
'; +print ''; +print ''; +print ''; + +if ($action == 'create') +{ + print ''; +} +else +{ + print ''; +} +print ''; +print '
----[Editer]-

'; + +if ($id && $action == '') +{ + + $htmls = new Form($db); + $propal = New Propal($db); + + print ''; + print ''; + print '
'; + print_titre("Ajouter ma proposition"); + print ''; + print_titre("Ajouter aux autres propositions"); + print '
'; + $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price - p.remise as price, p.ref,".$db->pdate("p.datep")." as dp"; + $sql .= " FROM llx_societe as s, llx_propal as p"; + $sql .=" WHERE p.fk_soc = s.idp AND p.fk_statut = 0 AND p.fk_user_author = ".$user->id; + $sql .= " ORDER BY p.datec DESC, tms DESC"; + + if ( $db->query($sql) ) + { + $num = $db->num_rows(); + $i = 0; + print ''; + + $var=True; + + while ($i < $num) + { + $objp = $db->fetch_object( $i); + + $var=!$var; + print ""; + print "\n"; + print "\n"; + + print "\n"; + + print ''; + print ''; + + print ""; + print ''; + + + print "\n"; + + $i++; + } + + print "
propalid\">$objp->refidp\">$objp->nom"; + + print strftime("%d %B %Y",$objp->dp)."
"; + print ''; + print ''; + print ''; + print ''; + print "
"; + $db->free(); + } + + print '
'; + + $otherprop = $propal->liste_array(1, '<>'.$user->id); + if (sizeof($otherprop)) + { + print '
'; + print ''; + print ''; + print ""; + print '
Autres Propositions"; + $htmls->select_array("propalid", $otherprop); + print ''; + print ''; + print ''; + print ''; + print "
'; + } + print '
'; +} + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?>