Fix: Visited company not saved
This commit is contained in:
parent
1091f72a8f
commit
98e46b4011
@ -18,11 +18,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/compta/deplacement/fiche.php
|
* \file htdocs/compta/deplacement/fiche.php
|
||||||
\brief Page fiche d'un deplacement
|
* \brief Page fiche d'un deplacement
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
$langs->load("trips");
|
$langs->load("trips");
|
||||||
@ -94,11 +93,10 @@ if ($_POST["action"] == 'update' && $user->rights->deplacement->creer)
|
|||||||
$_POST["remonth"],
|
$_POST["remonth"],
|
||||||
$_POST["reday"],
|
$_POST["reday"],
|
||||||
$_POST["reyear"]);
|
$_POST["reyear"]);
|
||||||
|
|
||||||
$deplacement->km = $_POST["km"];
|
$deplacement->km = $_POST["km"];
|
||||||
$deplacement->type = $_POST["type"];
|
$deplacement->type = $_POST["type"];
|
||||||
$deplacement->fk_user = $_POST["fk_user"];
|
$deplacement->fk_user = $_POST["fk_user"];
|
||||||
|
$deplacement->socid = $_POST["socid"];
|
||||||
$result = $deplacement->update($user);
|
$result = $deplacement->update($user);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@ -177,12 +175,15 @@ else
|
|||||||
|
|
||||||
if ($_GET["action"] == 'edit')
|
if ($_GET["action"] == 'edit')
|
||||||
{
|
{
|
||||||
|
$soc = new Societe($db);
|
||||||
|
$soc->fetch($deplacement->socid);
|
||||||
|
|
||||||
$h=0;
|
$h=0;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/compta/deplacement/fiche.php?id=$deplacement->id";
|
$head[$h][0] = DOL_URL_ROOT."/compta/deplacement/fiche.php?id=$deplacement->id";
|
||||||
$head[$h][1] = $langs->trans("TripCard");
|
$head[$h][1] = $langs->trans("Card");
|
||||||
|
|
||||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Ref").' '.$deplacement->id);
|
dolibarr_fiche_head($head, $hselected, $langs->trans("TripCard"));
|
||||||
|
|
||||||
print "<form name='update' action=\"fiche.php\" method=\"post\">\n";
|
print "<form name='update' action=\"fiche.php\" method=\"post\">\n";
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
@ -190,11 +191,13 @@ else
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
$soc = new Societe($db);
|
print "<tr>";
|
||||||
$soc->fetch($deplacement->socid);
|
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
|
||||||
|
print $deplacement->ref;
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td width="20%">'.$langs->trans("CompanyVisited").'</td><td>';
|
print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
|
||||||
print $html->select_societes($soc->id,'socid','',1);
|
print $html->select_societes($soc->id,'socid','',1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -225,9 +228,9 @@ else
|
|||||||
$h=0;
|
$h=0;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/compta/deplacement/fiche.php?id=$deplacement->id";
|
$head[$h][0] = DOL_URL_ROOT."/compta/deplacement/fiche.php?id=$deplacement->id";
|
||||||
$head[$h][1] = $langs->trans("TripCard");
|
$head[$h][1] = $langs->trans("Card");
|
||||||
|
|
||||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Ref").' '.$deplacement->id);
|
dolibarr_fiche_head($head, $hselected, $langs->trans("TripCard"));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression du déplacement
|
* Confirmation de la suppression du déplacement
|
||||||
@ -242,20 +245,34 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($deplacement->socid);
|
if ($deplacement->socid) $soc->fetch($deplacement->socid);
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td width="20%">'.$langs->trans("CompanyVisited").'</td><td>'.$soc->getNomUrl(1).'</td></tr>';
|
|
||||||
|
print "<tr>";
|
||||||
|
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
|
||||||
|
print $deplacement->ref;
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td width="20%">'.$langs->trans("CompanyVisited").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
if ($soc->id) print $soc->getNomUrl(1);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Type").'</td><td>'.$langs->trans($deplacement->type).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Type").'</td><td>'.$langs->trans($deplacement->type).'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Person").'</td><td>';
|
print '<tr><td>'.$langs->trans("Person").'</td><td>';
|
||||||
$userfee=new User($db,$deplacement->fk_user);
|
$userfee=new User($db,$deplacement->fk_user);
|
||||||
$userfee->fetch();
|
$userfee->fetch();
|
||||||
print $userfee->getNomUrl(1);
|
print $userfee->getNomUrl(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Date").'</td><td>';
|
print '<tr><td>'.$langs->trans("Date").'</td><td>';
|
||||||
print dolibarr_print_date($deplacement->date);
|
print dolibarr_print_date($deplacement->date);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td>'.$deplacement->km.'</td></tr>';
|
print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td>'.$deplacement->km.'</td></tr>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user