From 95239fcd48882deec52b6300fdf6eefbf9a37955 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Aug 2005 03:02:34 +0000 Subject: [PATCH] Uniformisation lignes de commande, propal, facture --- htdocs/comm/propal.php | 2 +- htdocs/commande/fiche.php | 124 +++++++++++++++++++++----------------- 2 files changed, 70 insertions(+), 56 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 137ee743bbf..1d8ecc4f516 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -600,7 +600,7 @@ if ($_GET['propalid']) * Lignes de propale * */ - $sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice,"; + $sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice,'; $sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid'; $sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid'; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 2aa0c0249c6..6aa8f863637 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -622,68 +622,82 @@ else $objp = $db->fetch_object($resql); $var=!$var; - // Update ligne de propale - if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) - { - print ''; - if ($objp->fk_product > 0) - { - print ''; - if ($objp->fk_product_type) print img_object($langs->trans('ShowService'),'service'); - else print img_object($langs->trans('ShowProduct'),'product'); - print ' '.$objp->ref.' - '.stripslashes(nl2br($objp->product)); - print ($objp->description && $objp->description!=$objp->product)?'
'.$objp->description:''; - print ''; + // Affiche ligne de commande en mode non edit + if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) + { + print ''; + if ($objp->fk_product > 0) + { + print ''; + if ($objp->fk_product_type) print img_object($langs->trans('ShowService'),'service'); + else print img_object($langs->trans('ShowProduct'),'product'); + print ' '.$objp->ref.' - '.stripslashes(nl2br($objp->product)); + print ($objp->description && $objp->description!=$objp->product)?'
'.$objp->description:''; + print ''; + } + else + { + print ''.stripslashes(nl2br($objp->description)); + print "\n"; + } + print ''.$objp->tva_tx.'%'; + + print ''.price($objp->subprice)."\n"; + + print ''.$objp->qty.''; + + if ($objp->remise_percent > 0) + { + print ''.$objp->remise_percent."%\n"; + } + else + { + print ' '; + } + print ''.price($objp->subprice*$objp->qty*(100-$objp->remise_percent)/100)."\n"; + + // Icone d'edition et suppression + if ($commande->statut == 0 && $user->rights->commande->creer && $_GET["action"] == '') + { + print ''; + print img_edit(); + print ''; + print ''; + print img_delete(); + print ''; + } + else + { + print '  '; + } + print ''; } - else - { - print ''.stripslashes(nl2br($objp->description)); - print "\n"; - } - print ''.$objp->tva_tx.'%'; - - print ''.price($objp->subprice)."\n"; - - print ''.$objp->qty.''; - - if ($objp->remise_percent > 0) - { - print ''.$objp->remise_percent."%\n"; - } - else - { - print ' '; - } - print ''.price($objp->subprice*$objp->qty*(100-$objp->remise_percent)/100)."\n"; - - // Icone d'edition et suppression - if ($commande->statut == 0 && $user->rights->commande->creer && $_GET["action"] == '') - { - print ''; - print img_edit(); - print ''; - print ''; - print img_delete(); - print ''; - } - else - { - print '  '; - } - print ''; - } - // Update ligne de commande + // Affiche ligne de commande en mode non edit if ($_GET["action"] == 'editline' && $_GET["rowid"] == $objp->rowid) { print "
"; print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print '%'; + print ""; + print ''; + if ($objp->fk_product > 0) + { + print ''; + if ($objp->fk_product_type) print img_object($langs->trans('ShowService'),'service'); + else print img_object($langs->trans('ShowProduct'),'product'); + print ' '.$objp->ref.''; + print ' - '.stripslashes(nl2br($objp->product)); + print '
'; + } + print ''; + print ''; + //print $html->select_tva("tva_tx",$objp->tva_taux); + print $objp->tva_tx."%"; // Taux tva dépend du produit, donc on ne doit pas pouvoir le changer ici + print ''; + print ''; + print ''; + print '%'; print ''; print ''; print '
';