Look: Modif esthétiques mineures
This commit is contained in:
parent
1b6d7d5de4
commit
5dbf26a344
@ -822,92 +822,95 @@ print "\n</div><br>\n";
|
|||||||
|
|
||||||
if ($_GET["id"] && $_GET["action"] == '' && $product->status)
|
if ($_GET["id"] && $_GET["action"] == '' && $product->status)
|
||||||
{
|
{
|
||||||
$propal = New Propal($db);
|
$propal = New Propal($db);
|
||||||
|
|
||||||
print '<table width="100%" class="noborder">';
|
print '<table width="100%" class="noborder">';
|
||||||
|
|
||||||
|
|
||||||
// Propals
|
// Propals
|
||||||
if($user->rights->propale->creer)
|
if($user->rights->propale->creer)
|
||||||
{
|
{
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
|
|
||||||
print '<tr><td width="50%" valign="top">';
|
print '<tr><td width="50%" valign="top">';
|
||||||
print_titre($langs->trans("AddToMyProposals")) . '</td>';
|
print_titre($langs->trans("AddToMyProposals")) . '</td>';
|
||||||
|
|
||||||
if ($user->rights->commercial->client->voir)
|
if ($user->rights->commercial->client->voir)
|
||||||
{
|
{
|
||||||
print '<td width="50%" valign="top">';
|
print '<td width="50%" valign="top">';
|
||||||
print_titre($langs->trans("AddToOtherProposals")) . '</td>';
|
print_titre($langs->trans("AddToOtherProposals")) . '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td width="50%" valign="top"></td>';
|
print '<td width="50%" valign="top"></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Liste de "Mes propals"
|
// Liste de "Mes propals"
|
||||||
print '<tr><td width="50%" valign="top">';
|
print '<tr><td width="50%" valign="top">';
|
||||||
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.ref,".$db->pdate("p.datep")." as dp";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
|
|
||||||
$sql .=" WHERE p.fk_soc = s.idp AND p.fk_statut = 0 AND p.fk_user_author = ".$user->id;
|
|
||||||
$sql .= " ORDER BY p.datec DESC, tms DESC";
|
|
||||||
|
|
||||||
$result=$db->query($sql);
|
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.ref,".$db->pdate("p.datep")." as dp";
|
||||||
if ($result)
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
|
||||||
{
|
$sql .=" WHERE p.fk_soc = s.idp AND p.fk_statut = 0 AND p.fk_user_author = ".$user->id;
|
||||||
$num = $db->num_rows($result);
|
$sql .= " ORDER BY p.datec DESC, tms DESC";
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
if ($num)
|
$result=$db->query($sql);
|
||||||
{
|
if ($result)
|
||||||
$i = 0;
|
{
|
||||||
$var=true;
|
$num = $db->num_rows($result);
|
||||||
while ($i < $num)
|
print '<table class="noborder" width="100%">';
|
||||||
{
|
if ($num)
|
||||||
$objp = $db->fetch_object($result);
|
{
|
||||||
$var=!$var;
|
$i = 0;
|
||||||
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
$var=true;
|
||||||
print "<tr $bc[$var]>";
|
while ($i < $num)
|
||||||
print "<td nowrap>";
|
{
|
||||||
print '<input type="hidden" name="action" value="addinpropal">';
|
$objp = $db->fetch_object($result);
|
||||||
print "<a href=\"../comm/propal.php?propalid=$objp->propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."</a></td>\n";
|
$var=!$var;
|
||||||
print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">".dolibarr_trunc($objp->nom,18)."</a></td>\n";
|
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
||||||
print "<td nowrap=\"nowrap\">".dolibarr_print_date($objp->dp,"%d %b")."</td>\n";
|
print "<tr $bc[$var]>";
|
||||||
print '<td><input type="hidden" name="propalid" value="'.$objp->propalid.'">';
|
print "<td nowrap>";
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
print '<input type="hidden" name="action" value="addinpropal">';
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
print "<a href=\"../comm/propal.php?propalid=$objp->propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."</a></td>\n";
|
||||||
print " ".$product->stock_proposition;
|
print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">".dolibarr_trunc($objp->nom,18)."</a></td>\n";
|
||||||
print '</td><td align="right">';
|
print "<td nowrap=\"nowrap\">".dolibarr_print_date($objp->dp,"%d %b")."</td>\n";
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '<td><input type="hidden" name="propalid" value="'.$objp->propalid.'">';
|
||||||
print '</td>';
|
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
||||||
print '</tr>';
|
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
||||||
print '</form>';
|
print " ".$product->stock_proposition;
|
||||||
$i++;
|
print '</td><td align="right">';
|
||||||
}
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
}
|
print '</td>';
|
||||||
else {
|
print '</tr>';
|
||||||
print "<tr $bc[$var]><td>";
|
print '</form>';
|
||||||
print $langs->trans("NoOpenedPropals");
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print "<tr $bc[$var]><td>";
|
||||||
|
print $langs->trans("NoOpenedPropals");
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($user->rights->commercial->client->voir)
|
if ($user->rights->commercial->client->voir)
|
||||||
{
|
{
|
||||||
// Liste de "Other propals"
|
// Liste de "Other propals"
|
||||||
print '<td width="50%" valign="top">';
|
print '<td width="50%" valign="top">';
|
||||||
|
|
||||||
|
$var=true;
|
||||||
$otherprop = $propal->liste_array(1, ' <> '.$user->id);
|
$otherprop = $propal->liste_array(1, ' <> '.$user->id);
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
if (is_array($otherprop) && sizeof($otherprop))
|
if (is_array($otherprop) && sizeof($otherprop))
|
||||||
{
|
{
|
||||||
$var=false;
|
$var=!$var;
|
||||||
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr '.$bc[$var].'><td colspan="3">';
|
print '<tr '.$bc[$var].'><td colspan="3">';
|
||||||
print '<input type="hidden" name="action" value="addinpropal">';
|
print '<input type="hidden" name="action" value="addinpropal">';
|
||||||
print $langs->trans("OtherPropals").'</td><td>';
|
print $langs->trans("OtherPropals").'</td><td>';
|
||||||
@ -919,13 +922,15 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->status)
|
|||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
print "<tr ".$bc[!$var]."><td>";
|
||||||
print $langs->trans("NoOtherOpenedPropals");
|
print $langs->trans("NoOtherOpenedPropals");
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -933,246 +938,254 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->status)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$commande = New Commande($db);
|
$commande = New Commande($db);
|
||||||
|
|
||||||
|
|
||||||
// Commande
|
// Commande
|
||||||
if($user->rights->commande->creer)
|
if($user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
print '<tr><td width="50%" valign="top">';
|
print '<tr><td width="50%" valign="top">';
|
||||||
print_titre($langs->trans("AddToMyOrders")) . '</td>';
|
print_titre($langs->trans("AddToMyOrders")) . '</td>';
|
||||||
|
|
||||||
if ($user->rights->commercial->client->voir)
|
if ($user->rights->commercial->client->voir)
|
||||||
{
|
{
|
||||||
print '<td width="50%" valign="top">';
|
print '<td width="50%" valign="top">';
|
||||||
print_titre($langs->trans("AddToOtherOrders")) . '</td>';
|
print_titre($langs->trans("AddToOtherOrders")) . '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td width="50%" valign="top"></td>';
|
print '<td width="50%" valign="top"></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Liste de "Mes commandes"
|
// Liste de "Mes commandes"
|
||||||
print '<tr><td width="50%" valign="top">';
|
print '<tr><td width="50%" valign="top">';
|
||||||
$sql = "SELECT s.nom, s.idp, c.rowid as commandeid, c.ref,".$db->pdate("c.date_commande")." as dc";
|
$sql = "SELECT s.nom, s.idp, c.rowid as commandeid, c.ref,".$db->pdate("c.date_commande")." as dc";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
||||||
$sql .=" WHERE c.fk_soc = s.idp AND c.fk_statut = 0 AND c.fk_user_author = ".$user->id;
|
$sql .=" WHERE c.fk_soc = s.idp AND c.fk_statut = 0 AND c.fk_user_author = ".$user->id;
|
||||||
$sql .= " ORDER BY c.date_creation DESC";
|
$sql .= " ORDER BY c.date_creation DESC";
|
||||||
|
|
||||||
$result=$db->query($sql);
|
$result=$db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$var=true;
|
$var=true;
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
if ($num) {
|
if ($num)
|
||||||
$i = 0;
|
{
|
||||||
while ($i < $num)
|
$i = 0;
|
||||||
{
|
while ($i < $num)
|
||||||
$objc = $db->fetch_object($result);
|
{
|
||||||
$var=!$var;
|
$objc = $db->fetch_object($result);
|
||||||
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
||||||
print "<td nowrap>";
|
print "<tr $bc[$var]>";
|
||||||
print '<input type="hidden" name="action" value="addincommande">';
|
print "<td nowrap>";
|
||||||
print "<a href=\"../commande/fiche.php?id=$objc->commandeid\">".img_object($langs->trans("ShowOrder"),"order")." ".$objc->ref."</a></td>\n";
|
print '<input type="hidden" name="action" value="addincommande">';
|
||||||
print "<td><a href=\"../comm/fiche.php?socid=$objc->idp\">".dolibarr_trunc($objc->nom,18)."</a></td>\n";
|
print "<a href=\"../commande/fiche.php?id=$objc->commandeid\">".img_object($langs->trans("ShowOrder"),"order")." ".$objc->ref."</a></td>\n";
|
||||||
print "<td nowrap=\"nowrap\">".dolibarr_print_date($objc->dc,"%d %b")."</td>\n";
|
print "<td><a href=\"../comm/fiche.php?socid=$objc->idp\">".dolibarr_trunc($objc->nom,18)."</a></td>\n";
|
||||||
print '<td><input type="hidden" name="commandeid" value="'.$objc->commandeid.'">';
|
print "<td nowrap=\"nowrap\">".dolibarr_print_date($objc->dc,"%d %b")."</td>\n";
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
print '<td><input type="hidden" name="commandeid" value="'.$objc->commandeid.'">';
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
||||||
print " ".$product->stock_proposition;
|
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
||||||
print '</td><td align="right">';
|
print " ".$product->stock_proposition;
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '</td><td align="right">';
|
||||||
print '</td>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
print '</tr>';
|
print '</td>';
|
||||||
print '</form>';
|
print '</tr>';
|
||||||
$i++;
|
print '</form>';
|
||||||
}
|
$i++;
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
print "<tr $bc[$var]><td>";
|
else
|
||||||
print $langs->trans("NoOpenedOrders");
|
{
|
||||||
print "</td></tr>";
|
print "<tr ".$bc[!$var]."><td>";
|
||||||
}
|
print $langs->trans("NoOpenedOrders");
|
||||||
print "</table>";
|
print '</td></tr>';
|
||||||
$db->free($result);
|
}
|
||||||
}
|
print "</table>";
|
||||||
|
$db->free($result);
|
||||||
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($user->rights->commercial->client->voir)
|
if ($user->rights->commercial->client->voir)
|
||||||
{
|
{
|
||||||
// Liste de "Other orders"
|
// Liste de "Other orders"
|
||||||
print '<td width="50%" valign="top">';
|
print '<td width="50%" valign="top">';
|
||||||
|
|
||||||
$othercom = $commande->liste_array(1, ' <> '.$user->id);
|
$var=true;
|
||||||
if (is_array($othercom) && sizeof($othercom))
|
$othercom = $commande->liste_array(1, ' <> '.$user->id);
|
||||||
{
|
print '<table class="noborder" width="100%">';
|
||||||
$var=false;
|
if (is_array($othercom) && sizeof($othercom))
|
||||||
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td colspan="3">';
|
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
||||||
print '<input type="hidden" name="action" value="addincommande">';
|
print '<tr '.$bc[$var].'><td colspan="3">';
|
||||||
print $langs->trans("OtherOrders").'</td><td>';
|
print '<input type="hidden" name="action" value="addincommande">';
|
||||||
$html->select_array("commandeid", $othercom);
|
print $langs->trans("OtherOrders").'</td><td>';
|
||||||
print '</td></tr>';
|
$html->select_array("commandeid", $othercom);
|
||||||
print '<tr '.$bc[$var].'><td colspan="2">'.$langs->trans("Qty");
|
print '</td></tr>';
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
print '<tr '.$bc[$var].'><td colspan="2">'.$langs->trans("Qty");
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
||||||
print '</td><td align="right">';
|
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '</td><td align="right">';
|
||||||
print '</td></tr>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
print '</table>';
|
print '</td></tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
print $langs->trans("NoOtherOpenedOrders");
|
{
|
||||||
}
|
print "<tr ".$bc[!$var]."><td>";
|
||||||
}
|
print $langs->trans("NoOtherOpenedOrders");
|
||||||
print '</td>';
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Factures
|
// Factures
|
||||||
if($user->rights->facture->creer)
|
if($user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
print '<tr><td width="50%" valign="top">';
|
print '<tr><td width="50%" valign="top">';
|
||||||
print_titre($langs->trans("AddToMyBills"));
|
print_titre($langs->trans("AddToMyBills"));
|
||||||
|
|
||||||
if ($user->rights->commercial->client->voir)
|
if ($user->rights->commercial->client->voir)
|
||||||
{
|
{
|
||||||
print '</td><td width="50%" valign="top">';
|
print '</td><td width="50%" valign="top">';
|
||||||
print_titre($langs->trans("AddToOtherBills"));
|
print_titre($langs->trans("AddToOtherBills"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td width="50%" valign="top"></td>';
|
print '<td width="50%" valign="top"></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Liste de Mes factures
|
// Liste de Mes factures
|
||||||
print '<tr><td width="50%" valign="top">';
|
print '<tr><td width="50%" valign="top">';
|
||||||
$sql = "SELECT s.nom, s.idp, f.rowid as factureid, f.facnumber,".$db->pdate("f.datef")." as df";
|
$sql = "SELECT s.nom, s.idp, f.rowid as factureid, f.facnumber,".$db->pdate("f.datef")." as df";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql .=" WHERE f.fk_soc = s.idp AND f.fk_statut = 0 AND f.fk_user_author = ".$user->id;
|
$sql .=" WHERE f.fk_soc = s.idp AND f.fk_statut = 0 AND f.fk_user_author = ".$user->id;
|
||||||
$sql .= " ORDER BY f.datec DESC, f.rowid DESC";
|
$sql .= " ORDER BY f.datec DESC, f.rowid DESC";
|
||||||
|
|
||||||
$result=$db->query($sql);
|
$result=$db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$var=true;
|
$var=true;
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print "<td nowrap>";
|
print "<td nowrap>";
|
||||||
print '<input type="hidden" name="action" value="addinfacture">';
|
print '<input type="hidden" name="action" value="addinfacture">';
|
||||||
print "<a href=\"../compta/facture.php?facid=$objp->factureid\">".img_object($langs->trans("ShowBills"),"bill")." ".$objp->facnumber."</a></td>\n";
|
print "<a href=\"../compta/facture.php?facid=$objp->factureid\">".img_object($langs->trans("ShowBills"),"bill")." ".$objp->facnumber."</a></td>\n";
|
||||||
print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">".dolibarr_trunc($objp->nom,18)."</a></td>\n";
|
print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">".dolibarr_trunc($objp->nom,18)."</a></td>\n";
|
||||||
print "<td nowrap=\"nowrap\">".dolibarr_print_date($objp->df,"%d %b")."</td>\n";
|
print "<td nowrap=\"nowrap\">".dolibarr_print_date($objp->df,"%d %b")."</td>\n";
|
||||||
print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">';
|
print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">';
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "<tr $bc[$var]><td>";
|
print "<tr ".$bc[!$var]."><td>";
|
||||||
print $langs->trans("NoDraftBills");
|
print $langs->trans("NoDraftBills");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($user->rights->commercial->client->voir)
|
if ($user->rights->commercial->client->voir)
|
||||||
{
|
{
|
||||||
print '<td width="50%" valign="top">';
|
print '<td width="50%" valign="top">';
|
||||||
|
|
||||||
// Liste de Autres factures
|
// Liste de Autres factures
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.idp, f.rowid as factureid, f.facnumber,".$db->pdate("f.datef")." as df";
|
$sql = "SELECT s.nom, s.idp, f.rowid as factureid, f.facnumber,".$db->pdate("f.datef")." as df";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql .=" WHERE f.fk_soc = s.idp AND f.fk_statut = 0 AND f.fk_user_author <> ".$user->id;
|
$sql .=" WHERE f.fk_soc = s.idp AND f.fk_statut = 0 AND f.fk_user_author <> ".$user->id;
|
||||||
$sql .= " ORDER BY f.datec DESC, f.rowid DESC";
|
$sql .= " ORDER BY f.datec DESC, f.rowid DESC";
|
||||||
|
|
||||||
$result=$db->query($sql);
|
$result=$db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$var=true;
|
$var=true;
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
if ($num) {
|
if ($num) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
print '<form method="POST" action="fiche.php?id='.$product->id.'">';
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print "<td><a href=\"../compta/facture.php?facid=$objp->factureid\">$objp->facnumber</a></td>\n";
|
print "<td><a href=\"../compta/facture.php?facid=$objp->factureid\">$objp->facnumber</a></td>\n";
|
||||||
print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">$objp->nom</a></td>\n";
|
print "<td><a href=\"../comm/fiche.php?socid=$objp->idp\">$objp->nom</a></td>\n";
|
||||||
print "<td colspan=\"2\">".$langs->trans("Qty");
|
print "<td colspan=\"2\">".$langs->trans("Qty");
|
||||||
print '<input type="hidden" name="action" value="addinfacture">';
|
print '<input type="hidden" name="action" value="addinfacture">';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">';
|
print '<td><input type="hidden" name="factureid" value="'.$objp->factureid.'">';
|
||||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
||||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "<tr $bc[$var]><td>";
|
print "<tr ".$bc[!$var]."><td>";
|
||||||
print $langs->trans("NoOtherDraftBills");
|
print $langs->trans("NoOtherDraftBills");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user