Qual: Removed deprecated code

This commit is contained in:
Laurent Destailleur 2009-02-18 15:00:34 +00:00
parent 8126b0cd6f
commit 19e1bd0083
6 changed files with 445 additions and 456 deletions

View File

@ -297,7 +297,7 @@ if ($socid > 0)
} }
// Adresse de livraison // Adresse de livraison
if ($conf->expedition->enabled) if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
{ {
print '<tr><td nowrap>'; print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';

View File

@ -786,6 +786,7 @@ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer)
} }
} }
// Set project
if ($_POST['action'] == 'classin') if ($_POST['action'] == 'classin')
{ {
$propal = new Propal($db); $propal = new Propal($db);
@ -1050,7 +1051,7 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Delivery date
$langs->load('deliveries'); $langs->load('deliveries');
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -1097,7 +1098,7 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>'; print '</td></tr>';
} }
// Conditions et modes de reglement // Payment term
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort'); print $langs->trans('PaymentConditionsShort');
@ -1116,7 +1117,7 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Mode paiement // Payment mode
print '<tr>'; print '<tr>';
print '<td width="25%">'; print '<td width="25%">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -1142,9 +1143,9 @@ if ($id > 0 || ! empty($ref))
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project').'</td>'; print $langs->trans('Project').'</td>';
if ($propal->statut == 0 && $user->rights->propale->creer) if ($user->rights->propale->creer)
{ {
if ($_GET['action'] != 'classer' && $propal->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>'; if ($_GET['action'] != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('SetProject')).'</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')
@ -1166,7 +1167,7 @@ if ($id > 0 || ! empty($ref))
$proj = new Project($db); $proj = new Project($db);
$proj->fetch($propal->projetidp); $proj->fetch($propal->projetidp);
print '<a href="../projet/fiche.php?id='.$propal->projetidp.'" title="'.$langs->trans('ShowProject').'">'; print '<a href="../projet/fiche.php?id='.$propal->projetidp.'" title="'.$langs->trans('ShowProject').'">';
print $proj->title; print $proj->ref;
print '</a>'; print '</a>';
print '</td>'; print '</td>';
} }

View File

@ -1184,7 +1184,7 @@ else
/* /*
* Commande * Commande
*/ */
$nbrow=8; $nbrow=7;
if ($conf->projet->enabled) $nbrow++; if ($conf->projet->enabled) $nbrow++;
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -1268,35 +1268,34 @@ else
print '</tr>'; print '</tr>';
// Date de livraison // Date de livraison
if ($conf->expedition->enabled) print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryDate');
print '</td>';
if ($_GET['action'] != 'editdate_livraison' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
if ($_GET['action'] == 'editdate_livraison')
{ {
print '<tr><td height="10">'; print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'" method="post">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<input type="hidden" name="action" value="setdate_livraison">';
print $langs->trans('DeliveryDate'); $html->select_date($commande->date_livraison,'liv_','','','',"setdate_livraison");
print '</td>'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
if ($_GET['action'] != 'editdate_livraison' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>'; }
print '</tr></table>'; else
print '</td><td colspan="2">'; {
if ($_GET['action'] == 'editdate_livraison') print $commande->date_livraison ? dolibarr_print_date($commande->date_livraison,'daytext') : '&nbsp;';
{ }
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'" method="post">'; print '</td>';
print '<input type="hidden" name="action" value="setdate_livraison">'; print '<td rowspan="'.$nbrow.'" valign="top">'.$langs->trans('NotePublic').' :<br>';
$html->select_date($commande->date_livraison,'liv_','','','',"setdate_livraison"); print nl2br($commande->note_public);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '</td>';
print '</form>'; print '</tr>';
}
else
{
print $commande->date_livraison ? dolibarr_print_date($commande->date_livraison,'daytext') : '&nbsp;';
}
print '</td>';
print '<td rowspan="'.$nbrow.'" valign="top">'.$langs->trans('NotePublic').' :<br>';
print nl2br($commande->note_public);
print '</td>';
print '</tr>';
if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
{
// Adresse de livraison // Adresse de livraison
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -1337,23 +1336,14 @@ else
} }
print '</td>'; print '</td>';
//Note public lorsque le module expedition n'est pas active
if (!$conf->projet->enabled) $nbrow--;
if (!$conf->expedition->enabled)
{
$nbrow--;
if ($conf->projet->enabled) $nbrow--;
print '<td rowspan="'.$nbrow.'" valign="top">'.$langs->trans('NotePublic').' :<br>';
print nl2br($commande->note_public);
print '</td>';
}
print '</tr>'; print '</tr>';
// Payment mode
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentMode'); print $langs->trans('PaymentMode');
print '</td>'; print '</td>';
if ($_GET['action'] != 'editmode' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>'; if ($_GET['action'] != 'editmode') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="2">'; print '</td><td colspan="2">';
if ($_GET['action'] == 'editmode') if ($_GET['action'] == 'editmode')
@ -1374,7 +1364,7 @@ else
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>';
if ($_GET['action'] != 'classer' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>'; if ($_GET['action'] != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="2">'; print '</td><td colspan="2">';
if ($_GET['action'] == 'classer') if ($_GET['action'] == 'classer')

View File

@ -25,7 +25,7 @@
\ingroup propale \ingroup propale
\brief Page liste des propales (vision compta) \brief Page liste des propales (vision compta)
\version $Id$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
@ -44,7 +44,7 @@ $sortfield=$_GET["sortfield"];
$viewstatut=$_GET['viewstatut']; $viewstatut=$_GET['viewstatut'];
$propal_statut = $_GET['propal_statut']; $propal_statut = $_GET['propal_statut'];
if($propal_statut != '') if($propal_statut != '')
$viewstatut=$propal_statut; $viewstatut=$propal_statut;
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="p.datep"; if (! $sortfield) $sortfield="p.datep";
@ -76,12 +76,10 @@ $result = restrictedArea($user, $module, $objectid, $dbtable);
if ($_GET["action"] == 'setstatut') if ($_GET["action"] == 'setstatut')
{ {
/* // Close proposal
* Class<EFBFBD>e la facture comme factur<EFBFBD>e $propal = new Propal($db);
*/ $propal->id = $_GET["propalid"];
$propal = new Propal($db); $propal->cloture($user, $_GET["statut"], $note);
$propal->id = $_GET["propalid"];
$propal->cloture($user, $_GET["statut"], $note);
} }
@ -109,6 +107,15 @@ if ( $action == 'delete' )
$brouillon = 1; $brouillon = 1;
} }
// Set project
if ($_POST['action'] == 'classin')
{
$propal = new Propal($db);
$propal->fetch($_GET['propalid']);
$propal->setProject($_POST['projetidp']);
}
/* /*
* View * View
@ -130,50 +137,50 @@ $propalstatic=new Propal($db);
*/ */
if ($_GET["propalid"] > 0) if ($_GET["propalid"] > 0)
{ {
if ($mesg) print "$mesg<br>"; if ($mesg) print "$mesg<br>";
$propal = new Propal($db); $propal = new Propal($db);
$propal->fetch($_GET['propalid']); $propal->fetch($_GET['propalid']);
$societe = new Societe($db); $societe = new Societe($db);
$societe->fetch($propal->socid); $societe->fetch($propal->socid);
$head = propal_prepare_head($propal); $head = propal_prepare_head($propal);
dolibarr_fiche_head($head, 'compta', $langs->trans('Proposal')); dolibarr_fiche_head($head, 'compta', $langs->trans('Proposal'));
/* /*
* Fiche propal * Fiche propal
* *
*/ */
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback='<a href="propal.php' . "?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder" .'">'.$langs->trans("BackToList")."</a>"; $linkback='<a href="propal.php' . "?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder" .'">'.$langs->trans("BackToList")."</a>";
// Ref // Ref
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="5">'; print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="5">';
print $html->showrefnav($propal,'propalid',$linkback); print $html->showrefnav($propal,'propalid',$linkback);
print '</td></tr>'; print '</td></tr>';
// Ref client // Ref client
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>'; print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
print $langs->trans('RefCustomer').'</td><td align="left">'; print $langs->trans('RefCustomer').'</td><td align="left">';
print '</td>'; print '</td>';
if ($_GET['action'] != 'refclient' && $propal->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('Modify')).'</a></td>'; if ($_GET['action'] != 'refclient' && $propal->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="5">'; print '</td><td colspan="5">';
print $propal->ref_client; print $propal->ref_client;
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
$rowspan=8; $rowspan=8;
// Soci<63>t<EFBFBD> // Soci<63>t<EFBFBD>
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td></tr>';
// Ligne info remises tiers // Ligne info remises tiers
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">'; print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client); if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client);
else print $langs->trans("CompanyHasNoRelativeDiscount"); else print $langs->trans("CompanyHasNoRelativeDiscount");
$absolute_discount=$societe->getAvailableDiscounts(); $absolute_discount=$societe->getAvailableDiscounts();
@ -183,33 +190,33 @@ if ($_GET["propalid"] > 0)
print '.'; print '.';
print '</td></tr>'; print '</td></tr>';
// Dates // Dates
print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">';
print dolibarr_print_date($propal->date,'daytext'); print dolibarr_print_date($propal->date,'daytext');
print '</td>'; print '</td>';
if ($conf->projet->enabled) $rowspan++; if ($conf->projet->enabled) $rowspan++;
// Note // Note
print '<td valign="top" colspan="2" width="50%" rowspan="'.$rowspan.'">'.$langs->trans('NotePublic').' :<br>'. nl2br($propal->note_public).'</td>'; print '<td valign="top" colspan="2" width="50%" rowspan="'.$rowspan.'">'.$langs->trans('NotePublic').' :<br>'. nl2br($propal->note_public).'</td>';
print '</tr>'; print '</tr>';
// Date fin propal // Date fin propal
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans('DateEndPropal').'</td><td colspan="3">'; print '<td>'.$langs->trans('DateEndPropal').'</td><td colspan="3">';
if ($propal->fin_validite) if ($propal->fin_validite)
{ {
print dolibarr_print_date($propal->fin_validite,'daytext'); print dolibarr_print_date($propal->fin_validite,'daytext');
if ($propal->statut == 1 && $propal->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); if ($propal->statut == 1 && $propal->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
} }
else else
{ {
print $langs->trans("Unknown"); print $langs->trans("Unknown");
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Conditions et modes de r<>glement // Payment term
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort'); print $langs->trans('PaymentConditionsShort');
@ -227,7 +234,7 @@ if ($_GET["propalid"] > 0)
} }
print '</td>'; print '</td>';
// Mode de paiement // Payment mode
print '<tr>'; print '<tr>';
print '<td width="25%">'; print '<td width="25%">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -246,142 +253,130 @@ if ($_GET["propalid"] > 0)
} }
print '</td></tr>'; print '</td></tr>';
// Projet // Project
if ($conf->projet->enabled) if ($conf->projet->enabled)
{ {
$langs->load("projects"); $langs->load("projects");
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project').'</td>'; print $langs->trans('Project').'</td>';
$numprojet = $societe->has_projects(); if (1 == 2 && $user->rights->propale->creer)
if (! $numprojet) {
{ if ($_GET['action'] != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</td></tr></table>'; print '</tr></table>';
print '<td colspan="2">'; print '</td><td colspan="3">';
print $langs->trans("NoProject").'</td><td>'; if ($_GET['action'] == 'classer')
print '<a href=../projet/fiche.php?socid='.$societe->id.'&action=create>'.$langs->trans('AddProject').'</a>'; {
print '</td>'; $html->form_project($_SERVER['PHP_SELF'].'?propalid='.$propal->id, $propal->socid, $propal->projetidp, 'projetidp');
} }
else else
{ {
if ($propal->statut == 0 && $user->rights->propale->creer) $html->form_project($_SERVER['PHP_SELF'].'?propalid='.$propal->id, $propal->socid, $propal->projetidp, 'none');
{ }
if ($_GET['action'] != 'classer' && $propal->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>'; print '</td></tr>';
print '</tr></table>'; }
print '</td><td colspan="3">'; else
if ($_GET['action'] == 'classer') {
{ print '</td></tr></table>';
$html->form_project($_SERVER['PHP_SELF'].'?propalid='.$propal->id, $propal->socid, $propal->projetidp, 'projetidp'); if (!empty($propal->projetidp))
} {
else print '<td colspan="3">';
{ $proj = new Project($db);
$html->form_project($_SERVER['PHP_SELF'].'?propalid='.$propal->id, $propal->socid, $propal->projetidp, 'none'); $proj->fetch($propal->projetidp);
} print '<a href="../projet/fiche.php?id='.$propal->projetidp.'" title="'.$langs->trans('ShowProject').'">';
print '</td></tr>'; print $proj->ref;
} print '</a>';
else print '</td>';
{ }
print '</td></tr></table>'; else {
if (!empty($propal->projetidp)) print '<td colspan="3">&nbsp;</td>';
{ }
print '<td colspan="3">'; }
$proj = new Project($db); print '</tr>';
$proj->fetch($propal->projetidp); }
print '<a href="../projet/fiche.php?id='.$propal->projetidp.'" title="'.$langs->trans('ShowProject').'">';
print $proj->title;
print '</a>';
print '</td>';
}
else {
print '<td colspan="3">&nbsp;</td>';
}
}
}
print '</tr>';
}
// Amount // Amount
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>'; print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
print '<td align="right" colspan="2"><b>'.price($propal->total_ht).'</b></td>'; print '<td align="right" colspan="2"><b>'.price($propal->total_ht).'</b></td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print '<tr><td height="10">'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2">'.price($propal->total_tva).'</td>'; print '<tr><td height="10">'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2">'.price($propal->total_tva).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2">'.price($propal->total_ttc).'</td>'; print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2">'.price($propal->total_ttc).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>'; print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
// Statut // Statut
print '<tr><td height="10">'.$langs->trans('Status').'</td><td align="left" colspan="3">'.$propal->getLibStatut(4).'</td></tr>'; print '<tr><td height="10">'.$langs->trans('Status').'</td><td align="left" colspan="3">'.$propal->getLibStatut(4).'</td></tr>';
print '</table><br>'; print '</table><br>';
/* /*
* Lignes de propale * Lignes de propale
* *
*/ */
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
$sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.fk_remise_except,'; $sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.fk_remise_except,';
$sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,'; $sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,';
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc,'; $sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc,';
$sql.= ' p.rowid as prodid, p.label as product, p.ref, p.fk_product_type, '; $sql.= ' p.rowid as prodid, p.label as product, p.ref, p.fk_product_type, ';
$sql.= ' p.description as product_desc'; $sql.= ' p.description as product_desc';
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt'; $sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid';
$sql.= ' WHERE pt.fk_propal = '.$propal->id; $sql.= ' WHERE pt.fk_propal = '.$propal->id;
$sql.= ' ORDER BY pt.rang ASC, pt.rowid'; $sql.= ' ORDER BY pt.rang ASC, pt.rowid';
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
$num_lignes = $db->num_rows($resql); $num_lignes = $db->num_rows($resql);
$i = 0; $i = 0;
$total = 0; $total = 0;
if ($num_lignes) if ($num_lignes)
{ {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Description').'</td>'; print '<td>'.$langs->trans('Description').'</td>';
print '<td align="right" width="50">'.$langs->trans('VAT').'</td>'; print '<td align="right" width="50">'.$langs->trans('VAT').'</td>';
print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>';
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>'; print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>'; print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>'; print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>';
print '<td width="16">&nbsp;</td>';
print '<td width="16">&nbsp;</td>';
print '<td width="16">&nbsp;</td>'; print '<td width="16">&nbsp;</td>';
print "</tr>\n"; print '<td width="16">&nbsp;</td>';
} print '<td width="16">&nbsp;</td>';
$var=true; print "</tr>\n";
while ($i < $num_lignes) }
{ $var=true;
$objp = $db->fetch_object($resql); while ($i < $num_lignes)
$var=!$var; {
if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) $objp = $db->fetch_object($resql);
{ $var=!$var;
print '<tr '.$bc[$var].'>'; if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid)
if ($objp->fk_product > 0) {
{ print '<tr '.$bc[$var].'>';
print '<td><a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'; if ($objp->fk_product > 0)
if ($objp->fk_product_type==1) {
print img_object($langs->trans('ShowService'),'service'); print '<td><a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
else if ($objp->fk_product_type==1)
print img_object($langs->trans('ShowProduct'),'product'); print img_object($langs->trans('ShowService'),'service');
print ' '.$objp->ref.'</a> - '.stripslashes(nl2br($objp->product)); else
if ($objp->date_start && $objp->date_end) print img_object($langs->trans('ShowProduct'),'product');
{ print ' '.$objp->ref.'</a> - '.stripslashes(nl2br($objp->product));
print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; if ($objp->date_start && $objp->date_end)
} {
if ($objp->date_start && ! $objp->date_end) print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')';
{ }
print ' (A partir du '.dolibarr_print_date($objp->date_start).')'; if ($objp->date_start && ! $objp->date_end)
} {
if (! $objp->date_start && $objp->date_end) print ' (A partir du '.dolibarr_print_date($objp->date_start).')';
{ }
print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; if (! $objp->date_start && $objp->date_end)
} {
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):''; print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')';
print '</td>'; }
} print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
print '</td>';
}
else else
{ {
print '<td>'; print '<td>';
@ -423,8 +418,8 @@ if ($_GET["propalid"] > 0)
} }
print "</td>\n"; print "</td>\n";
} }
print '<td align="right">'.vatrate($objp->tva_tx).'%</td>'; print '<td align="right">'.vatrate($objp->tva_tx).'%</td>';
print '<td align="right">'.price($objp->subprice)."</td>\n"; print '<td align="right">'.price($objp->subprice)."</td>\n";
// Qty // Qty
print '<td align="right">'; print '<td align="right">';
@ -435,40 +430,40 @@ if ($_GET["propalid"] > 0)
else print '&nbsp;'; else print '&nbsp;';
print '</td>'; print '</td>';
if ($objp->remise_percent > 0) if ($objp->remise_percent > 0)
{ {
print '<td align="right">'.$objp->remise_percent."%</td>\n"; print '<td align="right">'.$objp->remise_percent."%</td>\n";
} }
else else
{ {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
} }
print '<td align="right">'.price($objp->total_ht)."</td>\n"; print '<td align="right">'.price($objp->total_ht)."</td>\n";
print '<td colspan="3">&nbsp;</td>'; print '<td colspan="3">&nbsp;</td>';
print '</tr>'; print '</tr>';
} }
$i++; $i++;
} }
$db->free($resql); $db->free($resql);
} }
else else
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
print '</table>'; print '</table>';
print '</div>'; print '</div>';
/* /*
* Boutons Actions * Boutons Actions
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($propal->statut <> 4 && $user->societe_id == 0) if ($propal->statut <> 4 && $user->societe_id == 0)
{ {
@ -483,25 +478,25 @@ if ($_GET["propalid"] > 0)
print '<a class="butAction" href="propal.php?propalid='.$propal->id."&action=setstatut&statut=4&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder\">".$langs->trans("ClassifyBilled")."</a>"; print '<a class="butAction" href="propal.php?propalid='.$propal->id."&action=setstatut&statut=4&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder\">".$langs->trans("ClassifyBilled")."</a>";
} }
} }
print "</div>"; print "</div>";
print "<br>\n"; print "<br>\n";
print '<table width="100%"><tr><td width="50%" valign="top">'; print '<table width="100%"><tr><td width="50%" valign="top">';
/* /*
* Documents g<EFBFBD>n<EFBFBD>r<EFBFBD>s * Documents g<EFBFBD>n<EFBFBD>r<EFBFBD>s
*/ */
$filename=sanitizeFileName($propal->ref); $filename=sanitizeFileName($propal->ref);
$filedir=$conf->propal->dir_output . "/" . sanitizeFileName($propal->ref); $filedir=$conf->propal->dir_output . "/" . sanitizeFileName($propal->ref);
$urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id; $urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id;
$genallowed=0; $genallowed=0;
$delallowed=0; $delallowed=0;
$var=true; $var=true;
$somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed); $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed);
/* /*
@ -556,33 +551,33 @@ if ($_GET["propalid"] > 0)
$sql2.= " WHERE cp.fk_propale = ".$propal->id." AND cf.fk_commande = cp.fk_commande AND cf.fk_facture = f.rowid"; $sql2.= " WHERE cp.fk_propale = ".$propal->id." AND cf.fk_commande = cp.fk_commande AND cf.fk_facture = f.rowid";
dolibarr_syslog("propal.php::liste factures sql=".$sql); dolibarr_syslog("propal.php::liste factures sql=".$sql);
$resql=$db->query($sql); $resql=$db->query($sql);
$resql2=null; $resql2=null;
if ($resql) if ($resql)
{ {
dolibarr_syslog("propal.php::liste factures sql2=".$sql2); dolibarr_syslog("propal.php::liste factures sql2=".$sql2);
$resql2=$db->query($sql2); $resql2=$db->query($sql2);
} }
if ($resql2) if ($resql2)
{ {
$tab_sqlobj=array(); $tab_sqlobj=array();
$num_fac_asso = $db->num_rows($resql); $num_fac_asso = $db->num_rows($resql);
for ($i = 0;$i < $num_fac_asso;$i++) for ($i = 0;$i < $num_fac_asso;$i++)
{ {
$sqlobj = $db->fetch_object($resql); $sqlobj = $db->fetch_object($resql);
$tab_sqlobj[] = $sqlobj; $tab_sqlobj[] = $sqlobj;
//$tab_sqlobjOrder[]= $sqlobj->dc; //$tab_sqlobjOrder[]= $sqlobj->dc;
} }
$db->free($resql); $db->free($resql);
$num_fac_asso = $db->num_rows($resql2); $num_fac_asso = $db->num_rows($resql2);
for ($i = 0;$i < $num_fac_asso;$i++) for ($i = 0;$i < $num_fac_asso;$i++)
{ {
$sqlobj = $db->fetch_object($resql2); $sqlobj = $db->fetch_object($resql2);
$tab_sqlobj[] = $sqlobj; $tab_sqlobj[] = $sqlobj;
//$tab_sqlobjOrder[]= $sqlobj->dc; //$tab_sqlobjOrder[]= $sqlobj->dc;
} }
$db->free($resql2); $db->free($resql2);
//array_multisort ($tab_sqlobjOrder,$tab_sqlobj); //array_multisort ($tab_sqlobjOrder,$tab_sqlobj);
@ -627,69 +622,69 @@ if ($_GET["propalid"] > 0)
} }
print '</td><td valign="top" width="50%">'; print '</td><td valign="top" width="50%">';
// List of actions on element // List of actions on element
include_once(DOL_DOCUMENT_ROOT.'/html.formactions.class.php'); include_once(DOL_DOCUMENT_ROOT.'/html.formactions.class.php');
$formactions=new FormActions($db); $formactions=new FormActions($db);
$somethingshown=$formactions->showactions($propal,'propal',$socid); $somethingshown=$formactions->showactions($propal,'propal',$socid);
print '</td></tr></table>'; print '</td></tr></table>';
} }
else else
{ {
/** /**
* *
* Mode Liste des propales * Mode Liste des propales
* *
*/ */
$now=gmmktime(); $now=gmmktime();
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$year = $_REQUEST["year"]; $year = $_REQUEST["year"];
$month = $_REQUEST["month"]; $month = $_REQUEST["month"];
$sql = "SELECT s.nom, s.rowid as socid, s.client,"; $sql = "SELECT s.nom, s.rowid as socid, s.client,";
$sql.= " p.rowid as propalid, p.ref, p.fk_statut,"; $sql.= " p.rowid as propalid, p.ref, p.fk_statut,";
$sql.= " p.total_ht, p.tva, p.total,"; $sql.= " p.total_ht, p.tva, p.total,";
$sql.= $db->pdate("p.datep")." as dp, "; $sql.= $db->pdate("p.datep")." as dp, ";
$sql.= $db->pdate("p.fin_validite")." as dfin"; $sql.= $db->pdate("p.fin_validite")." as dfin";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE p.fk_soc = s.rowid"; $sql.= " WHERE p.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql .= " AND s.rowid = ".$socid; if ($socid) $sql .= " AND s.rowid = ".$socid;
if ($viewstatut <> '') $sql .= " AND p.fk_statut in ($viewstatut)"; // viewstatut peut etre combinaisons s<>par<61> par virgules if ($viewstatut <> '') $sql .= " AND p.fk_statut in ($viewstatut)"; // viewstatut peut etre combinaisons s<>par<61> par virgules
if ($month > 0) if ($month > 0)
{ {
if ($year > 0) if ($year > 0)
$sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'"; $sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
else else
$sql .= " AND date_format(p.datep, '%m') = '$month'"; $sql .= " AND date_format(p.datep, '%m') = '$month'";
} }
if ($year > 0) $sql .= " AND date_format(p.datep, '%Y') = $year"; if ($year > 0) $sql .= " AND date_format(p.datep, '%Y') = $year";
if (!empty($_GET['search_ref'])) if (!empty($_GET['search_ref']))
{ {
$sql .= " AND p.ref LIKE '%".addslashes($_GET['search_ref'])."%'"; $sql .= " AND p.ref LIKE '%".addslashes($_GET['search_ref'])."%'";
} }
if (!empty($_GET['search_societe'])) if (!empty($_GET['search_societe']))
{ {
$sql .= " AND s.nom LIKE '%".addslashes($_GET['search_societe'])."%'"; $sql .= " AND s.nom LIKE '%".addslashes($_GET['search_societe'])."%'";
} }
if (!empty($_GET['search_montant_ht'])) if (!empty($_GET['search_montant_ht']))
{ {
$sql .= " AND p.price='".addslashes($_GET['search_montant_ht'])."'"; $sql .= " AND p.price='".addslashes($_GET['search_montant_ht'])."'";
} }
$sql .= " ORDER BY $sortfield $sortorder, p.rowid DESC "; $sql .= " ORDER BY $sortfield $sortorder, p.rowid DESC ";
$sql .= $db->plimit($limit + 1,$offset); $sql .= $db->plimit($limit + 1,$offset);
if ( $result = $db->query($sql) ) if ( $result = $db->query($sql) )
{ {
@ -708,38 +703,38 @@ else
print_liste_field_titre($langs->trans("Date"),"propal.php","p.datep","&viewstatut=$viewstatut","",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),"propal.php","p.datep","&viewstatut=$viewstatut","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountHT"),"propal.php","p.price","&viewstatut=$viewstatut","",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountHT"),"propal.php","p.price","&viewstatut=$viewstatut","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),"propal.php","p.fk_statut","&viewstatut=$viewstatut","",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),"propal.php","p.fk_statut","&viewstatut=$viewstatut","",'align="right"',$sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
// Lignes des champs de filtre // Lignes des champs de filtre
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td valign="right">'; print '<td valign="right">';
print '<input class="flat" size="10" type="text" name="search_ref" value="'.$_GET['search_ref'].'">'; print '<input class="flat" size="10" type="text" name="search_ref" value="'.$_GET['search_ref'].'">';
print '</td>'; print '</td>';
print '<td align="left">'; print '<td align="left">';
print '<input class="flat" type="text" size="40" name="search_societe" value="'.$_GET['search_societe'].'">'; print '<input class="flat" type="text" size="40" name="search_societe" value="'.$_GET['search_societe'].'">';
print '</td>'; print '</td>';
print '<td class="liste_titre" colspan="1" align="right">'; print '<td class="liste_titre" colspan="1" align="right">';
print $langs->trans('Month').': <input class="flat" type="text" size="2" maxlength="2" name="month" value="'.$month.'">'; print $langs->trans('Month').': <input class="flat" type="text" size="2" maxlength="2" name="month" value="'.$month.'">';
print '&nbsp;'.$langs->trans('Year').': '; print '&nbsp;'.$langs->trans('Year').': ';
$max_year = date("Y"); $max_year = date("Y");
$syear = $year; $syear = $year;
if($syear == '') if($syear == '')
$syear = date("Y"); $syear = date("Y");
$html->select_year($syear,'year',1, '', $max_year); $html->select_year($syear,'year',1, '', $max_year);
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';
print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$_GET['search_montant_ht'].'">'; print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$_GET['search_montant_ht'].'">';
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';
$html->select_propal_statut($viewstatut); $html->select_propal_statut($viewstatut);
print '</td>'; print '</td>';
print '<td align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">'; print '<td align="right"><input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
print '</form>'; print '</form>';
while ($i < min($num, $limit)) while ($i < min($num, $limit))
{ {
@ -749,27 +744,27 @@ else
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
$propalstatic->id=$objp->propalid; $propalstatic->id=$objp->propalid;
$propalstatic->ref=$objp->ref; $propalstatic->ref=$objp->ref;
//Ref //Ref
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="90" class="nobordernopadding" nowrap="nowrap">'; print '<td width="90" class="nobordernopadding" nowrap="nowrap">';
print $propalstatic->getNomUrl(1, 'compta', "&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder"); print $propalstatic->getNomUrl(1, 'compta', "&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder");
print '</td>'; print '</td>';
print '<td width="20" class="nobordernopadding" nowrap="nowrap">'; print '<td width="20" class="nobordernopadding" nowrap="nowrap">';
if ($objp->fk_statut == 1 && $objp->din < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); if ($objp->fk_statut == 1 && $objp->din < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
print '</td>'; print '</td>';
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" align="right" class="nobordernopadding">';
$filename=sanitizeFileName($objp->ref); $filename=sanitizeFileName($objp->ref);
$filedir=$conf->propal->dir_output . '/' . sanitizeFileName($objp->ref); $filedir=$conf->propal->dir_output . '/' . sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid; $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1); $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
print '</td></tr></table>'; print '</td></tr></table>';
print "</td>\n"; print "</td>\n";
@ -797,13 +792,13 @@ else
print "<td align=\"right\">".price($objp->total_ht)."</td>\n"; print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
print "<td align=\"right\">".$propalstatic->LibStatut($objp->fk_statut,5)."</td>\n"; print "<td align=\"right\">".$propalstatic->LibStatut($objp->fk_statut,5)."</td>\n";
print "<td>&nbsp;</td>"; print "<td>&nbsp;</td>";
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }
print "</table>"; print "</table>";
$db->free($result); $db->free($result);
} }
else else
{ {

View File

@ -45,7 +45,7 @@ $langs->load('stocks');
if (!$user->rights->commande->lire) if (!$user->rights->commande->lire)
accessforbidden(); accessforbidden();
// Sécurité accés client // S<EFBFBD>curit<EFBFBD> acc<63>s client
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
$action = ''; $action = '';
@ -148,12 +148,12 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET["action"] == 'cloture') if ($_GET["action"] == 'cloture')
{ {
$html->form_confirm("commande.php?id=".$_GET["id"],"Clôturer la commande","Etes-vous sûr de vouloir clôturer cette commande ?","confirm_cloture"); $html->form_confirm("commande.php?id=".$_GET["id"],"Cl<EFBFBD>turer la commande","Etes-vous s<>r de vouloir cl<63>turer cette commande ?","confirm_cloture");
print "<br />"; print "<br />";
} }
// Onglet commande // Onglet commande
$nbrow=8; $nbrow=7;
if ($conf->projet->enabled) $nbrow++; if ($conf->projet->enabled) $nbrow++;
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -262,27 +262,30 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Adresse de livraison if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress');
print '</td>';
if ($_GET['action'] != 'editdelivery_adress' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_adress&amp;socid='.$commande->socid.'&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
if ($_GET['action'] == 'editdelivery_adress')
{ {
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id); // Adresse de livraison
} print '<tr><td height="10">';
else print '<table class="nobordernopadding" width="100%"><tr><td>';
{ print $langs->trans('DeliveryAddress');
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id); print '</td>';
}
print '</td></tr>';
// Conditions et modes de réglement if ($_GET['action'] != 'editdelivery_adress' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_adress&amp;socid='.$commande->socid.'&amp;id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
if ($_GET['action'] == 'editdelivery_adress')
{
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id);
}
else
{
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id);
}
print '</td></tr>';
}
// Conditions et modes de r<>glement
print '<tr><td height="10">'; print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort'); print $langs->trans('PaymentConditionsShort');
@ -363,8 +366,8 @@ if ($id > 0 || ! empty($ref))
/** /**
* Lignes de commandes avec quantité livrées et reste à livrer * Lignes de commandes avec quantit<EFBFBD> livr<EFBFBD>es et reste <EFBFBD> livrer
* Les quantités livrées sont stockées dans $commande->expeditions[fk_product] * Les quantit<EFBFBD>s livr<EFBFBD>es sont stock<EFBFBD>es dans $commande->expeditions[fk_product]
*/ */
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
@ -595,7 +598,7 @@ if ($id > 0 || ! empty($ref))
} }
else else
{ {
/* Commande non trouvée */ /* Commande non trouv<EFBFBD>e */
print "Commande inexistante"; print "Commande inexistante";
} }
} }

View File

@ -1614,7 +1614,7 @@ class Form
$projet = new Project($this->db); $projet = new Project($this->db);
$projet->fetch($selected); $projet->fetch($selected);
//print '<a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$selected.'">'.$projet->title.'</a>'; //print '<a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$selected.'">'.$projet->title.'</a>';
print $projet->getNomUrl(1); print $projet->getNomUrl(0);
} else { } else {
print "&nbsp;"; print "&nbsp;";
} }