From feebc9f134888cdc7f9601712f97b9f5b58e771f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2005 21:56:05 +0000 Subject: [PATCH] =?UTF-8?q?Look:=20Modif=20esth=E9tiques=20mineures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/fourn/commande/fiche.php | 161 +++++++++++++++--------------- htdocs/fourn/commande/history.php | 105 ++++++++++--------- htdocs/fourn/commande/liste.php | 104 ++++++++++--------- htdocs/fourn/commande/note.php | 11 +- 4 files changed, 194 insertions(+), 187 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 78401267feb..a382568a81d 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -19,14 +19,13 @@ * * $Id$ * $Source$ - * */ /** - \file htdocs/fourn/commande/fiche.php - \ingroup commande - \brief Fiche commande - \version $Revision$ + \file htdocs/fourn/commande/fiche.php + \ingroup commande + \brief Fiche commande + \version $Revision$ */ require("./pre.inc.php"); @@ -36,14 +35,13 @@ if (!$user->rights->fournisseur->commande->lire) accessforbidden(); require_once(DOL_DOCUMENT_ROOT."/project.class.php"); require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); -/* - * Sécurité accés client - */ +// Sécurité accés client if ($user->societe_id > 0) { $action = ''; $socidp = $user->societe_id; } + /* * */ @@ -63,10 +61,6 @@ if ($_GET["action"] == 'pdf') $commande->generate_pdf(); } -/* - * - */ - if ($_POST["action"] == 'setremise' && $user->rights->commande->creer) { $commande = new CommandeFournisseur($db); @@ -74,6 +68,7 @@ if ($_POST["action"] == 'setremise' && $user->rights->commande->creer) $commande->set_remise($user, $_POST["remise"]); } + /* * */ @@ -100,7 +95,7 @@ if ($_POST["action"] == 'addligne' && $user->rights->fournisseur->commande->cree 0, $_POST["remise_percent"]); } - Header("Location: fiche.php?id=".$_GET["id"]); + Header("Location: fiche.php?id=".$_GET["id"]); } if ($_POST["action"] == 'updateligne' && $user->rights->commande->creer) @@ -206,6 +201,8 @@ if ($_GET["action"] == 'create') } } + + llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur"); $html = new Form($db); @@ -319,7 +316,7 @@ if ($_GET["id"] > 0) if ($commande->date_commande) { - print strftime("%A %d %B %Y",$commande->date_commande)."\n"; + print dolibarr_print_date($commande->date_commande,"%A %d %B %Y")."\n"; } print ''; @@ -337,16 +334,16 @@ if ($_GET["id"] > 0) // Ligne de 3 colonnes print ''.$langs->trans("AmountHT").''; print ''.price($commande->total_ht).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; - print ''.$langs->trans("VAT").''.price($commande->total_tva).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->monnaie).' '; + print ''.$langs->trans("VAT").''.price($commande->total_tva).''; + print ''.$langs->trans("Currency".$conf->monnaie).' '; print ''.$langs->trans("TotalTTC").''.price($commande->total_ttc).''; print ''.$langs->trans("Currency".$conf->monnaie).' '; if ($commande->note) { - print 'Note'.nl2br($commande->note).""; + print ''.$langs->trans("Note").''.nl2br($commande->note).""; } print ""; @@ -355,7 +352,7 @@ if ($_GET["id"] > 0) * Lignes de commandes * */ - echo '
'; + print '
'; $sql = "SELECT l.ref, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l "; @@ -364,7 +361,7 @@ if ($_GET["id"] > 0) $resql = $db->query($sql); if ($resql) { - $num_lignes = $db->num_rows(); + $num_lignes = $db->num_rows($resql); $i = 0; $total = 0; if ($num_lignes) @@ -382,7 +379,7 @@ if ($_GET["id"] > 0) $var=True; while ($i < $num_lignes) { - $objp = $db->fetch_object(); + $objp = $db->fetch_object($resql); print ""; print "\n"; if ($objp->fk_product > 0) @@ -392,10 +389,10 @@ if ($_GET["id"] > 0) } else { - print "\n"; + print "\n"; } - print ''; - print ''; + print ''; + print ''; if ($objp->remise_percent > 0) { print '\n"; @@ -445,35 +442,35 @@ if ($_GET["id"] > 0) * Ajouter une ligne * */ - if ($_GET["action"] <> 'valid' && $commande->statut == 0 && $user->rights->fournisseur->commande->creer) - { - $sql = "SELECT p.rowid,p.label,p.ref "; - $sql .=" , (pf.price / pf.quantity) as priceunit"; - $sql .= " FROM ".MAIN_DB_PREFIX."product as p "; - $sql .= " , ".MAIN_DB_PREFIX."product_fournisseur_price as pf "; - $sql .= " WHERE p.rowid = pf.fk_product AND pf.fk_soc = ".$commande->fourn_id; - $sql .= " ORDER BY p.ref "; - $resql = $db->query($sql); - if ($resql) - { - $opt = ''; - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) - { - $objp = $db->fetch_object($resql); - $opt .= "\n"; - $i++; - } - } - $db->free($resql); - } - else - { - print $db->error(); - } + if ($_GET["action"] <> 'valid' && $commande->statut == 0 && $user->rights->fournisseur->commande->creer) + { + $sql = "SELECT p.rowid,p.label,p.ref "; + $sql .=" , (pf.price / pf.quantity) as priceunit"; + $sql .= " FROM ".MAIN_DB_PREFIX."product as p "; + $sql .= " , ".MAIN_DB_PREFIX."product_fournisseur_price as pf "; + $sql .= " WHERE p.rowid = pf.fk_product AND pf.fk_soc = ".$commande->fourn_id; + $sql .= " ORDER BY p.ref "; + $resql = $db->query($sql); + if ($resql) + { + $opt = ''; + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $objp = $db->fetch_object($resql); + $opt .= "\n"; + $i++; + } + } + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } print ''; print ''; @@ -496,6 +493,7 @@ if ($_GET["id"] > 0) print ""; } + print "
".$objp->ref."".stripslashes(nl2br($objp->description))."".stripslashes(nl2br($objp->description))."'.$objp->tva_tx.' %'.$objp->qty.''.$objp->tva_tx.'%'.$objp->qty.''.$objp->remise_percent." %

"; /* * Fin Ajout ligne @@ -549,38 +547,39 @@ if ($_GET["id"] > 0) print ""; } - print "

\n"; - /* - * Documents générés - * - */ - $file = $conf->commande->dir_output . "/" . $commande->ref . "/" . $commande->ref . ".pdf"; - $relativepath=$commande->ref . "/" . $commande->ref . ".pdf"; - - $var=true; - - if (file_exists($file)) - { - print_titre($langs->trans("Documents")); - print ''; - - print ""; - print ''; - print ''; - print ''; - print ''; - - print "
".$langs->trans("Order")." PDF'.$commande->ref.'.pdf'.filesize($file). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'
\n"; - print ''; - } + /* + * Documents générés + * + */ + $file = $conf->commande->dir_output . "/" . $commande->ref . "/" . $commande->ref . ".pdf"; + $relativepath=$commande->ref . "/" . $commande->ref . ".pdf"; + + $var=true; + + if (file_exists($file)) + { + print_titre($langs->trans("Documents")); + print ''; + + print ""; + print ''; + print ''; + print ''; + print ''; + + print "
".$langs->trans("Order")." PDF'.$commande->ref.'.pdf'.filesize($file). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'
\n"; + + print ''; + } + /* * * */ if ($_GET["action"] == 'classer') { - print '

'; + print ''; print ''; print ''; print '
Projet'; @@ -603,7 +602,7 @@ if ($_GET["id"] > 0) $form = new Form($db); print ''; - print ''; + print '
'; print ''; print '"; + + print '\n"; + + print '\n"; + + print ''; + + print ""; + + + $i++; + $var=!$var; + } + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } + + print "
Commander
Date commande'; print $form->select_date(); @@ -634,7 +633,7 @@ if ($_GET["id"] > 0) print ''; print ''; - print ''; + print '
'; print ''; print ''; - print '\n"; + print '\n"; print '"; } @@ -108,55 +106,56 @@ if ($_GET["id"] > 0) print ''; print "
Réceptionner
Date de livraison'; print $form->select_date(); @@ -664,5 +663,5 @@ if ($_GET["id"] > 0) $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/fourn/commande/history.php b/htdocs/fourn/commande/history.php index 5c43d4710bc..2cdc2d38f19 100644 --- a/htdocs/fourn/commande/history.php +++ b/htdocs/fourn/commande/history.php @@ -18,14 +18,13 @@ * * $Id$ * $Source$ - * */ -/*! - \file htdocs/fourn/commande/history.php - \ingroup commande - \brief Fiche commande - \version $Revision$ +/** + \file htdocs/fourn/commande/history.php + \ingroup commande + \brief Fiche commande + \version $Revision$ */ require("./pre.inc.php"); @@ -37,9 +36,7 @@ $langs->load("companies"); $user->getrights('fournisseur'); if (!$user->rights->fournisseur->commande->lire) accessforbidden(); -/* - * - */ + /* *************************************************************************** */ /* */ @@ -81,6 +78,7 @@ if ($_GET["id"] > 0) $h++; dolibarr_fiche_head($head, $a, $soc->nom); + /* * Commande @@ -99,7 +97,7 @@ if ($_GET["id"] > 0) if ($commande->methode_commande_id > 0) { print '
'.$langs->trans("Date").''.strftime("%A %e %B %Y",$commande->date_commande)."'.dolibarr_print_date($commande->date_commande,"%A %e %B %Y")." '; print "
 
\n"; + /* * Historique * */ - echo '
'; + echo '
'; - $sql = "SELECT l.fk_statut, ".$db->pdate("l.datelog") ."as dl, u.firstname, u.name"; - $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_log as l "; - $sql .= " , ".MAIN_DB_PREFIX."user as u "; - $sql .= " WHERE l.fk_commande = ".$commande->id." AND u.rowid = l.fk_user"; - $sql .= " ORDER BY l.rowid DESC"; - - $resql = $db->query($sql); + $sql = "SELECT l.fk_statut, ".$db->pdate("l.datelog") ."as dl, u.firstname, u.name"; + $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_log as l "; + $sql .= " , ".MAIN_DB_PREFIX."user as u "; + $sql .= " WHERE l.fk_commande = ".$commande->id." AND u.rowid = l.fk_user"; + $sql .= " ORDER BY l.rowid DESC"; + + $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - - $var=True; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - print ""; - - print '\n"; - - print '\n"; - - print ''; - - print ""; - - - $i++; - $var=!$var; - } - $db->free($resql); - } - else - { - print $db->error(); - } - - print "
'.strftime("%a %d %B %Y %H:%M:%S",$obj->dl)." '; - - print $commande->statuts[$obj->fk_statut]."'.$obj->firstname. " " . $obj->name.'
"; - print '
'; + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + + $var=True; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + print "
'.strftime("%a %d %B %Y %H:%M:%S",$obj->dl)." '; + + print $commande->statuts[$obj->fk_statut]."'.$obj->firstname. " " . $obj->name.'
"; + print ''; } else { @@ -167,5 +166,5 @@ if ($_GET["id"] > 0) $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index 9e156dc2f17..bfb810cafb4 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -73,22 +72,22 @@ $sql .= " WHERE cf.fk_soc = s.idp "; if ($socid) { - $sql .= " AND s.idp=$socid"; + $sql .= " AND s.idp=$socid"; } if (strlen($_GET["statut"])) { - $sql .= " AND fk_statut =".$_GET["statut"]; + $sql .= " AND fk_statut =".$_GET["statut"]; } if (strlen($_GET["search_ref"])) { - $sql .= " AND cf.ref LIKE '%".$_GET["search_ref"]."%'"; + $sql .= " AND cf.ref LIKE '%".$_GET["search_ref"]."%'"; } if (strlen($_GET["search_nom"])) { - $sql .= " AND s.nom LIKE '%".$_GET["search_nom"]."%'"; + $sql .= " AND s.nom LIKE '%".$_GET["search_nom"]."%'"; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); @@ -96,59 +95,70 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $ $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; - + $num = $db->num_rows($resql); + $i = 0; - print_barre_liste($title, $page, "liste.php", "", $sortfield, $sortorder, '', $num); - print ''; - print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref"); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom"); - print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"dc"); - print "\n"; + print_barre_liste($title, $page, "liste.php", "", $sortfield, $sortorder, '', $num); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print '
'; + print ''; + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref"); + print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom"); + print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"dc","","",'align="center"'); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cf.fk_statut","","",'align="center"'); + print "\n"; - $var=true; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - while ($i < min($num,$conf->liste_limit)) + $var=true; + + while ($i < min($num,$conf->liste_limit)) { - $obj = $db->fetch_object($resql); - $var=!$var; + $obj = $db->fetch_object($resql); + $var=!$var; - print ""; - print ''."\n"; - print ''."\n"; + print ""; - print "'; - print "\n"; - $i++; + // Ref + print ''."\n"; + + // Société + print ''."\n"; + + // Date + print "'; + + // Statut + print ''; + + print "\n"; + $i++; } - print "
'; + print ''; + print '
'; - print ' '.$obj->ref.''.img_object($langs->trans("ShowCompany"),"company").' '; - print $obj->nom.'
"; - if ($obj->dc) - { - print dolibarr_print_date($obj->dc,"%e %b %Y"); - } - else - { - print "-"; - } - print '
'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.''.img_object($langs->trans("ShowCompany"),"company").' '; + print $obj->nom.'"; + if ($obj->dc) + { + print dolibarr_print_date($obj->dc,"%e %b %Y"); + } + else + { + print "-"; + } + print '
"; - $db->free($resql); + print "
"; + $db->free($resql); } -else +else { - dolibarr_print_error($db); + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 1150433b8be..bc4c899d50e 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -133,12 +132,12 @@ if ($_GET["id"] > 0) print ''.$langs->trans("AmountHT").''; print ''.price($commande->total_ht).''; print ''.$langs->trans("Currency".$conf->monnaie).''; - print ' '; + print ' '; print ''.$langs->trans("VAT").''.price($commande->total_tva).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->monnaie).' '; print ''.$langs->trans("TotalTTC").''.price($commande->total_ttc).''; - print ''.$langs->trans("Currency".$conf->monnaie).''; + print ''.$langs->trans("Currency".$conf->monnaie).' '; if ($user->rights->fournisseur->commande->creer) @@ -151,7 +150,7 @@ if ($_GET["id"] > 0) print ''.$langs->trans("Note").''.nl2br($commande->note).""; } - print "
"; + print ""; } else { @@ -163,5 +162,5 @@ if ($_GET["id"] > 0) $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?>