Fix project on loans
This commit is contained in:
parent
d23aa8ef3c
commit
4c4aeba855
@ -458,13 +458,16 @@ class FormProjets
|
|||||||
if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
|
if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
|
||||||
|
|
||||||
$linkedtothirdparty=false;
|
$linkedtothirdparty=false;
|
||||||
if (! in_array($table_element, array('don','expensereport_det','expensereport'))) $linkedtothirdparty=true;
|
if (! in_array($table_element, array('don','expensereport_det','expensereport','loan'))) $linkedtothirdparty=true;
|
||||||
|
|
||||||
$sqlfilter='';
|
$sqlfilter='';
|
||||||
$projectkey="fk_projet";
|
$projectkey="fk_projet";
|
||||||
//print $table_element;
|
//print $table_element;
|
||||||
switch ($table_element)
|
switch ($table_element)
|
||||||
{
|
{
|
||||||
|
case "loan":
|
||||||
|
$sql = "SELECT t.rowid, t.label as ref";
|
||||||
|
break;
|
||||||
case "facture":
|
case "facture":
|
||||||
$sql = "SELECT t.rowid, t.facnumber as ref";
|
$sql = "SELECT t.rowid, t.facnumber as ref";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -43,6 +43,7 @@ LoanCalcDesc=This <b>mortgage calculator</b> can be used to figure out monthly p
|
|||||||
GoToInterest=%s will go towards INTEREST
|
GoToInterest=%s will go towards INTEREST
|
||||||
GoToPrincipal=%s will go towards PRINCIPAL
|
GoToPrincipal=%s will go towards PRINCIPAL
|
||||||
YouWillSpend=You will spend %s in year %s
|
YouWillSpend=You will spend %s in year %s
|
||||||
|
ListLoanAssociatedProject=List of loan associated with the project
|
||||||
# Admin
|
# Admin
|
||||||
ConfigLoan=Configuration of the module loan
|
ConfigLoan=Configuration of the module loan
|
||||||
LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accounting account capital by default
|
LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accounting account capital by default
|
||||||
|
|||||||
@ -24,8 +24,8 @@
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||||
|
|
||||||
|
|
||||||
/** \class Loan
|
/**
|
||||||
* \brief Class to manage loan
|
* Loan
|
||||||
*/
|
*/
|
||||||
class Loan extends CommonObject
|
class Loan extends CommonObject
|
||||||
{
|
{
|
||||||
@ -404,7 +404,7 @@ class Loan extends CommonObject
|
|||||||
* @param int $maxlen Label max length
|
* @param int $maxlen Label max length
|
||||||
* @return string Chaine with URL
|
* @return string Chaine with URL
|
||||||
*/
|
*/
|
||||||
function getLinkUrl($withpicto=0,$maxlen=0)
|
function getNomUrl($withpicto=0,$maxlen=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,7 @@ if ($resql)
|
|||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<td>'.$loan_static->getLinkUrl(1, 42).'</td>';
|
print '<td>'.$loan_static->getNomUrl(1, 42).'</td>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<td>'.dol_trunc($obj->label,42).'</td>';
|
print '<td>'.dol_trunc($obj->label,42).'</td>';
|
||||||
|
|||||||
@ -231,7 +231,7 @@ if ($resql)
|
|||||||
// Ref
|
// Ref
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$loan->fetch($objp->id);
|
$loan->fetch($objp->id);
|
||||||
print $loan->getLinkUrl(1);
|
print $loan->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
// Label
|
// Label
|
||||||
print '<td>'.$objp->label.'</td>';
|
print '<td>'.$objp->label.'</td>';
|
||||||
|
|||||||
@ -377,14 +377,14 @@ $listofreferent=array(
|
|||||||
'title'=>"ListLoanAssociatedProject",
|
'title'=>"ListLoanAssociatedProject",
|
||||||
'class'=>'Loan',
|
'class'=>'Loan',
|
||||||
'margin'=>'add',
|
'margin'=>'add',
|
||||||
'table'=>'Loan',
|
'table'=>'loan',
|
||||||
'datefieldname'=>'datestart',
|
'datefieldname'=>'datestart',
|
||||||
'disableamount'=>0,
|
'disableamount'=>0,
|
||||||
'urlnew'=>DOL_URL_ROOT.'/loan/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
'urlnew'=>DOL_URL_ROOT.'/loan/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
||||||
'lang'=>'loan',
|
'lang'=>'loan',
|
||||||
'buttonnew'=>'AddLoan',
|
'buttonnew'=>'AddLoan',
|
||||||
'testnew'=>$user->rights->loan->creer,
|
'testnew'=>$user->rights->loan->write,
|
||||||
'test'=>$conf->loan->enabled && $user->rights->loan->lire),
|
'test'=>$conf->loan->enabled && $user->rights->loan->read),
|
||||||
'project_task'=>array(
|
'project_task'=>array(
|
||||||
'name'=>"TaskTimeValorised",
|
'name'=>"TaskTimeValorised",
|
||||||
'title'=>"ListTaskTimeUserProject",
|
'title'=>"ListTaskTimeUserProject",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user