From 8f8bcf5f47193eddd83141549e498e12abe42ec9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Jan 2009 16:54:45 +0000 Subject: [PATCH] Add navigation in supplier invoice --- htdocs/fourn/facture/fiche.php | 46 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 9daf2f95b55..e9d9267696d 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2007 Regis Houssin @@ -153,7 +153,7 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer) { $datefacture=dolibarr_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); $datedue=dolibarr_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); - + if ($datefacture == '') { $mesg='
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')).'
'; @@ -169,7 +169,7 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer) $error++; } - if (! $error) + if (! $error) { $db->begin(); @@ -285,7 +285,7 @@ if ($_GET['action'] == 'add_ligne') dolibarr_print_error($db,$facfou->error); exit; } - + if ($_POST['prodfournpriceid']) // > 0 or -1 { $nv_prod = new ProductFournisseur($db); @@ -293,7 +293,7 @@ if ($_GET['action'] == 'add_ligne') if ($idprod > 0) { $result=$nv_prod->fetch($idprod); - + // cas special pour lequel on a les meme reference que le fournisseur // $label = '['.$nv_prod->ref.'] - '. $nv_prod->libelle; $label = $nv_prod->libelle; @@ -371,13 +371,13 @@ if ($_GET['action'] == 'create') $datefacture=dolibarr_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); $datedue=dolibarr_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); - + $dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture); - + print '
'; print ''; print ''; - + // Third party print ''; print '
'.$langs->trans('Company').''; @@ -438,7 +438,7 @@ if ($_GET['action'] == 'create') print '
'; } - + print '
'; print '
'; } @@ -453,7 +453,7 @@ else /* *************************************************************************** */ $now=gmmktime(); - + $productstatic = new Product($db); $fac = new FactureFournisseur($db); @@ -569,7 +569,7 @@ else $html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); print '
'; } - + // Clone confirmation if ($_GET["action"] == 'clone') { @@ -582,7 +582,7 @@ else $html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes'); print '
'; } - + // Confirmation de la validation if ($_GET['action'] == 'valid') { @@ -608,7 +608,9 @@ else print ''; // Ref - print ''; + print ''; print "\n"; // Ref supplier @@ -648,7 +650,7 @@ else $langs->load('projects'); print ''; print ''; print ''; } - + print '
'.$langs->trans("Ref").''.$fac->ref.'
'.$langs->trans("Ref").''; + print $html->showrefnav($fac,'facid','',1,'rowid','ref',$morehtmlref); + print '
'; - + print ''; @@ -659,7 +661,7 @@ else print ''; } print '
'; print $langs->trans('Project'); print '
'; - + print '
'; if ($_GET['action'] == 'classer') { @@ -672,7 +674,7 @@ else print '
'; print ''; @@ -779,7 +781,7 @@ else print ' '; print ''; } - + $var=!$var; // Ligne en modification if ($fac->statut == 0 && $_GET['action'] == 'mod_ligne' && $_GET['etat'] == '0' && $_GET['ligne_id'] == $fac->lignes[$i]->rowid) @@ -847,8 +849,8 @@ else else print ' '; print ''; print ''; - } - + } + } if ($fac->statut == 0 && $_GET['action'] != 'mod_ligne') @@ -910,7 +912,7 @@ else print ''; } } - + print ''; print ''; @@ -920,7 +922,7 @@ else /* * Boutons actions */ - + print '
'; if ($fac->statut <= 1 && $fac->getSommePaiement() <= 0 && $user->rights->fournisseur->facture->creer) @@ -961,7 +963,7 @@ else print '>'.$langs->trans('Validate').''; } } - + if ($user->rights->fournisseur->facture->creer) { print ''.$langs->trans('ToClone').'';