From 490aab2bfaf14b72302e4bcf35f231f515753085 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 4 Apr 2005 15:03:32 +0000 Subject: [PATCH] Gestion des notes --- htdocs/fourn/commande/fiche.php | 102 ++++++++++++++++---------------- 1 file changed, 50 insertions(+), 52 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index ee162e1f73f..e9a2f86ec4d 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2005 Rodolphe Quiedeville * Copyright (C) 2004-2005 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -22,10 +22,11 @@ */ /** - \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"); @@ -34,14 +35,12 @@ $langs->load("orders"); $langs->load("suppliers"); $langs->load("companies"); - $user->getrights('fournisseur'); -if (!$user->rights->fournisseur->commande->lire) - accessforbidden(); +if (!$user->rights->fournisseur->commande->lire) accessforbidden(); -require_once "../../project.class.php"; -require_once "../../propal.class.php"; +require_once DOL_DOCUMENT_ROOT."/project.class.php"; +require_once DOL_DOCUMENT_ROOT."/propal.class.php"; require_once DOL_DOCUMENT_ROOT."/fournisseur.class.php"; /* @@ -61,6 +60,15 @@ if ($_POST["action"] == 'classin') $commande->fetch($_GET["id"]); $commande->classin($_POST["projetid"]); } +/* + * + */ +if ($_GET["action"] == 'pdf') +{ + $commande = new CommandeFournisseur($db); + $commande->fetch($_GET["id"]); + $commande->generate_pdf(); +} /* * @@ -167,18 +175,11 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes && $user->r $commande->id = $_GET["id"]; $commande->delete(); Header("Location: index.php"); - } -if ($_GET["action"] == 'pdf') -{ - /* - * Generation de la commande - * définit dans /includes/modules/commande/modules_commande.php - */ - commande_pdf_create($db, $_GET["id"]); -} - +/* + * Créé une commande + */ if ($_GET["action"] == 'create') { @@ -194,22 +195,18 @@ if ($_GET["action"] == 'create') llxHeader('',$langs->trans("OrderCard"),"Commande"); - - $html = new Form($db); - /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ -$id = $_GET["id"]; -if ($id > 0) +if ($_GET["id"] > 0) { $commande = new CommandeFournisseur($db); - if ( $commande->fetch($id) == 0) + if ( $commande->fetch($_GET["id"]) == 0) { $soc = new Societe($db); $soc->fetch($commande->soc_id); @@ -223,6 +220,9 @@ if ($id > 0) $a = $h; $h++; + $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$commande->id; + $head[$h][1] = $langs->trans("Note"); + $h++; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/history.php?id='.$commande->id; $head[$h][1] = $langs->trans("History"); @@ -236,7 +236,7 @@ if ($id > 0) */ if ($_GET["action"] == 'delete') { - $html->form_confirm("fiche.php?id=$id","Supprimer la commande","Etes-vous sûr de vouloir supprimer cette commande ?","confirm_delete"); + $html->form_confirm("fiche.php?id=$commande->id","Supprimer la commande","Etes-vous sûr de vouloir supprimer cette commande ?","confirm_delete"); print '
'; } @@ -246,7 +246,7 @@ if ($id > 0) */ if ($_GET["action"] == 'valid') { - $html->form_confirm("fiche.php?id=$id","Valider la commande","Etes-vous sûr de vouloir valider cette commande ?","confirm_valid"); + $html->form_confirm("fiche.php?id=$commande->id","Valider la commande","Etes-vous sûr de vouloir valider cette commande ?","confirm_valid"); print '
'; } /* @@ -255,7 +255,7 @@ if ($id > 0) */ if ($_GET["action"] == 'approve') { - $html->form_confirm("fiche.php?id=$id","Approuver la commande","Etes-vous sûr de vouloir approuver cette commande ?","confirm_approve"); + $html->form_confirm("fiche.php?id=$commande->id","Approuver la commande","Etes-vous sûr de vouloir approuver cette commande ?","confirm_approve"); print '
'; } /* @@ -264,7 +264,7 @@ if ($id > 0) */ if ($_GET["action"] == 'refuse') { - $html->form_confirm("fiche.php?id=$id","Refuser la commande","Etes-vous sûr de vouloir refuser cette commande ?","confirm_refuse"); + $html->form_confirm("fiche.php?id=$commande->id","Refuser la commande","Etes-vous sûr de vouloir refuser cette commande ?","confirm_refuse"); print '
'; } /* @@ -273,7 +273,7 @@ if ($id > 0) */ if ($_GET["action"] == 'annuler') { - $html->form_confirm("fiche.php?id=$id",$langs->trans("Cancel"),"Etes-vous sûr de vouloir annuler cette commande ?","confirm_cancel"); + $html->form_confirm("fiche.php?id=$commande->id",$langs->trans("Cancel"),"Etes-vous sûr de vouloir annuler cette commande ?","confirm_cancel"); print '
'; } /* @@ -295,7 +295,7 @@ if ($id > 0) print ''; print ''.$soc->nom.''; - print ''; + print ''; print ' '; print $commande->statuts[$commande->statut]; print ""; @@ -308,31 +308,29 @@ if ($id > 0) print strftime("%A %d %B %Y",$commande->date_commande)."\n"; } - print ' '; + print ' '; if ($commande->methode_commande) { print "Méthode : " .$commande->methode_commande; } print ""; print ''.$langs->trans("Author").''.$author->fullname.''; - print ''; + print ''; print " "; // Ligne de 3 colonnes print ''.$langs->trans("AmountHT").''; print ''.price($commande->total_ht).''; print ''.$conf->monnaie.''; - print ''.$langs->trans("Note").' :'; - - - - print ''.$langs->trans("VAT").''.price($commande->total_tva).''; + print ''.$langs->trans("VAT").''.price($commande->total_tva).''; print ''.$conf->monnaie.''; + print ''.$langs->trans("TotalTTC").''.price($commande->total_ttc).''; - print ''.$conf->monnaie.''; + print ''.$conf->monnaie.' '; + if ($commande->note) { - print 'Note : '.nl2br($commande->note).""; + print 'Note'.nl2br($commande->note).""; } print ""; @@ -345,7 +343,7 @@ if ($id > 0) $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 "; - $sql .= " WHERE l.fk_commande = $id ORDER BY l.rowid"; + $sql .= " WHERE l.fk_commande = $commande->id ORDER BY l.rowid"; $result = $db->query($sql); if ($result) @@ -393,11 +391,11 @@ if ($id > 0) print ''.price($objp->subprice)."\n"; if ($commande->statut == 0 && $user->rights->fournisseur->commande->creer) {/* - print ''; + print ''; print img_edit(); print ''; */ - print ' '; + print ' '; print img_delete(); print ''; } @@ -409,7 +407,7 @@ if ($id > 0) if ($_GET["action"] == 'editline' && $_GET["rowid"] == $objp->rowid) { - print "
"; + print "id\" method=\"post\">"; print ''; print ''; print ""; @@ -462,7 +460,7 @@ if ($id > 0) print $db->error(); } - print ""; + print "id\" method=\"post\">"; print ''; print ""; @@ -511,7 +509,7 @@ if ($id > 0) { if ($user->rights->fournisseur->commande->valider) { - print ''.$langs->trans("Valid").''; + print ''.$langs->trans("Valid").''; } } @@ -519,9 +517,9 @@ if ($id > 0) { if ($user->rights->fournisseur->commande->approuver) { - print ''.$langs->trans("ApproveOrder").''; + print ''.$langs->trans("ApproveOrder").''; - print ''.$langs->trans("RefuseOrder").''; + print ''.$langs->trans("RefuseOrder").''; } } @@ -529,7 +527,7 @@ if ($id > 0) { if ($user->rights->fournisseur->commande->approuver) { - print ''.$langs->trans("RefuseOrder").''; + print ''.$langs->trans("RefuseOrder").''; } } @@ -537,7 +535,7 @@ if ($id > 0) { if ($user->rights->fournisseur->commande->creer) { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } } @@ -695,7 +693,7 @@ if ($id > 0) else { /* Commande non trouvée */ - print "Commande inexistante ou accés refusé"; + print "Commande inexistante"; } }