2
0
forked from Wavyzz/dolibarr

Merge remote-tracking branch 'upstream/develop' into camelCaps

This commit is contained in:
Frédéric FRANCE
2018-08-21 20:57:58 +02:00
216 changed files with 1840 additions and 818 deletions

View File

@@ -162,6 +162,7 @@ class doc_generic_project_odt extends ModelePDFProjects
'task_description'=>$task->description,
'task_fk_parent'=>$task->fk_parent,
'task_duration'=>$task->duration,
'task_duration_hour'=>convertSecondToTime($task->duration,'all'),
'task_progress'=>$task->progress,
'task_public'=>$task->public,
'task_date_start'=>dol_print_date($task->date_start,'day'),
@@ -324,7 +325,10 @@ class doc_generic_project_odt extends ModelePDFProjects
'tasktime_fk_user'=>$tasktime['fk_user'],
'tasktime_user_name'=>$tasktime['name'],
'tasktime_user_first'=>$tasktime['firstname'],
'tasktime_fullcivname'=>$tasktime['fullcivname']
'tasktime_fullcivname'=>$tasktime['fullcivname'],
'tasktime_amountht'=>$tasktime['amountht'],
'tasktime_amountttc'=>$tasktime['amountttc'],
'tasktime_thm'=>$tasktime['thm'],
);
}
@@ -707,7 +711,7 @@ class doc_generic_project_odt extends ModelePDFProjects
//Time ressources
$sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note";
$sql.= ", u.lastname, u.firstname";
$sql.= ", u.lastname, u.firstname, t.thm";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
$sql .= " , ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE t.fk_task =".$task->id;
@@ -721,6 +725,35 @@ class doc_generic_project_odt extends ModelePDFProjects
$i = 0;
$tasks = array();
$listlinestasktime = $listlines->__get('taskstimes');
if (empty($num)) {
$row['rowid']='';
$row['task_date']='';
$row['task_duration']='';
$row['$tasktime']='';
$row['note']='';
$row['fk_user']='';
$row['name']='';
$row['firstname']='';
$row['fullcivname']='';
$row['amountht']='';
$row['amountttc']='';
$row['thm']='';
$tmparray=$this->get_substitutionarray_taskstime($row,$outputlangs);
foreach($tmparray as $key => $val)
{
try
{
$listlinestasktime->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
}
}
$listlinestasktime->merge();
}
while ($i < $num)
{
$row = $this->db->fetch_array($resql);
@@ -732,6 +765,16 @@ class doc_generic_project_odt extends ModelePDFProjects
$row['fullcivname']='';
}
if (!empty($row['thm'])) {
$row['amountht']=($row['task_duration'] / 3600) * $row['thm'];
$defaultvat = get_default_tva($mysoc, $mysoc);
$row['amountttc']=price2num($row['amountht'] * (1 + ($defaultvat / 100)),'MT');;
} else {
$row['amountht']=0;
$row['amountttc']=0;
$row['thm']=0;
}
$tmparray=$this->get_substitutionarray_taskstime($row,$outputlangs);
foreach($tmparray as $key => $val)
@@ -893,60 +936,114 @@ class doc_generic_project_odt extends ModelePDFProjects
//List of referent
$listofreferent=array(
'propal'=>array(
'title'=>"ListProposalsAssociatedProject",
'class'=>'Propal',
'table'=>'propal',
'test'=>$conf->propal->enabled && $user->rights->propale->lire),
'order'=>array(
'title'=>"ListOrdersAssociatedProject",
'class'=>'Commande',
'table'=>'commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire),
'invoice'=>array(
'title'=>"ListInvoicesAssociatedProject",
'class'=>'Facture',
'table'=>'facture',
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'invoice_predefined'=>array(
'title'=>"ListPredefinedInvoicesAssociatedProject",
'class'=>'FactureRec',
'table'=>'facture_rec',
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'order_supplier'=>array(
'title'=>"ListSupplierOrdersAssociatedProject",
'table'=>'commande_fournisseur',
'class'=>'CommandeFournisseur',
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire),
'invoice_supplier'=>array(
'title'=>"ListSupplierInvoicesAssociatedProject",
'table'=>'facture_fourn',
'class'=>'FactureFournisseur',
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire),
'contract'=>array(
'title'=>"ListContractAssociatedProject",
'class'=>'Contrat',
'table'=>'contrat',
'test'=>$conf->contrat->enabled && $user->rights->contrat->lire),
'intervention'=>array(
'title'=>"ListFichinterAssociatedProject",
'class'=>'Fichinter',
'table'=>'fichinter',
'disableamount'=>1,
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
'trip'=>array(
'title'=>"ListTripAssociatedProject",
'class'=>'Deplacement',
'table'=>'deplacement',
'disableamount'=>1,
'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire),
'agenda'=>array(
'title'=>"ListActionsAssociatedProject",
'class'=>'ActionComm',
'table'=>'actioncomm',
'disableamount'=>1,
'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->lire)
$listofreferent = array(
'propal' => array(
'title' => "ListProposalsAssociatedProject",
'class' => 'Propal',
'table' => 'propal',
'test' => $conf->propal->enabled && $user->rights->propale->lire
),
'order' => array(
'title' => "ListOrdersAssociatedProject",
'class' => 'Commande',
'table' => 'commande',
'test' => $conf->commande->enabled && $user->rights->commande->lire
),
'invoice' => array(
'title' => "ListInvoicesAssociatedProject",
'class' => 'Facture',
'table' => 'facture',
'test' => $conf->facture->enabled && $user->rights->facture->lire
),
'invoice_predefined' => array(
'title' => "ListPredefinedInvoicesAssociatedProject",
'class' => 'FactureRec',
'table' => 'facture_rec',
'test' => $conf->facture->enabled && $user->rights->facture->lire
),
'proposal_supplier' => array(
'title' => "ListSupplierProposalsAssociatedProject",
'class' => 'SupplierProposal',
'table' => 'supplier_proposal',
'test' => $conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire
),
'order_supplier' => array(
'title' => "ListSupplierOrdersAssociatedProject",
'table' => 'commande_fournisseur',
'class' => 'CommandeFournisseur',
'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire
),
'invoice_supplier' => array(
'title' => "ListSupplierInvoicesAssociatedProject",
'table' => 'facture_fourn',
'class' => 'FactureFournisseur',
'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire
),
'contract' => array(
'title' => "ListContractAssociatedProject",
'class' => 'Contrat',
'table' => 'contrat',
'test' => $conf->contrat->enabled && $user->rights->contrat->lire
),
'intervention' => array(
'title' => "ListFichinterAssociatedProject",
'class' => 'Fichinter',
'table' => 'fichinter',
'disableamount' => 1,
'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire
),
'shipping' => array(
'title' => "ListShippingAssociatedProject",
'class' => 'Expedition',
'table' => 'expedition',
'disableamount' => 1,
'test' => $conf->expedition->enabled && $user->rights->expedition->lire
),
'trip' => array(
'title' => "ListTripAssociatedProject",
'class' => 'Deplacement',
'table' => 'deplacement',
'disableamount' => 1,
'test' => $conf->deplacement->enabled && $user->rights->deplacement->lire
),
'expensereport' => array(
'title' => "ListExpenseReportsAssociatedProject",
'class' => 'ExpenseReportLine',
'table' => 'expensereport_det',
'test' => $conf->expensereport->enabled && $user->rights->expensereport->lire
),
'donation' => array(
'title' => "ListDonationsAssociatedProject",
'class' => 'Don',
'table' => 'don',
'test' => $conf->don->enabled && $user->rights->don->lire
),
'loan' => array(
'title' => "ListLoanAssociatedProject",
'class' => 'Loan',
'table' => 'loan',
'test' => $conf->loan->enabled && $user->rights->loan->read
),
'chargesociales' => array(
'title' => "ListSocialContributionAssociatedProject",
'class' => 'ChargeSociales',
'table' => 'chargesociales',
'urlnew' => DOL_URL_ROOT . '/compta/sociales/card.php?action=create&projectid=' . $id,
'test' => $conf->tax->enabled && $user->rights->tax->charges->lire
),
'stock_mouvement' => array(
'title' => "ListMouvementStockProject",
'class' => 'MouvementStock',
'table' => 'stock_mouvement',
'test' => ($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))
),
'agenda' => array(
'title' => "ListActionsAssociatedProject",
'class' => 'ActionComm',
'table' => 'actioncomm',
'disableamount' => 1,
'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire
)
);
//Insert reference

View File

@@ -33,7 +33,10 @@ class mod_project_simple extends ModeleNumRefProjects
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='PJ';
var $error='';
/**
* @var string Error code (or message)
*/
public $error='';
var $nom = "Simple";
var $name = "Simple";

View File

@@ -31,7 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModelePDFProjects extends CommonDocGenerator
{
var $error='';
/**
* @var string Error code (or message)
*/
public $error='';
/**
@@ -63,7 +66,10 @@ abstract class ModelePDFProjects extends CommonDocGenerator
*/
abstract class ModeleNumRefProjects
{
var $error='';
/**
* @var string Error code (or message)
*/
public $error='';
/**
* Return if a module can be used or not

View File

@@ -33,7 +33,10 @@ class mod_task_simple extends ModeleNumRefTask
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='TK';
var $error='';
/**
* @var string Error code (or message)
*/
public $error='';
var $nom = "Simple";
var $name = "Simple";

View File

@@ -32,7 +32,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModelePDFTask extends CommonDocGenerator
{
var $error='';
/**
* @var string Error code (or message)
*/
public $error='';
/**
@@ -64,7 +67,10 @@ abstract class ModelePDFTask extends CommonDocGenerator
*/
abstract class ModeleNumRefTask
{
var $error='';
/**
* @var string Error code (or message)
*/
public $error='';
/**
* Return if a module can be used or not