héhé moi aussi je vais être confronté à ce problème donc voila ce que j'ai prévu de faire :
modifier le fichier client/pdf/modeles/facture.php et je vais commenter tout ce qui est en rapport avec le calcul de tva et l'affichage de cette même tva.
function creer($ref){
global $pdf, $client, $commande;
if(!isset($mht)) $mht="";
$commande = new Commande();
$commande->charger_ref($ref);
$client = new Client();
$client->charger_id($commande->client);
$pdf= new fpdi();
$pdf->SetAutoPageBreak(false);
if($commande->lang)
$lang=$commande->lang;
else $lang="1";
$pagecount = $pdf->setSourceFile("../pdf/doc/fpagesimple" . $lang . ".pdf");
$pagesimple = $pdf->ImportPage(1);
$pagecount = $pdf->setSourceFile("../pdf/doc/fpagecomplete" . $lang . ".pdf");
$tplidx = $pdf->ImportPage(1);
$nbpage = $this->comptPage();
$pdf->addPage();
if($nbpage == 1)
$pdf->useTemplate($tplidx);
else $pdf->useTemplate($pagesimple);
$istva = $this->entete();
$venteprod = new Venteprod();
$query = "select * from $venteprod->table where commande='$commande->id' order by tva desc";
$resul = mysql_query($query, $venteprod->link);
$hauteur = 85;
$page = 1;
while($row = mysql_fetch_object($resul)){
$venteprod->charger($row->id);
$pdf->SetFont('Arial','',8);
$pdf->SetXY(12,$hauteur);
$pdf->write(5,$venteprod->ref);
$produit = new Produit();
$produit->charger($venteprod->ref);
$produitdesc = new Produitdesc();
$hauteursave = $hauteur;
$pdf->SetFont('Arial','',8);
$pdf->SetXY(42,$hauteursave);
$chapo = $venteprod->titre;
$chapo = ereg_replace("<br/>", "\n", $chapo);
$pdf->SetXY(42,$hauteursave);
$pdf->MultiCell(60, 5, $chapo, 0, "L");
$recy = $pdf->getY();
$pdf->SetFont('Arial','',8);
$pdf->SetXY(167,$hauteursave);
if($istva)
$pdf->write(5,round($venteprod->tva, 2));
else
$pdf->write(5,"N/A");
$pdf->SetXY(125,$hauteursave);
/* if($istva)
$pdf->write(5,round($venteprod->prixu/($venteprod->tva/100+1), 2));
else*/
$pdf->write(5,round($venteprod->prixu, 2));
$pdf->SetXY(148,$hauteursave);
/* if($istva)
$pdf->write(5,round($venteprod->prixu/($venteprod->tva/100+1), 2) * $venteprod->quantite);
else*/
$pdf->write(5,round($venteprod->prixu * $venteprod->quantite, 2));
$pdf->SetFont('Arial','',8);
$pdf->SetXY(110,$hauteursave);
$pdf->write(5,$venteprod->quantite);
$pdf->SetFont('Arial','',8);
$pdf->SetXY(184,$hauteursave);
$pdf->write(5, round($venteprod->quantite*$venteprod->prixu, 2));
$hauteur=$recy + 5;
if($hauteur > 220){
$hauteur = 85;
$hauteursave=$hauteur;
$pdf->addpage();
$page++;
if($nbpage != $page)
$pdf->useTemplate($pagesimple);
else $pdf->useTemplate($tplidx);
$this->entete();
}
}
$hauteur+=5;
$venteprod = new Venteprod();
$query2 = "SELECT sum(prixu*quantite) as total FROM $venteprod->table where commande='$commande->id'";
$resul2 = mysql_query($query2, $venteprod->link);
$total = mysql_result($resul2, 0, "total");
$modules = new Modules();
$modules->charger_id($commande->paiement);
$pourcremise = $commande->remise / $total * 100;
$total += $commande->port;
$total = round($total, 2);
/* 19, 6 %
$query2 = "SELECT sum(prixu*quantite) as total FROM $venteprod->table where commande='$commande->id' and tva like '19.6'";
$resul2 = mysql_query($query2, $venteprod->link);
$total19 = mysql_result($resul2, 0, "total")/1.196;
$tva19=$total19*19.6/100;
$pdf->SetFont('Arial','',8);
$pdf->SetXY(179,237.5);
if($istva)
$pdf->write(10, round($total19 - $total19 * $pourcremise / 100,2));
else
$pdf->write(10, "N/A");
$pdf->SetFont('Arial','',8);
$pdf->SetXY(179,242.5);
if($istva)
$pdf->write(10, round($tva19 - $tva19 * $pourcremise / 100, 2));
else
$pdf->write(10, "N/A");
5, 5 %
$query2 = "SELECT sum(prixu*quantite) as total FROM $venteprod->table where commande='$commande->id' and tva like '5.5'";
$resul2 = mysql_query($query2, $venteprod->link);
$total5 = mysql_result($resul2, 0, "total")/1.055;
$tva5=$total5*5.5/100;
$pdf->SetFont('Arial','',8);
$pdf->SetXY(179,247.5);
if($istva)
$pdf->write(10, round($total5 - $total5 * $pourcremise / 100,2));
else
$pdf->write(10, "N/A");
$pdf->SetFont('Arial','',8);
$pdf->SetXY(179,252.5);
if($istva)
$pdf->write(10, round($tva5 - $tva5 * $pourcremise / 100, 2));
else
$pdf->write(10, "N/A");
2, 1 %
$query2 = "SELECT sum(prixu*quantite) as total FROM $venteprod->table where commande='$commande->id' and tva like '2.1'";
$resul2 = mysql_query($query2, $venteprod->link);
$total2 = mysql_result($resul2, 0, "total")/1.021;
$tva2=$total2*2.1/100;
$pdf->SetFont('Arial','',8);
$pdf->SetXY(179,257.5);
if($istva)
$pdf->write(10, round($total2 - $total2 * $pourcremise / 100,2));
else
$pdf->write(10, "N/A");
$pdf->SetFont('Arial','',8);
$pdf->SetXY(179,262.5);
if($istva)
$pdf->write(10, round($tva2 - $tva2 * $pourcremise/100, 2));
else
$pdf->write(10, "N/A");*/
$pdf->SetFont('Arial','',8);
$pdf->SetXY(179,232.5);
$pdf->write(10, round($pourcremise, 2) . " %");
$mht = round($mht, 2);
$pdf->SetXY(179,270);
$pdf->write(5,round($commande->port, 2));
$pdf->SetFont('Arial','',8);
$devise = new Devise();
$devise->charger($commande->devise);
$pdf->SetFont('Arial','',8);
$pdf->SetXY(179,272.5);
$pdf->write(10,$total-$commande->remise . " " . $devise->symbole);
$nom = $modules->nom;
$nom[0] = strtoupper($nom[0]);
include_once("../../client/plugins/" . $modules->nom . "/$nom.class.php");
$tmpobj = new $nom();
$pdf->SetFont('Arial','',8);
$pdf->SetXY(47,241);
$pdf->write(10, $tmpobj->getTitre());
$modules = new Modules();
$modules->charger_id($commande->transport);
$nom = $modules->nom;
$nom[0] = strtoupper($nom[0]);
include_once("../../client/plugins/" . $modules->nom . "/$nom.class.php");
$tmpobj = new $nom();
$pdf->SetFont('Arial','',8);
$pdf->SetXY(47,248);
$pdf->write(10, $tmpobj->getTitre());
$pdf->Output("facture" . $commande->facture . ".pdf","I");
$pdf->closeParsers();
}
je ne l'ai pas testé mais ca devrait le faire.
Après il faut que tu modifies le fichier pdf (dans le répertoire doc) et enlever toutes les mentions à la tva et rajouter la phrase "non soumis à la tva etc"