NEW Can add project search on left menu search area
This commit is contained in:
parent
5975536fcf
commit
a27212644e
@ -199,7 +199,8 @@ if ($resql)
|
|||||||
|
|
||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
|
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ";
|
||||||
|
print '<strong>'.$sall.'</strong>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].($param?'?'.$param:'').'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].($param?'?'.$param:'').'">';
|
||||||
|
|||||||
@ -45,10 +45,10 @@ $action = GETPOST('action');
|
|||||||
if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
|
if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
|
||||||
|
|
||||||
// List of supported permanent search area
|
// List of supported permanent search area
|
||||||
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT");
|
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT");
|
||||||
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT);
|
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT);
|
||||||
$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"),$langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')',$langs->trans("Members"));
|
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"));
|
||||||
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name');
|
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name');
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'update')
|
if ($action == 'update')
|
||||||
@ -73,6 +73,7 @@ if ($action == 'update')
|
|||||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity);
|
||||||
|
dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
|
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
|
||||||
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2014-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -211,7 +211,7 @@ if ($conf->societe->enabled)
|
|||||||
{
|
{
|
||||||
$nbno=$nbtotal=0;
|
$nbno=$nbtotal=0;
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','');
|
print_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','object_company');
|
||||||
print '<br>'."\n";
|
print '<br>'."\n";
|
||||||
$sql="SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''";
|
$sql="SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
@ -236,7 +236,7 @@ if ($conf->societe->enabled)
|
|||||||
print '<br><input class="button" type="submit" id="submitformbarcodethirdpartygen" '.((GETPOST("selectorforbarcode") && GETPOST("selectorforbarcode"))?'':'disabled ').'value="'.$langs->trans("InitEmptyBarCode",$nbno).'"';
|
print '<br><input class="button" type="submit" id="submitformbarcodethirdpartygen" '.((GETPOST("selectorforbarcode") && GETPOST("selectorforbarcode"))?'':'disabled ').'value="'.$langs->trans("InitEmptyBarCode",$nbno).'"';
|
||||||
print ' title="'.dol_escape_htmltag($langs->trans("FeatureNotYetAvailable")).'" disabled';
|
print ' title="'.dol_escape_htmltag($langs->trans("FeatureNotYetAvailable")).'" disabled';
|
||||||
print '>';
|
print '>';
|
||||||
print '<br><br><br>';
|
print '<br><br><br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ if ($conf->product->enabled || $conf->product->service)
|
|||||||
|
|
||||||
$nbno=$nbtotal=0;
|
$nbno=$nbtotal=0;
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','');
|
print_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','object_product');
|
||||||
print '<br>'."\n";
|
print '<br>'."\n";
|
||||||
|
|
||||||
$sql ="SELECT count(rowid) as nb, fk_product_type, datec";
|
$sql ="SELECT count(rowid) as nb, fk_product_type, datec";
|
||||||
@ -312,7 +312,7 @@ if ($conf->product->enabled || $conf->product->service)
|
|||||||
$moretags2=(($nbno == $nbtotal)?' disabled':'');
|
$moretags2=(($nbno == $nbtotal)?' disabled':'');
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input class="button" type="submit" name="eraseallbarcode" id="eraseallbarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretags2.' onClick="return confirm_erase();">';
|
print '<input class="button" type="submit" name="eraseallbarcode" id="eraseallbarcode" value="'.$langs->trans("EraseAllCurrentBarCode").'"'.$moretags2.' onClick="return confirm_erase();">';
|
||||||
print '<br><br><br>';
|
print '<br><br><br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ function project_prepare_head($object)
|
|||||||
|| ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled))
|
|| ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled))
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("ProjectReferers");
|
$head[$h][1] = $langs->trans("Overview");
|
||||||
$head[$h][2] = 'element';
|
$head[$h][2] = 'element';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -594,7 +594,9 @@ else
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $langs->trans('CronDtNextLaunch')."</td><td>";
|
print $langs->trans('CronDtNextLaunch');
|
||||||
|
print ' ('.$langs->trans('CronFrom').')';
|
||||||
|
print "</td><td>";
|
||||||
if(!empty($object->datenextrun)) {print dol_print_date($object->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');}
|
if(!empty($object->datenextrun)) {print dol_print_date($object->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
|
|||||||
@ -842,8 +842,8 @@ class Cronjob extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Run a job
|
* Run a job
|
||||||
*
|
*
|
||||||
* @param string $userlogin User login
|
* @param string $userlogin User login
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function run_jobs($userlogin)
|
function run_jobs($userlogin)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -76,6 +76,7 @@ CronMethodHelp=The object method to launch. <BR> For exemple to fetch method of
|
|||||||
CronArgsHelp=The method arguments. <BR> For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of paramters can be <i>0, ProductRef</i>
|
CronArgsHelp=The method arguments. <BR> For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of paramters can be <i>0, ProductRef</i>
|
||||||
CronCommandHelp=The system command line to execute.
|
CronCommandHelp=The system command line to execute.
|
||||||
CronCreateJob=Create new Scheduled Job
|
CronCreateJob=Create new Scheduled Job
|
||||||
|
CronFrom=From
|
||||||
# Info
|
# Info
|
||||||
CronInfoPage=Information
|
CronInfoPage=Information
|
||||||
# Common
|
# Common
|
||||||
|
|||||||
@ -151,4 +151,5 @@ TasksWithThisUserAsContact=Tasks assigned to this user
|
|||||||
ResourceNotAssignedToProject=Not assigned to project
|
ResourceNotAssignedToProject=Not assigned to project
|
||||||
ResourceNotAssignedToTask=Not assigned to task
|
ResourceNotAssignedToTask=Not assigned to task
|
||||||
AssignTaskToMe=Assign task to me
|
AssignTaskToMe=Assign task to me
|
||||||
AssignTask=Assign
|
AssignTask=Assign
|
||||||
|
ProjectOverview=Overview
|
||||||
@ -1555,6 +1555,12 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user'));
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire)
|
||||||
|
{
|
||||||
|
$langs->load("members");
|
||||||
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'M', 'searchleftproj', img_object('','projectpub'));
|
||||||
|
}
|
||||||
|
|
||||||
// Execute hook printSearchForm
|
// Execute hook printSearchForm
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|||||||
@ -293,7 +293,188 @@ if ($action=="addelement")
|
|||||||
|
|
||||||
$elementuser = new User($db);
|
$elementuser = new User($db);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$showdatefilter=0;
|
$showdatefilter=0;
|
||||||
|
// Show the filter on date on top of element list
|
||||||
|
if (! $showdatefilter)
|
||||||
|
{
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
|
||||||
|
print '<input type="hidden" name="tablename" value="'.$tablename.'">';
|
||||||
|
print '<input type="hidden" name="action" value="view">';
|
||||||
|
print '<table><tr>';
|
||||||
|
print '<td>'.$langs->trans("From").' ';
|
||||||
|
print $form->select_date($dates,'dates',0,0,1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td>'.$langs->trans("to").' ';
|
||||||
|
print $form->select_date($datee,'datee',0,0,1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '<input type="submit" name="refresh" value="'.$langs->trans("Refresh").'" class="button">';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr></table>';
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
$showdatefilter++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Show balance for whole project
|
||||||
|
|
||||||
|
$langs->load("suppliers");
|
||||||
|
$langs->load("bills");
|
||||||
|
$langs->load("orders");
|
||||||
|
$langs->load("proposals");
|
||||||
|
$langs->load("margins");
|
||||||
|
|
||||||
|
//print load_fiche_titre($langs->trans("Profit"),'','title_accountancy');
|
||||||
|
print '<div class="center">'.img_picto("", "title_accountancy").' '.$langs->trans("Profit").'</div><br>';
|
||||||
|
|
||||||
|
print '<table class="noborder">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td align="left" width="200">'.$langs->trans("Element").'</td>';
|
||||||
|
print '<td align="right" width="100">'.$langs->trans("Number").'</td>';
|
||||||
|
print '<td align="right" width="100">'.$langs->trans("AmountHT").'</td>';
|
||||||
|
print '<td align="right" width="100">'.$langs->trans("AmountTTC").'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$var = false;
|
||||||
|
|
||||||
|
foreach ($listofreferent as $key => $value)
|
||||||
|
{
|
||||||
|
$name=$langs->trans($value['name']);
|
||||||
|
$title=$value['title'];
|
||||||
|
$classname=$value['class'];
|
||||||
|
$tablename=$value['table'];
|
||||||
|
$datefieldname=$value['datefieldname'];
|
||||||
|
$qualified=$value['test'];
|
||||||
|
$margin = $value['margin'];
|
||||||
|
if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'plus')
|
||||||
|
{
|
||||||
|
$element = new $classname($db);
|
||||||
|
|
||||||
|
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
|
||||||
|
if (count($elementarray)>0 && is_array($elementarray))
|
||||||
|
{
|
||||||
|
$var=true;
|
||||||
|
$total_ht = 0;
|
||||||
|
$total_ttc = 0;
|
||||||
|
|
||||||
|
$num=count($elementarray);
|
||||||
|
for ($i = 0; $i < $num; $i++)
|
||||||
|
{
|
||||||
|
$tmp=explode('_',$elementarray[$i]);
|
||||||
|
$idofelement=$tmp[0];
|
||||||
|
$idofelementuser=$tmp[1];
|
||||||
|
|
||||||
|
$element->fetch($idofelement);
|
||||||
|
if ($idofelementuser) $elementuser->fetch($idofelementuser);
|
||||||
|
|
||||||
|
if ($tablename != 'expensereport_det') $element->fetch_thirdparty();
|
||||||
|
|
||||||
|
if ($tablename == 'don') $total_ht_by_line=$element->amount;
|
||||||
|
elseif ($tablename == 'projet_task')
|
||||||
|
{
|
||||||
|
if ($idofelementuser)
|
||||||
|
{
|
||||||
|
$tmp = $element->getSumOfAmount($elementuser, $dates, $datee);
|
||||||
|
$total_ht_by_line = price2num($tmp['amount'],'MT');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tmp = $element->getSumOfAmount('', $dates, $datee);
|
||||||
|
$total_ht_by_line = price2num($tmp['amount'],'MT');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else $total_ht_by_line=$element->total_ht;
|
||||||
|
|
||||||
|
$total_ht = $total_ht + $total_ht_by_line;
|
||||||
|
|
||||||
|
if ($tablename == 'don') $total_ttc_by_line=$element->amount;
|
||||||
|
elseif ($tablename == 'projet_task')
|
||||||
|
{
|
||||||
|
$defaultvat = get_default_tva($mysoc, $mysoc);
|
||||||
|
$total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)),'MT');
|
||||||
|
}
|
||||||
|
else $total_ttc_by_line=$element->total_ttc;
|
||||||
|
|
||||||
|
$total_ttc = $total_ttc + $total_ttc_by_line;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate margin
|
||||||
|
if ($margin=="add")
|
||||||
|
{
|
||||||
|
$balance_ht+= $total_ht;
|
||||||
|
$balance_ttc+= $total_ttc;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$balance_ht-= $total_ht;
|
||||||
|
$balance_ttc-= $total_ttc;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show $total_ht & $total_ttc -- add a minus when necessary
|
||||||
|
if ($margin!="add")
|
||||||
|
{
|
||||||
|
$total_ht = -$total_ht;
|
||||||
|
$total_ttc = -$total_ttc;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($classname) {
|
||||||
|
case 'FactureFournisseur':
|
||||||
|
$newclassname = 'SupplierInvoice';
|
||||||
|
break;
|
||||||
|
case 'Facture':
|
||||||
|
$newclassname = 'Bill';
|
||||||
|
break;
|
||||||
|
case 'Propal':
|
||||||
|
$newclassname = 'CommercialProposal';
|
||||||
|
break;
|
||||||
|
case 'Commande':
|
||||||
|
$newclassname = 'Order';
|
||||||
|
break;
|
||||||
|
case 'Expedition':
|
||||||
|
$newclassname = 'Sending';
|
||||||
|
break;
|
||||||
|
case 'Contrat':
|
||||||
|
$newclassname = 'Contract';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$newclassname = $classname;
|
||||||
|
}
|
||||||
|
|
||||||
|
$var = ! $var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
// Module
|
||||||
|
print '<td align="left">'.$langs->trans($newclassname).'</td>';
|
||||||
|
// Nb
|
||||||
|
print '<td align="right">'.$i.'</td>';
|
||||||
|
// Amount HT
|
||||||
|
print '<td align="right">'.price($total_ht).'</td>';
|
||||||
|
// Amount TTC
|
||||||
|
print '<td align="right">'.price($total_ttc).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// and the final balance
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td align="right" colspan=2 >'.$langs->trans("Total").'</td>';
|
||||||
|
print '<td align="right" >'.price($balance_ht).'</td>';
|
||||||
|
print '<td align="right" >'.price($balance_ttc).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print '<br><br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Detail
|
||||||
foreach ($listofreferent as $key => $value)
|
foreach ($listofreferent as $key => $value)
|
||||||
{
|
{
|
||||||
$title=$value['title'];
|
$title=$value['title'];
|
||||||
@ -310,32 +491,7 @@ foreach ($listofreferent as $key => $value)
|
|||||||
|
|
||||||
$element = new $classname($db);
|
$element = new $classname($db);
|
||||||
|
|
||||||
// Show the filter on date on top of element list
|
$addform='';
|
||||||
if (! $showdatefilter)
|
|
||||||
{
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
|
|
||||||
print '<input type="hidden" name="tablename" value="'.$tablename.'">';
|
|
||||||
print '<input type="hidden" name="action" value="view">';
|
|
||||||
print '<table><tr>';
|
|
||||||
print '<td>'.$langs->trans("From").' ';
|
|
||||||
print $form->select_date($dates,'dates',0,0,1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td>'.$langs->trans("to").' ';
|
|
||||||
print $form->select_date($datee,'datee',0,0,1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print '<input type="submit" name="refresh" value="'.$langs->trans("Refresh").'" class="button">';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr></table>';
|
|
||||||
print '</form><br>';
|
|
||||||
|
|
||||||
$showdatefilter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print_titre($langs->trans($title));
|
|
||||||
|
|
||||||
$selectList=$formproject->select_element($tablename,$object->thirdparty->id);
|
$selectList=$formproject->select_element($tablename,$object->thirdparty->id);
|
||||||
if (! $selectList || ($selectList<0))
|
if (! $selectList || ($selectList<0))
|
||||||
{
|
{
|
||||||
@ -343,17 +499,20 @@ foreach ($listofreferent as $key => $value)
|
|||||||
}
|
}
|
||||||
elseif($selectList)
|
elseif($selectList)
|
||||||
{
|
{
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
|
$addform.='<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
|
||||||
print '<input type="hidden" name="tablename" value="'.$tablename.'">';
|
$addform.='<input type="hidden" name="tablename" value="'.$tablename.'">';
|
||||||
print '<input type="hidden" name="action" value="addelement">';
|
$addform.='<input type="hidden" name="action" value="addelement">';
|
||||||
print '<input type="hidden" name="datesrfc" value="'.dol_print_date($dates,'dayhourrfc').'">';
|
$addform.='<input type="hidden" name="datesrfc" value="'.dol_print_date($dates,'dayhourrfc').'">';
|
||||||
print '<input type="hidden" name="dateerfc" value="'.dol_print_date($datee,'dayhourrfc').'">';
|
$addform.='<input type="hidden" name="dateerfc" value="'.dol_print_date($datee,'dayhourrfc').'">';
|
||||||
print '<table><tr><td>'.$langs->trans("SelectElement").'</td>';
|
$addform.='<table><tr><td>'.$langs->trans("SelectElement").'</td>';
|
||||||
print '<td>'.$selectList.'</td>';
|
$addform.='<td>'.$selectList.'</td>';
|
||||||
print '<td><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("AddElement")).'"></td>';
|
$addform.='<td><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("AddElement")).'"></td>';
|
||||||
print '</tr></table>';
|
$addform.='</tr></table>';
|
||||||
print '</form>';
|
$addform.='</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans($title), $addform, '');
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -675,151 +834,6 @@ foreach ($listofreferent as $key => $value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Show profit summary for whole project
|
|
||||||
|
|
||||||
$langs->load("suppliers");
|
|
||||||
$langs->load("bills");
|
|
||||||
$langs->load("orders");
|
|
||||||
$langs->load("proposals");
|
|
||||||
$langs->load("margins");
|
|
||||||
|
|
||||||
//print load_fiche_titre($langs->trans("Profit"),'','title_accountancy');
|
|
||||||
print '<br><div class="center">'.img_picto("", "title_accountancy").' '.$langs->trans("Profit").'</div><br>';
|
|
||||||
|
|
||||||
print '<table class="noborder">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td align="left" width="200">'.$langs->trans("Element").'</td>';
|
|
||||||
print '<td align="right" width="100">'.$langs->trans("Number").'</td>';
|
|
||||||
print '<td align="right" width="100">'.$langs->trans("AmountHT").'</td>';
|
|
||||||
print '<td align="right" width="100">'.$langs->trans("AmountTTC").'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
foreach ($listofreferent as $key => $value)
|
|
||||||
{
|
|
||||||
$name=$langs->trans($value['name']);
|
|
||||||
$title=$value['title'];
|
|
||||||
$classname=$value['class'];
|
|
||||||
$tablename=$value['table'];
|
|
||||||
$datefieldname=$value['datefieldname'];
|
|
||||||
$qualified=$value['test'];
|
|
||||||
$margin = $value['margin'];
|
|
||||||
if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'plus')
|
|
||||||
{
|
|
||||||
$element = new $classname($db);
|
|
||||||
|
|
||||||
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
|
|
||||||
if (count($elementarray)>0 && is_array($elementarray))
|
|
||||||
{
|
|
||||||
$var=true;
|
|
||||||
$total_ht = 0;
|
|
||||||
$total_ttc = 0;
|
|
||||||
|
|
||||||
$num=count($elementarray);
|
|
||||||
for ($i = 0; $i < $num; $i++)
|
|
||||||
{
|
|
||||||
$tmp=explode('_',$elementarray[$i]);
|
|
||||||
$idofelement=$tmp[0];
|
|
||||||
$idofelementuser=$tmp[1];
|
|
||||||
|
|
||||||
$element->fetch($idofelement);
|
|
||||||
if ($idofelementuser) $elementuser->fetch($idofelementuser);
|
|
||||||
|
|
||||||
if ($tablename != 'expensereport_det') $element->fetch_thirdparty();
|
|
||||||
|
|
||||||
if ($tablename == 'don') $total_ht_by_line=$element->amount;
|
|
||||||
elseif ($tablename == 'projet_task')
|
|
||||||
{
|
|
||||||
if ($idofelementuser)
|
|
||||||
{
|
|
||||||
$tmp = $element->getSumOfAmount($elementuser, $dates, $datee);
|
|
||||||
$total_ht_by_line = price2num($tmp['amount'],'MT');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$tmp = $element->getSumOfAmount('', $dates, $datee);
|
|
||||||
$total_ht_by_line = price2num($tmp['amount'],'MT');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else $total_ht_by_line=$element->total_ht;
|
|
||||||
|
|
||||||
$total_ht = $total_ht + $total_ht_by_line;
|
|
||||||
|
|
||||||
if ($tablename == 'don') $total_ttc_by_line=$element->amount;
|
|
||||||
elseif ($tablename == 'projet_task')
|
|
||||||
{
|
|
||||||
$defaultvat = get_default_tva($mysoc, $mysoc);
|
|
||||||
$total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)),'MT');
|
|
||||||
}
|
|
||||||
else $total_ttc_by_line=$element->total_ttc;
|
|
||||||
|
|
||||||
$total_ttc = $total_ttc + $total_ttc_by_line;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate margin
|
|
||||||
if ($margin=="add")
|
|
||||||
{
|
|
||||||
$margin_ht+= $total_ht;
|
|
||||||
$margin_ttc+= $total_ttc;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$margin_ht-= $total_ht;
|
|
||||||
$margin_ttc-= $total_ttc;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show $total_ht & $total_ttc -- add a minus when necessary
|
|
||||||
if ($margin!="add")
|
|
||||||
{
|
|
||||||
$total_ht = -$total_ht;
|
|
||||||
$total_ttc = -$total_ttc;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($classname) {
|
|
||||||
case 'FactureFournisseur':
|
|
||||||
$newclassname = 'SupplierInvoice';
|
|
||||||
break;
|
|
||||||
case 'Facture':
|
|
||||||
$newclassname = 'Bill';
|
|
||||||
break;
|
|
||||||
case 'Propal':
|
|
||||||
$newclassname = 'CommercialProposal';
|
|
||||||
break;
|
|
||||||
case 'Commande':
|
|
||||||
$newclassname = 'Order';
|
|
||||||
break;
|
|
||||||
case 'Expedition':
|
|
||||||
$newclassname = 'Sending';
|
|
||||||
break;
|
|
||||||
case 'Contrat':
|
|
||||||
$newclassname = 'Contract';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$newclassname = $classname;
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<tr>';
|
|
||||||
// Module
|
|
||||||
print '<td align="left">'.$langs->trans($newclassname).'</td>';
|
|
||||||
// Nb
|
|
||||||
print '<td align="right">'.$i.'</td>';
|
|
||||||
// Amount HT
|
|
||||||
print '<td align="right">'.price($total_ht).'</td>';
|
|
||||||
// Amount TTC
|
|
||||||
print '<td align="right">'.price($total_ttc).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// and the margin amount total
|
|
||||||
print '<tr class="liste_total">';
|
|
||||||
print '<td align="right" colspan=2 >'.$langs->trans("Total").'</td>';
|
|
||||||
print '<td align="right" >'.price($margin_ht).'</td>';
|
|
||||||
print '<td align="right" >'.price($margin_ttc).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -61,6 +61,7 @@ $pagenext = $page + 1;
|
|||||||
|
|
||||||
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
|
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
|
||||||
|
|
||||||
|
$search_all=GETPOST("search_all");
|
||||||
$search_ref=GETPOST("search_ref");
|
$search_ref=GETPOST("search_ref");
|
||||||
$search_label=GETPOST("search_label");
|
$search_label=GETPOST("search_label");
|
||||||
$search_societe=GETPOST("search_societe");
|
$search_societe=GETPOST("search_societe");
|
||||||
@ -83,11 +84,11 @@ if ($search_status == '') $search_status=-1; // -1 or 1
|
|||||||
// Purge criteria
|
// Purge criteria
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
|
$search_all='';
|
||||||
$search_ref="";
|
$search_ref="";
|
||||||
$search_label="";
|
$search_label="";
|
||||||
$search_societe="";
|
$search_societe="";
|
||||||
$search_year="";
|
$search_year="";
|
||||||
$search_all=0;
|
|
||||||
$search_status=-1;
|
$search_status=-1;
|
||||||
$search_public="";
|
$search_public="";
|
||||||
$search_sale="";
|
$search_sale="";
|
||||||
@ -189,7 +190,6 @@ if ($search_user > 0)
|
|||||||
$sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='project' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user;
|
$sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='project' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
@ -205,6 +205,7 @@ if ($resql)
|
|||||||
$param='';
|
$param='';
|
||||||
if ($month) $param.='&month='.$month;
|
if ($month) $param.='&month='.$month;
|
||||||
if ($year) $param.='&year=' .$year;
|
if ($year) $param.='&year=' .$year;
|
||||||
|
if ($search_all != '') $param.='&search_all='.$search_all;
|
||||||
if ($search_ref != '') $param.='&search_ref='.$search_ref;
|
if ($search_ref != '') $param.='&search_ref='.$search_ref;
|
||||||
if ($search_label != '') $param.='&search_label='.$search_label;
|
if ($search_label != '') $param.='&search_label='.$search_label;
|
||||||
if ($search_societe != '') $param.='&search_societe='.$search_societe;
|
if ($search_societe != '') $param.='&search_societe='.$search_societe;
|
||||||
@ -228,6 +229,12 @@ if ($resql)
|
|||||||
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
|
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($search_all)
|
||||||
|
{
|
||||||
|
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Label")." ".$langs->trans("or")." ".$langs->trans("ThirdParty")."): ";
|
||||||
|
print '<strong>'.$search_all.'</strong>';
|
||||||
|
}
|
||||||
|
|
||||||
// If the user can view prospects other than his'
|
// If the user can view prospects other than his'
|
||||||
if ($user->rights->societe->client->voir || $socid)
|
if ($user->rights->societe->client->voir || $socid)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
|
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
|
||||||
* Copyright (C) 2013 Florian Henry <forian.henry@open-cocnept.pro>
|
* Copyright (C) 2013 Florian Henry <forian.henry@open-cocnept.pro>
|
||||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -149,7 +149,7 @@ if (is_array($object->lines) && (count($object->lines)>0))
|
|||||||
}
|
}
|
||||||
// Execut job
|
// Execut job
|
||||||
$result=$cronjob->run_jobs($userlogin);
|
$result=$cronjob->run_jobs($userlogin);
|
||||||
if ($result<0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
echo "Error:".$cronjob->error;
|
echo "Error:".$cronjob->error;
|
||||||
dol_syslog("cron_run_jobs.php:: run_jobs Error".$cronjob->error, LOG_ERR);
|
dol_syslog("cron_run_jobs.php:: run_jobs Error".$cronjob->error, LOG_ERR);
|
||||||
|
|||||||
@ -147,7 +147,7 @@ background: #DDDFDD;
|
|||||||
}
|
}
|
||||||
|
|
||||||
table { font-size: 12px; }
|
table { font-size: 12px; }
|
||||||
table.login { border: 1px solid #C0C0C0; background: #F0F0F0; font-size: 12px; }
|
table.login { border: 1px solid #C0C0C0; background: #FFF; font-size: 12px; }
|
||||||
|
|
||||||
.inline-block
|
.inline-block
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@ -194,7 +194,8 @@ print '</td></tr></table>';
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr><tr>';
|
print '</tr><tr>';
|
||||||
$urlwiki='http://wiki.dolibarr.org/index.php/List of Dolibarr partners and providers';
|
#$urlwiki='http://wiki.dolibarr.org/index.php/List of Dolibarr partners and providers';
|
||||||
|
$urlwiki='http://partners.dolibarr.org';
|
||||||
print '<td align="center" valign="top">';
|
print '<td align="center" valign="top">';
|
||||||
print '<table class="nocellnopadd">';
|
print '<table class="nocellnopadd">';
|
||||||
print '<tr><td align="center">';
|
print '<tr><td align="center">';
|
||||||
@ -228,7 +229,8 @@ print '</td></tr></table>';
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr><tr>';
|
print '</tr><tr>';
|
||||||
$urlwiki='http://wiki.dolibarr.org/index.php/List of Dolibarr partners and providers';
|
#$urlwiki='http://wiki.dolibarr.org/index.php/List of Dolibarr partners and providers';
|
||||||
|
$urlwiki='http://partners.dolibarr.org';
|
||||||
print '<td align="center" valign="top">';
|
print '<td align="center" valign="top">';
|
||||||
print '<table class="nocellnopadd">';
|
print '<table class="nocellnopadd">';
|
||||||
print '<tr><td align="center">';
|
print '<tr><td align="center">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user