From d7039c4df0bf794b2ea91593879c680a93e7aaf9 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 31 Aug 2003 22:13:07 +0000 Subject: [PATCH] =?UTF-8?q?Utilisation=20des=20modules=20pour=20num=E9rote?= =?UTF-8?q?r=20les=20propales?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/addpropal.php3 | 294 ++++++++++++++++++------------------- 1 file changed, 140 insertions(+), 154 deletions(-) diff --git a/htdocs/comm/addpropal.php3 b/htdocs/comm/addpropal.php3 index e3d92feb428..058cd37b8da 100644 --- a/htdocs/comm/addpropal.php3 +++ b/htdocs/comm/addpropal.php3 @@ -46,178 +46,164 @@ print_titre("Nouvelle proposition commerciale"); */ if ($action == 'create') { - if ( $objsoc->prefix_comm ) + $numpr = propale_get_num(); + $sql = "SELECT count(*) FROM llx_propal WHERE ref like '$numpr%'"; + + if ( $db->query($sql) ) { - - $numpr = "PR-" . $objsoc->prefix_comm . "-" . strftime("%y%m%d", time()); - - $sql = "SELECT count(*) FROM llx_propal WHERE ref like '$numpr%'"; - - if ( $db->query($sql) ) + $num = $db->result(0, 0); + $db->free(); + if ($num > 0) { - $num = $db->result(0, 0); - $db->free(); - if ($num > 0) - { - $numpr .= "." . ($num + 1); - } + $numpr .= "." . ($num + 1); } + } - print "
"; - print ""; - - print ''; - - print ''; - - print '"; - - print ""; - - print ''; - print "\n"; - /* - * - * Destinataire de la propale - * - */ - print "'; - /* - * - * Projet associé - * - */ - print ''; + print ''; + print '
Société'.$objsoc->nom.''; - print "Commentaires
Date"; - print_date_select(); - print "'; - print ''; - - print '
Auteur'.$user->fullname.'
Num
Contact'; - - if ($numdest==0) - { - print 'Cette societe n\'a pas de contact, veuillez en creer un avant de faire de propale
'; - print 'Ajouter un contact'; - } - print '
Projet'; - if ($numprojet==0) - { + print ""; + print ""; + + print ''; + + print ''; + + print '"; + + print ""; + + print ''; + print "\n"; + /* + * + * Destinataire de la propale + * + */ + print "'; + /* + * + * Projet associé + * + */ + print ''; - print ''; - print '
Société'.$objsoc->nom.''; + print "Commentaires
Date"; + print_date_select(); + print "'; + print ''; + + print '
Auteur'.$user->fullname.'
Numéro
Contact'; + + if ($numdest==0) + { + print 'Cette societe n\'a pas de contact, veuillez en creer un avant de faire de propale
'; + print 'Ajouter un contact'; + } + print '
Projet'; + if ($numprojet==0) + { print 'Cette societe n\'a pas de projet.
'; print 'Créer un projet'; - } - print '
Modèle'; - $html = new Form($db); - $modelpdf = new Propal_Model_pdf($db); - $html->select_array("modelpdf",$modelpdf->liste_array(),PROPALE_ADDON_PDF); - print "
"; - - /* - * - * Liste des elements - * - */ - $sql = "SELECT p.rowid,p.label,p.ref,p.price FROM llx_product as p "; - $sql .= " WHERE envente = 1"; - $sql .= " ORDER BY p.nbvente DESC LIMIT 20"; - if ( $db->query($sql) ) - { - $opt = ""; - if ($result) - { - $num = $db->num_rows(); $i = 0; + } + print '
Modèle'; + $html = new Form($db); + $modelpdf = new Propal_Model_pdf($db); + $html->select_array("modelpdf",$modelpdf->liste_array(),PROPALE_ADDON_PDF); + print "
"; + + /* + * + * Liste des elements + * + */ + $sql = "SELECT p.rowid,p.label,p.ref,p.price FROM llx_product as p "; + $sql .= " WHERE envente = 1"; + $sql .= " ORDER BY p.nbvente DESC LIMIT 20"; + if ( $db->query($sql) ) + { + $opt = ""; + if ($result) + { + $num = $db->num_rows(); $i = 0; while ($i < $num) { $objp = $db->fetch_object( $i); $opt .= "\n"; $i++; } - } - $db->free(); - } - else - { - print $db->error(); - } - - print_titre("Services/Produits"); - - - print ''; - - for ($i = 1 ; $i < 5 ; $i++) - { - print ''; - print ''; - } - - print "
"; - /* - * Si il n'y a pas de contact pour la societe on ne permet pas la creation de propale - */ - if ($numdest > 0) - { - print ''; - } - print "
"; - + } + $db->free(); } else { - print "Vous devez d'abord associer un prefixe commercial à cette société" ; + print $db->error(); } + + print_titre("Services/Produits"); + + print ''; + + for ($i = 1 ; $i < 5 ; $i++) + { + print ''; + print ''; + } + + print "
"; + /* + * Si il n'y a pas de contact pour la societe on ne permet pas la creation de propale + */ + if ($numdest > 0) + { + print ''; + } + print ""; } -/* - * - */ $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>