Uniformisation facture fournisseur sur facture client dans espace compta

This commit is contained in:
Laurent Destailleur 2007-07-07 13:20:36 +00:00
parent 8855a0d108
commit e2f85b6d44
7 changed files with 285 additions and 170 deletions

View File

@ -30,8 +30,9 @@
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT.'/facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/facture.class.php');
require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php');
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php'); if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
if ($conf->facture->enabled) require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php'); if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.commande.class.php');
if ($conf->tax->enabled) require_once(DOL_DOCUMENT_ROOT.'/chargesociales.class.php'); if ($conf->tax->enabled) require_once(DOL_DOCUMENT_ROOT.'/chargesociales.class.php');
$user->getrights(); // On a besoin des permissions sur plusieurs modules $user->getrights(); // On a besoin des permissions sur plusieurs modules
@ -89,6 +90,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'del_bookmark')
*/ */
$facturestatic=new Facture($db); $facturestatic=new Facture($db);
$facturesupplierstatic=new FactureFournisseur($db);
llxHeader("",$langs->trans("AccountancyTreasuryArea")); llxHeader("",$langs->trans("AccountancyTreasuryArea"));
@ -103,21 +105,30 @@ print '<tr><td valign="top" width="30%" class="notopnoleft">';
*/ */
if ($conf->facture->enabled) if ($conf->facture->enabled)
{ {
print '<form method="post" action="facture.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/facture.php">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td colspan="3">'.$langs->trans("SearchABill").'</td></tr>'; print '<td colspan="3">'.$langs->trans("SearchACustomerInvoice").'</td></tr>';
print "<tr $bc[0]><td>".$langs->trans("Ref").':</td><td><input type="text" name="sf_ref" class="flat" size="18"></td>'; print "<tr $bc[0]><td>".$langs->trans("Ref").':</td><td><input type="text" name="sf_ref" class="flat" size="18"></td>';
print '<td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>'; print '<td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print "<tr $bc[0]><td>".$langs->trans("Other").':</td><td><input type="text" name="sall" class="flat" size="18"></td>'; print "<tr $bc[0]><td>".$langs->trans("Other").':</td><td><input type="text" name="sall" class="flat" size="18"></td>';
print '</tr>'; print '</tr>';
print "</table></form><br>"; print "</table></form><br>";
print '<form method="post" action="'.DOL_URL_ROOT.'/fourn/facture/index.php">';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
print '<td colspan="3">'.$langs->trans("SearchASupplierInvoice").'</td></tr>';
print "<tr $bc[0]><td>".$langs->trans("Ref").':</td><td><input type="text" name="search_ref" class="flat" size="18"></td>';
print '<td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
//print "<tr $bc[0]><td>".$langs->trans("Other").':</td><td><input type="text" name="sall" class="flat" size="18"></td>';
print '</tr>';
print "</table></form><br>";
} }
/** /**
* Factures brouillons * Factures clients brouillons
*/ */
if ($conf->facture->enabled && $user->rights->facture->lire) if ($conf->facture->enabled && $user->rights->facture->lire)
{ {
@ -138,21 +149,21 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
if ( $resql ) if ( $resql )
{ {
$var = false;
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("CustomersDraftInvoices").($num?' ('.$num.')':'').'</td></tr>';
if ($num) if ($num)
{ {
$companystatic=new Societe($db); $companystatic=new Societe($db);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("DraftBills").' ('.$num.')</td></tr>';
$i = 0; $i = 0;
$tot_ttc = 0; $tot_ttc = 0;
$var = True;
while ($i < $num && $i < 20) while ($i < $num && $i < 20)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'><td nowrap>'; print '<tr '.$bc[$var].'><td nowrap>';
$facturestatic->ref=$obj->facnumber; $facturestatic->ref=$obj->facnumber;
$facturestatic->id=$obj->rowid; $facturestatic->id=$obj->rowid;
@ -169,14 +180,91 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
print '</tr>'; print '</tr>';
$tot_ttc+=$obj->total_ttc; $tot_ttc+=$obj->total_ttc;
$i++; $i++;
$var=!$var;
} }
print '<tr class="liste_total"><td align="left">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td align="left">'.$langs->trans("Total").'</td>';
print '<td colspan="2" align="right">'.price($tot_ttc).'</td>'; print '<td colspan="2" align="right">'.price($tot_ttc).'</td>';
print '</tr>'; print '</tr>';
print "</table><br>";
} }
else
{
print '<tr colspan="3" '.$bc[$var].'><td>'.$langs->trans("NoInvoice").'</td></tr>';
}
print "</table><br>";
$db->free($resql);
}
else
{
dolibarr_print_error($db);
}
}
/**
* Factures fournisseurs brouillons
*/
if ($conf->facture->enabled && $user->rights->facture->lire)
{
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
$sql.= " s.nom, s.rowid as socid";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid)
{
$sql .= " AND f.fk_soc = $socid";
}
$resql = $db->query($sql);
if ( $resql )
{
$var = false;
$num = $db->num_rows($resql);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("SuppliersDraftInvoices").($num?' ('.$num.')':'').'</td></tr>';
if ($num)
{
$companystatic=new Societe($db);
$i = 0;
$tot_ttc = 0;
while ($i < $num && $i < 20)
{
$obj = $db->fetch_object($resql);
print '<tr '.$bc[$var].'><td nowrap>';
$facturesupplierstatic->ref=$obj->facnumber;
$facturesupplierstatic->id=$obj->rowid;
$facturesupplierstatic->type=$obj->type;
print $facturesupplierstatic->getNomUrl(1,'');
print '</td>';
print '<td>';
$facturesupplierstatic->id=$obj->socid;
$facturesupplierstatic->nom=$obj->nom;
$facturesupplierstatic->fournisseur=1;
print $facturesupplierstatic->getNomUrl(1,'',16);
print '</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '</tr>';
$tot_ttc+=$obj->total_ttc;
$i++;
$var=!$var;
}
print '<tr class="liste_total"><td align="left">'.$langs->trans("Total").'</td>';
print '<td colspan="2" align="right">'.price($tot_ttc).'</td>';
print '</tr>';
}
else
{
print '<tr colspan="3" '.$bc[$var].'><td>'.$langs->trans("NoInvoice").'</td></tr>';
}
print "</table><br>";
$db->free($resql); $db->free($resql);
} }
else else
@ -200,22 +288,21 @@ if ($conf->tax->enabled)
$sql.= " WHERE c.fk_type = cc.id AND c.paye=0"; $sql.= " WHERE c.fk_type = cc.id AND c.paye=0";
$resql = $db->query($sql); $resql = $db->query($sql);
if ( $resql ) if ( $resql )
{ {
$var = false;
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
if ($num)
{
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("ContributionsToPay").' ('.$num.')</td></tr>'; print '<td colspan="2">'.$langs->trans("ContributionsToPay").($num?' ('.$num.')':'').'</td></tr>';
if ($num)
{
$i = 0; $i = 0;
$tot_ttc=0; $tot_ttc=0;
$var = True;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$var = !$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
$chargestatic->id=$obj->rowid; $chargestatic->id=$obj->rowid;
$chargestatic->lib=$obj->libelle; $chargestatic->lib=$obj->libelle;
@ -223,15 +310,19 @@ if ($conf->tax->enabled)
print '<td align="right">'.price($obj->amount).'</td>'; print '<td align="right">'.price($obj->amount).'</td>';
print '</tr>'; print '</tr>';
$tot_ttc+=$obj->amount; $tot_ttc+=$obj->amount;
$var = !$var;
$i++; $i++;
} }
print '<tr class="liste_total"><td align="left">'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td align="left">'.$langs->trans("Total").'</td>';
print '<td align="right">'.price($tot_ttc).'</td>'; print '<td align="right">'.price($tot_ttc).'</td>';
print '</tr>'; print '</tr>';
print '</table><br>';
} }
else
{
print '<tr colspan="2" '.$bc[$var].'><td>'.$langs->trans("None").'</td></tr>';
}
print "</table><br>";
$db->free($resql); $db->free($resql);
} }
else else
@ -307,16 +398,17 @@ if ($user->rights->societe->lire)
if ($result) if ($result)
{ {
$var=false;
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
if ($num)
{
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastCustomers",min($max,$num)).'</td>'; print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastCustomers",min($max,$num)).'</td>';
print '<td align="right">'.$langs->trans("Date").'</td>'; print '<td align="right">'.$langs->trans("Date").'</td>';
print '</tr>'; print '</tr>';
if ($num)
{
$var = True; $var = True;
$total_ttc = $totalam = $total = 0; $total_ttc = $totalam = $total = 0;
@ -336,8 +428,12 @@ if ($user->rights->societe->lire)
$i++; $i++;
} }
print '</table><br>';
} }
else
{
print '<tr colspan="2" '.$bc[$var].'><td>'.$langs->trans("None").'</td></tr>';
}
print '</table><br>';
} }
} }
@ -365,42 +461,44 @@ if ($user->rights->societe->lire)
if ($result) if ($result)
{ {
$var=false;
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
if ($num)
{
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastSuppliers",min($max,$num)).'</td>'; print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastSuppliers",min($max,$num)).'</td>';
print '<td align="right">'.$langs->trans("Date").'</td>'; print '<td align="right">'.$langs->trans("Date").'</td>';
print '</tr>'; print '</tr>';
$var = True; if ($num)
{
$total_ttc = $totalam = $total = 0; $total_ttc = $totalam = $total = 0;
$customerstatic=new Client($db); $customerstatic=new Client($db);
$var=true;
while ($i < $num && $i < $max) while ($i < $num && $i < $max)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$customerstatic->id=$objp->rowid; $customerstatic->id=$objp->rowid;
$customerstatic->nom=$objp->nom; $customerstatic->nom=$objp->nom;
$var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$customerstatic->getNomUrl(1).'</td>'; print '<td>'.$customerstatic->getNomUrl(1).'</td>';
print '<td align="right">'.dolibarr_print_date($objp->dc,'day').'</td>'; print '<td align="right">'.dolibarr_print_date($objp->dc,'day').'</td>';
print '</tr>'; print '</tr>';
$var=!$var;
$i++; $i++;
} }
print '</table><br>';
} }
else
{
print '<tr colspan="2" '.$bc[$var].'><td>'.$langs->trans("None").'</td></tr>';
}
print '</table><br>';
} }
} }
/* /*
* Commandes à facturer * Commandes clients à facturer
*/ */
if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->commande->lire) if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->commande->lire)
{ {
@ -429,7 +527,9 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
if ( $resql ) if ( $resql )
{ {
$var=false;
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
if ($num) if ($num)
{ {
$i = 0; $i = 0;
@ -441,12 +541,10 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
print '<td align="right">'.$langs->trans("ToBill").'</td>'; print '<td align="right">'.$langs->trans("ToBill").'</td>';
print '<td align="center" width="16">&nbsp;</td>'; print '<td align="center" width="16">&nbsp;</td>';
print '</tr>'; print '</tr>';
$var = True;
$tot_ht=$tot_ttc=$tot_tobill=0; $tot_ht=$tot_ttc=$tot_tobill=0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print "<td width=\"20%\"><a href=\"commande/fiche.php?id=$obj->rowid\">".img_object($langs->trans("ShowOrder"),"order").'</a>&nbsp;'; print "<td width=\"20%\"><a href=\"commande/fiche.php?id=$obj->rowid\">".img_object($langs->trans("ShowOrder"),"order").'</a>&nbsp;';
print "<a href=\"commande/fiche.php?id=$obj->rowid\">".$obj->ref.'</a></td>'; print "<a href=\"commande/fiche.php?id=$obj->rowid\">".$obj->ref.'</a></td>';
@ -463,8 +561,8 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
//print "x".$tot_ttc."z".$obj->tot_fttc; //print "x".$tot_ttc."z".$obj->tot_fttc;
$tot_tobill += ($obj->total_ttc-$obj->tot_fttc); $tot_tobill += ($obj->total_ttc-$obj->tot_fttc);
$i++; $i++;
}
$var=!$var; $var=!$var;
}
print '<tr class="liste_total"><td colspan="2" align="right">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>'; print '<tr class="liste_total"><td colspan="2" align="right">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($tot_ht).'</td>'; if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($tot_ht).'</td>';
@ -483,7 +581,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
} }
/* /*
* Factures impayées * Factures clients impayées
*/ */
if ($conf->facture->enabled && $user->rights->facture->lire) if ($conf->facture->enabled && $user->rights->facture->lire)
{ {
@ -506,11 +604,10 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
$var=true;
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
if ($num)
{
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2"><a href="'.DOL_URL_ROOT.'/compta/facture/impayees.php">'.$langs->trans("BillsCustomersUnpayed",min($conf->liste_limit,$num)).' ('.$num.')</a></td>'; print '<tr class="liste_titre"><td colspan="2"><a href="'.DOL_URL_ROOT.'/compta/facture/impayees.php">'.$langs->trans("BillsCustomersUnpayed",min($conf->liste_limit,$num)).' ('.$num.')</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
@ -518,13 +615,13 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
print '<td align="right">'.$langs->trans("Received").'</td>'; print '<td align="right">'.$langs->trans("Received").'</td>';
print '<td width="16">&nbsp;</td>'; print '<td width="16">&nbsp;</td>';
print '</tr>'; print '</tr>';
$var = True; if ($num)
{
$total_ttc = $totalam = $total = 0; $total_ttc = $totalam = $total = 0;
while ($i < $num && $i < $conf->liste_limit) while ($i < $num && $i < $conf->liste_limit)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td nowrap>'; print '<td nowrap>';
$facturestatic->ref=$obj->facnumber; $facturestatic->ref=$obj->facnumber;
@ -543,9 +640,9 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$total_ttc += $obj->total_ttc; $total_ttc += $obj->total_ttc;
$total += $obj->total; $total += $obj->total;
$totalam += $obj->am; $totalam += $obj->am;
$var=!$var;
$i++; $i++;
} }
$var=!$var;
print '<tr class="liste_total"><td colspan="2" align="right">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>'; print '<tr class="liste_total"><td colspan="2" align="right">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($total).'</td>'; if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($total).'</td>';
@ -553,8 +650,14 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
print '<td align="right">'.price($totalam).'</td>'; print '<td align="right">'.price($totalam).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
print '</table><br>';
} }
else
{
$colspan=5;
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
}
print '</table><br>';
$db->free($resql); $db->free($resql);
} }
else else
@ -564,14 +667,12 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
} }
/* /*
* Factures a payer * Factures fournisseurs impayées
*/ */
if ($conf->facture->enabled && $user->rights->facture->lire) if ($conf->facture->enabled && $user->rights->facture->lire)
{ {
$facstatic=new FactureFournisseur($db); $facstatic=new FactureFournisseur($db);
if ($user->societe_id == 0)
{
$sql = "SELECT ff.rowid, ff.facnumber, ff.fk_statut, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc,"; $sql = "SELECT ff.rowid, ff.facnumber, ff.fk_statut, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc,";
$sql.= " sum(pf.amount) as am,"; $sql.= " sum(pf.amount) as am,";
$sql.= " s.nom, s.rowid as socid"; $sql.= " s.nom, s.rowid as socid";
@ -582,14 +683,15 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$sql.= " WHERE s.rowid = ff.fk_soc"; $sql.= " WHERE s.rowid = ff.fk_soc";
$sql.= " AND ff.paye=0 AND ff.fk_statut = 1"; $sql.= " AND ff.paye=0 AND ff.fk_statut = 1";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql .= " AND f.fk_soc = ".$socid;
$sql.= " GROUP BY ff.rowid, ff.facnumber, ff.fk_statut, ff.total, ff.total_ttc, s.nom, s.rowid"; $sql.= " GROUP BY ff.rowid, ff.facnumber, ff.fk_statut, ff.total, ff.total_ttc, s.nom, s.rowid";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
$var=false;
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
if ($num)
{
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsSuppliersUnpayed").' ('.$num.')</td>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsSuppliersUnpayed").' ('.$num.')</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
@ -597,13 +699,13 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
print '<td align="right">'.$langs->trans("Payed").'</td>'; print '<td align="right">'.$langs->trans("Payed").'</td>';
print '<td width="16">&nbsp;</td>'; print '<td width="16">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
if ($num)
{
$i = 0; $i = 0;
$var = True;
$total = $total_ttc = $totalam = 0; $total = $total_ttc = $totalam = 0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$var = !$var;
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
$facstatic->ref=$obj->facnumber; $facstatic->ref=$obj->facnumber;
$facstatic->id=$obj->rowid; $facstatic->id=$obj->rowid;
@ -619,8 +721,8 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$total_ttc += $obj->total_ttc; $total_ttc += $obj->total_ttc;
$totalam += $obj->am; $totalam += $obj->am;
$i++; $i++;
}
$var = !$var; $var = !$var;
}
print '<tr class="liste_total"><td colspan="2" align="right">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>'; print '<tr class="liste_total"><td colspan="2" align="right">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($total).'</td>'; if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($total).'</td>';
@ -628,8 +730,14 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
print '<td align="right">'.price($totalam).'</td>'; print '<td align="right">'.price($totalam).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
print '</table><br>';
} }
else
{
$colspan=5;
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
}
print '</table><br>';
} }
else else
{ {
@ -637,8 +745,6 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
} }
} }
}
// \todo Mettre ici recup des actions en rapport avec la compta // \todo Mettre ici recup des actions en rapport avec la compta

View File

@ -111,9 +111,9 @@ if ($_GET["filtre"])
} }
} }
if ($_GET["search_ref"]) if ($_REQUEST["search_ref"])
{ {
$sql .= " AND fac.facnumber like '%".addslashes($_GET["search_ref"])."%'"; $sql .= " AND fac.facnumber like '%".addslashes($_REQUEST["search_ref"])."%'";
} }
if ($_GET["search_libelle"]) if ($_GET["search_libelle"])
@ -167,7 +167,7 @@ if ($resql)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" size="10" type="text" name="search_ref" value="'.$_GET["search_ref"].'">'; print '<input class="flat" size="10" type="text" name="search_ref" value="'.$_REQUEST["search_ref"].'">';
print '</td><td class="liste_titre">&nbsp;</td>'; print '</td><td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_libelle" value="'.$_GET["search_libelle"].'">'; print '<input class="flat" type="text" name="search_libelle" value="'.$_GET["search_libelle"].'">';

View File

@ -66,7 +66,8 @@ ClassifyClosed=Classify 'Closed'
CreateBill=Create Invoice CreateBill=Create Invoice
AddBill=Add invoice or credit note AddBill=Add invoice or credit note
DeleteBill=Delete invoice DeleteBill=Delete invoice
SearchABill=Search an invoice SearchACustomerInvoice=Search a customer invoice
SearchASupplierInvoice=Search a supplier invoice
CancelBill=Cancel an invoice CancelBill=Cancel an invoice
SendByMail=EMail SendByMail=EMail
SendRemindByMail=EMail reminder SendRemindByMail=EMail reminder
@ -121,6 +122,8 @@ LastSuppliersBills=Last %s suppliers invoices
AllBills=All invoices AllBills=All invoices
OtherBills=Other invoices OtherBills=Other invoices
DraftBills=Draft invoices DraftBills=Draft invoices
CustomersDraftInvoices=Customers draft invoices
SuppliersDraftInvoices=Suppliers draft invoices
Unpayed=Unpayed Unpayed=Unpayed
ConfirmDeleteBill=Are you sure you want to delete this invoice ? ConfirmDeleteBill=Are you sure you want to delete this invoice ?
ConfirmValidateBill=Are you sure you want to validate this invoice with reference <b>%s</b> ? ConfirmValidateBill=Are you sure you want to validate this invoice with reference <b>%s</b> ?

View File

@ -278,6 +278,7 @@ Unknown=Unknown
General=General General=General
Size=Size Size=Size
Received=Received Received=Received
Payed=Payed
Topic=Sujet Topic=Sujet
ByCompanies=By companies ByCompanies=By companies
ByUsers=By users ByUsers=By users

View File

@ -66,7 +66,8 @@ ClassifyClosed=Classer 'Ferm
CreateBill=Créer Facture CreateBill=Créer Facture
AddBill=Créer facture ou avoir AddBill=Créer facture ou avoir
DeleteBill=Supprimer facture DeleteBill=Supprimer facture
SearchABill=Rechercher une facture SearchACustomerInvoice=Rechercher une facture client
SearchASupplierInvoice=Rechercher une facture fournisseur
CancelBill=Annuler une facture CancelBill=Annuler une facture
SendByMail=Envoyer SendByMail=Envoyer
SendRemindByMail=Envoyer rappel SendRemindByMail=Envoyer rappel
@ -121,6 +122,8 @@ LastSuppliersBills=Les %s derni
AllBills=Toutes les factures AllBills=Toutes les factures
OtherBills=Autres factures OtherBills=Autres factures
DraftBills=Factures brouillons DraftBills=Factures brouillons
CustomersDraftInvoices=Factures clients brouillons
SuppliersDraftInvoices=Factures fournisseurs brouillons
Unpayed=Impayées Unpayed=Impayées
ConfirmDeleteBill=Êtes-vous sûr de vouloir supprimer cette facture ? ConfirmDeleteBill=Êtes-vous sûr de vouloir supprimer cette facture ?
ConfirmValidateBill=Êtes-vous sûr de vouloir valider cette facture sous la référence <b>%s</b> ? ConfirmValidateBill=Êtes-vous sûr de vouloir valider cette facture sous la référence <b>%s</b> ?

View File

@ -279,6 +279,7 @@ Unknown=Inconnu
General=Général General=Général
Size=Taille Size=Taille
Received=Reçu Received=Reçu
Payed=Payé
Topic=Sujet Topic=Sujet
ByCompanies=Par société ByCompanies=Par société
ByUsers=Par utilisateur ByUsers=Par utilisateur

View File

@ -42,6 +42,16 @@ function societe_prepare_head($objsoc)
$head[$h][2] = 'company'; $head[$h][2] = 'company';
$h++; $h++;
//affichage onglet catégorie
if ($conf->categorie->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category';
$h++;
}
if ($objsoc->client==1) if ($objsoc->client==1)
{ {
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id; $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id;
@ -64,15 +74,6 @@ function societe_prepare_head($objsoc)
$h++; $h++;
} }
//affichage onglet catégorie
if ($conf->categorie->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category';
$h++;
}
if ($conf->facture->enabled || $conf->compta->enabled || $conf->comptaexpert->enabled) if ($conf->facture->enabled || $conf->compta->enabled || $conf->comptaexpert->enabled)
{ {
$langs->load("compta"); $langs->load("compta");