Fix: Some fix in project referrers page. Add also third party in a column.
This commit is contained in:
parent
323c188e6e
commit
eb4ee0d42d
@ -277,6 +277,7 @@ class ActionComm extends CommonObject
|
|||||||
$this->priority = $obj->priority;
|
$this->priority = $obj->priority;
|
||||||
$this->location = $obj->location;
|
$this->location = $obj->location;
|
||||||
|
|
||||||
|
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
|
||||||
$this->societe->id = $obj->fk_soc;
|
$this->societe->id = $obj->fk_soc;
|
||||||
$this->contact->id = $obj->fk_contact;
|
$this->contact->id = $obj->fk_contact;
|
||||||
$this->fk_project = $obj->fk_project;
|
$this->fk_project = $obj->fk_project;
|
||||||
|
|||||||
@ -395,7 +395,7 @@ if ($_POST['action'] == 'addline' && $user->rights->commande->creer)
|
|||||||
$prod->fetch($_POST['idprod']);
|
$prod->fetch($_POST['idprod']);
|
||||||
|
|
||||||
$tva_tx = get_default_tva($mysoc,$commande->client,$prod->tva_tx);
|
$tva_tx = get_default_tva($mysoc,$commande->client,$prod->tva_tx);
|
||||||
|
|
||||||
// multiprix
|
// multiprix
|
||||||
if ($conf->global->PRODUIT_MULTIPRICES && $commande->client->price_level)
|
if ($conf->global->PRODUIT_MULTIPRICES && $commande->client->price_level)
|
||||||
{
|
{
|
||||||
@ -437,11 +437,11 @@ if ($_POST['action'] == 'addline' && $user->rights->commande->creer)
|
|||||||
$desc=$_POST['dp_desc'];
|
$desc=$_POST['dp_desc'];
|
||||||
$type=$_POST["type"];
|
$type=$_POST["type"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Local Taxes
|
// Local Taxes
|
||||||
$localtax1_tx= get_localtax($tva_tx, 1, $commande->client);
|
$localtax1_tx= get_localtax($tva_tx, 1, $commande->client);
|
||||||
$localtax2_tx= get_localtax($tva_tx, 2, $commande->client);
|
$localtax2_tx= get_localtax($tva_tx, 2, $commande->client);
|
||||||
|
|
||||||
$desc=dol_htmlcleanlastbr($desc);
|
$desc=dol_htmlcleanlastbr($desc);
|
||||||
|
|
||||||
$info_bits=0;
|
$info_bits=0;
|
||||||
@ -1038,7 +1038,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Reference
|
// Reference
|
||||||
print '<tr><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans("Draft").'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans("Draft").'</td></tr>';
|
||||||
|
|
||||||
// Reference client
|
// Reference client
|
||||||
print '<tr><td>'.$langs->trans('RefCustomer').'</td><td>';
|
print '<tr><td>'.$langs->trans('RefCustomer').'</td><td>';
|
||||||
@ -1046,7 +1046,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Client
|
// Client
|
||||||
print '<tr><td>'.$langs->trans('Customer').'</td><td>'.$soc->getNomUrl(1).'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Customer').'</td><td>'.$soc->getNomUrl(1).'</td></tr>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Contact de la commande
|
* Contact de la commande
|
||||||
@ -1601,6 +1601,7 @@ else
|
|||||||
if ($_GET['action'] != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&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&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">';
|
||||||
|
//print "$commande->id, $commande->socid, $commande->fk_project";
|
||||||
if ($_GET['action'] == 'classer')
|
if ($_GET['action'] == 'classer')
|
||||||
{
|
{
|
||||||
$html->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->fk_project, 'projectid');
|
$html->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->fk_project, 'projectid');
|
||||||
|
|||||||
@ -305,7 +305,7 @@ class Deplacement extends CommonObject
|
|||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
|
|
||||||
$lien = '<a href="'.DOL_URL_ROOT.'/deplacement/fiche.php?id='.$this->id.'">';
|
$lien = '<a href="'.DOL_URL_ROOT.'/compta/deplacement/fiche.php?id='.$this->id.'">';
|
||||||
$lienfin='</a>';
|
$lienfin='</a>';
|
||||||
|
|
||||||
$picto='trip';
|
$picto='trip';
|
||||||
|
|||||||
@ -1802,6 +1802,7 @@ class Form
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
|
//print "$socid,$selected,$htmlname";
|
||||||
select_projects($socid,$selected,$htmlname);
|
select_projects($socid,$selected,$htmlname);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||||
|
|||||||
@ -816,7 +816,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Confirmation de la desapprobation
|
* Confirmation de la desapprobation
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'refuse')
|
if ($_GET['action'] == 'refuse')
|
||||||
{
|
{
|
||||||
@ -907,12 +906,12 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auteur
|
// Author
|
||||||
print '<tr><td>'.$langs->trans("AuthorRequest").'</td>';
|
print '<tr><td>'.$langs->trans("AuthorRequest").'</td>';
|
||||||
print '<td colspan="2">'.$author->getNomUrl(1).'</td>';
|
print '<td colspan="2">'.$author->getNomUrl(1).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Projet
|
// Project
|
||||||
if ($conf->projet->enabled)
|
if ($conf->projet->enabled)
|
||||||
{
|
{
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
@ -923,6 +922,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($_GET['action'] != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&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&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">';
|
||||||
|
//print "$commande->id, $commande->socid, $commande->fk_project";
|
||||||
if ($_GET['action'] == 'classer')
|
if ($_GET['action'] == 'classer')
|
||||||
{
|
{
|
||||||
$html->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->fk_project, 'projectid');
|
$html->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->fk_project, 'projectid');
|
||||||
|
|||||||
@ -505,10 +505,10 @@ if ($_GET['action'] == 'create')
|
|||||||
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 class="fieldrequired">'.$langs->trans('Company').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
if ($_GET['socid'])
|
if ($_REQUEST['socid'] > 0)
|
||||||
{
|
{
|
||||||
print $societe->getNomUrl(1);
|
print $societe->getNomUrl(1);
|
||||||
print '<input type="hidden" name="socid" value="'.$_GET['socid'].'">';
|
print '<input type="hidden" name="socid" value="'.$_GET['socid'].'">';
|
||||||
@ -520,13 +520,15 @@ if ($_GET['action'] == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="50%">'.$langs->trans('NotePublic').'</td></tr>';
|
print '<td width="50%">'.$langs->trans('NotePublic').'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('RefSupplier').'</td><td><input name="facnumber" value="'.(isset($_POST['facnumber'])?$_POST['facnumber']:$fac_ori->ref).'" type="text"></td>';
|
// Ref supplier
|
||||||
|
print '<tr><td class="fieldrequired">'.$langs->trans('RefSupplier').'</td><td><input name="facnumber" value="'.(isset($_POST['facnumber'])?$_POST['facnumber']:$fac_ori->ref).'" type="text"></td>';
|
||||||
print '<td width="50%" rowspan="4" valign="top"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td></tr>';
|
print '<td width="50%" rowspan="4" valign="top"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td></tr>';
|
||||||
|
|
||||||
|
// Label
|
||||||
print '<tr><td>'.$langs->trans('Label').'</td><td><input size="30" name="libelle" value="'.(isset($_POST['libelle'])?$_POST['libelle']:$fac_ori->libelle).'" type="text"></td></tr>';
|
print '<tr><td>'.$langs->trans('Label').'</td><td><input size="30" name="libelle" value="'.(isset($_POST['libelle'])?$_POST['libelle']:$fac_ori->libelle).'" type="text"></td></tr>';
|
||||||
|
|
||||||
// Date invoice
|
// Date invoice
|
||||||
print '<tr><td>'.$langs->trans('DateInvoice').'</td><td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('DateInvoice').'</td><td>';
|
||||||
$html->select_date($dateinvoice,'','','','',"add",1,1);
|
$html->select_date($dateinvoice,'','','','',"add",1,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -598,7 +600,7 @@ else
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('Company').'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Company').'</td>';
|
||||||
print '<td>'.$societe->getNomUrl(1).'</td>';
|
print '<td>'.$societe->getNomUrl(1).'</td>';
|
||||||
print '<td width="50%" valign="top">'.$langs->trans('NotePublic').'</td>';
|
print '<td width="50%" valign="top">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -612,14 +614,17 @@ else
|
|||||||
print $fac->note;
|
print $fac->note;
|
||||||
print '</textarea></td></tr>';
|
print '</textarea></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans('RefSupplier').'</td><td valign="top">';
|
// Ref supplier
|
||||||
|
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('RefSupplier').'</td><td valign="top">';
|
||||||
print '<input name="facnumber" type="text" value="'.$fac->ref_supplier.'"></td>';
|
print '<input name="facnumber" type="text" value="'.$fac->ref_supplier.'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Label
|
||||||
print '<tr><td valign="top">'.$langs->trans('Label').'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans('Label').'</td><td>';
|
||||||
print '<input size="30" name="libelle" type="text" value="'.$fac->libelle.'"></td></tr>';
|
print '<input size="30" name="libelle" type="text" value="'.$fac->libelle.'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('DateInvoice').'</td><td nowrap="nowrap">';
|
// Date invoice
|
||||||
|
print '<tr><td class="fieldrequired">'.$langs->trans('DateInvoice').'</td><td nowrap="nowrap">';
|
||||||
$html->select_date($fac->datep,'','','','',"update",1,1);
|
$html->select_date($fac->datep,'','','','',"update",1,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -319,6 +319,7 @@ class Project extends CommonObject
|
|||||||
if ($type == 'agenda') $sql = "SELECT id as rowid FROM ".MAIN_DB_PREFIX."actioncomm WHERE fk_project=".$this->id;
|
if ($type == 'agenda') $sql = "SELECT id as rowid FROM ".MAIN_DB_PREFIX."actioncomm WHERE fk_project=".$this->id;
|
||||||
if (! $sql) return -1;
|
if (! $sql) return -1;
|
||||||
|
|
||||||
|
//print $sql;
|
||||||
dol_syslog("Project::get_element_list sql=".$sql);
|
dol_syslog("Project::get_element_list sql=".$sql);
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -118,7 +118,7 @@ print '</div>';
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Factures
|
* Referers types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$listofreferent=array(
|
$listofreferent=array(
|
||||||
@ -180,8 +180,9 @@ foreach ($listofreferent as $key => $value)
|
|||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="150">'.$langs->trans("Ref").'</td>';
|
print '<td width="100">'.$langs->trans("Ref").'</td>';
|
||||||
print '<td>'.$langs->trans("Date").'</td>';
|
print '<td width="100" align="center">'.$langs->trans("Date").'</td>';
|
||||||
|
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
||||||
if (empty($value['disableamount'])) print '<td align="right">'.$langs->trans("Amount").'</td>';
|
if (empty($value['disableamount'])) print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||||
print '<td align="right" width="200">'.$langs->trans("Status").'</td>';
|
print '<td align="right" width="200">'.$langs->trans("Status").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -194,12 +195,14 @@ foreach ($listofreferent as $key => $value)
|
|||||||
{
|
{
|
||||||
$element = new $classname($db);
|
$element = new $classname($db);
|
||||||
$element->fetch($elementarray[$i]);
|
$element->fetch($elementarray[$i]);
|
||||||
|
$element->fetch_client();
|
||||||
|
//print $classname;
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print "<td>";
|
print '<td align="left">';
|
||||||
print $element->getNomUrl(1);
|
print $element->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
@ -207,9 +210,14 @@ foreach ($listofreferent as $key => $value)
|
|||||||
$date=$element->date;
|
$date=$element->date;
|
||||||
if (empty($date)) $date=$element->datep;
|
if (empty($date)) $date=$element->datep;
|
||||||
if (empty($date)) $date=$element->date_contrat;
|
if (empty($date)) $date=$element->date_contrat;
|
||||||
print '<td>'.dol_print_date($date,'day').'</td>';
|
print '<td align="center">'.dol_print_date($date,'day').'</td>';
|
||||||
|
|
||||||
// Amount
|
// Third party
|
||||||
|
print '<td align="left">';
|
||||||
|
if (is_object($element->client)) print $element->client->getNomUrl(1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Amount
|
||||||
if (empty($value['disableamount'])) print '<td align="right">'.(isset($element->total_ht)?price($element->total_ht):' ').'</td>';
|
if (empty($value['disableamount'])) print '<td align="right">'.(isset($element->total_ht)?price($element->total_ht):' ').'</td>';
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
@ -220,7 +228,7 @@ foreach ($listofreferent as $key => $value)
|
|||||||
$total = $total + $element->total_ht;
|
$total = $total + $element->total_ht;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Number").': '.$i.'</td>';
|
print '<tr class="liste_total"><td colspan="3">'.$langs->trans("Number").': '.$i.'</td>';
|
||||||
if (empty($value['disableamount'])) print '<td align="right" width="100">'.$langs->trans("TotalHT").' : '.price($total).'</td>';
|
if (empty($value['disableamount'])) print '<td align="right" width="100">'.$langs->trans("TotalHT").' : '.price($total).'</td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user