diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 571924aee3f..967c399d5b1 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2267,7 +2267,7 @@ else } print ''; - // Discount + // Discounts print ''.$langs->trans('Discounts').''; if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); else print $langs->trans("CompanyHasNoRelativeDiscount"); @@ -2343,14 +2343,17 @@ else print ''; - // Payments + /* + * List of payments + */ + $nbrows=8; if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) $nbrows++; if ($conf->projet->enabled) $nbrows++; print ''; - print ''; + print '
'; // List of payments already done print ''; @@ -2362,10 +2365,6 @@ else $var=true; - /* - * List of payments - */ - // Payments already done (from deposits) /* $depositamount=0; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index f8e9a35db08..25a9f8ed0ed 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -179,7 +179,7 @@ if ($id > 0) // Reference du facture print '"; // Ref supplier diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 0c0b12ce6ea..96cf068cf75 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -20,11 +20,11 @@ */ /** - \file htdocs/fourn/facture/document.php - \ingroup facture, fournisseur - \brief Page de gestion des documents attachees a une facture fournisseur - \version $Id$ -*/ + * \file htdocs/fourn/facture/document.php + * \ingroup facture, fournisseur + * \brief Page de gestion des documents attachees a une facture fournisseur + * \version $Id$ + */ require('./pre.inc.php'); require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php'); @@ -66,42 +66,42 @@ if ($_POST['sendit'] && ! empty($conf->global->MAIN_UPLOAD_DOC)) { $facture = new FactureFournisseur($db); if ($facture->fetch($facid)) - { - $upload_dir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($facture->id,2).$facture->id; + { + $upload_dir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($facture->id,2).$facture->id; - if (! is_dir($upload_dir)) create_exdir($upload_dir); + if (! is_dir($upload_dir)) create_exdir($upload_dir); - if (is_dir($upload_dir)) - { - if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . '/' . $_FILES['userfile']['name'],0) > 0) - { - $mesg = '
'.$langs->trans('FileTransferComplete').'
'; - //print_r($_FILES); - } - else - { - // Echec transfert (fichier depassant la limite ?) - $mesg = '
'.$langs->trans('ErrorFileNotUploaded').'
'; - // print_r($_FILES); - } - } - } + if (is_dir($upload_dir)) + { + if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . '/' . $_FILES['userfile']['name'],0) > 0) + { + $mesg = '
'.$langs->trans('FileTransferComplete').'
'; + //print_r($_FILES); + } + else + { + // Echec transfert (fichier depassant la limite ?) + $mesg = '
'.$langs->trans('ErrorFileNotUploaded').'
'; + // print_r($_FILES); + } + } + } } // Delete if ($action=='delete') { - $facid=$_GET["id"]; + $facid=$_GET["id"]; - $facture = new FactureFournisseur($db); + $facture = new FactureFournisseur($db); if ($facture->fetch($facid)) - { - $upload_dir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($facture->id,2).$facture->id; + { + $upload_dir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($facture->id,2).$facture->id; - $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - dol_delete_file($file); - $mesg = '
'.$langs->trans('FileWasRemoved').'
'; - } + $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). + dol_delete_file($file); + $mesg = '
'.$langs->trans('FileWasRemoved').'
'; + } } @@ -109,14 +109,16 @@ if ($action=='delete') * Affichage */ +$html = new Form($db); + llxHeader(); if ($facid > 0) { $facture = new FactureFournisseur($db); if ($facture->fetch($facid)) - { - $facture->fetch_fournisseur(); + { + $facture->fetch_fournisseur(); $upload_dir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($facture->id,2).$facture->id; @@ -133,31 +135,33 @@ if ($facid > 0) } - print '
'.$langs->trans("Ref").''; - print $facture->ref; + print $html->showrefnav($facture,'facid','',1,'rowid','ref',$morehtmlref); print "
'; + print '
'; // Ref - print ''; + print ''; print "\n"; // Ref supplier print ''; print "\n"; - // Societe - print ''; + // Societe + print ''; - print ''; + print ''; - print ''; + print ''; - print '
'.$langs->trans("Ref").''.$facture->ref.'
'.$langs->trans("Ref").''; + print $html->showrefnav($facture,'facid','',1,'rowid','ref',$morehtmlref); + print '
'.$langs->trans("RefSupplier").''.$facture->ref_supplier.'
'.$langs->trans('Company').''.$facture->fournisseur->getNomUrl(1).'
'.$langs->trans('Company').''.$facture->fournisseur->getNomUrl(1).'
'.$langs->trans('NbOfAttachedFiles').''.sizeof($filearray).'
'.$langs->trans('NbOfAttachedFiles').''.sizeof($filearray).'
'.$langs->trans('TotalSizeOfAttachedFiles').''.$totalsize.' '.$langs->trans('bytes').'
'.$langs->trans('TotalSizeOfAttachedFiles').''.$totalsize.' '.$langs->trans('bytes').'
'; - print ''; + print ''; + print ''; - if ($mesg) { print $mesg.'
'; } + if ($mesg) { print $mesg.'
'; } - // Affiche formulaire upload - $formfile=new FormFile($db); + // Affiche formulaire upload + $formfile=new FormFile($db); $formfile->form_attach_new_file(DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$facture->id,'',0,0,$user->rights->fournisseur->facture->creer); diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index f654fd2c184..88974a1d023 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -645,8 +645,6 @@ else if ($ret == 'html') print '
'; } - print ''; - print '
'; /* * Facture @@ -654,84 +652,70 @@ else print ''; // Ref - print ''; print "\n"; // Ref supplier - print ''; + print ''; print "\n"; - // Societe - print ''; - print ''; - print ''; + // Third party + print ''; + // Type + print ''; + + + // Label print ''; - print ''; - - print ''; - - print ''; - print ''; - - // Status - $alreadypayed=$fac->getSommePaiement(); - print ''; - - print ''; - print ''; - print ''; - - // Project - if ($conf->projet->enabled) - { - $langs->load('projects'); - print ''; - print ''; - print ''; - } - - print '
'.$langs->trans("Ref").''; + print '
'.$langs->trans("Ref").''; print $html->showrefnav($fac,'facid','',1,'rowid','ref',$morehtmlref); print '
'.$langs->trans("RefSupplier").''.$fac->ref_supplier.'
'.$langs->trans("RefSupplier").''.$fac->ref_supplier.'
'.$langs->trans('Company').''.$societe->getNomUrl(1).''.$langs->trans('OtherBills').'
'.$langs->trans('Company').''.$societe->getNomUrl(1).' ('.$langs->trans('OtherBills').')
'.$langs->trans('Type').''; + 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 '
'.$langs->trans('Label').''; print $fac->libelle; print '
'.$langs->trans('Date').''; - print dol_print_date($fac->datep,'daytext').'
'.$langs->trans('DateEcheance').''; - 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 '
'.$langs->trans('Status').''.$fac->getLibStatut(4,$alreadypayed).'
'.$langs->trans('AmountHT').''.price($fac->total_ht).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('AmountVAT').''.price($fac->total_tva).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('AmountTTC').''.price($fac->total_ttc).''.$langs->trans('Currency'.$conf->monnaie).'
'; - - print ''; - if ($_GET['action'] != 'classer') - { - print ''; - } - print '
'; - print $langs->trans('Project'); - print 'id.'">'; - print img_edit($langs->trans('SetProject'),1); - print '
'; - - print '
'; - 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 '
'; - - print '
'; - - - print ''; /* * List of payments */ - print ''; + print ''; + print ''; + print ''; + + // Project + if ($conf->projet->enabled) + { + $langs->load('projects'); + print ''; + print ''; + print ''; + } - print ''; print '
'; + $nbrows=7; + if ($conf->projet->enabled) $nbrows++; + + print ''; $sql = 'SELECT '.$db->pdate('datep').' as dp, pf.amount,'; $sql .= ' c.libelle as paiement_type, p.num_paiement, p.rowid'; $sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; @@ -745,7 +729,7 @@ else { $num = $db->num_rows($result); $i = 0; $totalpaye = 0; - print ''; + print '
'; print ''; print ''; print ''; @@ -796,12 +780,59 @@ else { dol_print_error($db); } + print ''; + + + print ''; + + print ''; + + print ''; + print ''; - print '
'.$langs->trans('Payments').''.$langs->trans('Type').'
'.$langs->trans('Date').''; + print dol_print_date($fac->datep,'daytext').'
'.$langs->trans('DateEcheance').''; + 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 '
'; + // Status + $alreadypayed=$fac->getSommePaiement(); + print '
'.$langs->trans('Status').''.$fac->getLibStatut(4,$alreadypayed).'
'.$langs->trans('AmountHT').''.price($fac->total_ht).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('AmountVAT').''.price($fac->total_tva).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('AmountTTC').''.price($fac->total_ttc).''.$langs->trans('Currency'.$conf->monnaie).'
'; + + print ''; + if ($_GET['action'] != 'classer') + { + print ''; + } + print '
'; + print $langs->trans('Project'); + print 'id.'">'; + print img_edit($langs->trans('SetProject'),1); + print '
'; + + print '
'; + 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 '
'; diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index f0d7efd5a7c..529bea0afc1 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -19,11 +19,11 @@ */ /** - \file htdocs/fourn/facture/note.php - \ingroup facture - \brief Fiche de notes sur une facture fournisseur - \version $Id$ -*/ + * \file htdocs/fourn/facture/note.php + * \ingroup facture + * \brief Fiche de notes sur une facture fournisseur + * \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/fourn.lib.php'); @@ -49,7 +49,7 @@ $fac->fetch($_GET["facid"]); if ($_POST["action"] == 'update_public' && $user->rights->facture->creer) { $db->begin(); - + $res=$fac->update_note_public($_POST["note_public"],$user); if ($res < 0) { @@ -65,7 +65,7 @@ if ($_POST["action"] == 'update_public' && $user->rights->facture->creer) if ($_POST["action"] == 'update' && $user->rights->fournisseur->facture->creer) { $db->begin(); - + $res=$fac->update_note($_POST["note"],$user); if ($res < 0) { @@ -80,14 +80,14 @@ if ($_POST["action"] == 'update' && $user->rights->fournisseur->facture->creer) -/******************************************************************************/ -/* Affichage fiche */ -/******************************************************************************/ - -llxHeader(); +/* + * View + */ $html = new Form($db); +llxHeader(); + if ($_GET["facid"]) { $fac->fetch_fournisseur(); @@ -100,7 +100,9 @@ if ($_GET["facid"]) print ''; // Ref - print ''; + print ''; print "\n"; // Ref supplier @@ -148,7 +150,7 @@ if ($_GET["facid"]) } print ""; } - + print "
'.$langs->trans("Ref").''.$fac->ref.'
'.$langs->trans("Ref").''; + print $html->showrefnav($fac,'facid','',1,'rowid','ref',$morehtmlref); + print '
";