Add navigation in supplier invoice

This commit is contained in:
Laurent Destailleur 2009-01-23 16:54:45 +00:00
parent d61219feed
commit 8f8bcf5f47

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2005 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) 2004 Christophe Combelles <ccomb@free.fr> * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.fr> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.fr>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
@ -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']); $datefacture=dolibarr_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']);
$datedue=dolibarr_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); $datedue=dolibarr_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
if ($datefacture == '') if ($datefacture == '')
{ {
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')).'</div>'; $mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')).'</div>';
@ -169,7 +169,7 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer)
$error++; $error++;
} }
if (! $error) if (! $error)
{ {
$db->begin(); $db->begin();
@ -285,7 +285,7 @@ if ($_GET['action'] == 'add_ligne')
dolibarr_print_error($db,$facfou->error); dolibarr_print_error($db,$facfou->error);
exit; exit;
} }
if ($_POST['prodfournpriceid']) // > 0 or -1 if ($_POST['prodfournpriceid']) // > 0 or -1
{ {
$nv_prod = new ProductFournisseur($db); $nv_prod = new ProductFournisseur($db);
@ -293,7 +293,7 @@ if ($_GET['action'] == 'add_ligne')
if ($idprod > 0) if ($idprod > 0)
{ {
$result=$nv_prod->fetch($idprod); $result=$nv_prod->fetch($idprod);
// cas special pour lequel on a les meme reference que le fournisseur // cas special pour lequel on a les meme reference que le fournisseur
// $label = '['.$nv_prod->ref.'] - '. $nv_prod->libelle; // $label = '['.$nv_prod->ref.'] - '. $nv_prod->libelle;
$label = $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']); $datefacture=dolibarr_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']);
$datedue=dolibarr_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); $datedue=dolibarr_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
$dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture); $dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture);
print '<form name="add" action="fiche.php" method="post">'; print '<form name="add" action="fiche.php" method="post">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Third party // Third party
print '<tr><td>'.$langs->trans('Company').'</td>'; print '<tr><td>'.$langs->trans('Company').'</td>';
print '<td>'; print '<td>';
@ -438,7 +438,7 @@ if ($_GET['action'] == 'create')
print '</table>'; print '</table>';
} }
print '<center><input type="submit" class="button" value="'.$langs->trans('Save').'"></center>'; print '<center><input type="submit" class="button" value="'.$langs->trans('Save').'"></center>';
print '</form>'; print '</form>';
} }
@ -453,7 +453,7 @@ else
/* *************************************************************************** */ /* *************************************************************************** */
$now=gmmktime(); $now=gmmktime();
$productstatic = new Product($db); $productstatic = new Product($db);
$fac = new FactureFournisseur($db); $fac = new FactureFournisseur($db);
@ -569,7 +569,7 @@ else
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); $html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
print '<br>'; print '<br>';
} }
// Clone confirmation // Clone confirmation
if ($_GET["action"] == 'clone') 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'); $html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes');
print '<br>'; print '<br>';
} }
// Confirmation de la validation // Confirmation de la validation
if ($_GET['action'] == 'valid') if ($_GET['action'] == 'valid')
{ {
@ -608,7 +608,9 @@ 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">'.$fac->ref.'</td>'; print '<tr><td 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
@ -648,7 +650,7 @@ else
$langs->load('projects'); $langs->load('projects');
print '<tr>'; print '<tr>';
print '<td>'; print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project'); print $langs->trans('Project');
print '</td>'; print '</td>';
@ -659,7 +661,7 @@ else
print '</a></td>'; print '</a></td>';
} }
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($_GET['action'] == 'classer') if ($_GET['action'] == 'classer')
{ {
@ -672,7 +674,7 @@ else
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
print '</table>'; print '</table>';
print '</td><td valign="top" class="notopnoleftnoright">'; print '</td><td valign="top" class="notopnoleftnoright">';
@ -779,7 +781,7 @@ else
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
} }
$var=!$var; $var=!$var;
// Ligne en modification // Ligne en modification
if ($fac->statut == 0 && $_GET['action'] == 'mod_ligne' && $_GET['etat'] == '0' && $_GET['ligne_id'] == $fac->lignes[$i]->rowid) 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 '&nbsp;'; else print '&nbsp;';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
} }
if ($fac->statut == 0 && $_GET['action'] != 'mod_ligne') if ($fac->statut == 0 && $_GET['action'] != 'mod_ligne')
@ -910,7 +912,7 @@ else
print '</form>'; print '</form>';
} }
} }
print '</table>'; print '</table>';
print '</div>'; print '</div>';
@ -920,7 +922,7 @@ else
/* /*
* Boutons actions * Boutons actions
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($fac->statut <= 1 && $fac->getSommePaiement() <= 0 && $user->rights->fournisseur->facture->creer) if ($fac->statut <= 1 && $fac->getSommePaiement() <= 0 && $user->rights->fournisseur->facture->creer)
@ -961,7 +963,7 @@ else
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
} }
if ($user->rights->fournisseur->facture->creer) if ($user->rights->fournisseur->facture->creer)
{ {
print '<a class="butAction" href="fiche.php?facid='.$fac->id.'&amp;action=clone&amp;socid='.$fac->socid.'">'.$langs->trans('ToClone').'</a>'; print '<a class="butAction" href="fiche.php?facid='.$fac->id.'&amp;action=clone&amp;socid='.$fac->socid.'">'.$langs->trans('ToClone').'</a>';