New: Add navigation arrows in supplier invoices

This commit is contained in:
Laurent Destailleur 2009-07-19 15:39:25 +00:00
parent d28ce530e8
commit 3bcd18feb6
5 changed files with 171 additions and 135 deletions

View File

@ -2267,7 +2267,7 @@ else
} }
print '</td></tr>'; print '</td></tr>';
// Discount // Discounts
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">'; print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
else print $langs->trans("CompanyHasNoRelativeDiscount"); else print $langs->trans("CompanyHasNoRelativeDiscount");
@ -2343,14 +2343,17 @@ else
print '</td>'; print '</td>';
// Payments /*
* List of payments
*/
$nbrows=8; $nbrows=8;
if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) $nbrows++; if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) $nbrows++;
if ($conf->projet->enabled) $nbrows++; if ($conf->projet->enabled) $nbrows++;
print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">'; print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">';
print '<table class="noborder" width="100%">'; print '<table class="nobordernopadding" width="100%">';
// List of payments already done // List of payments already done
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -2362,10 +2365,6 @@ else
$var=true; $var=true;
/*
* List of payments
*/
// Payments already done (from deposits) // Payments already done (from deposits)
/* /*
$depositamount=0; $depositamount=0;

View File

@ -179,7 +179,7 @@ if ($id > 0)
// Reference du facture // Reference du facture
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $facture->ref; print $html->showrefnav($facture,'facid','',1,'rowid','ref',$morehtmlref);
print "</td></tr>"; print "</td></tr>";
// Ref supplier // Ref supplier

View File

@ -20,10 +20,10 @@
*/ */
/** /**
\file htdocs/fourn/facture/document.php * \file htdocs/fourn/facture/document.php
\ingroup facture, fournisseur * \ingroup facture, fournisseur
\brief Page de gestion des documents attachees a une facture fournisseur * \brief Page de gestion des documents attachees a une facture fournisseur
\version $Id$ * \version $Id$
*/ */
require('./pre.inc.php'); require('./pre.inc.php');
@ -109,6 +109,8 @@ if ($action=='delete')
* Affichage * Affichage
*/ */
$html = new Form($db);
llxHeader(); llxHeader();
if ($facid > 0) if ($facid > 0)
@ -136,7 +138,9 @@ if ($facid > 0)
print '<table class="border"width="100%">'; print '<table class="border"width="100%">';
// Ref // Ref
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">'.$facture->ref.'</td>'; print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
print $html->showrefnav($facture,'facid','',1,'rowid','ref',$morehtmlref);
print '</td>';
print "</tr>\n"; print "</tr>\n";
// Ref supplier // Ref supplier

View File

@ -645,8 +645,6 @@ else
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<table width="100%" class="notopnoleftnoright">';
print '<tr><td width="50%" valign="top" class="notopnoleft">';
/* /*
* Facture * Facture
@ -654,84 +652,70 @@ else
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td nowrap="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<tr><td nowrap="nowrap" width="20%">'.$langs->trans("Ref").'</td><td colspan="4">';
print $html->showrefnav($fac,'facid','',1,'rowid','ref',$morehtmlref); print $html->showrefnav($fac,'facid','',1,'rowid','ref',$morehtmlref);
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
// Ref supplier // Ref supplier
print '<tr><td nowrap="nowrap">'.$langs->trans("RefSupplier").'</td><td colspan="3">'.$fac->ref_supplier.'</td>'; print '<tr><td nowrap="nowrap">'.$langs->trans("RefSupplier").'</td><td colspan="4">'.$fac->ref_supplier.'</td>';
print "</tr>\n"; print "</tr>\n";
// Societe // Third party
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$societe->getNomUrl(1).'</td>'; print '<tr><td>'.$langs->trans('Company').'</td><td colspan="4">'.$societe->getNomUrl(1).' (<a href="index.php?socid='.$fac->socid.'">'.$langs->trans('OtherBills').'</a>)</td></tr>';
print '<td align="right"><a href="index.php?socid='.$fac->socid.'">'.$langs->trans('OtherBills').'</a></td>';
print '</tr>';
// Type
print '<tr><td>'.$langs->trans('Type').'</td><td colspan="4">';
print $fac->getLibType();
if ($fac->type == 1)
{
$facreplaced=new FactureFournisseur($db);
$facreplaced->fetch($fac->fk_facture_source);
print ' ('.$langs->transnoentities("ReplaceInvoice",$facreplaced->getNomUrl(1)).')';
}
if ($fac->type == 2)
{
$facusing=new FactureFournisseur($db);
$facusing->fetch($fac->fk_facture_source);
print ' ('.$langs->transnoentities("CorrectInvoice",$facusing->getNomUrl(1)).')';
}
$facidavoir=$fac->getListIdAvoirFromInvoice();
if (sizeof($facidavoir) > 0)
{
print ' ('.$langs->transnoentities("InvoiceHasAvoir");
$i=0;
foreach($facidavoir as $id)
{
if ($i==0) print ' ';
else print ',';
$facavoir=new FactureFournisseur($db);
$facavoir->fetch($id);
print $facavoir->getNomUrl(1);
}
print ')';
}
if ($facidnext > 0)
{
$facthatreplace=new FactureFournisseur($db);
$facthatreplace->fetch($facidnext);
print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')';
}
print '</td></tr>';
// Label
print '<tr><td>'.$langs->trans('Label').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Label').'</td><td colspan="3">';
print $fac->libelle; print $fac->libelle;
print '</td>'; print '</td>';
print '</tr>';
print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3" nowrap="nowrap">';
print dol_print_date($fac->datep,'daytext').'</td></tr>';
print '<tr>';
print '<td>'.$langs->trans('DateEcheance').'</td><td colspan="3">';
print dol_print_date($fac->date_echeance,'daytext');
if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print '</td></tr>';
// Status
$alreadypayed=$fac->getSommePaiement();
print '<tr><td>'.$langs->trans('Status').'</td><td colspan="3">'.$fac->getLibStatut(4,$alreadypayed).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountHT').'</td><td><b>'.price($fac->total_ht).'</b></td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($fac->total_tva).'</td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($fac->total_ttc).'</td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
// Project
if ($conf->projet->enabled)
{
$langs->load('projects');
print '<tr>';
print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($_GET['action'] != 'classer')
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classer&amp;facid='.$fac->id.'">';
print img_edit($langs->trans('SetProject'),1);
print '</a></td>';
}
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'classer')
{
$html->form_project($_SERVER['PHP_SELF'].'?facid='.$fac->id,$fac->socid,$fac->fk_project,'projetid');
}
else
{
$html->form_project($_SERVER['PHP_SELF'].'?facid='.$fac->id,$fac->socid,$fac->fk_project,'none');
}
print '</td>';
print '</tr>';
}
print '</table>';
print '</td><td valign="top" class="notopnoleftnoright">';
print '<table width="100%" class="noborder">';
/* /*
* List of payments * List of payments
*/ */
print '<tr><td colspan="2">'; $nbrows=7;
if ($conf->projet->enabled) $nbrows++;
print '<td rowspan="'.$nbrows.'" valign="top">';
$sql = 'SELECT '.$db->pdate('datep').' as dp, pf.amount,'; $sql = 'SELECT '.$db->pdate('datep').' as dp, pf.amount,';
$sql .= ' c.libelle as paiement_type, p.num_paiement, p.rowid'; $sql .= ' c.libelle as paiement_type, p.num_paiement, p.rowid';
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; $sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
@ -745,7 +729,7 @@ else
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $totalpaye = 0; $i = 0; $totalpaye = 0;
print '<table class="noborder" width="100%">'; print '<table class="nobordernopadding" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Payments').'</td>'; print '<td>'.$langs->trans('Payments').'</td>';
print '<td>'.$langs->trans('Type').'</td>'; print '<td>'.$langs->trans('Type').'</td>';
@ -796,12 +780,59 @@ else
{ {
dol_print_error($db); dol_print_error($db);
} }
print '</td>';
print '</tr>';
print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3" nowrap="nowrap">';
print dol_print_date($fac->datep,'daytext').'</td></tr>';
print '<tr>';
print '<td>'.$langs->trans('DateEcheance').'</td><td colspan="3">';
print dol_print_date($fac->date_echeance,'daytext');
if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print '</td></tr>'; print '</td></tr>';
print '</table>';
// Status
$alreadypayed=$fac->getSommePaiement();
print '<tr><td>'.$langs->trans('Status').'</td><td colspan="3">'.$fac->getLibStatut(4,$alreadypayed).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountHT').'</td><td><b>'.price($fac->total_ht).'</b></td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($fac->total_tva).'</td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($fac->total_ttc).'</td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
// Project
if ($conf->projet->enabled)
{
$langs->load('projects');
print '<tr>';
print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($_GET['action'] != 'classer')
{
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classer&amp;facid='.$fac->id.'">';
print img_edit($langs->trans('SetProject'),1);
print '</a></td>';
}
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'classer')
{
$html->form_project($_SERVER['PHP_SELF'].'?facid='.$fac->id,$fac->socid,$fac->fk_project,'projetid');
}
else
{
$html->form_project($_SERVER['PHP_SELF'].'?facid='.$fac->id,$fac->socid,$fac->fk_project,'none');
}
print '</td>';
print '</tr>';
}
print '</td></tr>';
print '</table>'; print '</table>';

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -19,10 +19,10 @@
*/ */
/** /**
\file htdocs/fourn/facture/note.php * \file htdocs/fourn/facture/note.php
\ingroup facture * \ingroup facture
\brief Fiche de notes sur une facture fournisseur * \brief Fiche de notes sur une facture fournisseur
\version $Id$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -80,14 +80,14 @@ if ($_POST["action"] == 'update' && $user->rights->fournisseur->facture->creer)
/******************************************************************************/ /*
/* Affichage fiche */ * View
/******************************************************************************/ */
llxHeader();
$html = new Form($db); $html = new Form($db);
llxHeader();
if ($_GET["facid"]) if ($_GET["facid"])
{ {
$fac->fetch_fournisseur(); $fac->fetch_fournisseur();
@ -100,7 +100,9 @@ if ($_GET["facid"])
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">'.$fac->ref.'</td>'; print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
print $html->showrefnav($fac,'facid','',1,'rowid','ref',$morehtmlref);
print '</td>';
print "</tr>\n"; print "</tr>\n";
// Ref supplier // Ref supplier