Look: Ajout pictos
This commit is contained in:
parent
43debcd792
commit
a4cd376d94
@ -513,7 +513,7 @@ else
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||||
print "<td colspan=\"2\">".strftime("%A %e %B %Y",$commande->date)."</td>\n";
|
print "<td colspan=\"2\">".dolibarr_print_date($commande->date,"%A %d %B %Y")."</td>\n";
|
||||||
|
|
||||||
print '<td width="50%">';
|
print '<td width="50%">';
|
||||||
print $langs->trans("Author").' : '.$author->fullname.'</td></tr>';
|
print $langs->trans("Author").' : '.$author->fullname.'</td></tr>';
|
||||||
@ -560,12 +560,14 @@ else
|
|||||||
echo '<br><table class="noborder" width="100%">';
|
echo '<br><table class="noborder" width="100%">';
|
||||||
|
|
||||||
$sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice";
|
$sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as l WHERE l.fk_commande = ".$commande->id." ORDER BY l.rowid";
|
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as l";
|
||||||
|
$sql .= " WHERE l.fk_commande = ".$commande->id;
|
||||||
|
$sql .= " ORDER BY l.rowid";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows($result);
|
||||||
$i = 0; $total = 0;
|
$i = 0; $total = 0;
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
@ -582,7 +584,7 @@ else
|
|||||||
$var=True;
|
$var=True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object();
|
$objp = $db->fetch_object($result);
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
if ($objp->fk_product > 0)
|
if ($objp->fk_product > 0)
|
||||||
{
|
{
|
||||||
@ -651,7 +653,8 @@ else
|
|||||||
{
|
{
|
||||||
$sql = "SELECT p.rowid,p.label,p.ref,p.price FROM ".MAIN_DB_PREFIX."product as p ";
|
$sql = "SELECT p.rowid,p.label,p.ref,p.price FROM ".MAIN_DB_PREFIX."product as p ";
|
||||||
$sql .= " WHERE envente = 1";
|
$sql .= " WHERE envente = 1";
|
||||||
$sql .= " ORDER BY p.nbvente DESC LIMIT 20";
|
$sql .= " ORDER BY p.nbvente DESC";
|
||||||
|
$sql .= " LIMIT 20";
|
||||||
if ( $db->query($sql) )
|
if ( $db->query($sql) )
|
||||||
{
|
{
|
||||||
$opt = "<option value=\"0\" selected></option>";
|
$opt = "<option value=\"0\" selected></option>";
|
||||||
@ -759,7 +762,7 @@ else
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows($result);
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
print_titre($langs->trans("Sendings"));
|
print_titre($langs->trans("Sendings"));
|
||||||
@ -770,11 +773,11 @@ else
|
|||||||
$var=True;
|
$var=True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object();
|
$objp = $db->fetch_object($result);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td><a href="../expedition/fiche.php?id='.$objp->rowid.'">'.stripslashes($objp->ref).'</a></td>';
|
print '<td><a href="../expedition/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowSending"),"sending").' '.$objp->ref.'</a></td>';
|
||||||
print "<td>".strftime("%d %B %Y",$objp->de)."</td></tr>\n";
|
print "<td>".dolibarr_print_date($objp->de)."</td></tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
@ -796,7 +799,7 @@ else
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows($result);
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
print_titre($langs->trans("Bills"));
|
print_titre($langs->trans("Bills"));
|
||||||
@ -807,11 +810,11 @@ else
|
|||||||
$var=True;
|
$var=True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object();
|
$objp = $db->fetch_object($result);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td><a href="../compta/facture.php?facid='.$objp->rowid.'">'.stripslashes($objp->facnumber).'</a></td>';
|
print '<td><a href="../compta/facture.php?facid='.$objp->rowid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->facnumber.'</a></td>';
|
||||||
print "<td>".strftime("%d %B %Y",$objp->df)."</td></tr>\n";
|
print "<td>".dolibarr_print_date($objp->df)."</td></tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|||||||
@ -133,7 +133,7 @@ if ($_GET["id"] > 0)
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||||
print "<td colspan=\"2\">".strftime("%A %d %B %Y",$commande->date)."</td>\n";
|
print "<td colspan=\"2\">".dolibarr_print_date($commande->date,"%A %d %B %Y")."</td>\n";
|
||||||
|
|
||||||
print '<td width="50%">';
|
print '<td width="50%">';
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ if ($_GET["id"] > 0)
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows($result);
|
||||||
$i = 0; $total = 0;
|
$i = 0; $total = 0;
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
@ -184,7 +184,7 @@ if ($_GET["id"] > 0)
|
|||||||
$var=True;
|
$var=True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object();
|
$objp = $db->fetch_object($result);
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
if ($objp->fk_product > 0)
|
if ($objp->fk_product > 0)
|
||||||
{
|
{
|
||||||
@ -212,7 +212,7 @@ if ($_GET["id"] > 0)
|
|||||||
$i++;
|
$i++;
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
}
|
}
|
||||||
$db->free();
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -220,100 +220,6 @@ if ($_GET["id"] > 0)
|
|||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
/*
|
|
||||||
* Documents générés
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
$file = $conf->facture->dir_output . "/" . $commande->ref . "/" . $commande->ref . ".pdf";
|
|
||||||
$relativepath = $commande->ref."/".$commande->ref.".pdf";
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
if (file_exists($file))
|
|
||||||
{
|
|
||||||
print "<table width=\"100%\" cellspacing=2><tr><td width=\"50%\" valign=\"top\">";
|
|
||||||
print_titre("Documents");
|
|
||||||
print '<table width="100%" class="border">';
|
|
||||||
|
|
||||||
print "<tr $bc[$var]><td>".$langs->trans("Order")." PDF</td>";
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=commande&file='.urlencode($relativepath).'">'.$commande->ref.'.pdf</a></td>';
|
|
||||||
print '<td align="right">'.filesize($file). ' bytes</td>';
|
|
||||||
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print "</table>\n";
|
|
||||||
print '</td><td valign="top" width="50%">';
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
print "</td></tr></table>";
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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."co_fa as fp WHERE fp.fk_facture = f.rowid AND fp.fk_commande = ".$commande->id;
|
|
||||||
|
|
||||||
if ($db->query($sql))
|
|
||||||
{
|
|
||||||
$num_fac_asso = $db->num_rows();
|
|
||||||
$i = 0; $total = 0;
|
|
||||||
|
|
||||||
if ($num_fac_asso > 0)
|
|
||||||
{
|
|
||||||
print "<br>";
|
|
||||||
if ($num_fac_asso > 1)
|
|
||||||
{
|
|
||||||
print_titre("Factures associées");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print_titre("Facture associée");
|
|
||||||
}
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Author").'</td>';
|
|
||||||
print '<td align="right">'.$langs->trans("Price").'</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
$var=True;
|
|
||||||
while ($i < $num_fac_asso)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object();
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr bgcolor=\"#E0E0E0\">";
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a>';
|
|
||||||
if ($objp->paye)
|
|
||||||
{
|
|
||||||
print " (<b>payée</b>)";
|
|
||||||
}
|
|
||||||
print "</td>\n";
|
|
||||||
print "<td>".strftime("%d %B %Y",$objp->df)."</td>\n";
|
|
||||||
if ($objp->fk_user_author <> $user->id)
|
|
||||||
{
|
|
||||||
$fuser = new User($db, $objp->fk_user_author);
|
|
||||||
$fuser->fetch();
|
|
||||||
print "<td>".$fuser->fullname."</td>\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<td>".$user->fullname."</td>\n";
|
|
||||||
}
|
|
||||||
print '<td align="right">'.price($objp->total).'</td>';
|
|
||||||
print "</tr>";
|
|
||||||
$total = $total + $objp->total;
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print "<tr><td align=\"right\" colspan=\"4\">".$langs->trans("TotalHT").": <b>$total</b> ".$conf->monnaie."</td></tr>\n";
|
|
||||||
print "</table>";
|
|
||||||
}
|
|
||||||
$db->free();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_print_error($db);
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -342,10 +248,103 @@ if ($_GET["id"] > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Documents générés
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
$file = $conf->facture->dir_output . "/" . $commande->ref . "/" . $commande->ref . ".pdf";
|
||||||
|
$relativepath = $commande->ref."/".$commande->ref.".pdf";
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
|
||||||
|
if (file_exists($file))
|
||||||
|
{
|
||||||
|
print "<table width=\"100%\" cellspacing=2><tr><td width=\"50%\" valign=\"top\">";
|
||||||
|
print_titre($langs->trans("Documents"));
|
||||||
|
print '<table width="100%" class="border">';
|
||||||
|
|
||||||
|
print "<tr $bc[$var]><td>".$langs->trans("Order")." PDF</td>";
|
||||||
|
print '<td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=commande&file='.urlencode($relativepath).'">'.$commande->ref.'.pdf</a></td>';
|
||||||
|
print '<td align="right">'.filesize($file). ' bytes</td>';
|
||||||
|
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print "</table>\n";
|
||||||
|
print '</td><td valign="top" width="50%">';
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
print "</td></tr></table>";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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."co_fa as fp WHERE fp.fk_facture = f.rowid AND fp.fk_commande = ".$commande->id;
|
||||||
|
|
||||||
|
if ($db->query($sql))
|
||||||
|
{
|
||||||
|
$num_fac_asso = $db->num_rows();
|
||||||
|
$i = 0; $total = 0;
|
||||||
|
|
||||||
|
if ($num_fac_asso)
|
||||||
|
{
|
||||||
|
$var=false;
|
||||||
|
print "<br>";
|
||||||
|
|
||||||
|
print_titre($langs->trans("Bills"));
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
print "<tr $bc[$var]><td>".$langs->trans("Ref").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Author").'</td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Price").'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$var=True;
|
||||||
|
while ($i < $num_fac_asso)
|
||||||
|
{
|
||||||
|
$objp = $db->fetch_object();
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->facnumber.'</a>';
|
||||||
|
if ($objp->paye)
|
||||||
|
{
|
||||||
|
print " (<b>payée</b>)";
|
||||||
|
}
|
||||||
|
print "</td>\n";
|
||||||
|
print "<td>".dolibarr_print_date($objp->df)."</td>\n";
|
||||||
|
if ($objp->fk_user_author <> $user->id)
|
||||||
|
{
|
||||||
|
$fuser = new User($db, $objp->fk_user_author);
|
||||||
|
$fuser->fetch();
|
||||||
|
print "<td>".$fuser->fullname."</td>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<td>".$user->fullname."</td>\n";
|
||||||
|
}
|
||||||
|
print '<td align="right">'.price($objp->total).'</td>';
|
||||||
|
print "</tr>";
|
||||||
|
$total = $total + $objp->total;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
print "<tr $bc[$var]><td align=\"right\" colspan=\"4\">".$langs->trans("TotalHT").": <b>$total</b> ".$conf->monnaie."</td></tr>\n";
|
||||||
|
print "</table>";
|
||||||
|
}
|
||||||
|
$db->free();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Commande non trouvée */
|
// Commande non trouvée
|
||||||
print "Commande inexistante ou accés refusé";
|
print "Commande inexistante ou accés refusé";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user