From b5d0591f46582d44ff25955fa69daa1bb02ea656 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Apr 2005 23:47:25 +0000 Subject: [PATCH] =?UTF-8?q?Modifications=20esth=E9tiques=20mineures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture.php | 306 ++++++++++++++++++++------------------ 1 file changed, 160 insertions(+), 146 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 37a44c82097..1510ae0fda3 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -641,7 +641,7 @@ if ($_GET["action"] == 'create') { 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) { @@ -724,7 +724,7 @@ if ($_GET["action"] == 'create') print "[$objp->ref]\n"; print ''.$objp->product.''; print "".price($objp->price).""; - print ''.$objp->remise_percent.' %'; + print ''.$objp->remise_percent.'%'; print "".$objp->qty."\n"; $i++; } @@ -745,7 +745,7 @@ if ($_GET["action"] == 'create') print " \n"; print ''.$objp->product.''; print ''.price($objp->price).''; - print ''.$objp->remise_percent.' %'; + print ''.$objp->remise_percent.'%'; print "".$objp->qty."\n"; $i++; } @@ -788,7 +788,7 @@ if ($_GET["action"] == 'create') print "[$objp->ref]\n"; print ''.$objp->product.''; print ''.price($objp->subprice).''; - print ''.$objp->remise_percent.' %'; + print ''.$objp->remise_percent.'%'; print ''.$objp->qty.''; $i++; } @@ -987,11 +987,11 @@ else print '
'; print ''; print '% '; - print ''; + print ''; print '
'; } else { - print ''.$fac->remise_percent.' %'; + print ''.$fac->remise_percent.'%'; } print ''; @@ -1016,149 +1016,163 @@ else print "
"; - /* - * Lignes de factures - * - */ - $sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux"; - $sql .= " , l.remise_percent, l.subprice,"; - $sql .= $db->pdate("l.date_start")." as date_start"; - $sql .= " , ".$db->pdate("l.date_end")." as date_end, "; - $sql .= " p.fk_product_type"; - $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l "; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON l.fk_product=p.rowid"; - $sql .= " WHERE l.fk_facture = ".$fac->id; - $sql .= " ORDER BY l.rang ASC, l.rowid"; + /* + * Lignes de factures + * + */ + $sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux"; + $sql .= " , l.remise_percent, l.subprice,"; + $sql .= $db->pdate("l.date_start")." as date_start"; + $sql .= " , ".$db->pdate("l.date_end")." as date_end, "; + $sql .= " p.fk_product_type"; + $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l "; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON l.fk_product=p.rowid"; + $sql .= " WHERE l.fk_facture = ".$fac->id; + $sql .= " ORDER BY l.rang ASC, l.rowid"; + + $resql = $db->query($sql); + if ($resql) + { + $num_lignes = $db->num_rows($resql); + $i = 0; $total = 0; + + print ''; + if ($num_lignes) + { + print ""; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + } + $var=True; + while ($i < $num_lignes) + { + $objp = $db->fetch_object($resql); + $var=!$var; - $resql = $db->query($sql); - if ($resql) - { - $num_lignes = $db->num_rows($resql); - $i = 0; $total = 0; - - print '
'.$langs->trans("Description").''.$langs->trans("VAT").''.$langs->trans("PriceUHT").''.$langs->trans("Qty").''.$langs->trans("Discount").''.$langs->trans("AmountHT").' 
'; - if ($num_lignes) - { - print ""; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - } - $var=True; - while ($i < $num_lignes) - { - $objp = $db->fetch_object($resql); - $var=!$var; - print ""; - if ($objp->fk_product > 0) - { - print ''; - } - else - { - print "\n"; - } + // Update ligne de facture + if ($_GET["action"] != 'editline' || $_GET["rowid"] != $objp->rowid) + { - print ''; - print '\n"; - print ''; - if ($objp->remise_percent > 0) - { - print '\n"; - } - else - { - print ''; - } - print '\n"; - - // Icone d'edition et suppression - if ($fac->statut == 0 && $user->rights->facture->creer) - { - print ''; - print ''; + print ""; + if ($objp->fk_product > 0) + { + print ''; + } + else + { + print "\n"; + } + + print ''; + print '\n"; + print ''; + if ($objp->remise_percent > 0) + { + print '\n"; + } + else + { + print ''; + } + print '\n"; + + // Icone d'edition et suppression + if ($fac->statut == 0 && $user->rights->facture->creer) + { + print ''; + print ''; + + print ''; + } + } + else + { + print ''; + } + print ""; + + } + + // Update ligne de facture + if ($_GET["action"] == 'editline' && $_GET["rowid"] == $objp->rowid) + { + print ''; + print ''; + print ''; + print ''; + print ""; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '' . "\n"; + if ($conf->service->enabled) + { + print ""; + print ''; + print '' . "\n"; + } + print "\n"; + } + + $total = $total + ($objp->qty * $objp->price); + $i++; + } + + $db->free(); + } + else + { + dolibarr_print_error($db); + } - print ''; - - } - else - { - print ''; - } - print ""; - - // Update ligne de facture - if ($_GET["action"] == 'editline' && $_GET["rowid"] == $objp->rowid) - { - print ''; - print ''; - print ''; - print ''; - print ""; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '' . "\n"; - if ($conf->service->enabled) - { - print ""; - print ''; - print '' . "\n"; - } - print "\n"; - } - - $total = $total + ($objp->qty * $objp->price); - $i++; - } - - $db->free(); - } - else - { - dolibarr_print_error($db); - } - /* * Ajouter une ligne * */ - if ($fac->statut == 0 && $user->rights->facture->creer && $_GET["action"] <> 'editline' && $_GET["action"] <> 'valid') + if ($fac->statut == 0 && $user->rights->facture->creer && $_GET["action"] <> 'valid') { print ""; @@ -1183,13 +1197,13 @@ else print ''; - print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; if ($conf->service->enabled) { print ''; - print '
'.$langs->trans("Description").''.$langs->trans("VAT").''.$langs->trans("PriceUHT").''.$langs->trans("Qty").''.$langs->trans("Discount").''.$langs->trans("AmountHT").' 
'; - if ($objp->fk_product_type) print img_object($langs->trans("ShowService"),"service"); - else print img_object($langs->trans("ShowProduct"),"product"); - print ' '.stripslashes(nl2br($objp->description)).''; - if ($objp->date_start && $objp->date_end) { print " (Du ".dolibarr_print_date($objp->date_start)." au ".dolibarr_print_date($objp->date_end).")"; } - if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dolibarr_print_date($objp->date_start).")"; } - if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dolibarr_print_date($objp->date_end).")"; } - print '".stripslashes(nl2br($objp->description)); - if ($objp->date_start && $objp->date_end) { print " (Du ".dolibarr_print_date($objp->date_start)." au ".dolibarr_print_date($objp->date_end).")"; } - if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dolibarr_print_date($objp->date_start).")"; } - if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dolibarr_print_date($objp->date_end).")"; } - print "'.$objp->tva_taux.'%'.price($objp->subprice)."'.$objp->qty.''.$objp->remise_percent." % '.price($objp->subprice*$objp->qty*(100-$objp->remise_percent)/100)."'; - print img_edit(); - print ''; - print img_delete(); - print '
'; + if ($objp->fk_product_type) print img_object($langs->trans("ShowService"),"service"); + else print img_object($langs->trans("ShowProduct"),"product"); + print ' '.stripslashes(nl2br($objp->description)).''; + if ($objp->date_start && $objp->date_end) { print " (Du ".dolibarr_print_date($objp->date_start)." au ".dolibarr_print_date($objp->date_end).")"; } + if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dolibarr_print_date($objp->date_start).")"; } + if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dolibarr_print_date($objp->date_end).")"; } + print '".stripslashes(nl2br($objp->description)); + if ($objp->date_start && $objp->date_end) { print " (Du ".dolibarr_print_date($objp->date_start)." au ".dolibarr_print_date($objp->date_end).")"; } + if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dolibarr_print_date($objp->date_start).")"; } + if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dolibarr_print_date($objp->date_end).")"; } + print "'.$objp->tva_taux.'%'.price($objp->subprice)."'.$objp->qty.''.$objp->remise_percent."% '.price($objp->subprice*$objp->qty*(100-$objp->remise_percent)/100)."'; + print img_edit(); + print ''; + print img_delete(); + print ''; + if ($i > 0) + { + print ''; + print img_up(); + print ''; + } + if ($i < $num_lignes-1) + { + print ''; + print img_down(); + print ' 
'; + //print $html->select_tva("tva_tx",$objp->tva_taux); + print $objp->tva_taux."%"; // Taux tva dépend du produit, donc on ne doit pas pouvoir le changer ici + print '%'; + print '
Si produit de type service à durée limitée: Du '; + print $html->select_date($objp->date_start,"date_start",0,0,$objp->date_start?0:1); + print ' au '; + print $html->select_date($objp->date_end,"date_end",0,0,$objp->date_end?0:1); + print '
'; - print ''; - print img_up(); - print ''; - print img_down(); - print ' 
'; - //print $html->select_tva("tva_tx",$objp->tva_taux); - print "$objp->tva_taux %"; // Taux tva dépend du produit, donc on ne doit pas pouvoir le changer ici - print ' %
Si produit de type service à durée limitée: Du '; - print $html->select_date($objp->date_start,"date_start",0,0,$objp->date_start?0:1); - print ' au '; - print $html->select_date($objp->date_end,"date_end",0,0,$objp->date_end?0:1); - print '
'; print $html->select_tva("tva_tx",$conf->defaulttx); print ' %
%
Si produit de type service à durée limitée: Du '; + print 'Si produit de type service à durée limitée: Du '; print $html->select_date('',"date_start",0,0,1); print ' au '; print $html->select_date('',"date_end",0,0,1);