From a18a5fec60a921aa2ecd6fb25f3fff0f98c7040f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Mar 2006 21:42:15 +0000 Subject: [PATCH] =?UTF-8?q?Look:=20Modif=20esth=E9tique=20mineure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/propal.php | 2 +- htdocs/compta/propal.php | 325 ++++++++++++++++++++------------------- 2 files changed, 167 insertions(+), 160 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index c0e2fb765a2..6e9b67de7e3 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1076,7 +1076,7 @@ if ($_GET['propalid'] > 0) } print ''; - + print "
\n"; print '
'; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index c6500a687fc..f09163a082c 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -477,29 +477,30 @@ if ($_GET["propalid"] > 0) print ''; - /* - * Boutons Actions - */ - if ($obj->statut <> 4 && $user->societe_id == 0) - { - print '
'; - - if ($obj->statut == 2 && $user->rights->facture->creer) - { - print '".$langs->trans("BuildBill").""; - } - - if ($obj->statut == 2 && sizeof($propal->facture_liste_array())) - { - print '".$langs->trans("ClassifyBilled").""; - } - - print "
"; - } + /* + * Boutons Actions + */ + if ($obj->statut <> 4 && $user->societe_id == 0) + { + print '
'; + + if ($obj->statut == 2 && $user->rights->facture->creer) + { + print '".$langs->trans("BuildBill").""; + } + + if ($obj->statut == 2 && sizeof($propal->facture_liste_array())) + { + print '".$langs->trans("ClassifyBilled").""; + } + + print "
"; + print "
\n"; + } + - - print '
'; + print '"; + + // Ref + print '\n"; + + // Societe + print "\n"; + + // Date + print "\n"; + + // Prix + print "\n"; + print "\n"; + print "\n"; + + $i++; + } + + print "
'; /* * Documents générés @@ -515,80 +516,89 @@ if ($_GET["propalid"] > 0) $html->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed); - /* - * Commandes rattachées - */ - if($conf->commande->enabled) - { - $coms = $propal->associated_orders(); - if (sizeof($coms) > 0) + /* + * Commandes rattachées + */ + if($conf->commande->enabled) { - print '
'; - print_titre($langs->trans('RelatedOrders')); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $var=true; - for ($i = 0 ; $i < sizeof($coms) ; $i++) - { - $var=!$var; - print '\n"; - print ''; - print ''; - print "\n"; - } - print '
'.$langs->trans("Ref").''.$langs->trans("Date").''.$langs->trans("Price").'
'; - print ''.img_object($langs->trans("ShowOrder"),"order").' '.$coms[$i]->ref."'.dolibarr_print_date($coms[$i]->date).''.$coms[$i]->total_ttc.'
'; + $coms = $propal->associated_orders(); + if (sizeof($coms) > 0) + { + require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php'); + $staticcommande=new Commande($db); + + $total=0; + print '
'; + print_titre($langs->trans('RelatedOrders')); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $var=true; + for ($i = 0 ; $i < sizeof($coms) ; $i++) + { + $var=!$var; + print '\n"; + print ''; + print ''; + print ''; + print "\n"; + $total = $total + $objp->total; + } + print '
'.$langs->trans("Ref").''.$langs->trans("Date").''.$langs->trans("Price").''.$langs->trans("Status").'
'; + print ''.img_object($langs->trans("ShowOrder"),"order").' '.$coms[$i]->ref."'.dolibarr_print_date($coms[$i]->date).''.$coms[$i]->total_ttc.''.$staticcommande->LibStatut($coms[$i]->statut,3).'
'; + } } - } - - /* - * Factures associees - */ - $sql = "SELECT f.facnumber, f.total,".$db->pdate("f.datef")." as df, f.rowid as facid, f.fk_user_author, f.paye"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."fa_pr as fp WHERE fp.fk_facture = f.rowid AND fp.fk_propal = ".$propal->id; - - $resql = $db->query($sql); - if ($resql) + + /* + * Factures associees + */ + $sql = "SELECT f.facnumber, f.total,".$db->pdate("f.datef")." as df, f.rowid as facid, f.fk_user_author, f.fk_statut, f.paye"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."fa_pr as fp WHERE fp.fk_facture = f.rowid AND fp.fk_propal = ".$propal->id; + + $resql = $db->query($sql); + if ($resql) { - $num_fac_asso = $db->num_rows($resql); - $i = 0; $total = 0; - print "
"; - if ($num_fac_asso > 1) print_titre($langs->trans("RelatedBills")); - else print_titre($langs->trans("RelatedBill")); - print ''; - print ""; - print ''; - print ''; - print ''; - print "\n"; - - $var=True; - while ($i < $num_fac_asso) - { - $objp = $db->fetch_object(); - $var=!$var; - print ""; - print '\n"; - print ''; - print ''; - print ""; - $total = $total + $objp->total; - $i++; - } - print "\n"; - print "
'.$langs->trans("Ref").''.$langs->trans("Date").''.$langs->trans("Price").'
'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->facnumber.''; - if ($objp->paye) - { - print " (payée)"; - } - print "'.dolibarr_print_date($objp->df).''.price($objp->total).'
".$langs->trans("TotalHT")."".price($total)."
"; - $db->free(); - } + $num_fac_asso = $db->num_rows($resql); + $i = 0; $total = 0; + print "
"; + if ($num_fac_asso > 1) print_titre($langs->trans("RelatedBills")); + else print_titre($langs->trans("RelatedBill")); + print ''; + print ""; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + require_once(DOL_DOCUMENT_ROOT.'/facture.class.php'); + $staticfacture=new Facture($db); + + $var=True; + while ($i < $num_fac_asso) + { + $objp = $db->fetch_object(); + $var=!$var; + print ""; + print ''; + print ''; + print ''; + print ''; + print ""; + $total = $total + $objp->total; + $i++; + } + print ""; + print ""; + print "\n"; + print "
'.$langs->trans("Ref").''.$langs->trans("Date").''.$langs->trans("Price").''.$langs->trans("Status").'
'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->facnumber.''.dolibarr_print_date($objp->df).''.price($objp->total).''.$staticfacture->LibStatut($objp->paye,$objp->fk_statut,3).'
".$langs->trans("TotalHT")."".price($total)." 
"; + $db->free(); + } print '
'; @@ -660,7 +670,9 @@ if ($_GET["propalid"] > 0) $pagenext = $page + 1; - $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp"; + $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.fk_statut, "; + $sql.= $db->pdate("p.datep")." as dp, "; + $sql.= $db->pdate("p.fin_validite")." as dfin"; if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -673,76 +685,71 @@ if ($_GET["propalid"] > 0) $sql .= " ORDER BY $sortfield $sortorder, p.rowid DESC "; $sql .= $db->plimit($limit + 1,$offset); - if ( $db->query($sql) ) - { - $num = $db->num_rows(); + if ( $db->query($sql) ) + { + $num = $db->num_rows(); + + $propalstatic=new Propal($db); + + print_barre_liste($langs->trans("Proposals"), $page, "propal.php","&socidp=$socidp",$sortfield,$sortorder,'',$num); + + $i = 0; + $var=true; + + print ""; + print ''; + print_liste_field_titre($langs->trans("Ref"),"propal.php","p.ref","","&year=$year&viewstatut=$viewstatut",'',$sortfield); + print_liste_field_titre($langs->trans("Company"),"propal.php","s.nom","&viewstatut=$viewstatut","",'',$sortfield); + print_liste_field_titre($langs->trans("Date"),"propal.php","p.datep","&viewstatut=$viewstatut","",'align="right"',$sortfield); + print_liste_field_titre($langs->trans("Price"),"propal.php","p.price","&viewstatut=$viewstatut","",'align="right"',$sortfield); + print_liste_field_titre($langs->trans("Status"),"propal.php","p.fk_statut","&viewstatut=$viewstatut","",'align="right"',$sortfield); + print "\n"; - $propalstatic=new Propal($db); - - print_barre_liste($langs->trans("Proposals"), $page, "propal.php","&socidp=$socidp",$sortfield,$sortorder,'',$num); - - $i = 0; - $var=true; - - print "
"; - print ''; - print_liste_field_titre($langs->trans("Ref"),"propal.php","p.ref","","&year=$year&viewstatut=$viewstatut",'',$sortfield); - print_liste_field_titre($langs->trans("Company"),"propal.php","s.nom","&viewstatut=$viewstatut","",'',$sortfield); - print_liste_field_titre($langs->trans("Date"),"propal.php","p.datep","&viewstatut=$viewstatut","",'align="right" colspan="2"',$sortfield); - print_liste_field_titre($langs->trans("Price"),"propal.php","p.price","&viewstatut=$viewstatut","",'align="right"',$sortfield); - print_liste_field_titre($langs->trans("Status"),"propal.php","p.fk_statut","&viewstatut=$viewstatut","",'align="center"',$sortfield); - print "\n"; - - while ($i < min($num, $limit)) - { - $objp = $db->fetch_object(); - - $var=!$var; - print ""; - - print '\n"; - - print "\n"; - - $now = time(); - $lim = 3600 * 24 * 15 ; - - if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) - { - print ""; - } - else - { - print ""; - } - - print "\n"; - - print "\n"; - print "\n"; - print "\n"; - - $i++; - } - - print "
'.img_object($langs->trans("ShowPropal"),"propal").' '; - print $objp->ref."idp\">".dolibarr_trunc($objp->nom,44)." > 15 jours "; - $y = strftime("%Y",$objp->dp); - $m = strftime("%m",$objp->dp); - - print strftime("%d",$objp->dp)."\n"; - print " "; - print strftime("%B",$objp->dp)."\n"; - print " "; - print strftime("%Y",$objp->dp)."".price($objp->price)."".$propalstatic->LibStatut($objp->fk_statut,2)."
"; - $db->free(); - } - else - { - dolibarr_print_error($db); - } + while ($i < min($num, $limit)) + { + $objp = $db->fetch_object(); + + $var=!$var; + print "
'.img_object($langs->trans("ShowPropal"),"propal").' '; + print $objp->ref.""; + if ($objp->fk_statut==1 && $obj->dfin < time() - $conf->propal->cloture->warning_delay) { print " ".img_warning($langs->trans("Late")); } + print "idp\">".dolibarr_trunc($objp->nom,44).""; + $y = strftime("%Y",$objp->dp); + $m = strftime("%m",$objp->dp); + print strftime("%d",$objp->dp)."\n"; + print " "; + print strftime("%B",$objp->dp)."\n"; + print " "; + print strftime("%Y",$objp->dp)."".price($objp->price)."".$propalstatic->LibStatut($objp->fk_statut,5)."
"; + $db->free(); + } + else + { + dolibarr_print_error($db); + } } $db->close(); + llxFooter('$Date$ - $Revision$'); + ?>