Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
c25872b182
@ -3,7 +3,10 @@ How to contribute to Dolibarr
|
||||
|
||||
Bug reports and feature requests
|
||||
--------------------------------
|
||||
** NEW **
|
||||
|
||||
*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum).
|
||||
|
||||
**NEW**
|
||||
|
||||
Issues are now managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues).
|
||||
|
||||
|
||||
@ -182,43 +182,27 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
|
||||
$res3=1;
|
||||
}*/
|
||||
|
||||
// TODO We add/delete permission until permission can have a condition on a global var
|
||||
$r_id = 1190;
|
||||
$entity = $conf->entity;
|
||||
$r_desc=$langs->trans("Permission1190");
|
||||
$r_modul='fournisseur';
|
||||
$r_type='w';
|
||||
$r_perms='commande';
|
||||
$r_subperms='approve2';
|
||||
$r_def=0;
|
||||
// TODO We add/delete permission here until permission can have a condition on a global var
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
|
||||
$newmodule=new modFournisseur($db);
|
||||
// clear default rights array
|
||||
$newmodule->rights=array();
|
||||
// add new right
|
||||
$r=0;
|
||||
$newmodule->rights[$r][0] = 1190;
|
||||
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
|
||||
$newmodule->rights[$r][2] = 'w';
|
||||
$newmodule->rights[$r][3] = 0;
|
||||
$newmodule->rights[$r][4] = 'commande';
|
||||
$newmodule->rights[$r][5] = 'approve2';
|
||||
|
||||
if ($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def";
|
||||
$sql.= " (id, entity, libelle, module, type, bydefault, perms, subperms)";
|
||||
$sql.= " VALUES ";
|
||||
$sql.= "(".$r_id.",".$entity.",'".$db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."','".$r_subperms."')";
|
||||
|
||||
$resqlinsert=$db->query($sql,1);
|
||||
if (! $resqlinsert)
|
||||
{
|
||||
if ($db->errno() != "DB_ERROR_RECORD_ALREADY_EXISTS")
|
||||
{
|
||||
setEventMessage($db->lasterror(),'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
$newmodule->insert_permissions(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."rights_def";
|
||||
$sql.= " WHERE id = ".$r_id;
|
||||
$resqldelete=$db->query($sql,1);
|
||||
if (! $resqldelete)
|
||||
{
|
||||
setEventMessage($db->lasterror(),'errors');
|
||||
$error++;
|
||||
}
|
||||
$newmodule->delete_permissions();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -627,7 +627,7 @@ if ($id > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomerOrders",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
//if($num2 > 0) print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').'</a></td>';
|
||||
//else print '<td width="20px" align="right"><a href="#">'.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'</a></td>';
|
||||
|
||||
@ -403,7 +403,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<input name="label" class="flat" type="text" size="24" value="'.GETPOST("label").'">';
|
||||
if ($nbcategories)
|
||||
{
|
||||
print '<br>'.$langs->trans("Category").': <select class="flat" name="cat1">'.$options.'</select>';
|
||||
print '<br>'.$langs->trans("Rubrique").': <select class="flat" name="cat1">'.$options.'</select>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align=right><input name="debit" class="flat" type="text" size="4" value="'.GETPOST("debit").'"></td>';
|
||||
|
||||
@ -178,9 +178,10 @@ if ($resql)
|
||||
print '<form method="post" action="search.php" name="search_form">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
|
||||
|
||||
$moreforfilter .= $langs->trans('Period') . ' ' . $langs->trans('StartDate') . ': ';
|
||||
$moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 1, 1);
|
||||
$moreforfilter .= $langs->trans('EndDate') . ':' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 1, 1);
|
||||
$moreforfilter .= $langs->trans('Period') . ' ('.$langs->trans('DateOperationShort').') : ' . $langs->trans('StartDate') . ' ';
|
||||
$moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1);
|
||||
$moreforfilter .= ' - ';
|
||||
$moreforfilter .= $langs->trans('EndDate') . ' ' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1);
|
||||
|
||||
|
||||
if ($moreforfilter) {
|
||||
|
||||
@ -329,8 +329,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
// Solde actuel
|
||||
$var=!$var;
|
||||
print '<tr class="liste_total">';
|
||||
print '<td align="left" colspan="5">'.$langs->trans("FutureBalance").'</td>';
|
||||
print '<td align="right" nowrap>'.price($solde).'</td>';
|
||||
print '<td align="left" colspan="5">'.$langs->trans("FutureBalance").' ('.$acct->currency_code.')</td>';
|
||||
print '<td align="right" nowrap>'.price($solde, 0, $langs, 0, 0, -1, $acct->currency_code).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -79,7 +79,7 @@ if ($action == 'add')
|
||||
$accountto=new Account($db);
|
||||
$accountto->fetch(GETPOST('account_to','int'));
|
||||
|
||||
if ($accountto->id != $accountfrom->id)
|
||||
if (($accountto->id != $accountfrom->id) && ($accountto->currency_code == $accountfrom->currency_code))
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
|
||||
@ -1076,7 +1076,7 @@ if (empty($reshook))
|
||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
||||
$array_options = $lines[$i]->array_options;
|
||||
}
|
||||
|
||||
|
||||
// View third's localtaxes for now
|
||||
$localtax1_tx = get_localtax($lines[$i]->tva_tx, 1, $object->client);
|
||||
$localtax2_tx = get_localtax($lines[$i]->tva_tx, 2, $object->client);
|
||||
|
||||
@ -1887,10 +1887,11 @@ abstract class CommonObject
|
||||
* @param int $targetid Object target id
|
||||
* @param string $targettype Object target type
|
||||
* @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
|
||||
* @param int $alsosametype 0=Return only links to different object than source. 1=Include also link to objects of same type.
|
||||
* @return void
|
||||
* @see add_object_linked, updateObjectLinked, deleteObjectLinked
|
||||
*/
|
||||
function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
|
||||
function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR',$alsosametype=1)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -1924,7 +1925,7 @@ abstract class CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Links beetween objects are stored in this table
|
||||
// Links between objects are stored in table element_element
|
||||
$sql = 'SELECT fk_source, sourcetype, fk_target, targettype';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'element_element';
|
||||
$sql.= " WHERE ";
|
||||
@ -1983,7 +1984,7 @@ abstract class CommonObject
|
||||
|
||||
$classpath = $element.'/class';
|
||||
|
||||
// To work with non standard path
|
||||
// To work with non standard classpath or module name
|
||||
if ($objecttype == 'facture') {
|
||||
$classpath = 'compta/facture/class';
|
||||
}
|
||||
@ -2019,7 +2020,7 @@ abstract class CommonObject
|
||||
$classfile = 'fournisseur.commande'; $classname = 'CommandeFournisseur';
|
||||
}
|
||||
|
||||
if ($conf->$module->enabled && $element != $this->element)
|
||||
if ($conf->$module->enabled && (($element != $this->element) || $alsosametype))
|
||||
{
|
||||
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
||||
|
||||
|
||||
@ -31,7 +31,6 @@
|
||||
|
||||
/**
|
||||
* Events class
|
||||
* Initialy built by build_class_from_table on 2008-02-28 17:25
|
||||
*/
|
||||
class Events // extends CommonObject
|
||||
{
|
||||
@ -41,6 +40,8 @@ class Events // extends CommonObject
|
||||
var $id;
|
||||
var $db;
|
||||
|
||||
var $error;
|
||||
|
||||
var $tms;
|
||||
var $type;
|
||||
var $entity;
|
||||
|
||||
@ -31,7 +31,7 @@ abstract class Stats
|
||||
{
|
||||
protected $db;
|
||||
var $_lastfetchdate=array(); // Dates of cache file read by methods
|
||||
var $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts)
|
||||
var $cachefilesuffix=''; // Suffix to add to name of cache file (to avoid file name conflicts)
|
||||
|
||||
/**
|
||||
* Return nb of elements by month for several years
|
||||
@ -76,7 +76,7 @@ abstract class Stats
|
||||
dol_syslog(get_class($this).'::'.__FUNCTION__." cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Load file into $data
|
||||
if ($foundintocache) // Cache file found and is not too old
|
||||
{
|
||||
@ -203,11 +203,14 @@ abstract class Stats
|
||||
dol_syslog(get_class($this).'::'.__FUNCTION__." save cache file ".$newpathofdestfile." onto disk.");
|
||||
if (! dol_is_dir($conf->user->dir_temp)) dol_mkdir($conf->user->dir_temp);
|
||||
$fp = fopen($newpathofdestfile, 'w');
|
||||
fwrite($fp, json_encode($data));
|
||||
fclose($fp);
|
||||
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
|
||||
if ($fp)
|
||||
{
|
||||
fwrite($fp, json_encode($data));
|
||||
fclose($fp);
|
||||
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
}
|
||||
else dol_syslog("Failed to write cache file", LOG_ERR);
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
}
|
||||
|
||||
@ -309,21 +312,23 @@ abstract class Stats
|
||||
dol_syslog(get_class($this).'::'.__FUNCTION__." save cache file ".$newpathofdestfile." onto disk.");
|
||||
if (! dol_is_dir($conf->user->dir_temp)) dol_mkdir($conf->user->dir_temp);
|
||||
$fp = fopen($newpathofdestfile, 'w');
|
||||
fwrite($fp, json_encode($data));
|
||||
fclose($fp);
|
||||
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
|
||||
if ($fp)
|
||||
{
|
||||
fwrite($fp, json_encode($data));
|
||||
fclose($fp);
|
||||
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
}
|
||||
$this->_lastfetchdate[get_class($this).'_'.__FUNCTION__]=$nowgmt;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Here we have low level of shared code called by XxxStats.class.php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return nb of elements by year
|
||||
*
|
||||
@ -532,8 +537,8 @@ abstract class Stats
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return number or total of product refs
|
||||
*
|
||||
@ -544,7 +549,7 @@ abstract class Stats
|
||||
function _getAllByProduct($sql, $limit=10)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
$result=array();
|
||||
$res=array();
|
||||
|
||||
@ -567,6 +572,6 @@ abstract class Stats
|
||||
else dol_print_error($this->db);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ function product_prepare_head($object)
|
||||
$head[$h][2] = 'referers';
|
||||
$h++;
|
||||
|
||||
if($object->isproduct()) // Si produit stockable
|
||||
if ($object->isproduct() || ($object->isservice() && ! empty($conf->global->STOCK_SUPPORTS_SERVICES))) // If physical product we can stock (or service with option)
|
||||
{
|
||||
if (! empty($conf->stock->enabled) && $user->rights->stock->lire)
|
||||
{
|
||||
|
||||
@ -371,7 +371,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
$taskstatic->id=$lines[$i]->id;
|
||||
$taskstatic->ref=$lines[$i]->ref;
|
||||
$taskstatic->label=($taskrole[$lines[$i]->id]?$langs->trans("YourRole").': '.$taskrole[$lines[$i]->id]:'');
|
||||
print $taskstatic->getNomUrl(1,($showproject?'':'withproject'));
|
||||
print $taskstatic->getNomUrl(1,'withproject');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -504,9 +504,10 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
* @param string $tasksrole Array of roles user has on task
|
||||
* @param string $mine Show only task lines I am assigned to
|
||||
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
|
||||
* @param int $preselectedday Preselected day
|
||||
* @return $inc
|
||||
*/
|
||||
function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0)
|
||||
function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0, $preselectedday='')
|
||||
{
|
||||
global $db, $user, $bc, $langs;
|
||||
global $form, $formother, $projectstatic, $taskstatic;
|
||||
@ -527,6 +528,12 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
|
||||
{
|
||||
$var = !$var;
|
||||
$lastprojectid=$lines[$i]->fk_project;
|
||||
|
||||
if ($preselectedday)
|
||||
{
|
||||
$projectstatic->id = $lines[$i]->fk_project;
|
||||
$projectstatic->loadTimeSpent($preselectedday, 0, $fuser->id); // Load time spent into this->weekWorkLoad and this->weekWorkLoadPerTaks for all day of a week
|
||||
}
|
||||
}
|
||||
|
||||
// If we want all or we have a role on task, we show it
|
||||
@ -549,7 +556,7 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
|
||||
// Ref
|
||||
print '<td>';
|
||||
$taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id);
|
||||
print $taskstatic->getNomUrl(1);
|
||||
print $taskstatic->getNomUrl(1,'withproject');
|
||||
print '</td>';
|
||||
|
||||
// Label task
|
||||
@ -559,7 +566,7 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
|
||||
$taskstatic->ref=$lines[$i]->label;
|
||||
$taskstatic->date_start=$lines[$i]->date_start;
|
||||
$taskstatic->date_end=$lines[$i]->date_end;
|
||||
print $taskstatic->getNomUrl(0);
|
||||
print $taskstatic->getNomUrl(0,'withproject');
|
||||
//print "<br>";
|
||||
//for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
|
||||
@ -613,14 +620,21 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
|
||||
|
||||
// Form to add new time
|
||||
print '<td class="nowrap" align="center">';
|
||||
$s='';
|
||||
$s.=$form->select_date('',$lines[$i]->id,1,1,2,"addtime",1,0,1,$disabledtask);
|
||||
print $s;
|
||||
$tableCell=$form->select_date($preselectedday,$lines[$i]->id,1,1,2,"addtime",0,0,1,$disabledtask);
|
||||
print $tableCell;
|
||||
print '</td><td align="right">';
|
||||
//$s.=' ';
|
||||
$s=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1);
|
||||
//$s.=' <input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
|
||||
print $s;
|
||||
|
||||
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id];
|
||||
$alreadyspent='';
|
||||
if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($dayWorkLoad,'allhourmin');
|
||||
|
||||
$tableCell='';
|
||||
$tableCell.='<span class="timesheetalreadyrecorded"><input type="text" class="center" size="2" disabled="disabled" id="timespent['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="'.$alreadyspent.'"></span>';
|
||||
$tableCell.=' + ';
|
||||
//$tableCell.=' ';
|
||||
$tableCell.=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1);
|
||||
//$tableCell.=' <input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
|
||||
print $tableCell;
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
@ -633,7 +647,7 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
|
||||
|
||||
$inc++;
|
||||
$level++;
|
||||
if ($lines[$i]->id) projectLinesPerDay($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
||||
if ($lines[$i]->id) projectLinesPerDay($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $preselectedday);
|
||||
$level--;
|
||||
}
|
||||
else
|
||||
@ -776,18 +790,30 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
for ($idw = 0; $idw < 7; $idw++)
|
||||
{
|
||||
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
|
||||
$tmparray=dol_getdate($tmpday);
|
||||
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id];
|
||||
$alreadyspent='';
|
||||
if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($dayWorkLoad,'allhourmin');
|
||||
$tableCell ='<td align="center">';
|
||||
$tableCell.='<span class="timesheetalreadyrecorded"><input type="text" class="center" size="2" disabled="disabled" id="timespent['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="'.$alreadyspent.'"></span>';
|
||||
$tableCell.='+';
|
||||
$tableCell.='<input type="text" class="center" size="2" id="timeadded['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="" cols="2" maxlength="5"';
|
||||
$tableCell.=' onkeypress="return regexEvent(this,event,\'timeChar\')"';
|
||||
$tableCell.= 'onblur="regexEvent(this,event,\''.$modeinput.'\'); updateTotal('.$idw.',\''.$modeinput.'\')" />';
|
||||
//$placeholder=' placeholder="00:00"';
|
||||
$placeholder='';
|
||||
//if (! $disabledtask)
|
||||
//{
|
||||
$tableCell.='+';
|
||||
$tableCell.='<input type="text" alt="'.$langs->trans("AddHereTimeSpentForDay",$tmparray['day'],$tmparray['mon']).'" title="'.$langs->trans("AddHereTimeSpentForDay",$tmparray['day'],$tmparray['mon']).'" '.($disabledtask?'disabled="disabled"':$placeholder).' class="center" size="2" id="timeadded['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="" cols="2" maxlength="5"';
|
||||
$tableCell.=' onkeypress="return regexEvent(this,event,\'timeChar\')"';
|
||||
$tableCell.= 'onblur="regexEvent(this,event,\''.$modeinput.'\'); updateTotal('.$idw.',\''.$modeinput.'\')" />';
|
||||
//}
|
||||
$tableCell.='</td>';
|
||||
print $tableCell;
|
||||
}
|
||||
|
||||
print '<td align="right">';
|
||||
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject"));
|
||||
else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou"));
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -695,7 +695,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if ((empty($leftmenu) || $leftmenu=="orders_suppliers") && empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->fournisseur->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusOrderApprovedShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusOrderReceivedPartially"), 2, $user->rights->fournisseur->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusOrderReceivedPartiallyShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusOrderReceivedAll"), 2, $user->rights->fournisseur->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusOrderCanceled"), 2, $user->rights->fournisseur->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusOrderRefused"), 2, $user->rights->fournisseur->commande->lire);
|
||||
|
||||
@ -161,6 +161,14 @@ class modFournisseur extends DolibarrModules
|
||||
$this->rights[$r][4] = 'commande';
|
||||
$this->rights[$r][5] = 'approuver';
|
||||
|
||||
/*$r++;
|
||||
$this->rights[$r][0] = 1191;
|
||||
$this->rights[$r][1] = 'Approuver une commande fournisseur (si supérieur hiérarchique)';
|
||||
$this->rights[$r][2] = 'w';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'commande';
|
||||
$this->rights[$r][5] = 'approve_ifsupervisor_advance';*/
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 1186;
|
||||
$this->rights[$r][1] = 'Commander une commande fournisseur';
|
||||
@ -250,6 +258,18 @@ class modFournisseur extends DolibarrModules
|
||||
$this->rights[$r][4] = 'commande';
|
||||
$this->rights[$r][5] = 'export';
|
||||
|
||||
if ($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)
|
||||
{
|
||||
$r++;
|
||||
$this->rights[$r][0] = 1190;
|
||||
$this->rights[$r][1] = 'Approve supplier order (second level)'; // $langs->trans("Permission1190");
|
||||
$this->rights[$r][2] = 'w';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'commande';
|
||||
$this->rights[$r][5] = 'approve2';
|
||||
}
|
||||
|
||||
|
||||
// Exports
|
||||
//--------
|
||||
$r=0;
|
||||
|
||||
@ -364,7 +364,7 @@ if ($object->id > 0)
|
||||
|
||||
|
||||
/*
|
||||
* Last orders
|
||||
* Last supplier orders
|
||||
*/
|
||||
$orderstatic = new CommandeFournisseur($db);
|
||||
|
||||
@ -409,7 +409,7 @@ if ($object->id > 0)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastOrders",($num<$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierOrders",($num<$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
print '<td align="right"><a href="commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
print '</tr></table>';
|
||||
@ -455,7 +455,7 @@ if ($object->id > 0)
|
||||
}
|
||||
|
||||
/*
|
||||
* Last invoices
|
||||
* Last supplier invoices
|
||||
*/
|
||||
$MAXLIST=5;
|
||||
|
||||
|
||||
@ -1392,13 +1392,19 @@ class CommandeFournisseur extends CommonOrder
|
||||
function dispatchProduct($user, $product, $qty, $entrepot, $price=0, $comment='', $eatby='', $sellby='', $batch='', $fk_commandefourndet=0, $notrigger=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$error = 0;
|
||||
require_once DOL_DOCUMENT_ROOT .'/product/stock/class/mouvementstock.class.php';
|
||||
|
||||
// Check parameters
|
||||
if ($entrepot <= 0 || $qty <= 0)
|
||||
// Check parameters (if test are wrong here, there is bug into caller)
|
||||
if ($entrepot <= 0)
|
||||
{
|
||||
$this->error='BadValueForParameterWarehouseOrQty';
|
||||
$this->error='ErrorBadValueForParameterWarehouse';
|
||||
return -1;
|
||||
}
|
||||
if ($qty <= 0)
|
||||
{
|
||||
$this->error='ErrorBadValueForParameterQty';
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1741,18 +1747,37 @@ class CommandeFournisseur extends CommonOrder
|
||||
if ($type == 'nev') $statut = 7;
|
||||
if ($type == 'can') $statut = 7;
|
||||
|
||||
if (! $error && ! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && ($type == 'tot'))
|
||||
{
|
||||
// If option SUPPLIER_ORDER_USE_DISPATCH_STATUS is on, we check all reception are approved to allow status "total/done"
|
||||
$dispatchedlinearray=$this->getDispachedLines(0);
|
||||
if (count($dispatchedlinearray) > 0)
|
||||
// Some checks to accept the record
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS))
|
||||
{
|
||||
// If option SUPPLIER_ORDER_USE_DISPATCH_STATUS is on, we check all reception are approved to allow status "total/done"
|
||||
if (! $error && ($type == 'tot'))
|
||||
{
|
||||
$dispatchedlinearray=$this->getDispachedLines(0);
|
||||
if (count($dispatchedlinearray) > 0)
|
||||
{
|
||||
$result=-1;
|
||||
$error++;
|
||||
$this->errors[]='ErrorCantSetReceptionToTotalDoneWithReceptionToApprove';
|
||||
dol_syslog('ErrorCantSetReceptionToTotalDoneWithReceptionToApprove', LOG_DEBUG);
|
||||
}
|
||||
|
||||
}
|
||||
if (! $error && ! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS_NEED_APPROVE) && ($type == 'tot')) // Accept to move to rception done, only if status of all line are ok (refuse denied)
|
||||
{
|
||||
$result=-1;
|
||||
$error++;
|
||||
$this->errors[]='ErrorCantSetReceptionToTotalDoneWithReceptionToApprove';
|
||||
dol_syslog('ErrorCantSetReceptionToTotalDoneWithReceptionToApprove', LOG_DEBUG);
|
||||
$dispatcheddenied=$this->getDispachedLines(2);
|
||||
if (count($dispatchedlinearray) > 0)
|
||||
{
|
||||
$result=-1;
|
||||
$error++;
|
||||
$this->errors[]='ErrorCantSetReceptionToTotalDoneWithReceptionDenied';
|
||||
dol_syslog('ErrorCantSetReceptionToTotalDoneWithReceptionDenied', LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO LDR01 Add option to accept only if ALL predefined products are received (same qty).
|
||||
|
||||
|
||||
if (! $error && ! ($statut == 4 or $statut == 5 or $statut == 7))
|
||||
{
|
||||
|
||||
@ -495,16 +495,19 @@ class CommandeFournisseurDispatch extends CommonObject
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut0');
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]),'statut4');
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut8');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($statut==0) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]),'statut0');
|
||||
if ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]),'statut4');
|
||||
if ($statut==2) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]),'statut8');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ class ProductFournisseur extends Product
|
||||
* @param float $remise_percent Discount regarding qty (percent)
|
||||
* @param float $remise Discount regarding qty (amount)
|
||||
* @param int $newnpr Set NPR or not
|
||||
* @param int $delivery_time_days Delay in days for delivery (max)
|
||||
* @param int $delivery_time_days Delay in days for delivery (max). May be '' if not defined.
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0, $newnpr=0, $delivery_time_days=0)
|
||||
@ -167,7 +167,7 @@ class ProductFournisseur extends Product
|
||||
if (empty($charges)) $charges=0;
|
||||
if (empty($availability)) $availability=0;
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
if (empty($delivery_time_days)) $delivery_time_days=0;
|
||||
if ($delivery_time_days != '' && ! is_numeric($delivery_time_days)) $delivery_time_days = '';
|
||||
if ($price_base_type == 'TTC')
|
||||
{
|
||||
//$ttx = get_default_tva($fourn,$mysoc,$this->id); // We must use the VAT rate defined by user and not calculate it
|
||||
@ -202,7 +202,7 @@ class ProductFournisseur extends Product
|
||||
$sql.= " entity = ".$conf->entity.",";
|
||||
$sql.= " info_bits = ".$newnpr.",";
|
||||
$sql.= " charges = ".$charges.",";
|
||||
$sql.= " delivery_time_days = ".$delivery_time_days;
|
||||
$sql.= " delivery_time_days = ".($delivery_time_days != '' ? $delivery_time_days : 'null');
|
||||
$sql.= " WHERE rowid = ".$this->product_fourn_price_id;
|
||||
// TODO Add price_base_type and price_ttc
|
||||
|
||||
@ -437,16 +437,16 @@ class ProductFournisseur extends Product
|
||||
$prodfourn->fourn_remise_percent = $record["remise_percent"];
|
||||
$prodfourn->fourn_remise = $record["remise"];
|
||||
$prodfourn->fourn_unitprice = $record["unitprice"];
|
||||
$prodfourn->fourn_charges = $record["charges"];
|
||||
$prodfourn->fourn_unitcharges = $record["unitcharges"];
|
||||
$prodfourn->fourn_charges = $record["charges"];
|
||||
$prodfourn->fourn_unitcharges = $record["unitcharges"];
|
||||
$prodfourn->fourn_tva_tx = $record["tva_tx"];
|
||||
$prodfourn->fourn_id = $record["fourn_id"];
|
||||
$prodfourn->fourn_name = $record["supplier_name"];
|
||||
$prodfourn->fk_availability = $record["fk_availability"];
|
||||
$prodfourn->delivery_time_days = $record["delivery_time_days"];
|
||||
$prodfourn->id = $prodid;
|
||||
$prodfourn->fourn_tva_npr = $record["info_bits"];
|
||||
$prodfourn->fk_supplier_price_expression = $record["fk_supplier_price_expression"];
|
||||
$prodfourn->fourn_tva_npr = $record["info_bits"];
|
||||
$prodfourn->fk_supplier_price_expression = $record["fk_supplier_price_expression"];
|
||||
|
||||
if (!empty($prodfourn->fk_supplier_price_expression)) {
|
||||
$priceparser = new PriceParser($this->db);
|
||||
@ -631,17 +631,19 @@ class ProductFournisseur extends Product
|
||||
/**
|
||||
* Display supplier of product
|
||||
*
|
||||
* @param int $withpicto Add picto
|
||||
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
|
||||
* @return string String with supplier price
|
||||
* @param int $withpicto Add picto
|
||||
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
|
||||
* @param int $maxlen Max length of name
|
||||
* @param integer $notooltip 1=Disable tooltip
|
||||
* @return string String with supplier price
|
||||
* TODO Remove this method. Use getNomUrl directly.
|
||||
*/
|
||||
function getSocNomUrl($withpicto=0,$option='supplier')
|
||||
function getSocNomUrl($withpicto=0,$option='supplier',$maxlen=0,$notooltip=0)
|
||||
{
|
||||
$thirdparty = new Fournisseur($this->db);
|
||||
$thirdparty->fetch($this->fourn_id);
|
||||
|
||||
return $thirdparty->getNomUrl($withpicto,$option);
|
||||
return $thirdparty->getNomUrl($withpicto,$option,$maxlen,$notooltip);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -649,13 +651,15 @@ class ProductFournisseur extends Product
|
||||
*
|
||||
* @param int $showunitprice Show "Unit price" into output string
|
||||
* @param int $showsuptitle Show "Supplier" into output string
|
||||
* @param int $maxlen Max length of name
|
||||
* @param integer $notooltip 1=Disable tooltip
|
||||
* @return string String with supplier price
|
||||
*/
|
||||
function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1)
|
||||
function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("suppliers");
|
||||
$out=($showunitprice?price($this->fourn_unitprice).' '.$langs->trans("HT").' (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier').' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
|
||||
$out=($showunitprice?price($this->fourn_unitprice).' '.$langs->trans("HT").' (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
@ -190,12 +190,13 @@ if (empty($reshook))
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
|
||||
if ($action == 'reopen') // no test on permission here, permission to use will depends on status
|
||||
{
|
||||
if (in_array($object->statut, array(1, 2, 5, 6, 7, 9)))
|
||||
if (in_array($object->statut, array(1, 2, 3, 5, 6, 7, 9)))
|
||||
{
|
||||
if ($object->statut == 1) $newstatus=0; // Validated->Draft
|
||||
else if ($object->statut == 2) $newstatus=0; // Approved->Draft
|
||||
else if ($object->statut == 3) $newstatus=2; // Ordered->Approved
|
||||
else if ($object->statut == 5) $newstatus=4; // Received->Received partially
|
||||
else if ($object->statut == 6) $newstatus=2; // Canceled->Approved
|
||||
else if ($object->statut == 7) $newstatus=3; // Canceled->Process running
|
||||
@ -950,40 +951,40 @@ if (empty($reshook))
|
||||
if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0)
|
||||
continue;
|
||||
|
||||
$label = (! empty($lines [$i]->label) ? $lines [$i]->label : '');
|
||||
$desc = (! empty($lines [$i]->desc) ? $lines [$i]->desc : $lines [$i]->libelle);
|
||||
$product_type = (! empty($lines [$i]->product_type) ? $lines [$i]->product_type : 0);
|
||||
$label = (! empty($lines[$i]->label) ? $lines[$i]->label : '');
|
||||
$desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle);
|
||||
$product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0);
|
||||
|
||||
// Reset fk_parent_line for no child products and special product
|
||||
if (($lines [$i]->product_type != 9 && empty($lines [$i]->fk_parent_line)) || $lines [$i]->product_type == 9) {
|
||||
if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
|
||||
$fk_parent_line = 0;
|
||||
}
|
||||
|
||||
// Extrafields
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines [$i], 'fetch_optionals')) // For avoid conflicts if
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if
|
||||
// trigger used
|
||||
{
|
||||
$lines [$i]->fetch_optionals($lines [$i]->rowid);
|
||||
$array_option = $lines [$i]->array_options;
|
||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
||||
$array_option = $lines[$i]->array_options;
|
||||
}
|
||||
|
||||
$idprod = $productsupplier->find_min_price_product_fournisseur($lines [$i]->fk_product, $lines [$i]->qty);
|
||||
$idprod = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty);
|
||||
$res = $productsupplier->fetch($idProductFourn);
|
||||
|
||||
$result = $object->addline(
|
||||
$desc,
|
||||
$lines [$i]->subprice,
|
||||
$lines [$i]->qty,
|
||||
$lines [$i]->tva_tx,
|
||||
$lines [$i]->localtax1_tx,
|
||||
$lines [$i]->localtax2_tx,
|
||||
$lines [$i]->fk_product,
|
||||
$lines[$i]->subprice,
|
||||
$lines[$i]->qty,
|
||||
$lines[$i]->tva_tx,
|
||||
$lines[$i]->localtax1_tx,
|
||||
$lines[$i]->localtax2_tx,
|
||||
$lines[$i]->fk_product,
|
||||
$productsupplier->product_fourn_price_id,
|
||||
$productsupplier->ref_fourn,
|
||||
$lines [$i]->remise_percent,
|
||||
$lines[$i]->remise_percent,
|
||||
'HT',
|
||||
0,
|
||||
$lines [$i]->product_type,
|
||||
$lines[$i]->product_type,
|
||||
'',
|
||||
'',
|
||||
null,
|
||||
@ -996,7 +997,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Defined the new fk_parent_line
|
||||
if ($result > 0 && $lines [$i]->product_type == 9) {
|
||||
if ($result > 0 && $lines[$i]->product_type == 9) {
|
||||
$fk_parent_line = $result;
|
||||
}
|
||||
}
|
||||
@ -1911,7 +1912,7 @@ elseif (! empty($object->id))
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Delai livraison jours
|
||||
// Delivery delay (in days)
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('NbDaysToDelivery').' '.img_picto($langs->trans('DescNbDaysToDelivery'), 'info', 'style="cursor:help"').'</td>';
|
||||
print '<td>'.$object->getMaxDeliveryTimeDay($langs).'</td>';
|
||||
@ -2671,7 +2672,7 @@ elseif (! empty($object->id))
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Disapprove").'</a>';
|
||||
}
|
||||
}
|
||||
if (in_array($object->statut, array(5, 6, 7, 9)))
|
||||
if (in_array($object->statut, array(3, 5, 6, 7, 9)))
|
||||
{
|
||||
if ($user->rights->fournisseur->commande->commander)
|
||||
{
|
||||
|
||||
@ -101,6 +101,23 @@ if ($action == 'uncheckdispatchline' &&
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'denydispatchline' &&
|
||||
! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))
|
||||
)
|
||||
{
|
||||
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
|
||||
$result=$supplierorderdispatch->fetch($lineid);
|
||||
if (! $result) dol_print_error($db);
|
||||
$result=$supplierorderdispatch->setStatut(2);
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors');
|
||||
$error++;
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
|
||||
{
|
||||
$commande = new CommandeFournisseur($db);
|
||||
@ -123,7 +140,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
|
||||
|
||||
if (GETPOST($qty) > 0) // We ask to move a qty
|
||||
{
|
||||
if (! GETPOST($ent,'int') > 0)
|
||||
if (! (GETPOST($ent,'int') > 0))
|
||||
{
|
||||
dol_syslog('No dispatch for line '.$key.' as no warehouse choosed');
|
||||
$text = $langs->transnoentities('Warehouse').', '.$langs->transnoentities('Line').' ' .($numline);
|
||||
@ -133,7 +150,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$result = $commande->DispatchProduct($user, GETPOST($prod,'int'),GETPOST($qty), GETPOST($ent,'int'), GETPOST($pu), GETPOST("comment"), '', '', '', GETPOST($fk_commandefourndet, 'int'), $notrigger);
|
||||
$result = $commande->DispatchProduct($user, GETPOST($prod,'int'), GETPOST($qty), GETPOST($ent,'int'), GETPOST($pu), GETPOST("comment"), '', '', '', GETPOST($fk_commandefourndet, 'int'), $notrigger);
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($commande->error, $commande->errors, 'errors');
|
||||
@ -643,11 +660,13 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if (empty($objp->status))
|
||||
{
|
||||
print '<a class="button buttonRefused" href="#">'.$langs->trans("Check").'</a>';
|
||||
print '<a class="button buttonRefused" href="#">'.$langs->trans("Approve").'</a>';
|
||||
print '<a class="button buttonRefused" href="#">'.$langs->trans("Deny").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="button buttonRefused" href="#">'.$langs->trans("Uncheck").'</a>';
|
||||
print '<a class="button buttonRefused" href="#">'.$langs->trans("Disapprove").'</a>';
|
||||
print '<a class="button buttonRefused" href="#">'.$langs->trans("Deny").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -656,11 +675,18 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($commande->statut == 5) $disabled=1;
|
||||
if (empty($objp->status))
|
||||
{
|
||||
print '<a class="button'.($disabled?' buttonRefused':'').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=checkdispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Check").'</a>';
|
||||
print '<a class="button'.($disabled?' buttonRefused':'').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=checkdispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Approve").'</a>';
|
||||
print '<a class="button'.($disabled?' buttonRefused':'').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=denydispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Deny").'</a>';
|
||||
}
|
||||
else
|
||||
if ($objp->status == 1)
|
||||
{
|
||||
print '<a class="button'.($disabled?' buttonRefused':'').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Uncheck").'</a>';
|
||||
print '<a class="button'.($disabled?' buttonRefused':'').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Reinit").'</a>';
|
||||
print '<a class="button'.($disabled?' buttonRefused':'').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=denydispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Deny").'</a>';
|
||||
}
|
||||
if ($objp->status == 2)
|
||||
{
|
||||
print '<a class="button'.($disabled?' buttonRefused':'').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Reinit").'</a>';
|
||||
print '<a class="button'.($disabled?' buttonRefused':'').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=checkdispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Approve").'</a>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -50,9 +50,9 @@ create table llx_facture_rec
|
||||
note_private text,
|
||||
note_public text,
|
||||
|
||||
usenewprice integer DEFAULT 0,
|
||||
frequency integer,
|
||||
unit_frequency varchar(2) DEFAULT 'd',
|
||||
usenewprice integer DEFAULT 0, -- update invoice with current price of product instead of recorded price
|
||||
frequency integer, -- frequency (for example: 3 for every 3 month)
|
||||
unit_frequency varchar(2) DEFAULT 'm', -- 'm' for month (date_when must be a day <= 28), 'y' for year, ...
|
||||
|
||||
date_when datetime DEFAULT NULL, -- date for next gen (when an invoice is generated, this field must be updated with next date)
|
||||
date_last_gen datetime DEFAULT NULL, -- date for last gen (date with last successfull generation of invoice)
|
||||
|
||||
@ -160,13 +160,16 @@ ErrorPriceExpressionInternal=Internal error '%s'
|
||||
ErrorPriceExpressionUnknown=Unknown error '%s'
|
||||
ErrorSrcAndTargetWarehouseMustDiffers=Source and target warehouses must differs
|
||||
ErrorTryToMakeMoveOnProductRequiringBatchData=Error, trying to make a stock movement without batch/serial information, on a product requiring batch/serial information
|
||||
ErrorCantSetReceptionToTotalDoneWithReceptionToApprove=All recorded receptions must first be verified before being allowed to do this action
|
||||
ErrorCantSetReceptionToTotalDoneWithReceptionToApprove=All recorded receptions must first be verified (approved or denied) before being allowed to do this action
|
||||
ErrorCantSetReceptionToTotalDoneWithReceptionDenied=All recorded receptions must first be verified (approved) before being allowed to do this action
|
||||
ErrorGlobalVariableUpdater0=HTTP request failed with error '%s'
|
||||
ErrorGlobalVariableUpdater1=Invalid JSON format '%s'
|
||||
ErrorGlobalVariableUpdater2=Missing parameter '%s'
|
||||
ErrorGlobalVariableUpdater3=The requested data was not found in result
|
||||
ErrorGlobalVariableUpdater4=SOAP client failed with error '%s'
|
||||
ErrorGlobalVariableUpdater5=No global variable selected
|
||||
ErrorFieldMustBeANumeric=Field <b>%s</b> must be a numeric value
|
||||
ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer
|
||||
|
||||
# Warnings
|
||||
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined
|
||||
|
||||
@ -220,6 +220,7 @@ Next=Next
|
||||
Cards=Cards
|
||||
Card=Card
|
||||
Now=Now
|
||||
HourStart=Start hour
|
||||
Date=Date
|
||||
DateAndHour=Date and hour
|
||||
DateStart=Date start
|
||||
@ -700,6 +701,7 @@ SelectElementAndClickRefresh=Select an element and click Refresh
|
||||
PrintFile=Print File %s
|
||||
ShowTransaction=Show transaction
|
||||
GoIntoSetupToChangeLogo=Go into Home - Setup - Company to change logo or go into Home - Setup - Display to hide.
|
||||
Denied=Denied
|
||||
# Week day
|
||||
Monday=Monday
|
||||
Tuesday=Tuesday
|
||||
|
||||
@ -79,7 +79,9 @@ NoOpenedOrders=No opened orders
|
||||
NoOtherOpenedOrders=No other opened orders
|
||||
NoDraftOrders=No draft orders
|
||||
OtherOrders=Other orders
|
||||
LastOrders=Last %s orders
|
||||
LastOrders=Last %s customer orders
|
||||
LastCustomerOrders=Last %s customer orders
|
||||
LastSupplierOrders=Last %s supplier orders
|
||||
LastModifiedOrders=Last %s modified orders
|
||||
LastClosedOrders=Last %s closed orders
|
||||
AllOrders=All orders
|
||||
|
||||
@ -7,6 +7,7 @@ ProductStatusNotOnBatchShort=No
|
||||
Batch=Batch/Serial
|
||||
atleast1batchfield=Eat-by date or Sell-by date or Batch number
|
||||
batch_number=Batch/Serial number
|
||||
BatchNumberShort=Batch/Serial
|
||||
l_eatby=Eat-by date
|
||||
l_sellby=Sell-by date
|
||||
DetailBatchNumber=Batch/Serial details
|
||||
|
||||
@ -14,6 +14,7 @@ MyTasksDesc=This view is limited to projects or tasks you are a contact for (wha
|
||||
OnlyOpenedProject=Only opened projects are visible (projects with draft or closed status are not visible).
|
||||
TasksPublicDesc=This view presents all projects and tasks you are allowed to read.
|
||||
TasksDesc=This view presents all projects and tasks (your user permissions grant you permission to view everything).
|
||||
AllTaskVisibleButEditIfYouAreAssigned=All tasks for such project are visible, but you can enter time only for task you are assigned on.
|
||||
ProjectsArea=Projects area
|
||||
NewProject=New project
|
||||
AddProject=Create project
|
||||
|
||||
@ -132,3 +132,4 @@ ShowWarehouse=Show warehouse
|
||||
MovementCorrectStock=Stock content correction for product %s
|
||||
MovementTransferStock=Stock transfer of product %s into another warehouse
|
||||
WarehouseMustBeSelectedAtFirstStepWhenProductBatchModuleOn=Source warehouse must be defined here when batch module is on. It will be used to list wich lot/serial is available for product that required lot/serial data for movement. If you want to send products from different warehouses, just make the shipment into several steps.
|
||||
InventoryCodeShort=Inv./Mov. code
|
||||
@ -1606,7 +1606,7 @@ SalariesSetup=Configuration du module salariés
|
||||
SortOrder=Ordre de tri
|
||||
Format=Format
|
||||
TypePaymentDesc=0:Type de paiement client, 1:Type de paiement fournisseur, 2:Paiement de type client et fournisseur
|
||||
IncludePath=Chemin Include (définir dans la variable %s)
|
||||
IncludePath=Chemin Include (défini dans la variable %s)
|
||||
ExpenseReportsSetup=Configuration du module Notes de frais
|
||||
TemplatePDFExpenseReports=Modèles de documents pour générer les document de Notes de frais
|
||||
NoModueToManageStockDecrease=Aucun module capable d'assurer la réduction de stock en automatique a été activé. La réduction de stock se fera donc uniquement sur mise à jour manuelle.
|
||||
|
||||
@ -190,7 +190,7 @@ AlreadyPaid=Déjà réglé
|
||||
AlreadyPaidBack=Déjà remboursé
|
||||
AlreadyPaidNoCreditNotesNoDeposits=Déjà réglé (hors avoirs et acomptes)
|
||||
Abandoned=Abandonné
|
||||
RemainderToPay=Restant impayé
|
||||
RemainderToPay=Reste à payer
|
||||
RemainderToTake=Montant restant à percevoir
|
||||
RemainderToPayBack=Montant à rembourser
|
||||
Rest=Créance
|
||||
@ -294,8 +294,8 @@ TotalOfTwoDiscountMustEqualsOriginal=La somme du montant des 2 nouvelles réduct
|
||||
ConfirmRemoveDiscount=Êtes-vous sûr de vouloir supprimer cette réduction ?
|
||||
RelatedBill=Facture associée
|
||||
RelatedBills=Factures associées
|
||||
RelatedCustomerInvoices=Related customer invoices
|
||||
RelatedSupplierInvoices=Related supplier invoices
|
||||
RelatedCustomerInvoices=Factures clients liées
|
||||
RelatedSupplierInvoices=Factures fournisseurs liées
|
||||
LatestRelatedBill=Dernière facture en rapport
|
||||
WarningBillExist=Attention, une ou plusieurs factures existent déjà
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# Dolibarr language file - Source file is en_US - categories
|
||||
Rubrique=Tag/Category
|
||||
Rubriques=Tags/Categories
|
||||
categories=tags/categories
|
||||
TheCategorie=The tag/category
|
||||
NoCategoryYet=No tag/category of this type created
|
||||
Rubrique=Label/Catégorie
|
||||
Rubriques=Labels/Catégories
|
||||
categories=labels/catégories
|
||||
TheCategorie=Le label/Catégorie
|
||||
NoCategoryYet=Aucun label/catégorie de ce type n'a été créé
|
||||
In=Dans
|
||||
AddIn=Ajouter dans
|
||||
modify=modifier
|
||||
@ -18,8 +18,8 @@ ContactsCategoriesArea=Contacts tags/categories area
|
||||
MainCats=Main tags/categories
|
||||
SubCats=Sous-catégories
|
||||
CatStatistics=Statistiques
|
||||
CatList=List of tags/categories
|
||||
AllCats=All tags/categories
|
||||
CatList=Liste des labels/catégories
|
||||
AllCats=Tous les labels/catégories
|
||||
ViewCat=View tag/category
|
||||
NewCat=Add tag/category
|
||||
NewCategory=New tag/category
|
||||
|
||||
@ -18,7 +18,7 @@ CronExplainHowToRunUnix=Sur un environnement Unix vous pouvez utiliser l'entrée
|
||||
CronExplainHowToRunWin=Sur un environement Microsoft(tm) Windows vous pouvez utiliser le planificateur de tache pour lancer cette commande toute les 5 minutes.
|
||||
# Menu
|
||||
CronJobs=Travaux programmés
|
||||
CronListActive=Liste des travaux actifs/programmés
|
||||
CronListActive=Liste des travaux
|
||||
CronListInactive=Liste des travaux inactifs
|
||||
# Page list
|
||||
CronDateLastRun=Dernier lancement
|
||||
|
||||
@ -6,8 +6,8 @@ Donor=Donateur
|
||||
Donors=Donateurs
|
||||
AddDonation=Créer un don
|
||||
NewDonation=Nouveau don
|
||||
DeleteADonation=Delete a donation
|
||||
ConfirmDeleteADonation=Are you sure you want to delete this donation ?
|
||||
DeleteADonation=Effacer le don
|
||||
ConfirmDeleteADonation=Êtes-vous sûr de vouloir supprimer ce don ?
|
||||
ShowDonation=Montrer don
|
||||
DonationPromise=Promesse de don
|
||||
PromisesNotValid=Promesses non validées
|
||||
@ -23,8 +23,8 @@ DonationStatusPaid=Don payé
|
||||
DonationStatusPromiseNotValidatedShort=Non validée
|
||||
DonationStatusPromiseValidatedShort=Validée
|
||||
DonationStatusPaidShort=Payé
|
||||
DonationTitle=Donation receipt
|
||||
DonationDatePayment=Payment date
|
||||
DonationTitle=Reçu de dons
|
||||
DonationDatePayment=Date paiement
|
||||
ValidPromess=Valider promesse
|
||||
DonationReceipt=Reçu de dons
|
||||
BuildDonationReceipt=Créer reçu
|
||||
@ -40,4 +40,4 @@ FrenchOptions=Options propres à la france
|
||||
DONATION_ART200=Afficher article 200 du CGI si vous êtes concernés
|
||||
DONATION_ART238=Afficher article 238 du CGI si vous êtes concernés
|
||||
DONATION_ART885=Afficher article 885 du CGI si vous êtes concernés
|
||||
DonationPayment=Donation payment
|
||||
DonationPayment=Paiement du don
|
||||
|
||||
@ -25,7 +25,7 @@ ErrorFromToAccountsMustDiffers=Les comptes source et destination doivent être d
|
||||
ErrorBadThirdPartyName=Nom de tiers incorrect
|
||||
ErrorProdIdIsMandatory=Le %s est obligatoire
|
||||
ErrorBadCustomerCodeSyntax=La syntaxe du code client est incorrecte
|
||||
ErrorBadBarCodeSyntax=Bad syntax for bar code. May be you set a bad barcode type or you defined a barcode mask for numbering that does not match value scanned.
|
||||
ErrorBadBarCodeSyntax=Mauvaise syntaxe pour le code barre. Peut être que vous avez défini un mauvais type de code-barres ou que vous avez défini un masque de code à barres pour la numérotation qui ne correspond pas à la valeur scannée.
|
||||
ErrorCustomerCodeRequired=Code client obligatoire
|
||||
ErrorBarCodeRequired=Code-barre requis
|
||||
ErrorCustomerCodeAlreadyUsed=Code client déjà utilisé
|
||||
@ -160,13 +160,13 @@ ErrorPriceExpressionInternal=Erreur interne '%s'
|
||||
ErrorPriceExpressionUnknown=Erreur inconnue '%s'
|
||||
ErrorSrcAndTargetWarehouseMustDiffers=Les entrepôts source et destination doivent être différents
|
||||
ErrorTryToMakeMoveOnProductRequiringBatchData=Erreur, vous essayez de faire un mouvement sans lot/numéro de série, sur un produit qui exige un lot/numéro de série.
|
||||
ErrorCantSetReceptionToTotalDoneWithReceptionToApprove=All recorded receptions must first be verified before being allowed to do this action
|
||||
ErrorGlobalVariableUpdater0=HTTP request failed with error '%s'
|
||||
ErrorGlobalVariableUpdater1=Invalid JSON format '%s'
|
||||
ErrorGlobalVariableUpdater2=Missing parameter '%s'
|
||||
ErrorGlobalVariableUpdater3=The requested data was not found in result
|
||||
ErrorGlobalVariableUpdater4=SOAP client failed with error '%s'
|
||||
ErrorGlobalVariableUpdater5=No global variable selected
|
||||
ErrorCantSetReceptionToTotalDoneWithReceptionToApprove=Toutes les réceptions enregistrées doivent d'abord être vérifiées avant d'être autorisés à faire cette action
|
||||
ErrorGlobalVariableUpdater0=La requête HTTP a échoué avec l'erreur '%s'
|
||||
ErrorGlobalVariableUpdater1=Format JSON invalide '%s'
|
||||
ErrorGlobalVariableUpdater2=Paramètre manquant '%s'
|
||||
ErrorGlobalVariableUpdater3=La donnée recherché n'a pas été trouvée
|
||||
ErrorGlobalVariableUpdater4=Le client SOAP a échoué avec l'erreur '%s'
|
||||
ErrorGlobalVariableUpdater5=Pas de variable globale
|
||||
|
||||
# Warnings
|
||||
WarningMandatorySetupNotComplete=Les informations de configuration obligatoire doivent être renseignées
|
||||
|
||||
@ -141,7 +141,7 @@ Cancel=Annuler
|
||||
Modify=Modifier
|
||||
Edit=Éditer
|
||||
Validate=Valider
|
||||
ValidateAndApprove=Validate and Approve
|
||||
ValidateAndApprove=Valider et Approuver
|
||||
ToValidate=À valider
|
||||
Save=Enregistrer
|
||||
SaveAs=Enregistrer sous
|
||||
@ -159,7 +159,7 @@ Search=Rechercher
|
||||
SearchOf=Recherche de
|
||||
Valid=Valider
|
||||
Approve=Approuver
|
||||
Disapprove=Disapprove
|
||||
Disapprove=Désapprouver
|
||||
ReOpen=Réouvrir
|
||||
Upload=Envoyer fichier
|
||||
ToLink=Lier
|
||||
@ -221,7 +221,7 @@ Cards=Fiches
|
||||
Card=Fiche
|
||||
Now=Maintenant
|
||||
Date=Date
|
||||
DateAndHour=Date and hour
|
||||
DateAndHour=Date et heure
|
||||
DateStart=Date début
|
||||
DateEnd=Date fin
|
||||
DateCreation=Date création
|
||||
@ -395,8 +395,8 @@ Available=Disponible
|
||||
NotYetAvailable=Pas encore disponible
|
||||
NotAvailable=Non disponible
|
||||
Popularity=Popularité
|
||||
Categories=Tags/categories
|
||||
Category=Tag/category
|
||||
Categories=Tags/catégories
|
||||
Category=Tag/catégorie
|
||||
By=Par
|
||||
From=Du
|
||||
to=au
|
||||
|
||||
@ -3689,7 +3689,7 @@ class Product extends CommonObject
|
||||
*/
|
||||
function isproduct()
|
||||
{
|
||||
return ($this->type != Product::TYPE_PRODUCT ? true : false);
|
||||
return ($this->type == Product::TYPE_PRODUCT ? true : false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -43,6 +43,7 @@ $id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$rowid=GETPOST('rowid','int');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$cancel=GETPOST('cancel', 'alpha');
|
||||
$socid=GETPOST('socid', 'int');
|
||||
$backtopage=GETPOST('backtopage','alpha');
|
||||
$error=0;
|
||||
@ -77,6 +78,8 @@ if (! $sortorder) $sortorder="ASC";
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($cancel) $action='';
|
||||
|
||||
$parameters=array('socid'=>$socid, 'id_prod'=>$id);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
@ -97,59 +100,70 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
|
||||
{
|
||||
$id_fourn=GETPOST("id_fourn");
|
||||
if (empty($id_fourn)) $id_fourn=GETPOST("search_id_fourn");
|
||||
$ref_fourn=GETPOST("ref_fourn");
|
||||
if (empty($ref_fourn)) $ref_fourn=GETPOST("search_ref_fourn");
|
||||
$quantity=GETPOST("qty");
|
||||
$remise_percent=price2num(GETPOST('remise_percent','alpha'));
|
||||
$npr = preg_match('/\*/', $_POST['tva_tx']) ? 1 : 0 ;
|
||||
$tva_tx = str_replace('*','', GETPOST('tva_tx','alpha'));
|
||||
$tva_tx = price2num($tva_tx);
|
||||
$price_expression = GETPOST('eid', 'int') ? GETPOST('eid', 'int') : ''; // Discard expression if not in expression mode
|
||||
$delivery_time_days = GETPOST('delivery_time_days', 'int') ? GETPOST('delivery_time_days', 'int') : '';
|
||||
if ($action == 'updateprice')
|
||||
{
|
||||
$id_fourn=GETPOST("id_fourn");
|
||||
if (empty($id_fourn)) $id_fourn=GETPOST("search_id_fourn");
|
||||
$ref_fourn=GETPOST("ref_fourn");
|
||||
if (empty($ref_fourn)) $ref_fourn=GETPOST("search_ref_fourn");
|
||||
$quantity=GETPOST("qty");
|
||||
$remise_percent=price2num(GETPOST('remise_percent','alpha'));
|
||||
$npr = preg_match('/\*/', $_POST['tva_tx']) ? 1 : 0 ;
|
||||
$tva_tx = str_replace('*','', GETPOST('tva_tx','alpha'));
|
||||
$tva_tx = price2num($tva_tx);
|
||||
$price_expression = GETPOST('eid', 'int') ? GETPOST('eid', 'int') : ''; // Discard expression if not in expression mode
|
||||
$delivery_time_days = GETPOST('delivery_time_days', 'int') ? GETPOST('delivery_time_days', 'int') : '';
|
||||
|
||||
if ($tva_tx == '')
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")), 'errors');
|
||||
}
|
||||
if (empty($quantity))
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")), 'errors');
|
||||
}
|
||||
if (empty($ref_fourn))
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")), 'errors');
|
||||
}
|
||||
if ($id_fourn <= 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")), 'errors');
|
||||
}
|
||||
if ($_POST["price"] < 0 || $_POST["price"] == '')
|
||||
{
|
||||
if ($price_expression === '') // Return error of missing price only if price_expression not set
|
||||
if ($tva_tx == '')
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")), 'errors');
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")), 'errors');
|
||||
}
|
||||
else
|
||||
if (! is_numeric($tva_tx))
|
||||
{
|
||||
$_POST["price"] = 0;
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",'eeee'), 'errors');
|
||||
}
|
||||
if (empty($quantity))
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")), 'errors');
|
||||
}
|
||||
if (empty($ref_fourn))
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")), 'errors');
|
||||
}
|
||||
if ($id_fourn <= 0)
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")), 'errors');
|
||||
}
|
||||
if ($_POST["price"] < 0 || $_POST["price"] == '')
|
||||
{
|
||||
if ($price_expression === '') // Return error of missing price only if price_expression not set
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$_POST["price"] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$product = new ProductFournisseur($db);
|
||||
$result=$product->fetch($id);
|
||||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($product->error, 'errors');
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -187,7 +201,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
|
||||
{
|
||||
|
||||
$error++;
|
||||
setEventMessage($product->error, 'errors');
|
||||
setEventMessage($product->error, $product->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -222,13 +236,10 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('cancel') == $langs->trans("Cancel"))
|
||||
{
|
||||
$action = '';
|
||||
header("Location: fournisseurs.php?id=".$_GET["id"]);
|
||||
exit;
|
||||
else
|
||||
{
|
||||
$action = 'add_price';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,10 +264,6 @@ if ($id || $ref)
|
||||
{
|
||||
if ($action <> 'edit' && $action <> 're-edit')
|
||||
{
|
||||
/*
|
||||
* En mode visu
|
||||
*/
|
||||
|
||||
$head=product_prepare_head($product);
|
||||
$titre=$langs->trans("CardProduct".$product->type);
|
||||
$picto=($product->type== Product::TYPE_SERVICE?'service':'product');
|
||||
@ -325,6 +332,8 @@ if ($id || $ref)
|
||||
print '<input type="hidden" name="id_fourn" value="'.$socid.'">';
|
||||
print '<input type="hidden" name="ref_fourn" value="'.$product->fourn_ref.'">';
|
||||
print '<input type="hidden" name="ref_fourn_price_id" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -487,11 +496,7 @@ if ($id || $ref)
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
// Actions buttons
|
||||
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
@ -523,13 +528,9 @@ if ($id || $ref)
|
||||
print_liste_field_titre($langs->trans("QtyMin"),$_SERVER["PHP_SELF"],"pfp.quantity","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre" align="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td class="liste_titre" align="right">'.$langs->trans("PriceQtyMinHT").'</td>';
|
||||
// Charges ????
|
||||
if ($conf->global->PRODUCT_CHARGES)
|
||||
{
|
||||
if (! empty($conf->margin->enabled)) print '<td align="right">'.$langs->trans("Charges").'</td>';
|
||||
}
|
||||
print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre" align="right">'.$langs->trans("DiscountQtyMin").'</td>';
|
||||
print_liste_field_titre($langs->trans("NbDaysToDelivery"),$_SERVER["PHP_SELF"],"pfp.delivery_time_days","",$param,'align="right"',$sortfield,$sortorder);
|
||||
// Charges ????
|
||||
if ($conf->global->PRODUCT_CHARGES)
|
||||
{
|
||||
@ -601,6 +602,11 @@ if ($id || $ref)
|
||||
print price2num($productfourn->fourn_remise_percent).'%';
|
||||
print '</td>';
|
||||
|
||||
// Delivery delay
|
||||
print '<td align="right">';
|
||||
print $productfourn->delivery_time_days;
|
||||
print '</td>';
|
||||
|
||||
// Charges ????
|
||||
if ($conf->global->PRODUCT_CHARGES)
|
||||
{
|
||||
|
||||
@ -476,8 +476,11 @@ else
|
||||
{
|
||||
if ($product_fourn->product_fourn_price_id > 0)
|
||||
{
|
||||
$htmltext=$product_fourn->display_price_product_fournisseur();
|
||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext);
|
||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
|
||||
{
|
||||
$htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1);
|
||||
print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext);
|
||||
}
|
||||
else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT");
|
||||
}
|
||||
}
|
||||
|
||||
@ -440,13 +440,13 @@ if ($resql)
|
||||
if (! empty($conf->productbatch->enabled))
|
||||
{
|
||||
$langs->load("productbatch");
|
||||
print '<td align="right" width="10%">'.$langs->trans("batch_number").'</td>';
|
||||
print '<td align="right" width="10%">'.$langs->trans("BatchNumberShort").'</td>';
|
||||
print '<td align="center" width="10%">'.$langs->trans("l_eatby").'</td>';
|
||||
print '<td align="center" width="10%">'.$langs->trans("l_sellby").'</td>';
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Warehouse"),$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible
|
||||
print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("InventoryCode"),$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("InventoryCodeShort"),$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("LabelMovement"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Units"),$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
@ -821,8 +821,9 @@ if (empty($action) && $product->id)
|
||||
|
||||
|
||||
/*
|
||||
* Stock detail
|
||||
* Stock detail (by warehouse). Do not go down into batch.
|
||||
*/
|
||||
|
||||
print '<br><table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="40%" colspan="4">'.$langs->trans("Warehouse").'</td>';
|
||||
print '<td align="right">'.$langs->trans("NumberOfUnit").'</td>';
|
||||
@ -870,9 +871,9 @@ if ($resql)
|
||||
print '<td colspan="4">'.$entrepotstatic->getNomUrl(1).'</td>';
|
||||
print '<td align="right">'.$obj->reel.($obj->reel<0?' '.img_warning():'').'</td>';
|
||||
// PMP
|
||||
print '<td align="right">'.(price2num($product->pmp)?price2num($product->pmp,'MU'):'').'</td>'; // Ditto : Show PMP from movement or from product
|
||||
print '<td align="right">'.(price2num($product->pmp)?price2num($product->pmp,'MU'):'').'</td>';
|
||||
// Value purchase
|
||||
print '<td align="right">'.(price2num($product->pmp)?price(price2num($product->pmp*$obj->reel,'MT')):'').'</td>'; // Ditto : Show PMP from movement or from product
|
||||
print '<td align="right">'.(price2num($product->pmp)?price(price2num($product->pmp*$obj->reel,'MT')):'').'</td>';
|
||||
// Sell price
|
||||
print '<td align="right">';
|
||||
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price,'MU'),1);
|
||||
@ -880,13 +881,13 @@ if ($resql)
|
||||
print '</td>';
|
||||
// Value sell
|
||||
print '<td align="right">';
|
||||
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price*$obj->reel,'MT'),1).'</td>'; // Ditto : Show PMP from movement or from product
|
||||
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price*$obj->reel,'MT'),1).'</td>';
|
||||
else print $langs->trans("Variable");
|
||||
print '</tr>'; ;
|
||||
$total += $obj->reel;
|
||||
if (price2num($product->pmp)) $totalwithpmp += $obj->reel;
|
||||
$totalvalue = $totalvalue + ($product->pmp*$obj->reel); // Ditto : Show PMP from movement or from product
|
||||
$totalvaluesell = $totalvaluesell + ($product->price*$obj->reel); // Ditto : Show PMP from movement or from product
|
||||
$totalvalue = $totalvalue + ($product->pmp*$obj->reel);
|
||||
$totalvaluesell = $totalvaluesell + ($product->price*$obj->reel);
|
||||
//Batch Detail
|
||||
if ((! empty($conf->productbatch->enabled)) && $product->hasbatch())
|
||||
{
|
||||
|
||||
@ -48,11 +48,33 @@ $socid=0;
|
||||
if ($user->societe_id > 0) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'projet', $projectid);
|
||||
|
||||
$now=dol_now();
|
||||
$nowtmp=dol_getdate($now);
|
||||
$nowday=$nowtmp['mday'];
|
||||
$nowmonth=$nowtmp['mon'];
|
||||
$nowyear=$nowtmp['year'];
|
||||
|
||||
$year=GETPOST('reyear')?GETPOST('reyear'):(GETPOST("year","int")?GETPOST("year","int"):date("Y"));
|
||||
$month=GETPOST('remonth')?GETPOST('remonth'):(GETPOST("month","int")?GETPOST("month","int"):date("m"));
|
||||
$day=GETPOST('reday')?GETPOST('reday'):(GETPOST("day","int")?GETPOST("day","int"):date("d"));
|
||||
$day = (int) $day;
|
||||
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
|
||||
|
||||
$daytoparse = $now;
|
||||
if ($year && $month && $day) $daytoparse=dol_mktime(0, 0, 0, $month, $day, $year);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('submitdateselect'))
|
||||
{
|
||||
$daytoparse = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
||||
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if ($action == 'addtime' && $user->rights->projet->creer)
|
||||
{
|
||||
$task = new Task($db);
|
||||
@ -133,6 +155,16 @@ $projectstatic=new Project($db);
|
||||
$project = new Project($db);
|
||||
$taskstatic = new Task($db);
|
||||
|
||||
$prev = dol_getdate($daytoparse - (24 * 3600));
|
||||
$prev_year = $prev['year'];
|
||||
$prev_month = $prev['mon'];
|
||||
$prev_day = $prev['mday'];
|
||||
|
||||
$next = dol_getdate($daytoparse + (24 * 3600));
|
||||
$next_year = $next['year'];
|
||||
$next_month = $next['mon'];
|
||||
$next_day = $next['mday'];
|
||||
|
||||
$title=$langs->trans("TimeSpent");
|
||||
if ($mine) $title=$langs->trans("MyTimeSpent");
|
||||
|
||||
@ -160,7 +192,18 @@ llxHeader("",$title,"");
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num);
|
||||
|
||||
|
||||
print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$project->id.'">';
|
||||
// Show navigation bar
|
||||
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
|
||||
$nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"day")." </span>\n";
|
||||
$nav.="<a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\">".img_next($langs->trans("Next"))."</a>\n";
|
||||
$nav.=" (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
|
||||
$nav.='<br>'.$form->select_date(-1,'',0,0,2,"addtime",1,0,1).' ';
|
||||
$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
|
||||
|
||||
$picto='calendarweek';
|
||||
|
||||
|
||||
print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].($project->id > 0 ? '?id='.$project->id : '').'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="addtime">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
@ -169,13 +212,15 @@ $head=project_timesheet_prepare_head($mode);
|
||||
dol_fiche_head($head, 'inputperday', '', 0, 'task');
|
||||
|
||||
// Show description of content
|
||||
if ($mine) print $langs->trans("MyTasksDesc").($onlyopened?' '.$langs->trans("OnlyOpenedProject"):'').'<br><br>';
|
||||
if ($mine) print $langs->trans("MyTasksDesc").($onlyopened?' '.$langs->trans("OnlyOpenedProject"):'').'<br>';
|
||||
else
|
||||
{
|
||||
if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").($onlyopened?' '.$langs->trans("OnlyOpenedProject"):'').'<br><br>';
|
||||
else print $langs->trans("ProjectsPublicTaskDesc").($onlyopened?' '.$langs->trans("AlsoOnlyOpenedProject"):'').'<br><br>';
|
||||
if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").($onlyopened?' '.$langs->trans("OnlyOpenedProject"):'').'<br>';
|
||||
else print $langs->trans("ProjectsPublicTaskDesc").($onlyopened?' '.$langs->trans("AlsoOnlyOpenedProject"):'').'<br>';
|
||||
}
|
||||
|
||||
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
|
||||
print '<br>';
|
||||
print "\n";
|
||||
|
||||
// Filter on user
|
||||
/* dol_fiche_head('');
|
||||
@ -197,6 +242,10 @@ else
|
||||
dol_fiche_end();
|
||||
*/
|
||||
|
||||
|
||||
print '<div align="right">'.$nav.'</div>';
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Project").'</td>';
|
||||
@ -207,7 +256,7 @@ print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>';
|
||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||
if ($usertoprocess->id == $user->id) print '<td align="right">'.$langs->trans("TimeSpentByYou").'</td>';
|
||||
else print '<td align="right">'.$langs->trans("TimeSpentByUser").'</td>';
|
||||
print '<td align="center">'.$langs->trans("DateAndHour").'</td>';
|
||||
print '<td align="center">'.$langs->trans("HourStart").'</td>';
|
||||
print '<td align="center" colspan="2">'.$langs->trans("Duration").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -217,7 +266,7 @@ $restricteditformytask=(empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJEC
|
||||
if (count($tasksarray) > 0)
|
||||
{
|
||||
$j=0;
|
||||
projectLinesPerDay($j, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
||||
projectLinesPerDay($j, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $daytoparse);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -234,6 +283,13 @@ print '</div>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
print "jQuery(document).ready(function () {\n";
|
||||
print ' jQuery(".timesheetalreadyrecorded").tipTip({ maxWidth: "600px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50, content: \''.dol_escape_js($langs->trans("TimeAlreadyRecorded", $user->getFullName($langs))).'\'});';
|
||||
print "});";
|
||||
print '</script>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -49,12 +49,15 @@ if ($user->societe_id > 0) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'projet', $projectid);
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$year=GETPOST("year","int")?GETPOST("year","int"):date("Y");
|
||||
$month=GETPOST("month","int")?GETPOST("month","int"):date("m");
|
||||
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
|
||||
$day=GETPOST("day","int")?GETPOST("day","int"):date("d");
|
||||
$nowtmp=dol_getdate($now);
|
||||
$nowday=$nowtmp['mday'];
|
||||
$nowmonth=$nowtmp['mon'];
|
||||
$nowyear=$nowtmp['year'];
|
||||
$year=GETPOST('reyear')?GETPOST('reyear'):(GETPOST("year","int")?GETPOST("year","int"):date("Y"));
|
||||
$month=GETPOST('remonth')?GETPOST('remonth'):(GETPOST("month","int")?GETPOST("month","int"):date("m"));
|
||||
$day=GETPOST('reday')?GETPOST('reday'):(GETPOST("day","int")?GETPOST("day","int"):date("d"));
|
||||
$day = (int) $day;
|
||||
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
|
||||
|
||||
$startdayarray=dol_get_first_day_week($day, $month, $year);
|
||||
|
||||
@ -83,6 +86,13 @@ $usertoprocess=$user;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('submitdateselect'))
|
||||
{
|
||||
$daytoparse = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
||||
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if ($action == 'addtime' && $user->rights->projet->creer)
|
||||
{
|
||||
$task = new Task($db);
|
||||
@ -176,16 +186,15 @@ llxHeader("",$title,"",'','','',array('/core/js/timesheet.js'));
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num);
|
||||
|
||||
|
||||
$tmpday = $first_day;
|
||||
|
||||
// Show navigation bar
|
||||
$nav ="<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
|
||||
$nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week;
|
||||
$nav.=" </span>\n";
|
||||
$nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week." </span>\n";
|
||||
$nav.="<a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\">".img_next($langs->trans("Next"))."</a>\n";
|
||||
$nav.=" (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
|
||||
$picto='calendarweek';
|
||||
$nav.='<br>'.$form->select_date(-1,'',0,0,2,"addtime",1,0,1).' ';
|
||||
$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
|
||||
|
||||
$picto='calendarweek';
|
||||
|
||||
print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -199,12 +208,14 @@ $head=project_timesheet_prepare_head($mode);
|
||||
dol_fiche_head($head, 'inputperweek', '', 0, 'task');
|
||||
|
||||
// Show description of content
|
||||
if ($mine) print $langs->trans("MyTasksDesc").($onlyopened?' '.$langs->trans("OnlyOpenedProject"):'').'<br><br>';
|
||||
if ($mine) print $langs->trans("MyTasksDesc").($onlyopened?' '.$langs->trans("OnlyOpenedProject"):'').'<br>';
|
||||
else
|
||||
{
|
||||
if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").($onlyopened?' '.$langs->trans("OnlyOpenedProject"):'').'<br><br>';
|
||||
else print $langs->trans("ProjectsPublicTaskDesc").($onlyopened?' '.$langs->trans("AlsoOnlyOpenedProject"):'').'<br><br>';
|
||||
if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").($onlyopened?' '.$langs->trans("OnlyOpenedProject"):'').'<br>';
|
||||
else print $langs->trans("ProjectsPublicTaskDesc").($onlyopened?' '.$langs->trans("AlsoOnlyOpenedProject"):'').'<br>';
|
||||
}
|
||||
print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'<br>';
|
||||
print '<br>';
|
||||
print "\n";
|
||||
|
||||
// Filter on user
|
||||
@ -248,6 +259,7 @@ for($i=0;$i<7;$i++)
|
||||
{
|
||||
print '<td width="7%" align="center">'.dol_print_date($startday + ($i * 3600 * 24), '%a').'<br>'.dol_print_date($startday + ($i * 3600 * 24), 'day').'</td>';
|
||||
}
|
||||
print '<td class="liste_total"></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -268,11 +280,12 @@ if (count($tasksarray) > 0)
|
||||
<td class="liste_total" width="7%" align="center"><div id="totalDay[4]"> </div></td>
|
||||
<td class="liste_total" width="7%" align="center"><div id="totalDay[5]"> </div></td>
|
||||
<td class="liste_total" width="7%" align="center"><div id="totalDay[6]"> </div></td>
|
||||
<td class="liste_total"></td>
|
||||
</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td colspan="10">'.$langs->trans("NoTasks").'</td></tr>';
|
||||
print '<tr><td colspan="11">'.$langs->trans("NoTasks").'</td></tr>';
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
@ -287,6 +300,7 @@ print '</div>';
|
||||
|
||||
print '</form>'."\n\n";
|
||||
|
||||
|
||||
$modeinput='hours';
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
|
||||
@ -413,7 +413,7 @@ else
|
||||
}
|
||||
|
||||
print '<table id="tablelines" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<tr class="liste_titre nodrag nodrop">';
|
||||
// print '<td>'.$langs->trans("Project").'</td>';
|
||||
print '<td width="100">'.$langs->trans("RefTask").'</td>';
|
||||
print '<td>'.$langs->trans("LabelTask").'</td>';
|
||||
|
||||
@ -1727,7 +1727,7 @@ class Societe extends CommonObject
|
||||
*
|
||||
* @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only)
|
||||
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
|
||||
* @param int $maxlen Max length of text
|
||||
* @param int $maxlen Max length of name
|
||||
* @param integer $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user