Merge remote-tracking branch 'Upstream/develop' into develop-loan

This commit is contained in:
aspangaro 2015-02-25 06:59:27 +01:00
commit 4803a1fb89
137 changed files with 16140 additions and 1515 deletions

View File

@ -220,6 +220,8 @@ Dolibarr better:
- Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object - Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object
- Fix: [ bug #1826 ] Supplier payment types are not translated into fourn/facture/paiement.php - Fix: [ bug #1826 ] Supplier payment types are not translated into fourn/facture/paiement.php
- Fix: [ bug #1830 ] Salaries payment only allows checking accounts - Fix: [ bug #1830 ] Salaries payment only allows checking accounts
- Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work
- Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key
***** ChangeLog for 3.6.2 compared to 3.6.1 ***** ***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
@ -386,6 +388,7 @@ Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 0
Fix: [ bug #1757 ] Sorting breaks product/service statistics Fix: [ bug #1757 ] Sorting breaks product/service statistics
Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date
Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled
Fix: [ bug #1846 ] Browser IE11 not detected
***** ChangeLog for 3.5.6 compared to 3.5.5 ***** ***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973 Fix: Avoid missing class error for fetch_thirdparty method #1973

View File

@ -0,0 +1,70 @@
#!/usr/bin/php
<?php
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file build/generate_filecheck_xml.php
* \ingroup dev
* \brief This script create a xml checksum file
*/
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
}
// Main
parse_str($argv[1]);
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
$outputfile=dirname(__FILE__).'/../htdocs/install/filelist.xml';
$fp = fopen($outputfile,'w');
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
fputs($fp, '<checksum_list>'."\n");
fputs($fp, '<dolibarr_root_dir version="'.$release.'">'."\n");
$dir_iterator = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
$iterator = new RecursiveIteratorIterator($dir_iterator);
// need to ignore document custom etc
$files = new RegexIterator($iterator, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
$dir='';
$needtoclose=0;
foreach ($files as $file) {
$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
if ($newdir!=$dir) {
if ($needtoclose)
fputs($fp, '</dir>'."\n");
fputs($fp, '<dir name="'.$newdir.'" >'."\n");
$dir = $newdir;
$needtoclose=1;
}
if (filetype($file)=="file") {
fputs($fp, '<md5file name="'.basename($file).'">'.md5_file($file).'</md5file>'."\n");
}
}
fputs($fp, '</dir>'."\n");
fputs($fp, '</dolibarr_root_dir>'."\n");
fputs($fp, '</checksum_list>'."\n");
fclose($fp);
print "File ".$outputfile." generated\n";
exit(0);

View File

@ -204,7 +204,10 @@ else {
my $NUM_SCRIPT; my $NUM_SCRIPT;
my $cpt=0; my $cpt=0;
while (! $found) { while (! $found) {
printf(" %2d - %-14s (%s)\n",$cpt,"ALL (1..9)","Need ".join(",",values %REQUIREMENTTARGET)); $cpt=0;
printf(" %2d - %-14s (%s)\n",$cpt,"ALL (1..10)","Need ".join(",",values %REQUIREMENTTARGET));
$cpt++;
printf(" %2d - %-14s\n",$cpt,"Generate check file");
foreach my $target (@LISTETARGET) { foreach my $target (@LISTETARGET) {
$cpt++; $cpt++;
printf(" %2d - %-14s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target}); printf(" %2d - %-14s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target});
@ -215,7 +218,7 @@ else {
printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".join(",",values %REQUIREMENTPUBLISH)); printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".join(",",values %REQUIREMENTPUBLISH));
# Ask which target to build # Ask which target to build
print "Choose one package number or several separated with space (0 - ".$cpt."): "; print "Choose one target number or several separated with space (0 - ".$cpt."): ";
$NUM_SCRIPT=<STDIN>; $NUM_SCRIPT=<STDIN>;
chomp($NUM_SCRIPT); chomp($NUM_SCRIPT);
if ($NUM_SCRIPT !~ /^[0-9\s]+$/) if ($NUM_SCRIPT !~ /^[0-9\s]+$/)
@ -232,30 +235,30 @@ else {
if ($NUM_SCRIPT eq "98") { if ($NUM_SCRIPT eq "98") {
$CHOOSEDPUBLISH{"ASSO"}=1; $CHOOSEDPUBLISH{"ASSO"}=1;
} }
else elsif ($NUM_SCRIPT eq "99") {
{ $CHOOSEDPUBLISH{"SF"}=1;
if ($NUM_SCRIPT eq "99") { }
$CHOOSEDPUBLISH{"SF"}=1; elsif ($NUM_SCRIPT eq "0") {
$CHOOSEDTARGET{"-CHKSUM"}=1;
foreach my $key (@LISTETARGET) {
if ($key ne 'SNAPSHOT' && $key ne 'ASSO' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
} }
else { }
if ($NUM_SCRIPT eq "0") { elsif ($NUM_SCRIPT eq "1") {
foreach my $key (@LISTETARGET) { $CHOOSEDTARGET{"-CHKSUM"}=1
if ($key ne 'SNAPSHOT' && $key ne 'ASSO' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; } }
} else {
} foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
else { $CHOOSEDTARGET{$LISTETARGET[$num-2]}=1;
foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
$CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
}
}
} }
} }
} }
# Test if requirement is ok # Test if requirement is ok
#-------------------------- #--------------------------
$atleastonerpm=0; $atleastonerpm=0;
foreach my $target (keys %CHOOSEDTARGET) { foreach my $target (sort keys %CHOOSEDTARGET) {
if ($target =~ /RPM/i) if ($target =~ /RPM/i)
{ {
if ($atleastonerpm && ($DESTI eq "$SOURCE/build")) if ($atleastonerpm && ($DESTI eq "$SOURCE/build"))
@ -297,20 +300,32 @@ foreach my $target (keys %CHOOSEDTARGET) {
print "\n"; print "\n";
# Check if there is at least on target to build # Build xml check file
#-----------------------
if ($CHOOSEDTARGET{'-CHKSUM'})
{
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filecheck_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
$ret=`php $SOURCE/build/generate_filecheck_xml.php release=$MAJOR.$MINOR.$BUILD`;
print $ret."\n";
}
#print join(',',sort keys %CHOOSEDTARGET)."\n";
# Check if there is at least one target to build
#---------------------------------------------- #----------------------------------------------
$nboftargetok=0; $nboftargetok=0;
$nboftargetneedbuildroot=0; $nboftargetneedbuildroot=0;
$nbofpublishneedtag=0; $nbofpublishneedtag=0;
foreach my $target (keys %CHOOSEDTARGET) { foreach my $target (sort keys %CHOOSEDTARGET) {
if ($CHOOSEDTARGET{$target} < 0) { next; } if ($CHOOSEDTARGET{$target} < 0) { next; }
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP') if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM')
{ {
$nboftargetneedbuildroot++; $nboftargetneedbuildroot++;
} }
$nboftargetok++; $nboftargetok++;
} }
foreach my $target (keys %CHOOSEDPUBLISH) { foreach my $target (sort keys %CHOOSEDPUBLISH) {
if ($CHOOSEDPUBLISH{$target} < 0) { next; } if ($CHOOSEDPUBLISH{$target} < 0) { next; }
if ($target eq 'ASSO') { $nbofpublishneedtag++; } if ($target eq 'ASSO') { $nbofpublishneedtag++; }
if ($target eq 'SF') { $nbofpublishneedtag++; } if ($target eq 'SF') { $nbofpublishneedtag++; }
@ -474,10 +489,11 @@ if ($nboftargetok) {
# Build package for each target # Build package for each target
#------------------------------ #------------------------------
foreach my $target (keys %CHOOSEDTARGET) foreach my $target (sort keys %CHOOSEDTARGET)
{ {
if ($CHOOSEDTARGET{$target} < 0) { next; } if ($CHOOSEDTARGET{$target} < 0) { next; }
if ($target eq '-CHKSUM') { next; }
print "\nBuild package for target $target\n"; print "\nBuild package for target $target\n";
if ($target eq 'SNAPSHOT') if ($target eq 'SNAPSHOT')
@ -979,7 +995,7 @@ if ($nboftargetok) {
# Publish package for each target # Publish package for each target
#-------------------------------- #--------------------------------
foreach my $target (keys %CHOOSEDPUBLISH) foreach my $target (sort keys %CHOOSEDPUBLISH)
{ {
if ($CHOOSEDPUBLISH{$target} < 0) { next; } if ($CHOOSEDPUBLISH{$target} < 0) { next; }
@ -1062,7 +1078,8 @@ if ($nboftargetok) {
} }
print "\n----- Summary -----\n"; print "\n----- Summary -----\n";
foreach my $target (keys %CHOOSEDTARGET) { foreach my $target (sort keys %CHOOSEDTARGET) {
if ($target eq '-CHKSUM') { print "Checksum was generated"; next; }
if ($CHOOSEDTARGET{$target} < 0) { if ($CHOOSEDTARGET{$target} < 0) {
print "Package $target not built (bad requirement).\n"; print "Package $target not built (bad requirement).\n";
} else { } else {

View File

@ -0,0 +1,499 @@
<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/expensereport.php
* \ingroup expensereport
* \brief Setup page of module ExpenseReport
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$langs->load("admin");
$langs->load("errors");
$langs->load("trips");
$langs->load('other');
if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$type='expensereport';
/*
* Actions
*/
if ($action == 'updateMask')
{
$maskconst=GETPOST('maskconst','alpha');
$maskvalue=GETPOST('maskvalue','alpha');
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
}
else if ($action == 'specimen') // For fiche inter
{
$modele= GETPOST('module','alpha');
$inter = new ExpenseReport($db);
$inter->initAsSpecimen();
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir)
{
$file=dol_buildpath($reldir."core/modules/expensereport/doc/pdf_".$modele.".modules.php",0);
if (file_exists($file))
{
$filefound=1;
$classname = "pdf_".$modele;
break;
}
}
if ($filefound)
{
require_once $file;
$module = new $classname($db);
if ($module->write_file($inter,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf");
return;
}
else
{
setEventMessage($obj->error,'errors');
dol_syslog($obj->error, LOG_ERR);
}
}
else
{
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
if ($action == 'setModuleOptions')
{
$post_size=count($_POST);
$db->begin();
for($i=0;$i < $post_size;$i++)
{
if (array_key_exists('param'.$i,$_POST))
{
$param=GETPOST("param".$i,'alpha');
$value=GETPOST("value".$i,'alpha');
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
}
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
}
}
// Activate a model
else if ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
else if ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPENSEREPORT_ADDON_PDF',$conf->entity);
}
}
// Set default model
else if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->EXPENSEREPORT_ADDON_PDF = $value;
}
// On active le modele
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
}
else if ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
dolibarr_set_const($db, "EXPENSEREPORT_ADDON",$value,'chaine',0,'',$conf->entity);
}
else if ($action == 'set_EXPENSEREPORT_FREE_TEXT')
{
$freetext= GETPOST('EXPENSEREPORT_FREE_TEXT','alpha');
$res = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
}
else if ($action == 'set_EXPENSEREPORT_DRAFT_WATERMARK')
{
$draft= GETPOST('EXPENSEREPORT_DRAFT_WATERMARK','alpha');
$res = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
}
/*
* View
*/
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
llxHeader();
$form=new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("ExpenseReportsSetup"),$linkback,'setup');
$head=expensereport_admin_prepare_head();
dol_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), 0, 'trip');
// Interventions numbering model
/*
print_titre($langs->trans("FicheinterNumberingModules"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="100">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
clearstatcache();
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/fichinter/");
if (is_dir($dir))
{
$handle = opendir($dir);
if (is_resource($handle))
{
$var=true;
while (($file = readdir($handle))!==false)
{
if (preg_match('/^(mod_.*)\.php$/i',$file,$reg))
{
$file = $reg[1];
$classname = substr($file,4);
require_once $dir.$file.'.php';
$module = new $file;
if ($module->isEnabled())
{
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
print '</td>';
// Show example of numbering model
print '<td class="nowrap">';
$tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
else print $tmp;
print '</td>'."\n";
print '<td align="center">';
if ($conf->global->FICHEINTER_ADDON == $classname)
{
print img_picto($langs->trans("Activated"),'switch_on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
print '</td>';
$ficheinter=new Fichinter($db);
$ficheinter->initAsSpecimen();
// Info
$htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$ficheinter);
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
$htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) {
if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>';
} else {
$htmltooltip.=$langs->trans($module->error).'<br>';
}
}
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>';
print '</tr>';
}
}
}
closedir($handle);
}
}
}
print '</table><br>';
*/
/*
* Documents models for Interventions
*/
print_titre($langs->trans("TemplatePDFExpenseReports"));
// Defini tableau def des modeles
$type='expensereport';
$def = array();
$sql = "SELECT nom";
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
$sql.= " WHERE type = '".$type."'";
$sql.= " AND entity = ".$conf->entity;
$resql=$db->query($sql);
if ($resql)
{
$i = 0;
$num_rows=$db->num_rows($resql);
while ($i < $num_rows)
{
$array = $db->fetch_array($resql);
array_push($def, $array[0]);
$i++;
}
}
else
{
dol_print_error($db);
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
print "</tr>\n";
clearstatcache();
$var=true;
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/expensereport/doc");
if (is_dir($dir))
{
$handle=opendir($dir);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
$filelist[]=$file;
}
closedir($handle);
arsort($filelist);
foreach($filelist as $file)
{
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
{
if (file_exists($dir.'/'.$file))
{
$var=!$var;
$name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
require_once $dir.'/'.$file;
$module = new $classname($db);
$modulequalified=1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
if ($modulequalified)
{
print '<tr '.$bc[$var].'><td width="100">';
print (empty($module->name)?$name:$module->name);
print "</td><td>\n";
if (method_exists($module,'info')) print $module->info($langs);
else print $module->description;
print '</td>';
// Active
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Default
print "<td align=\"center\">";
if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"),'on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,-1,0);
print '</td>';
// Preview
print '<td align="center">';
if ($module->type == 'pdf')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'intervention').'</a>';
}
else
{
print img_object($langs->trans("PreviewNotAvailable"),'generic');
}
print '</td>';
print '</tr>';
}
}
}
}
}
}
}
print '</table>';
dol_fiche_end();
llxFooter();
$db->close();

View File

@ -33,6 +33,7 @@ $langs->load("orders");
$langs->load("propal"); $langs->load("propal");
$langs->load("bills"); $langs->load("bills");
$langs->load("errors"); $langs->load("errors");
$langs->load("mails");
// Security check // Security check
if (!$user->admin) if (!$user->admin)
@ -76,7 +77,9 @@ if ($action == 'setvalue' && $user->admin)
* View * View
*/ */
llxHeader(); $form=new Form($db);
llxHeader('',$langs->trans("NotificationSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("NotificationSetup"),$linkback,'setup'); print_fiche_titre($langs->trans("NotificationSetup"),$linkback,'setup');
@ -132,9 +135,19 @@ foreach($listofnotifiedevents as $notifiedevent)
print '<td>'.$elementLabel.'</td>'; print '<td>'.$elementLabel.'</td>';
print '<td>'.$notifiedevent['code'].'</td>'; print '<td>'.$notifiedevent['code'].'</td>';
print '<td>'.$label.'</td>'; print '<td>'.$label.'</td>';
print '<td>';
$param='NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code']; $param='NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'];
print '<td><input type="email" size="32" name="'.$param.'" value="'.dol_escape_htmltag(GETPOST($param)?GETPOST($param,'alpha'):$conf->global->$param).'">'; $value=GETPOST($param)?GETPOST($param,'alpha'):$conf->global->$param;
if (! empty($conf->global->$param) && ! isValidEmail($conf->global->$param)) print ' '.img_warning($langs->trans("ErrorBadEMail")); $s='<input type="text" size="32" name="'.$param.'" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
$arrayemail=explode(',',$value);
$showwarning=0;
foreach($arrayemail as $key=>$valuedet)
{
$valuedet=trim($valuedet);
if (! empty($valuedet) && ! isValidEmail($valuedet)) $showwarning++;
}
if ((! empty($conf->global->$param)) && $showwarning) $s.=' '.img_warning($langs->trans("ErrorBadEMail"));
print $form->textwithpicto($s,$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -87,6 +87,9 @@ if($action)
if($action == 'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT') { if($action == 'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT') {
$res = dolibarr_set_const($db, "STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", GETPOST('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT','alpha'),'chaine',0,'',$conf->entity); $res = dolibarr_set_const($db, "STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", GETPOST('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT','alpha'),'chaine',0,'',$conf->entity);
} }
if($action == 'INDEPENDANT_SUBPRODUCT_STOCK') {
$res = dolibarr_set_const($db, "INDEPENDANT_SUBPRODUCT_STOCK", GETPOST('INDEPENDANT_SUBPRODUCT_STOCK','alpha'),'chaine',0,'',$conf->entity);
}
if (! $res > 0) $error++; if (! $res > 0) $error++;
@ -339,9 +342,29 @@ print '</form>';
print "</td>\n"; print "</td>\n";
print "</tr>\n"; print "</tr>\n";
print '<br>'; print '<br>';
print '</table>';
print '<br>';
/* I keep the option/feature, but hidden to end users for the moment. If feature is used by module, no need to have users see it.
If not used by a module, I still need to understand in which case user may need this now we can set rule on product page.
if ($conf->global->PRODUIT_SOUSPRODUITS)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("IndependantSubProductStock").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"INDEPENDANT_SUBPRODUCT_STOCK\">";
print $form->selectyesno("INDEPENDANT_SUBPRODUCT_STOCK",$conf->global->INDEPENDANT_SUBPRODUCT_STOCK,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
}
*/
print '</table>';
llxFooter(); llxFooter();

View File

@ -31,6 +31,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("orders");
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();

View File

@ -0,0 +1,138 @@
<?php
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/system/filecheck.php
* \brief Page to check Dolibarr files integrity
*/
require '../../main.inc.php';
$langs->load("admin");
if (!$user->admin)
accessforbidden();
/*
* View
*/
llxHeader();
print_fiche_titre($langs->trans("FileCheckDolibarr"),'','setup');
// Version
$var = true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
$var = ! $var;
print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
$var = ! $var;
print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("VersionLastUpgrade").'</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
$var = ! $var;
print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("VersionProgram").'</td><td>'.DOL_VERSION;
// If current version differs from last upgrade
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) {
// Compare version with last install database version (upgrades never occured)
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_INSTALL)
print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_INSTALL));
} else {
// Compare version with last upgrade database version
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE)
print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE));
}
print '</td></tr>'."\n";
print '</table>';
print '<br>';
// Modified or missing files
$file_list = array('missing' => array(), 'updated' => array());
$xmlfile = DOL_DOCUMENT_ROOT.'/core/filelist-'.DOL_VERSION.'.xml';
if (file_exists($xmlfile)) {
$xml = simplexml_load_file($xmlfile);
if ($xml) {
$ret = getFilesUpdated($xml->dolibarr_root_dir[0]);
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("FilesMissing") . '</td>';
print '</tr>'."\n";
$var = true;
foreach ($file_list['missing'] as $file) {
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>'.$file.'</td>' . "\n";
print "</tr>\n";
}
print '</table>';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("FilesUpdated") . '</td>';
print '</tr>'."\n";
$var = true;
foreach ($file_list['updated'] as $file) {
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>'.$file.'</td>' . "\n";
print "</tr>\n";
}
print '</table>';
}
} else {
print $langs->trans('XmlNotFound') . ': ' . DOL_DOCUMENT_ROOT . '/core/filelist-' . DOL_VERSION . '.xml';
}
llxFooter();
$db->close();
/**
* Function to get list of updated or modified files
*
* @param object $dir SimpleXMLElement of files to test
* @param string $path Path of file
* @return array Array of filenames
*/
function getFilesUpdated(SimpleXMLElement $dir, $path = '')
{
global $file_list;
$exclude = 'install';
foreach ($dir->md5file as $file) {
$filename = $path.$file['name'];
if (preg_match('#'.$exclude.'#', $filename))
continue;
if (!file_exists(DOL_DOCUMENT_ROOT.'/'.$filename)) {
$file_list['missing'][] = $filename;
} else {
$md5_local = md5_file(DOL_DOCUMENT_ROOT.'/'.$filename);
if ($md5_local != (string) $file)
$file_list['updated'][] = $filename;
}
}
foreach ($dir->dir as $subdir)
getFilesUpdated($subdir, $path.$subdir['name'].'/');
return $file_list;
}

View File

@ -23,10 +23,11 @@
* \ingroup agenda * \ingroup agenda
* \brief File of class to parse ical calendars * \brief File of class to parse ical calendars
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/lib/xcal.lib.php';
/** /**
* Class to parse ICal calendars * Class to read/parse ICal calendars
*/ */
class ICal class ICal
{ {
@ -107,6 +108,7 @@ class ICal
if (!stristr($this->file_text[0],'BEGIN:VCALENDAR')) return 'error not VCALENDAR'; if (!stristr($this->file_text[0],'BEGIN:VCALENDAR')) return 'error not VCALENDAR';
$insidealarm=0; $insidealarm=0;
$tmpkey='';$tmpvalue='';
foreach ($this->file_text as $text) foreach ($this->file_text as $text)
{ {
$text = trim($text); // trim one line $text = trim($text); // trim one line
@ -137,7 +139,7 @@ class ICal
case "BEGIN:DAYLIGHT": case "BEGIN:DAYLIGHT":
case "BEGIN:VTIMEZONE": case "BEGIN:VTIMEZONE":
case "BEGIN:STANDARD": case "BEGIN:STANDARD":
$type = $value; // save tu array under value key $type = $value; // save array under value key
break; break;
case "END:VTODO": // end special text - goto VCALENDAR key case "END:VTODO": // end special text - goto VCALENDAR key
@ -159,8 +161,31 @@ class ICal
$insidealarm=0; $insidealarm=0;
break; break;
default: // no special string default: // no special string (SUMMARY, DESCRIPTION, ...)
if (! $insidealarm) $this->add_to_array($type, $key, $value); // add to array if ($tmpvalue)
{
$tmpvalue .= $text;
if (! preg_match('/=$/',$text)) // No more lines
{
$key=$tmpkey;
$value=quotedPrintDecode(preg_replace('/^ENCODING=QUOTED-PRINTABLE:/i','',$tmpvalue));
$tmpkey='';
$tmpvalue='';
}
}
elseif (preg_match('/^ENCODING=QUOTED-PRINTABLE:/i',$value))
{
if (preg_match('/=$/',$value))
{
$tmpkey=$key;
$tmpvalue=$tmpvalue.preg_replace('/=$/',"",$value); // We must wait to have next line to have complete message
}
else
{
$value=quotedPrintDecode(preg_replace('/^ENCODING=QUOTED-PRINTABLE:/i','',$tmpvalue.$value));
}
} //$value=quotedPrintDecode($tmpvalue.$value);
if (! $insidealarm && ! $tmpkey) $this->add_to_array($type, $key, $value); // add to array
break; break;
} }
} }

View File

@ -361,6 +361,7 @@ if (! empty($conf->use_javascript_ajax))
foreach ($showextcals as $val) foreach ($showextcals as $val)
{ {
$htmlname = dol_string_nospecial($val['name']); $htmlname = dol_string_nospecial($val['name']);
$htmlname = dol_string_nospecial($htmlname,'_',array("\.","#"));
$s.='<script type="text/javascript">' . "\n"; $s.='<script type="text/javascript">' . "\n";
$s.='jQuery(document).ready(function () {' . "\n"; $s.='jQuery(document).ready(function () {' . "\n";
$s.=' jQuery("#check_' . $htmlname . '").click(function() {'; $s.=' jQuery("#check_' . $htmlname . '").click(function() {';

View File

@ -143,10 +143,10 @@ if (empty($reshook))
} }
// update outstandng limit // update outstandng limit
if ($action == 'setOutstandingBill') if ($action == 'setoutstanding_limit')
{ {
$object->fetch($id); $object->fetch($id);
$object->outstanding_limit=GETPOST('OutstandingBill'); $object->outstanding_limit=GETPOST('setoutstanding_limit');
$result=$object->set_OutstandingBill($user); $result=$object->set_OutstandingBill($user);
if ($result < 0) setEventMessage($object->error,'errors'); if ($result < 0) setEventMessage($object->error,'errors');
} }
@ -393,9 +393,10 @@ if ($id > 0)
{ {
print '<tr>'; print '<tr>';
print '<td>'; print '<td>';
print $form->editfieldkey("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer); print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
print '</td><td colspan="3">'; print '</td><td colspan="3">';
print $form->editfieldval("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer,'amount',($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
// display amount and link to unpaid bill // display amount and link to unpaid bill
$outstandigBills = $object->get_OutstandingBill(); $outstandigBills = $object->get_OutstandingBill();
if ($outstandigBills != 0) if ($outstandigBills != 0)

View File

@ -128,7 +128,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer)
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors');
$error++; $error++;
} }
if ($object->type == '-1') // Otherwise it is TF_LUNCH,... if ($object->type == '-1')
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
$error++; $error++;

View File

@ -897,7 +897,7 @@ class BonPrelevement extends CommonObject
$sql = "SELECT substring(ref from char_length(ref) - 1)"; $sql = "SELECT substring(ref from char_length(ref) - 1)";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons";
$sql.= " WHERE ref LIKE '%".$ref."%'"; $sql.= " WHERE ref LIKE '%".$this->db->escape($ref)."%'";
$sql.= " AND entity = ".$conf->entity; $sql.= " AND entity = ".$conf->entity;
$sql.= " ORDER BY ref DESC LIMIT 1"; $sql.= " ORDER BY ref DESC LIMIT 1";
@ -935,13 +935,13 @@ class BonPrelevement extends CommonObject
else else
{ {
$error++; $error++;
dol_syslog(__METHOD__."::Create withdraw receipt ".$this->db->error(), LOG_ERR); dol_syslog(__METHOD__."::Create withdraw receipt ".$this->db->lasterror(), LOG_ERR);
} }
} }
else else
{ {
$error++; $error++;
dol_syslog(__METHOD__."::Get last withdraw receipt ".$this->db->error(), LOG_ERR); dol_syslog(__METHOD__."::Get last withdraw receipt ".$this->db->lasterror(), LOG_ERR);
} }
} }
@ -975,10 +975,7 @@ class BonPrelevement extends CommonObject
$error++; $error++;
} }
/* // Update invoice requests as done
* Update orders
*
*/
$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande"; $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande";
$sql.= " SET traite = 1"; $sql.= " SET traite = 1";
$sql.= ", date_traite = '".$this->db->idate($now)."'"; $sql.= ", date_traite = '".$this->db->idate($now)."'";
@ -1025,7 +1022,7 @@ class BonPrelevement extends CommonObject
$bonprev->factures = $factures_prev_id; $bonprev->factures = $factures_prev_id;
//Build file // Generation of SEPA file
$bonprev->generate(); $bonprev->generate();
} }
dol_syslog(__METHOD__."::End withdraw receipt, file ".$filebonprev, LOG_DEBUG); dol_syslog(__METHOD__."::End withdraw receipt, file ".$filebonprev, LOG_DEBUG);
@ -1034,7 +1031,6 @@ class BonPrelevement extends CommonObject
/* /*
* Update total * Update total
*/ */
$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons"; $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons";
$sql.= " SET amount = ".price2num($bonprev->total); $sql.= " SET amount = ".price2num($bonprev->total);
$sql.= " WHERE rowid = ".$prev_id; $sql.= " WHERE rowid = ".$prev_id;
@ -1047,9 +1043,6 @@ class BonPrelevement extends CommonObject
dol_syslog(__METHOD__."::Error update total: ".$this->db->error(), LOG_ERR); dol_syslog(__METHOD__."::Error update total: ".$this->db->error(), LOG_ERR);
} }
/*
* Rollback or Commit
*/
if (!$error) if (!$error)
{ {
$this->db->commit(); $this->db->commit();
@ -1261,9 +1254,9 @@ class BonPrelevement extends CommonObject
/* /*
* section Debiteur (sepa Debiteurs bloc lines) * section Debiteur (sepa Debiteurs bloc lines)
*/ */
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, c.code as country_code,"; $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
$sql.= " pl.client_nom as name, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; $sql.= " pl.client_nom as name, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
$sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.datec, rib.rowid as drum";
$sql.= " FROM"; $sql.= " FROM";
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
$sql.= " ".MAIN_DB_PREFIX."facture as f,"; $sql.= " ".MAIN_DB_PREFIX."facture as f,";
@ -1504,17 +1497,21 @@ class BonPrelevement extends CommonObject
* @param string $row_idfac pf.fk_facture AS idfac, * @param string $row_idfac pf.fk_facture AS idfac,
* @param string $row_iban rib.iban_prefix AS iban, * @param string $row_iban rib.iban_prefix AS iban,
* @param string $row_bic rib.bic AS bic, * @param string $row_bic rib.bic AS bic,
* @param string $row_datec soc.datec, * @param string $row_datec rib.datec,
* @param string $row_drum soc.rowid AS drum * @param string $row_drum rib.rowid AS drum
* @return string Return string with SEPA part DrctDbtTxInf * @return string Return string with SEPA part DrctDbtTxInf
*/ */
function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum) function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
{ {
$CrLf = "\n"; $CrLf = "\n";
$Rowing = sprintf("%06d", $row_idfac); $Rowing = sprintf("%06d", $row_idfac);
// Define value for RUM
// Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId)
$Date_Rum = strtotime($row_datec); $Date_Rum = strtotime($row_datec);
$pre = ($date_Rum > 1359673200) ? 'Rum' : '++R'; $pre = ($date_Rum > 1359673200) ? 'RUM' : '++R';
$Rum = $pre.$row_code_client.$row_drum.'-0'.date('U', $Date_Rum); $Rum = dol_trunc($pre.$row_code_client.'-'.$row_drum.'-0'.date('U', $Date_Rum), 35, 'right', 'UTF-8', 1);
$XML_DEBITOR =''; $XML_DEBITOR ='';
$XML_DEBITOR .=' <DrctDbtTxInf>'.$CrLf; $XML_DEBITOR .=' <DrctDbtTxInf>'.$CrLf;
$XML_DEBITOR .=' <PmtId>'.$CrLf; $XML_DEBITOR .=' <PmtId>'.$CrLf;

View File

@ -36,7 +36,7 @@ $langs->load("companies");
// Security check // Security check
$id = GETPOST('id','int'); $id = GETPOST('id','int');
if ($user->societe_id) $id=$user->societe_id; if ($user->societe_id) $id=$user->societe_id;
$result = restrictedArea($user, 'societe', $id, '&societe'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$object = new Contact($db); $object = new Contact($db);
if ($id > 0) $object->fetch($id); if ($id > 0) $object->fetch($id);

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* *
* 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
@ -27,6 +28,7 @@
require ("../main.inc.php"); require ("../main.inc.php");
require_once (DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); require_once (DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$langs->load("contracts"); $langs->load("contracts");
$langs->load("products"); $langs->load("products");
@ -47,6 +49,8 @@ $sall=GETPOST('sall');
$search_status=GETPOST('search_status'); $search_status=GETPOST('search_status');
$socid=GETPOST('socid'); $socid=GETPOST('socid');
$search_sale = GETPOST('search_sale','int');
if (! $sortfield) $sortfield="c.rowid"; if (! $sortfield) $sortfield="c.rowid";
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
@ -63,6 +67,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_name=""; $search_name="";
$search_contract=""; $search_contract="";
$search_ref_supplier=""; $search_ref_supplier="";
$search_sale="";
$sall=""; $sall="";
$search_status=""; $search_status="";
} }
@ -75,6 +80,8 @@ if ($search_status == '') $search_status=1;
*/ */
$now=dol_now(); $now=dol_now();
$formother = new FormOther($db);
$socstatic = new Societe($db);
llxHeader(); llxHeader();
@ -87,13 +94,13 @@ $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND
$sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,';
$sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed'; $sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed';
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."contrat as c"; $sql.= ", ".MAIN_DB_PREFIX."contrat as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat";
$sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " WHERE c.fk_soc = s.rowid ";
$sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.entity = ".$conf->entity;
if ($socid) $sql.= " AND s.rowid = ".$socid; if ($socid) $sql.= " AND s.rowid = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($search_name) { if ($search_name) {
$sql .= natural_search('s.nom', $search_name); $sql .= natural_search('s.nom', $search_name);
} }
@ -103,6 +110,12 @@ if ($search_contract) {
if (!empty($search_ref_supplier)) { if (!empty($search_ref_supplier)) {
$sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier); $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
} }
if ($search_sale > 0)
{
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
}
if ($sall) { if ($sall) {
$sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall); $sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall);
} }
@ -121,13 +134,34 @@ if ($resql)
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">'; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
// If the user can view prospects other than his'
$moreforfilter='';
if ($user->rights->societe->client->voir || $socid)
{
$langs->load("commercial");
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
if ($moreforfilter)
{
print '<tr class="liste_titre">';
print '<td class="liste_titre" colspan="9">';
print $moreforfilter;
print '</td></tr>';
}
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
$param='&amp;search_contract='.$search_contract; $param='&amp;search_contract='.$search_contract;
$param.='&amp;search_name='.$search_name; $param.='&amp;search_name='.$search_name;
$param.='&amp;search_ref_supplier='.$search_ref_supplier; $param.='&amp;search_ref_supplier='.$search_ref_supplier;
$param.='&search_sale=' .$search_sale;
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("SalesRepresentative"), $_SERVER["PHP_SELF"], "","","$param",'',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "c.statut","","$param",'align="center"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "c.statut","","$param",'align="center"',$sortfield,$sortorder);
@ -150,7 +184,7 @@ if ($resql)
print '</td>'; print '</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
//print '<td class="liste_titre">&nbsp;</td>'; //print '<td class="liste_titre">&nbsp;</td>';
print '<td colspan="4" class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<td colspan="5" class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print "</td></tr>\n"; print "</td></tr>\n";
@ -167,6 +201,43 @@ if ($resql)
print '<td>'.$obj->ref_supplier.'</td>'; print '<td>'.$obj->ref_supplier.'</td>';
print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>'; print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
//print '<td align="center">'.dol_print_date($obj->datec).'</td>'; //print '<td align="center">'.dol_print_date($obj->datec).'</td>';
// Sales Rapresentatives
print '<td>';
if($obj->socid)
{
$socstatic->fetch($obj->socid);
$listsalesrepresentatives=$socstatic->getSalesRepresentatives($user);
$nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number
{
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$socstatic->id.'">';
print $nbofsalesrepresentative;
print '</a>';
}
else if ($nbofsalesrepresentative > 0)
{
$userstatic=new User($db);
$j=0;
foreach($listsalesrepresentatives as $val)
{
$userstatic->id=$val['id'];
$userstatic->lastname=$val['lastname'];
$userstatic->firstname=$val['firstname'];
print $userstatic->getNomUrl(1);
$j++;
if ($j < $nbofsalesrepresentative) print '<br/>';
}
}
else print $langs->trans("NoSalesRepresentativeAffected");
}
else
{
print '&nbsp';
}
print '</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat)).'</td>'; print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat)).'</td>';
//print '<td align="center">'.$staticcontrat->LibStatut($obj->statut,3).'</td>'; //print '<td align="center">'.$staticcontrat->LibStatut($obj->statut,3).'</td>';
print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>'; print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';

View File

@ -210,19 +210,17 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
else else
{ {
$langs->load("other"); $langs->load("other");
$mesg='<div class="error">';
if ($mailfile->error) if ($mailfile->error)
{ {
$mesg='';
$mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
$mesg.='<br>'.$mailfile->error; $mesg.='<br>'.$mailfile->error;
setEventMessage($mesg,'errors');
} }
else else
{ {
$mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; setEventMessage('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', 'warnings');
} }
$mesg.='</div>';
setEventMessage($mesg,'warnings');
$action = 'presend'; $action = 'presend';
} }
} }

View File

@ -148,9 +148,10 @@ class Ctypent // extends CommonObject
* *
* @param int $id Id object * @param int $id Id object
* @param string $code Code * @param string $code Code
* @param string $label Label
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id,$code='') function fetch($id,$code='',$label='')
{ {
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
@ -163,8 +164,8 @@ class Ctypent // extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."c_typent as t"; $sql.= " FROM ".MAIN_DB_PREFIX."c_typent as t";
if ($id) $sql.= " WHERE t.id = ".$id; if ($id) $sql.= " WHERE t.id = ".$id;
elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'"; elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'";
elseif ($label) $sql.= " WHERE t.libelle = '".$this->db->escape($label)."'";
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -183,7 +183,8 @@ class DolEditor
customConfig : ckeditorConfig, customConfig : ckeditorConfig,
readOnly : '.($this->readonly?'true':'false').', readOnly : '.($this->readonly?'true':'false').',
htmlEncodeOutput :'.$htmlencode_force.', htmlEncodeOutput :'.$htmlencode_force.',
toolbar: \''.$this->toolbarname.'\', allowedContent :'.(empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT)?'false':'true').',
toolbar: \''.$this->toolbarname.'\',
toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').', toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').',
width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').', width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').',
height: '.$this->height.', height: '.$this->height.',

View File

@ -1262,8 +1262,8 @@ class ExtraFields
* Fill array_options property of object by extrafields value (using for data sent by forms) * Fill array_options property of object by extrafields value (using for data sent by forms)
* *
* @param array $extralabels $array of extrafields * @param array $extralabels $array of extrafields
* @param object $object Object * @param object $object Object
* @param string $onlykey Only following key is filled * @param string $onlykey Only following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must must set this to avoid to have other extrafields being reset.
* @return int 1 if array_options set / 0 if no value * @return int 1 if array_options set / 0 if no value
*/ */
function setOptionalsFromPost($extralabels,&$object,$onlykey='') function setOptionalsFromPost($extralabels,&$object,$onlykey='')

View File

@ -440,11 +440,11 @@ class FormFile
} }
else if ($modulepart != 'agenda') else if ($modulepart != 'agenda')
{ {
// For normalized standard modules // For normalized standard modules
$file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0); $file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0);
if (file_exists($file)) if (file_exists($file))
{ {
$res=include_once $file; $res=include_once $file;
} }
// For normalized external modules // For normalized external modules
else else
@ -458,7 +458,7 @@ class FormFile
$modellist=call_user_func($class.'::liste_modeles',$this->db); $modellist=call_user_func($class.'::liste_modeles',$this->db);
} }
else else
{ {
dol_print_error($this->db,'Bad value for modulepart'); dol_print_error($this->db,'Bad value for modulepart');
return -1; return -1;
} }

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *
* 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
@ -269,6 +270,7 @@ class FormMail
if ($this->withform == 1) if ($this->withform == 1)
{ {
$out.= '<form method="POST" name="mailform" enctype="multipart/form-data" action="'.$this->param["returnurl"].'">'."\n"; $out.= '<form method="POST" name="mailform" enctype="multipart/form-data" action="'.$this->param["returnurl"].'">'."\n";
$out.= '<input style="display:none" type="submit" id="sendmail" name="sendmail">';
$out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />'; $out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
} }
foreach ($this->param as $key=>$value) foreach ($this->param as $key=>$value)

View File

@ -87,7 +87,7 @@ class FormProjets
if ($resql) if ($resql)
{ {
$minmax=''; $minmax='';
// Use select2 selector // Use select2 selector
$nodatarole=''; $nodatarole='';
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax))
@ -219,6 +219,11 @@ class FormProjets
$sql = "SELECT id as rowid, label as ref"; $sql = "SELECT id as rowid, label as ref";
$projectkey="fk_project"; $projectkey="fk_project";
break; break;
case "expensereport_det":
return '';
/*$sql = "SELECT rowid, '' as ref"; // table is llx_expensereport_det
$projectkey="fk_projet";
break;*/
default: default:
$sql = "SELECT rowid, ref"; $sql = "SELECT rowid, ref";
break; break;
@ -226,10 +231,8 @@ class FormProjets
$sql.= " FROM ".MAIN_DB_PREFIX.$table_element; $sql.= " FROM ".MAIN_DB_PREFIX.$table_element;
$sql.= " WHERE ".$projectkey." is null"; $sql.= " WHERE ".$projectkey." is null";
if (!empty($socid)) { if (!empty($socid)) $sql.= " AND fk_soc=".$socid;
$sql.= " AND fk_soc=".$socid; if (! in_array($table_element, array('expensereport_det'))) $sql.= ' AND entity='.getEntity('project');
}
$sql.= ' AND entity='.getEntity('project');
$sql.= " ORDER BY ref DESC"; $sql.= " ORDER BY ref DESC";
dol_syslog(get_class($this).'::select_element', LOG_DEBUG); dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
@ -260,9 +263,12 @@ class FormProjets
}*/ }*/
$this->db->free($resql); $this->db->free($resql);
return $sellist ; return $sellist;
}else { }
else
{
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
$this->errors[]=$this->db->lasterror();
dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR); dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR);
return -1; return -1;
} }

View File

@ -140,6 +140,10 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
if (empty($conf->dol_use_jmobile)) print ' - '; if (empty($conf->dol_use_jmobile)) print ' - ';
print '<input type="number" class="short" name="end_d" value="'.$end_d.'" min="1" max="7">'; print '<input type="number" class="short" name="end_d" value="'.$end_d.'" min="1" max="7">';
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("AgendaShowBirthdayEvents").' <input type="checkbox" id="check_birthday" name="check_birthday"></td></tr>';
print '</table>';
print '</td>';
} }
// Hooks // Hooks

View File

@ -59,3 +59,46 @@ function expensereport_prepare_head($object)
return $head; return $head;
} }
/**
* Return array head with list of tabs to view object informations.
*
* @return array head array with tabs
*/
function expensereport_admin_prepare_head()
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport.php";
$head[$h][1] = $langs->trans("ExpenseReports");
$head[$h][2] = 'expensereport';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf,$langs,null,$head,$h,'expensereport_admin');
/*$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinter_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributesdet';
$h++;
*/
complete_head_from_modules($conf,$langs,null,$head,$h,'expensereport_admin','remove');
return $head;
}

View File

@ -10,8 +10,8 @@
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* *
* 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
@ -95,13 +95,13 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
} }
/** /**
* Get entity to use * Get list of entity id to use
* *
* @param string $element Current element * @param string $element Current element
* @param int $shared 1=Return shared entities * @param int $shared 0=Return id of entity, 1=Return id entity + shared entities
* @return mixed Entity id(s) to use * @return mixed Entity id(s) to use
*/ */
function getEntity($element=false, $shared=false) function getEntity($element=false, $shared=0)
{ {
global $conf, $mc; global $conf, $mc;
@ -112,12 +112,9 @@ function getEntity($element=false, $shared=false)
else else
{ {
$out=''; $out='';
$addzero = array('user', 'usergroup'); $addzero = array('user', 'usergroup');
if (in_array($element, $addzero)) $out.= '0,'; if (in_array($element, $addzero)) $out.= '0,';
$out.= $conf->entity; $out.= $conf->entity;
return $out; return $out;
} }
} }
@ -156,7 +153,7 @@ function getBrowserInfo()
elseif (preg_match('/epiphany/i',$_SERVER["HTTP_USER_AGENT"])) { $name='epiphany'; $version=$reg[2]; } elseif (preg_match('/epiphany/i',$_SERVER["HTTP_USER_AGENT"])) { $name='epiphany'; $version=$reg[2]; }
elseif ((empty($phone) || preg_match('/iphone/i',$_SERVER["HTTP_USER_AGENT"])) && preg_match('/safari(\/|\s)([\d\.]*)/i',$_SERVER["HTTP_USER_AGENT"], $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not. elseif ((empty($phone) || preg_match('/iphone/i',$_SERVER["HTTP_USER_AGENT"])) && preg_match('/safari(\/|\s)([\d\.]*)/i',$_SERVER["HTTP_USER_AGENT"], $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not.
elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='opera'; $version=$reg[2]; } elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='opera'; $version=$reg[2]; }
elseif (preg_match('/msie(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='ie'; $version=$reg[2]; } // MS products at end elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='ie'; $version= end($reg); } // MS products at end
// Other // Other
$firefox=0; $firefox=0;
if (in_array($name,array('firefox','iceweasel'))) $firefox=1; if (in_array($name,array('firefox','iceweasel'))) $firefox=1;
@ -454,18 +451,18 @@ function dol_string_unaccent($str)
/** /**
* Clean a string from all punctuation characters to use it as a ref or login * Clean a string from all punctuation characters to use it as a ref or login
* *
* @param string $str String to clean * @param string $str String to clean
* @param string $newstr String to replace forbidden chars with * @param string $newstr String to replace forbidden chars with
* @param array $badchars List of forbidden characters * @param array $badcharstoreplace List of forbidden characters
* @return string Cleaned string * @return string Cleaned string
* *
* @see dol_sanitizeFilename, dol_string_unaccent * @see dol_sanitizeFilename, dol_string_unaccent
*/ */
function dol_string_nospecial($str,$newstr='_',$badchars='') function dol_string_nospecial($str,$newstr='_',$badcharstoreplace='')
{ {
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$forbidden_chars_to_remove=array(); $forbidden_chars_to_remove=array();
if (is_array($badchars)) $forbidden_chars_to_replace=$badchars; if (is_array($badcharstoreplace)) $forbidden_chars_to_replace=$badcharstoreplace;
//$forbidden_chars_to_remove=array("(",")"); //$forbidden_chars_to_remove=array("(",")");
return str_replace($forbidden_chars_to_replace,$newstr,str_replace($forbidden_chars_to_remove,"",$str)); return str_replace($forbidden_chars_to_replace,$newstr,str_replace($forbidden_chars_to_remove,"",$str));
@ -2707,7 +2704,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath
$return=''; $return='';
if ($picto == 'setup') $picto='title.png'; if ($picto == 'setup') $picto='title.png';
if (!empty($conf->browser->ie) && $picto=='title.png') $picto='title.gif'; if (($conf->browser->name == 'ie') && $picto=='title.png') $picto='title.gif';
$return.= "\n"; $return.= "\n";
$return.= '<table '.($id?'id="'.$id.'" ':'').'summary="" width="100%" border="0" class="notopnoleftnoright" style="margin-bottom: 2px;"><tr>'; $return.= '<table '.($id?'id="'.$id.'" ':'').'summary="" width="100%" border="0" class="notopnoleftnoright" style="margin-bottom: 2px;"><tr>';
@ -2746,7 +2743,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
global $conf,$langs; global $conf,$langs;
if ($picto == 'setup') $picto='title.png'; if ($picto == 'setup') $picto='title.png';
if (!empty($conf->browser->ie) && $picto=='title.png') $picto='title.gif'; if (($conf->browser->name == 'ie') && $picto=='title.png') $picto='title.gif';
if (($num > $conf->liste_limit) || ($num == -1)) if (($num > $conf->liste_limit) || ($num == -1))
{ {
@ -3061,7 +3058,7 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
/** /**
* Return localtax rate for a particular vat, when selling a product with vat $tva, from a $thirdparty_buyer to a $thirdparty_seller * Return localtax rate for a particular vat, when selling a product with vat $tva, from a $thirdparty_buyer to a $thirdparty_seller
* Note: It applies same rule than get_default_tva * Note: This function applies same rules than get_default_tva
* *
* @param float $tva Vat taxe * @param float $tva Vat taxe
* @param int $local Local tax to search and return (1 or 2 return only tax rate 1 or tax rate 2) * @param int $local Local tax to search and return (1 or 2 return only tax rate 1 or tax rate 2)
@ -3162,13 +3159,10 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
} }
} }
$sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type"; $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'"; $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'";
$sql .= " AND t.taux = ".((float) $tva)." AND t.active = 1"; $sql .= " AND t.taux = ".((float) $tva)." AND t.active = 1";
dol_syslog("get_localtax", LOG_DEBUG); dol_syslog("get_localtax", LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
@ -4189,15 +4183,15 @@ function get_date_range($date_start,$date_end,$format = '',$outputlangs='', $wit
if ($date_start && $date_end) if ($date_start && $date_end)
{ {
$out.= ($withparenthesis?' (':'').$outputlangs->trans('DateFromTo',dol_print_date($date_start, $format, false, $outputlangs),dol_print_date($date_end, $format, false, $outputlangs)).($withparenthesis?')':''); $out.= ($withparenthesis?' (':'').$outputlangs->transnoentitiesnoconv('DateFromTo',dol_print_date($date_start, $format, false, $outputlangs),dol_print_date($date_end, $format, false, $outputlangs)).($withparenthesis?')':'');
} }
if ($date_start && ! $date_end) if ($date_start && ! $date_end)
{ {
$out.= ($withparenthesis?' (':'').$outputlangs->trans('DateFrom',dol_print_date($date_start, $format, false, $outputlangs)).($withparenthesis?')':''); $out.= ($withparenthesis?' (':'').$outputlangs->transnoentitiesnoconv('DateFrom',dol_print_date($date_start, $format, false, $outputlangs)).($withparenthesis?')':'');
} }
if (! $date_start && $date_end) if (! $date_start && $date_end)
{ {
$out.= ($withparenthesis?' (':'').$outputlangs->trans('DateUntil',dol_print_date($date_end, $format, false, $outputlangs)).($withparenthesis?')':''); $out.= ($withparenthesis?' (':'').$outputlangs->transnoentitiesnoconv('DateUntil',dol_print_date($date_end, $format, false, $outputlangs)).($withparenthesis?')':'');
} }
return $out; return $out;
@ -4670,6 +4664,8 @@ function picto_from_langcode($codelang)
if (empty($codelang)) return ''; if (empty($codelang)) return '';
if (empty($codelang)) return '';
if ($codelang == 'auto') if ($codelang == 'auto')
{ {
return img_picto_common($langs->trans('AutoDetectLang'), 'flags/int.png'); return img_picto_common($langs->trans('AutoDetectLang'), 'flags/int.png');

View File

@ -39,10 +39,11 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 201__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/dolibarr.php?leftmenu=admintools', 'InfoDolibarr', 1, 'admin', '', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 201__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/dolibarr.php?leftmenu=admintools', 'InfoDolibarr', 1, 'admin', '', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 202__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/system/modules.php?leftmenu=admintools', 'Modules', 2, 'admin', '', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 202__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/system/modules.php?leftmenu=admintools', 'Modules', 2, 'admin', '', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 203__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/triggers.php?leftmenu=admintools', 'Triggers', 2, 'admin', '', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 203__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/triggers.php?leftmenu=admintools', 'Triggers', 2, 'admin', '', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 204__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/browser.php?leftmenu=admintools', 'InfoBrowser', 1, 'admin', '', '', 2, 1, __ENTITY__); --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 204__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/system/filecheck.php?leftmenu=admintools', 'FileCheck', 2, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 205__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/os.php?leftmenu=admintools', 'InfoOS', 1, 'admin', '', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 205__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/browser.php?leftmenu=admintools', 'InfoBrowser', 1, 'admin', '', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 206__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/web.php?leftmenu=admintools', 'InfoWebServer', 1, 'admin', '', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 206__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/os.php?leftmenu=admintools', 'InfoOS', 1, 'admin', '', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 207__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/phpinfo.php?leftmenu=admintools', 'InfoPHP', 1, 'admin', '', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 207__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/web.php?leftmenu=admintools', 'InfoWebServer', 1, 'admin', '', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 208__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/phpinfo.php?leftmenu=admintools', 'InfoPHP', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 210__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/database.php?leftmenu=admintools', 'InfoDatabase', 1, 'admin', '', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 210__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/database.php?leftmenu=admintools', 'InfoDatabase', 1, 'admin', '', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 301__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/dolibarr_export.php?leftmenu=admintools', 'Backup', 1, 'admin', '', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 301__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/dolibarr_export.php?leftmenu=admintools', 'Backup', 1, 'admin', '', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 302__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/dolibarr_import.php?leftmenu=admintools', 'Restore', 1, 'admin', '', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 302__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/dolibarr_import.php?leftmenu=admintools', 'Restore', 1, 'admin', '', '', 2, 7, __ENTITY__);

View File

@ -503,6 +503,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add('/admin/system/dolibarr.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('InfoDolibarr'), 1); $newmenu->add('/admin/system/dolibarr.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('InfoDolibarr'), 1);
if (empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/system/modules.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('Modules'), 2); if (empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/system/modules.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('Modules'), 2);
if (empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/triggers.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('Triggers'), 2); if (empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/triggers.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('Triggers'), 2);
//if (empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/system/filecheck.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('FileCheck'), 2);
$newmenu->add('/admin/system/browser.php?mainmenu=home&amp;leftmenu=admintools', $langs->trans('InfoBrowser'), 1); $newmenu->add('/admin/system/browser.php?mainmenu=home&amp;leftmenu=admintools', $langs->trans('InfoBrowser'), 1);
$newmenu->add('/admin/system/os.php?mainmenu=home&amp;leftmenu=admintools', $langs->trans('InfoOS'), 1); $newmenu->add('/admin/system/os.php?mainmenu=home&amp;leftmenu=admintools', $langs->trans('InfoOS'), 1);
$newmenu->add('/admin/system/web.php?mainmenu=home&amp;leftmenu=admintools', $langs->trans('InfoWebServer'), 1); $newmenu->add('/admin/system/web.php?mainmenu=home&amp;leftmenu=admintools', $langs->trans('InfoWebServer'), 1);

View File

@ -160,7 +160,7 @@ abstract class ModeleNumRefCommandes
* @param int $hidedesc Hide description * @param int $hidedesc Hide description
* @param int $hideref Hide ref * @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK * @return int 0 if KO, 1 if OK
* @deprecated Use the new function generateDocument of Commande class * @deprecated Use the new function generateDocument of Commande class
*/ */
function commande_pdf_create(DoliDB $db, Commande $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) function commande_pdf_create(DoliDB $db, Commande $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{ {

View File

@ -3,7 +3,7 @@
* *
* 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
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -19,10 +19,10 @@
/** /**
* \file htdocs/core/modules/expensereport/doc/pdf_standard.modules.php * \file htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
* \ingroup expensereport * \ingroup expensereport
* \brief File of class to generate invoices from standard model * \brief File of class to generate expense report from standard model
*/ */
dol_include_once("/expensereport/core/modules/expensereport/modules_expensereport.php"); require_once DOL_DOCUMENT_ROOT.'/core/modules/expensereport/modules_expensereport.php';
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
@ -34,9 +34,25 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
/** /**
* Classe permettant de generer les factures au modele Crabe * Classe permettant de generer les factures au modele Crabe
*/ */
class pdf_ extends ModeleExpenseReport class pdf_standard extends ModeleExpenseReport
{ {
var $emetteur; // Objet societe qui emet var $db;
var $name;
var $description;
var $type;
var $phpmin = array(4,3,0); // Minimum version of PHP required by module
var $version = 'dolibarr';
var $page_largeur;
var $page_hauteur;
var $format;
var $marge_gauche;
var $marge_droite;
var $marge_haute;
var $marge_basse;
var $emetteur; // Objet societe qui emet
/** /**
@ -51,11 +67,11 @@ class pdf_ extends ModeleExpenseReport
$langs->load("main"); $langs->load("main");
$langs->load("trips"); $langs->load("trips");
$langs->load("project"); $langs->load("project");
$langs->load("expensereport@expensereport"); $langs->load("trips");
$this->db = $db; $this->db = $db;
$this->name = ""; $this->name = "";
$this->description = $langs->trans('PDFDescription'); $this->description = $langs->trans('PDFStandardExpenseReports');
// Dimension page pour format A4 // Dimension page pour format A4
$this->type = 'pdf'; $this->type = 'pdf';
@ -85,17 +101,16 @@ class pdf_ extends ModeleExpenseReport
$this->emetteur=$mysoc; $this->emetteur=$mysoc;
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
// Defini position des colonnes // Define position of columns
// Defini position des colonnes
$this->posxpiece=$this->marge_gauche+1; $this->posxpiece=$this->marge_gauche+1;
$this->posxdesc=20; $this->posxdesc=20;
$this->posxdate=85; $this->posxdate=85;
$this->posxtype=105; $this->posxtype=105;
$this->posxprojet=125; $this->posxprojet=125;
$this->posxtva=145; $this->posxtva=145;
$this->posxup=158; $this->posxup=162;
$this->posxqty=170; $this->posxqty=176;
$this->postotalttc=176; $this->postotalttc=186;
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$this->posxdate-=20; $this->posxdate-=20;
@ -124,6 +139,7 @@ class pdf_ extends ModeleExpenseReport
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc * @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return int 1=OK, 0=KO
*/ */
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
@ -133,40 +149,27 @@ class pdf_ extends ModeleExpenseReport
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
// Hack to use expensereport dir
$rootfordata = DOL_DATA_ROOT;
$rootforuser = DOL_DATA_ROOT;
// If multicompany module is enabled, we redefine the root of data
//if (! empty($this->multicompany->enabled) && ! empty($this->entity) && $this->entity > 1)
//{
// $rootfordata.='/'.$this->entity;
//}
$conf->expensereport->dir_output = $rootfordata.'/expensereport';
$conf->expensereport_->dir_output = $rootfordata.'/expensereport';
$outputlangs->load("main"); $outputlangs->load("main");
$outputlangs->load("dict"); $outputlangs->load("dict");
$outputlangs->load("trips"); $outputlangs->load("trips");
$outputlangs->load("project"); $outputlangs->load("project");
$outputlangs->load("expensereport@expensereport");
$default_font_size = pdf_getPDFFontSize($outputlangs); $nblignes = count($object->lines);
if ($conf->expensereport_->dir_output) if ($conf->expensereport->dir_output)
{ {
// Definition de l'objet $object (pour compatibilite ascendante) // Definition of $dir and $file
if (! is_object($object)) if ($object->specimen)
{ {
$id = $object; $dir = $conf->expensereport->dir_output;
$object = new ExpenseReport($db); $file = $dir . "/SPECIMEN.pdf";
$ret=$object->fetch($id,$user); }
else
{
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->expensereport->dir_output . "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
} }
$objectref = dol_sanitizeFileName($object->ref_number);
$dir = $conf->expensereport_->dir_output . "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
if (! file_exists($dir)) if (! file_exists($dir))
{ {
@ -181,10 +184,24 @@ class pdf_ extends ModeleExpenseReport
if (file_exists($dir)) if (file_exists($dir))
{ {
$nblignes = count($object->lines); // Add pdfgeneration hook
if (! is_object($hookmanager))
{
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
}
$hookmanager->initHooks(array('pdfgeneration'));
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
global $action;
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
// Create pdf instance // Create pdf instance
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))
{ {
@ -205,13 +222,12 @@ class pdf_ extends ModeleExpenseReport
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref_number)); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref_number));
$pdf->SetSubject($outputlangs->transnoentities("Trips")); $pdf->SetSubject($outputlangs->transnoentities("Trips"));
$pdf->SetCreator(""); $pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref_number)." ".$outputlangs->transnoentities("Trips")); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Trips"));
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
// Positionne $this->atleastonediscount si on a au moins une remise // Positionne $this->atleastonediscount si on a au moins une remise
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
@ -232,17 +248,29 @@ class pdf_ extends ModeleExpenseReport
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$tab_top = 95; $tab_top = 95;
$tab_top_newpage = 95; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?95:10);
$tab_height = 110; $tab_height = 110;
$tab_height_newpage = 110; $tab_height_newpage = 110;
// Affiche notes // Affiche notes
if (! empty($object->note)) $notetoshow=empty($object->note_public)?'':$object->note_public;
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
{ {
$tab_top = 93; // Get first sale rep
if (is_object($object->thirdparty))
{
$salereparray=$object->thirdparty->getSalesRepresentatives($user);
$salerepobj=new User($this->db);
$salerepobj->fetch($salereparray[0]['id']);
if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature);
}
}
if ($notetoshow)
{
$tab_top = 95;
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note), 0, 1); $pdf->writeHTMLCell(190, 3, $this->posxpiece-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$height_note=$nexY-$tab_top; $height_note=$nexY-$tab_top;
@ -265,11 +293,20 @@ class pdf_ extends ModeleExpenseReport
// Loop on each lines // Loop on each lines
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
{ {
$piece_comptable = $i +1;
$curY = $nexY; $curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$piece_comptable = $i +1; $pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
// Description of product line
$curX = $this->posxdesc-1;
$showpricebeforepagebreak=1;
// Piece comptable // Piece comptable
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
@ -277,46 +314,50 @@ class pdf_ extends ModeleExpenseReport
// Comments // Comments
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY ($this->posxcomment, $curY); $pdf->SetXY($this->posxcomment, $curY);
$pdf->writeHTMLCell($this->posxdate-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $object->lignes[$i]->comments, 0, 1); $pdf->writeHTMLCell($this->posxdate-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $object->lines[$i]->comments, 0, 1);
//nexY //nexY
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setTopMargin($this->marge_haute);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
// Date // Date
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY ($this->posxdate, $curY); $pdf->SetXY($this->posxdate, $curY);
$pdf->MultiCell($this->posxtype-$this->posxdate-1, 3,dol_print_date($object->lignes[$i]->date,"day",false,$outpulangs), 0, 'C'); $pdf->MultiCell($this->posxtype-$this->posxdate-1, 3,dol_print_date($object->lines[$i]->date,"day",false,$outpulangs), 0, 'C');
// Type // Type
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY ($this->posxtype, $curY); $pdf->SetXY($this->posxtype, $curY);
$pdf->MultiCell($this->posxprojet-$this->posxtype-1, 3,$outputlangs->transnoentities($object->lignes[$i]->type_fees_code), 0, 'C'); $pdf->MultiCell($this->posxprojet-$this->posxtype-1, 3,$outputlangs->transnoentities($object->lines[$i]->type_fees_code), 0, 'C');
// Projet // Projet
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY ($this->posxprojet, $curY); $pdf->SetXY($this->posxprojet, $curY);
$pdf->MultiCell($this->posxtva-$this->posxprojet-1, 3,$object->lignes[$i]->projet_ref, 0, 'C'); $pdf->MultiCell($this->posxtva-$this->posxprojet-1, 3,$object->lines[$i]->projet_ref, 0, 'C');
// TVA // VAT Rate
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY ($this->posxtva, $curY); $pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-1, 3,vatrate($object->lignes[$i]->tva_taux,true), 0, 'R'); $pdf->MultiCell($this->posxup-$this->posxtva-1, 3,vatrate($object->lines[$i]->tva_taux,true), 0, 'R');
// UP // UP
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY ($this->posxup, $curY); $pdf->SetXY($this->posxup, $curY);
$pdf->MultiCell($this->posxqty-$this->posxup-1, 3,price($object->lignes[$i]->value_unit), 0, 'R'); $pdf->MultiCell($this->posxqty-$this->posxup-1, 3,price($object->lines[$i]->value_unit), 0, 'R');
// QTY // Quantity
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY ($this->posxqty, $curY); $pdf->SetXY($this->posxqty, $curY);
$pdf->MultiCell($this->postotalttc-$this->posxqty, 3,$object->lignes[$i]->qty, 0, 'C'); $pdf->MultiCell($this->postotalttc-$this->posxqty, 3,$object->lines[$i]->qty, 0, 'C');
// TotalTTC // TotalTTC
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY ($this->postotalttc-2, $curY); $pdf->SetXY($this->postotalttc-2, $curY);
$pdf->MultiCell(26, 3,price($object->lignes[$i]->total_ttc), 0, 'R'); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalttc, 3, price($object->lines[$i]->total_ttc), 0, 'R');
$nexY+=5; $nexY+=5;
@ -338,38 +379,42 @@ class pdf_ extends ModeleExpenseReport
$nblineFollowDesc = 0; $nblineFollowDesc = 0;
} }
// Test if a new page is required $nexY+=2; // Passe espace entre les lignes
if ($pagenb == 1)
{
$tab_top_in_current_page=$tab_top;
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_newpage;
}
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblignes - 1))
{
if ($pagenb == 1):
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$nexY=$tab_top + $tab_height + 1;
else:
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
$nexY=$tab_top_newpage + $tab_height_newpage + 1;
endif;
$this->_pagefoot($pdf,$object,$outputlangs);
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
{
$pdf->setPage($pagenb);
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs,1);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs,1);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
} }
} }
@ -377,30 +422,30 @@ class pdf_ extends ModeleExpenseReport
// Show square // Show square
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
$bottomlasttab=$tab_top + $tab_height + 1; $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1; $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
} }
// Affiche zone totaux // Show total area box
$posy=$bottomlasttab+5;//$nexY+95; $posy=$bottomlasttab+5;//$nexY+95;
$pdf->SetXY(120, $posy); $pdf->SetXY(100, $posy);
$pdf->MultiCell(50, 5, $outputlangs->transnoentities("TotalHT"), 1, 'L'); $pdf->MultiCell(60, 5, $outputlangs->transnoentities("TotalHT"), 1, 'L');
$pdf->SetXY (170, $posy); $pdf->SetXY(160, $posy);
$pdf->MultiCell(30, 5, price($object->total_ht), 1, 'R'); $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_ht), 1, 'R');
$pdf->SetFillColor(248,248,248); $pdf->SetFillColor(248,248,248);
$posy+=5; $posy+=5;
$pdf->SetXY (120, $posy); $pdf->SetXY(100, $posy);
$pdf->SetFont('','B', 10); $pdf->SetFont('','B', 10);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(50, 5, $outputlangs->transnoentities("TotalTTC"), 1,'L'); $pdf->MultiCell(60, 5, $outputlangs->transnoentities("TotalTTC"), 1,'L');
$pdf->SetXY (170, $posy); $pdf->SetXY(160, $posy);
$pdf->MultiCell(30, 5, price($object->total_ttc),1, 'R'); $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_ttc),1, 'R');
// Pied de page // Pied de page
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
@ -411,11 +456,6 @@ class pdf_ extends ModeleExpenseReport
$pdf->Output($file,'F'); $pdf->Output($file,'F');
// Add pdfgeneration hook // Add pdfgeneration hook
if (! is_object($hookmanager))
{
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
}
$hookmanager->initHooks(array('pdfgeneration')); $hookmanager->initHooks(array('pdfgeneration'));
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
global $action; global $action;
@ -434,7 +474,7 @@ class pdf_ extends ModeleExpenseReport
} }
else else
{ {
$this->error=$langs->trans("ErrorConstantNotDefined","DEPLACEMENT_OUTPUTDIR"); $this->error=$langs->trans("ErrorConstantNotDefined","EXPENSEREPORT_OUTPUTDIR");
return 0; return 0;
} }
$this->error=$langs->trans("ErrorUnknown"); $this->error=$langs->trans("ErrorUnknown");
@ -468,9 +508,9 @@ class pdf_ extends ModeleExpenseReport
*/ */
// Filligrane brouillon // Filligrane brouillon
if($object->fk_c_expensereport_statuts==1) if ($object->fk_c_expensereport_statuts==1 && ! empty($conf->global->EXPENSEREPORT_FREE_TEXT))
{ {
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',"' - PREVIEW ONLY"); pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->EXPENSEREPORT_FREE_TEXT);
} }
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
@ -504,48 +544,37 @@ class pdf_ extends ModeleExpenseReport
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
} }
$pdf->SetFont('','B', $default_font_size + 6); $pdf->SetFont('','B', $default_font_size + 4);
$pdf->SetXY($posx,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetTextColor(255,255,255); $pdf->SetTextColor(0,0,60);
$pdf->SetFillColor(193,219,62); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx,6,$langs->trans("ExpenseReport"), 0, 'L');
$ref_text = explode($conf->global->NDF_EXPLODE_CHAR,$object->ref_number);
$ref_text = substr($ref_text[1],3,$conf->global->NDF_NUM_CAR_REF);
$pdf->MultiCell(110,6,"Note de frais ".$ref_text, 0, 'L', 1);
$pdf->SetFont('','', $default_font_size -1); $pdf->SetFont('','', $default_font_size -1);
// Réf complète // Réf complète
$posy+=8; $posy+=8;
$pdf->SetXY(100,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Ref")." : " . $object->ref_number, '', 'L'); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("Ref")." : " . $object->ref, '', 'L');
// Date début période // Date début période
$posy+=5; $posy+=5;
$pdf->SetXY(100,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateStart")." : " . ($object->date_debut>0?$object->date_debut:dol_print_date($object->date_debut,"day",false,$outpulangs)), '', 'L'); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateStart")." : " . ($object->date_debut>0?dol_print_date($object->date_debut,"day",false,$outpulangs):''), '', 'L');
// Date fin période // Date fin période
$posy+=5; $posy+=5;
$pdf->SetXY(100,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEnd")." : " . ($object->date_fin>0?dol_print_date($object->date_fin,"day",false,$outpulangs):''), '', 'L'); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateEnd")." : " . ($object->date_fin>0?dol_print_date($object->date_fin,"day",false,$outpulangs):''), '', 'L');
// Statut NDF // Statut NDF
$posy+=7; $posy+=6;
$pdf->SetXY(100,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetFont('','B',20); $pdf->SetFont('','B',18);
$pdf->SetTextColor(111,81,124); $pdf->SetTextColor(111,81,124);
if(preg_match("#Pay#",$object->libelle_statut) && !preg_match("#A P#",$object->libelle_statut)): $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $object->getLibStatut(0), '', 'R');
$pdf->MultiCell(100, 3,$outputlangs->convToOutputCharset("Payée"), '', 'L');
elseif(preg_match("#Annul#",$object->libelle_statut)):
$pdf->MultiCell(100, 3,$outputlangs->convToOutputCharset("Annulée"), '', 'L');
elseif(preg_match("#Refus#",$object->libelle_statut)):
$pdf->MultiCell(100, 3,$outputlangs->convToOutputCharset("Refusée"), '', 'L');
else:
$pdf->MultiCell(100, 3,$object->libelle_statut, '', 'L');
endif;
// Sender properties // Sender properties
$carac_emetteur = ''; $carac_emetteur = '';
@ -596,64 +625,80 @@ class pdf_ extends ModeleExpenseReport
$pdf->SetFont('','B',8); $pdf->SetFont('','B',8);
$pdf->SetXY($posx,$posy-5); $pdf->SetXY($posx,$posy-5);
$pdf->MultiCell(80,5, $outputlangs->transnoentities("TripNDF")." :", 0, 'L'); $pdf->MultiCell(80,5, $outputlangs->transnoentities("TripNDF")." :", 0, 'L');
$pdf->rect($posx, $posy, 100, $hautcadre); $pdf->rect($posx, $posy, $this->page_largeur - $this->marge_gauche - $posx, $hautcadre);
// Informations for trip (dates and users workflow) // Informations for trip (dates and users workflow)
$userfee=new User($this->db); if ($object->fk_user_author > 0)
$userfee->fetch($object->fk_user_author); $posy+=3; {
$pdf->SetXY($posx+2,$posy); $userfee=new User($this->db);
$pdf->SetFont('','',10); $userfee->fetch($object->fk_user_author); $posy+=3;
$pdf->MultiCell(96,4,$outputlangs->transnoentities("AUTHOR")." : ".$outputlangs->convToOutputCharset($userfee->firstname)." ".$outputlangs->convToOutputCharset($userfee->lastname),0,'L'); $pdf->SetXY($posx+2,$posy);
$posy+=5; $pdf->SetFont('','',10);
$pdf->SetXY($posx+2,$posy); $pdf->MultiCell(96,4,$outputlangs->transnoentities("AUTHOR")." : ".dolGetFirstLastname($userfee->firstname,$userfee->lastname),0,'L');
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_SAVE")." : ".dol_print_date($object->date_create,"day",false,$outpulangs),0,'L'); $posy+=5;
$pdf->SetXY($posx+2,$posy);
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DateCreation")." : ".dol_print_date($object->date_create,"day",false,$outpulangs),0,'L');
}
if($object->fk_c_expensereport_statuts<3): if ($object->fk_c_expensereport_statuts==99)
$userfee=new User($this->db); {
$userfee->fetch($object->fk_user_validator); $posy+=6; if ($object->fk_user_refuse > 0)
$pdf->SetXY($posx+2,$posy); {
$pdf->MultiCell(96,4,$outputlangs->transnoentities("VALIDATOR")." : ".$outputlangs->convToOutputCharset($userfee->firstname)." ".$outputlangs->convToOutputCharset($userfee->lastname),0,'L'); $userfee=new User($this->db);
elseif($object->fk_c_expensereport_statuts==99): $userfee->fetch($object->fk_user_refuse); $posy+=6;
$userfee=new User($this->db); $pdf->SetXY($posx+2,$posy);
$userfee->fetch($object->fk_user_refuse); $posy+=6; $pdf->MultiCell(96,4,$outputlangs->transnoentities("REFUSEUR")." : ".dolGetFirstLastname($userfee->firstname,$userfee->lastname),0,'L');
$pdf->SetXY($posx+2,$posy); $posy+=5;
$pdf->MultiCell(96,4,$outputlangs->transnoentities("REFUSEUR")." : ".$outputlangs->convToOutputCharset($userfee->firstname)." ".$outputlangs->convToOutputCharset($userfee->lastname),0,'L'); $pdf->SetXY($posx+2,$posy);
$posy+=5; $pdf->MultiCell(96,4,$outputlangs->transnoentities("MOTIF_REFUS")." : ".$outputlangs->convToOutputCharset($object->detail_refuse),0,'L');
$pdf->SetXY($posx+2,$posy); $posy+=5;
$pdf->MultiCell(96,4,$outputlangs->transnoentities("MOTIF_REFUS")." : ".$outputlangs->convToOutputCharset($object->detail_refuse),0,'L'); $pdf->SetXY($posx+2,$posy);
$posy+=5; $pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_REFUS")." : ".dol_print_date($object->date_refuse,"day",false,$outpulangs),0,'L');
$pdf->SetXY($posx+2,$posy); }
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_REFUS")." : ".dol_print_date($object->date_refuse,"day",false,$outpulangs),0,'L'); }
elseif($object->fk_c_expensereport_statuts==4): else if($object->fk_c_expensereport_statuts==4)
$userfee=new User($this->db); {
$userfee->fetch($object->fk_user_cancel); $posy+=6; if ($object->fk_user_cancel > 0)
$pdf->SetXY($posx+2,$posy); {
$pdf->MultiCell(96,4,$outputlangs->transnoentities("CANCEL_USER")." : ".$outputlangs->convToOutputCharset($userfee->firstname)." ".$outputlangs->convToOutputCharset($userfee->lastname),0,'L'); $userfee=new User($this->db);
$posy+=5; $userfee->fetch($object->fk_user_cancel); $posy+=6;
$pdf->SetXY($posx+2,$posy); $pdf->SetXY($posx+2,$posy);
$pdf->MultiCell(96,4,$outputlangs->transnoentities("MOTIF_CANCEL")." : ".$outputlangs->convToOutputCharset($object->detail_cancel),0,'L'); $pdf->MultiCell(96,4,$outputlangs->transnoentities("CANCEL_USER")." : ".dolGetFirstLastname($userfee->firstname,$userfee->lastname),0,'L');
$posy+=5; $posy+=5;
$pdf->SetXY($posx+2,$posy); $pdf->SetXY($posx+2,$posy);
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_CANCEL")." : ".dol_print_date($object->date_cancel,"day",false,$outpulangs),0,'L'); $pdf->MultiCell(96,4,$outputlangs->transnoentities("MOTIF_CANCEL")." : ".$outputlangs->convToOutputCharset($object->detail_cancel),0,'L');
else: $posy+=5;
$userfee=new User($this->db); $pdf->SetXY($posx+2,$posy);
$userfee->fetch($object->fk_user_validator); $posy+=6; $pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_CANCEL")." : ".dol_print_date($object->date_cancel,"day",false,$outpulangs),0,'L');
$pdf->SetXY($posx+2,$posy); }
$pdf->MultiCell(96,4,$outputlangs->transnoentities("VALIDOR")." : ".$outputlangs->convToOutputCharset($userfee->firstname)." ".$outputlangs->convToOutputCharset($userfee->lastname),0,'L'); }
$posy+=5; else
$pdf->SetXY($posx+2,$posy); {
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_VALIDE")." : ".dol_print_date($object->date_valide,"day",false,$outpulangs),0,'L'); if ($object->fk_user_approve > 0)
endif; {
$userfee=new User($this->db);
$userfee->fetch($object->fk_user_approve); $posy+=6;
$pdf->SetXY($posx+2,$posy);
$pdf->MultiCell(96,4,$outputlangs->transnoentities("VALIDOR")." : ".dolGetFirstLastname($userfee->firstname,$userfee->lastname),0,'L');
$posy+=5;
$pdf->SetXY($posx+2,$posy);
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DateApprove")." : ".dol_print_date($object->date_approve,"day",false,$outpulangs),0,'L');
}
}
if($object->fk_c_expensereport_statuts==6): if($object->fk_c_expensereport_statuts==6)
$userfee=new User($this->db); {
$userfee->fetch($object->fk_user_paid); $posy+=6; if ($object->fk_user_paid > 0)
$pdf->SetXY($posx+2,$posy); {
$pdf->MultiCell(96,4,$outputlangs->transnoentities("AUTHORPAIEMENT")." : ".$outputlangs->convToOutputCharset($userfee->firstname)." ".$outputlangs->convToOutputCharset($userfee->lastname),0,'L'); $userfee=new User($this->db);
$posy+=5; $userfee->fetch($object->fk_user_paid); $posy+=6;
$pdf->SetXY($posx+2,$posy); $pdf->SetXY($posx+2,$posy);
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_PAIEMENT")." : ".dol_print_date($object->date_paiement,"day",false,$outpulangs),0,'L'); $pdf->MultiCell(96,4,$outputlangs->transnoentities("AUTHORPAIEMENT")." : ".dolGetFirstLastname($userfee->firstname,$userfee->lastname),0,'L');
endif; $posy+=5;
$pdf->SetXY($posx+2,$posy);
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_PAIEMENT")." : ".dol_print_date($object->date_paiement,"day",false,$outpulangs),0,'L');
}
}
} }
@ -690,48 +735,48 @@ class pdf_ extends ModeleExpenseReport
$pdf->SetFont('','',8); $pdf->SetFont('','',8);
//Piece comptable //Piece comptable
$pdf->SetXY ($this->posxpiece-1, $tab_top+1); $pdf->SetXY($this->posxpiece-1, $tab_top+1);
$pdf->MultiCell($this->posxpiece-$this->posxpiece-1,1,$outputlangs->transnoentities("Piece"),'','L'); $pdf->MultiCell($this->posxdesc-$this->posxpiece-1,1,'','','R');
//Comments //Comments
$pdf->line($this->posxdesc-1, $tab_top, $this->posxdesc-1, $tab_top + $tab_height); $pdf->line($this->posxdesc-1, $tab_top, $this->posxdesc-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxdesc-1, $tab_top+1); $pdf->SetXY($this->posxdesc-1, $tab_top+1);
$pdf->MultiCell($this->posxdate-$this->posxdesc-1,1,$outputlangs->transnoentities("Description"),'','L'); $pdf->MultiCell($this->posxdate-$this->posxdesc-1,1,$outputlangs->transnoentities("Description"),'','L');
//Date //Date
$pdf->line($this->posxdate-1, $tab_top, $this->posxdate-1, $tab_top + $tab_height); $pdf->line($this->posxdate-1, $tab_top, $this->posxdate-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxdate-1, $tab_top+1); $pdf->SetXY($this->posxdate-1, $tab_top+1);
$pdf->MultiCell($this->posxtype-$this->posxdate-1,2, $outputlangs->transnoentities("Date"),'','C'); $pdf->MultiCell($this->posxtype-$this->posxdate-1,2, $outputlangs->transnoentities("Date"),'','C');
//Type //Type
$pdf->line($this->posxtype-1, $tab_top, $this->posxtype-1, $tab_top + $tab_height); $pdf->line($this->posxtype-1, $tab_top, $this->posxtype-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxtype-1, $tab_top+1); $pdf->SetXY($this->posxtype-1, $tab_top+1);
$pdf->MultiCell($this->posxprojet-$this->posxtype-1,2, $outputlangs->transnoentities("Type"),'','C'); $pdf->MultiCell($this->posxprojet-$this->posxtype-1,2, $outputlangs->transnoentities("Type"),'','C');
// Projet // Projet
$pdf->line($this->posxprojet-1, $tab_top, $this->posxprojet-1, $tab_top + $tab_height); $pdf->line($this->posxprojet-1, $tab_top, $this->posxprojet-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxprojet-1, $tab_top+1); $pdf->SetXY($this->posxprojet-1, $tab_top+1);
$pdf->MultiCell($this->posxtva-$this->posxprojet-1,2, $outputlangs->transnoentities("Project"),'','C'); $pdf->MultiCell($this->posxtva-$this->posxprojet-1,2, $outputlangs->transnoentities("Project"),'','C');
//TVA //TVA
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxtva-1, $tab_top+1); $pdf->SetXY($this->posxtva-1, $tab_top+1);
$pdf->MultiCell($this->posxup-$this->posxtva-1,2, $outputlangs->transnoentities("VAT"),'','C'); $pdf->MultiCell($this->posxup-$this->posxtva-1,2, $outputlangs->transnoentities("VAT"),'','C');
//PU //PU
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxup-1, $tab_top+1); $pdf->SetXY($this->posxup-1, $tab_top+1);
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PU"),'','C'); $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("UP"),'','C');
//QTY //QTY
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxqty-1, $tab_top+1); $pdf->SetXY($this->posxqty-1, $tab_top+1);
$pdf->MultiCell($this->postotalttc-$this->posxqty,2, $outputlangs->transnoentities("Q"),'','R'); $pdf->MultiCell($this->postotalttc-$this->posxqty,2, $outputlangs->transnoentities("Qty"),'','R');
//TOTALTTC //TOTALTTC
$pdf->line($this->postotalttc, $tab_top, $this->postotalttc, $tab_top + $tab_height); $pdf->line($this->postotalttc, $tab_top, $this->postotalttc, $tab_top + $tab_height);
$pdf->SetXY ($this->postotalttc-4, $tab_top+1); $pdf->SetXY($this->postotalttc-1, $tab_top+1);
$pdf->MultiCell(28,2, $outputlangs->transnoentities("TotalTTC"),'','R'); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalttc, 2, $outputlangs->transnoentities("TotalTTC"),'','R');
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
} }
@ -747,7 +792,8 @@ class pdf_ extends ModeleExpenseReport
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'DEPLACEMENT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'EXPENSEREPORT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -3,7 +3,7 @@
* *
* 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
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -13,7 +13,6 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
@ -49,62 +48,20 @@ class ModeleExpenseReport extends CommonDocGenerator
} }
function expensereport_pdf_create($db, $id, $message, $modele, $outputlangs) /**
* expensereport_pdf_create
*
* @param DoliDB $db Database handler
* @param Object $object Object order
* @param string $message Message
* @param string $modele Force le modele a utiliser ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
*/
function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{ {
global $conf,$langs; return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
$langs->load("trips");
// Increase limit for PDF build
$err=error_reporting();
error_reporting(0);
@set_time_limit(120);
error_reporting($err);
$dir = dol_buildpath('/expensereport/core/modules/expensereport/');
// Positionne modele sur le nom du modele a utiliser
if (! strlen($modele))
{
if ($conf->global->DEPLACEMENT_ADDON_PDF)
{
$modele = $conf->global->DEPLACEMENT_ADDON_PDF;
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_DEPLACEMENT_ADDON_PDF_NotDefined");
return 0;
}
}
// Charge le modele
$file = "pdf_".$modele.".modules.php";
if (file_exists($dir.$file))
{
$classname = "pdf_".$modele;
require_once($dir.$file);
$obj = new $classname($db);
$obj->message = $message;
// We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8.
$sav_charset_output=$outputlangs->charset_output;
if ($obj->write_file($id, $outputlangs) > 0)
{
$outputlangs->charset_output=$sav_charset_output;
return 1;
}
else
{
$outputlangs->charset_output=$sav_charset_output;
dol_print_error($db,"expensereport_pdf_create Error: ".$obj->error);
return -1;
}
}
else
{
dol_print_error('',$langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$dir.$file));
return -1;
}
} }

View File

@ -414,21 +414,34 @@ class ImportCsv extends ModeleImports
if (! empty($objimport->array_import_convertvalue[0][$val])) if (! empty($objimport->array_import_convertvalue[0][$val]))
{ {
//print 'Must convert '.$newval.' with rule '.join(',',$objimport->array_import_convertvalue[0][$val]).'. '; //print 'Must convert '.$newval.' with rule '.join(',',$objimport->array_import_convertvalue[0][$val]).'. ';
if ($objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeid' || $objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromref') if ($objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeid'
|| $objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromref'
|| $objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeorlabel'
)
{ {
if (! is_numeric($newval) && $newval != '') // If value into input import file is not a numeric, we apply the function defined into descriptor if (! is_numeric($newval) && $newval != '') // If value into input import file is not a numeric, we apply the function defined into descriptor
{ {
$file=$objimport->array_import_convertvalue[0][$val]['classfile']; $file=$objimport->array_import_convertvalue[0][$val]['classfile'];
$class=$objimport->array_import_convertvalue[0][$val]['class']; $class=$objimport->array_import_convertvalue[0][$val]['class'];
$method=$objimport->array_import_convertvalue[0][$val]['method']; $method=$objimport->array_import_convertvalue[0][$val]['method'];
if (empty($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval])) if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] != '')
{ {
$newval=$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval];
}
else
{
dol_include_once($file); dol_include_once($file);
$classinstance=new $class($this->db); $classinstance=new $class($this->db);
// Try the fetch from code or ref
call_user_func_array(array($classinstance, $method),array('', $newval)); call_user_func_array(array($classinstance, $method),array('', $newval));
// If not found, try the fetch from label
if (! ($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeorlabel')
{
call_user_func_array(array($classinstance, $method),array('', '', $newval));
}
$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval]=$classinstance->id; $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval]=$classinstance->id;
//print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. '; //print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. ';
if (! empty($classinstance->id)) if ($classinstance->id != '') // id may be 0, it is a found value
{ {
$newval=$classinstance->id; $newval=$classinstance->id;
} }
@ -442,10 +455,6 @@ class ImportCsv extends ModeleImports
$error++; $error++;
} }
} }
else
{
$newval=$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval];
}
} }
} }

View File

@ -393,7 +393,7 @@ class modAgenda extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp on ac.fk_contact = sp.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp on ac.fk_contact = sp.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s on ac.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s on ac.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co on s.fk_pays = co.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co on s.fk_pays = co.rowid';
$this->export_sql_end[$r] .=' Where ac.entity = '.$conf->entity; $this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda',1).')';
$this->export_sql_end[$r] .=' ORDER BY ac.datep'; $this->export_sql_end[$r] .=' ORDER BY ac.datep';
} }

View File

@ -157,7 +157,7 @@ class modBanque extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."bank_url as bu ON (bu.fk_bank = b.rowid AND bu.type = 'company')"; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."bank_url as bu ON (bu.fk_bank = b.rowid AND bu.type = 'company')";
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON bu.url_id = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON bu.url_id = s.rowid';
$this->export_sql_end[$r] .=' WHERE ba.rowid = b.fk_account'; $this->export_sql_end[$r] .=' WHERE ba.rowid = b.fk_account';
$this->export_sql_end[$r] .=' AND ba.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND ba.entity IN ('.getEntity('bank',1).')';
$this->export_sql_order[$r] =' ORDER BY b.datev, b.num_releve'; $this->export_sql_order[$r] =' ORDER BY b.datev, b.num_releve';
$r++; $r++;
@ -184,7 +184,7 @@ class modBanque extends DolibarrModules
$this->export_sql_end[$r] .=' WHERE ba.rowid = b.fk_account AND bch.rowid = b.fk_bordereau and bch.fk_bank_account=ba.rowid'; $this->export_sql_end[$r] .=' WHERE ba.rowid = b.fk_account AND bch.rowid = b.fk_bordereau and bch.fk_bank_account=ba.rowid';
$this->export_sql_end[$r] .=" AND b.fk_type = 'CHQ'"; $this->export_sql_end[$r] .=" AND b.fk_type = 'CHQ'";
$this->export_sql_end[$r] .=' AND p.fk_paiement = 7'; $this->export_sql_end[$r] .=' AND p.fk_paiement = 7';
$this->export_sql_end[$r] .=' AND ba.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND ba.entity IN ('.getEntity('bank',1).')';
$this->export_sql_order[$r] =' ORDER BY b.datev, b.num_releve'; $this->export_sql_order[$r] =' ORDER BY b.datev, b.num_releve';
} }

View File

@ -122,7 +122,7 @@ class modCategorie extends DolibarrModules
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_fournisseur as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_fournisseur as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code';
$this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid'; $this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid';
$this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND u.entity IN ('.getEntity('category',1).')';
$this->export_sql_end[$r] .=' AND u.type = 1'; // Supplier categories $this->export_sql_end[$r] .=' AND u.type = 1'; // Supplier categories
$r++; $r++;
@ -137,7 +137,7 @@ class modCategorie extends DolibarrModules
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code';
$this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid'; $this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid';
$this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND u.entity IN ('.getEntity('category',1).')';
$this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories $this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories
$r++; $r++;
@ -152,7 +152,7 @@ class modCategorie extends DolibarrModules
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_product as cp, '.MAIN_DB_PREFIX.'product as p'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_product as cp, '.MAIN_DB_PREFIX.'product as p';
$this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_product = p.rowid'; $this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_product = p.rowid';
$this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND u.entity IN ('.getEntity('category',1).')';
$this->export_sql_end[$r] .=' AND u.type = 0'; // Supplier categories $this->export_sql_end[$r] .=' AND u.type = 0'; // Supplier categories
$r++; $r++;
@ -167,8 +167,8 @@ class modCategorie extends DolibarrModules
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_member as cp, '.MAIN_DB_PREFIX.'adherent as p'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_member as cp, '.MAIN_DB_PREFIX.'adherent as p';
$this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_member = p.rowid'; $this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_member = p.rowid';
$this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND u.entity IN ('.getEntity('category',1).')';
$this->export_sql_end[$r] .=' AND u.type = 3'; // Supplier categories $this->export_sql_end[$r] .=' AND u.type = 3'; // Member categories
$r++; $r++;
$this->export_code[$r]='category_'.$r; $this->export_code[$r]='category_'.$r;
@ -232,7 +232,7 @@ class modCategorie extends DolibarrModules
$this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p'; $this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p';
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_country as country ON p.fk_pays = country.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_country as country ON p.fk_pays = country.rowid';
$this->export_sql_end[$r] .= ' WHERE u.rowid = cp.fk_categorie AND cp.fk_socpeople = p.rowid AND u.entity = ' . $conf->entity; $this->export_sql_end[$r] .= ' WHERE u.rowid = cp.fk_categorie AND cp.fk_socpeople = p.rowid AND u.entity IN ('.getEntity('category',1).')';
$this->export_sql_end[$r] .= ' AND u.type = 4'; // contact categories $this->export_sql_end[$r] .= ' AND u.type = 4'; // contact categories
// Imports // Imports

View File

@ -192,7 +192,7 @@ class modCommande extends DolibarrModules
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commandedet as cd'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commandedet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
$this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande';
$this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('commande',1).')';
} }

View File

@ -42,7 +42,7 @@ class modContrat extends DolibarrModules
function __construct($db) function __construct($db)
{ {
global $conf; global $conf;
$this->db = $db; $this->db = $db;
$this->numero = 54; $this->numero = 54;
@ -160,9 +160,9 @@ class modContrat extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'contrat as co,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'contrat as co,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'contratdet as cod'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'contratdet as cod';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cod.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cod.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE co.fk_soc = s.rowid and co.rowid = cod.fk_contrat'; $this->export_sql_end[$r] .=' WHERE co.fk_soc = s.rowid and co.rowid = cod.fk_contrat';
$this->export_sql_end[$r] .=' AND co.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND co.entity IN ('.getEntity('contract',1).')';
} }

View File

@ -124,7 +124,7 @@ class modDeplacement extends DolibarrModules
$this->export_sql_end[$r] .=', '.MAIN_DB_PREFIX.'deplacement as d'; $this->export_sql_end[$r] .=', '.MAIN_DB_PREFIX.'deplacement as d';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON d.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON d.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' WHERE d.fk_user = u.rowid'; $this->export_sql_end[$r] .=' WHERE d.fk_user = u.rowid';
$this->export_sql_end[$r] .=' AND d.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('deplacement',1).')';
} }

View File

@ -229,7 +229,7 @@ class modExpedition extends DolibarrModules
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'expeditiondet as ed, '.MAIN_DB_PREFIX.'commandedet as cd'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'expeditiondet as ed, '.MAIN_DB_PREFIX.'commandedet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
$this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid';
$this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('shipment',1).')';
} }

View File

@ -4,7 +4,7 @@
* *
* 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
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -14,7 +14,6 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/ */
/** /**
@ -50,8 +49,6 @@ class modExpenseReport extends DolibarrModules
// Id for module (must be unique). // Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
$this->numero = 770; $this->numero = 770;
// Key text used to identify module (for permissions, menus, etc...)
$this->rights_class = 'deplacement';
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page // It is used to group modules in module setup page
@ -83,21 +80,29 @@ class modExpenseReport extends DolibarrModules
//$this->style_sheet = '/mymodule/mymodule.css.php'; //$this->style_sheet = '/mymodule/mymodule.css.php';
// Config pages. Put here list of php page names stored in admmin directory used to setup module. // Config pages. Put here list of php page names stored in admmin directory used to setup module.
$this->config_page_url = array(); $this->config_page_url = array('expensereport.php');
// Dependencies // Dependencies
$this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->depends = array(); // List of modules id that must be enabled if this module is enabled
// $this->conflictwith = array("modDeplacement"); $this->conflictwith = array("modDeplacement");
$this->requiredby = array(); // List of modules id to disable if this one is disabled $this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->phpmin = array(4,3); // Minimum version of PHP required by module $this->phpmin = array(4,3); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(3,7); // Minimum version of Dolibarr required by module
$this->langfiles = array("companies","trips","deplacement@deplacement"); $this->langfiles = array("companies","trips");
// Constants // Constants
// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0),
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) ); // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );
// 2=>array('MAIN_MODULE_MYMODULE_NEEDSMARTY','chaine',1,'Constant to say module need smarty',0) // 2=>array('MAIN_MODULE_MYMODULE_NEEDSMARTY','chaine',1,'Constant to say module need smarty',0)
$this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities') $this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities')
$r=0;
$this->const[$r][0] = "EXPENSEREPORT_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "standard";
$this->const[$r][3] = 'Name of manager to build PDF expense reports documents';
$this->const[$r][4] = 0;
$r++;
// Array to add new pages in new tabs // Array to add new pages in new tabs
$this->tabs = array(); $this->tabs = array();
@ -162,7 +167,7 @@ class modExpenseReport extends DolibarrModules
$this->rights[6][1] = 'Approve expense reports'; $this->rights[6][1] = 'Approve expense reports';
$this->rights[6][2] = 'w'; $this->rights[6][2] = 'w';
$this->rights[6][3] = 0; $this->rights[6][3] = 0;
$this->rights[6][4] = 'to_validate'; $this->rights[6][4] = 'approve';
$this->rights[7][0] = 776; $this->rights[7][0] = 776;
$this->rights[7][1] = 'Pay expense reports'; $this->rights[7][1] = 'Pay expense reports';
@ -195,19 +200,21 @@ class modExpenseReport extends DolibarrModules
$r=0; $r=0;
$r++; $r++;
$this->export_code[$r]='trips_'.$r; $this->export_code[$r]='expensereport_'.$r;
$this->export_label[$r]='ListTripsAndExpenses'; $this->export_label[$r]='ListTripsAndExpenses';
$this->export_icon[$r]='trip';
$this->export_permission[$r]=array(array("expensereport","export")); $this->export_permission[$r]=array(array("expensereport","export"));
$this->export_fields_array[$r]=array('d.rowid'=>"TripId",'d.type'=>"Type",'d.km'=>"FeesKilometersOrAmout",'d.note'=>'NotePrivate','d.note_public'=>'NotePublic','s.nom'=>'ThirdParty','u.lastname'=>'Lastname','u.firstname'=>'Firstname','d.dated'=>"Date"); $this->export_fields_array[$r]=array('d.rowid'=>"TripId",'d.ref'=>'Ref','d.date_debut'=>'DateStart','d.date_fin'=>'DateEnd','d.date_create'=>'DateCreation','d.date_approve'=>'DateApprove','d.total_ht'=>"TotalHT",'d.total_tva'=>'TotalVAT','d.total_ttc'=>'TotalTTC','d.note_private'=>'NotePrivate','d.note_public'=>'NotePublic','u.lastname'=>'Lastname','u.firstname'=>'Firstname','u.login'=>"Login",'ed.rowid'=>'LineId','tf.code'=>'Type','ed.date'=>'Date','ed.fk_c_tva'=>'VATRate','ed.total_ht'=>'TotalHT','ed.total_tva'=>'TotalVAT','ed.total_ttc'=>'TotalTTC','ed.comments'=>'Comment','p.rowid'=>'ProjectId','p.ref'=>'Ref');
$this->export_entities_array[$r]=array('d.rowid'=>"Trip",'d.type'=>"Trip",'d.km'=>"Trip",'d.note'=>'Trip','d.note_public'=>'Trip','s.nom'=>'company','u.lastname'=>'user','u.firstname'=>'user','d.dated'=>"Date"); $this->export_entities_array[$r]=array('u.lastname'=>'user','u.firstname'=>'user','u.login'=>'user','ed.rowid'=>'expensereport_line','ed.date'=>'expensereport_line','ed.fk_c_tva'=>'expensereport_line','ed.total_ht'=>'expensereport_line','ed.total_tva'=>'expensereport_line','ed.total_ttc'=>'expensereport_line','ed.comments'=>'expensereport_line','tf.code'=>'expensereport_line','p.project_ref'=>'expensereport_line','p.rowid'=>'project','p.ref'=>'project');
$this->export_alias_array[$r]=array('d.rowid'=>"idtrip",'d.type'=>"type",'d.km'=>"km",'d.note'=>'note','d.note_public'=>'note_public','s.nom'=>'companyname','u.lastname'=>'name','u.firstname'=>'firstname','d.dated'=>'date'); $this->export_alias_array[$r]=array('d.rowid'=>"idtrip",'d.type'=>"type",'d.note_private'=>'note_private','d.note_public'=>'note_public','u.lastname'=>'name','u.firstname'=>'firstname','u.login'=>'login');
$this->export_dependencies_array[$r]=array('expensereport_line'=>'ed.rowid','type_fees'=>'tf.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'user as u'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'expensereport as d, '.MAIN_DB_PREFIX.'user as u,';
$this->export_sql_end[$r] .=', '.MAIN_DB_PREFIX.'expensereport as d'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'expensereport_det as ed LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as tf ON ed.fk_c_type_fees = tf.id';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON d.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON ed.fk_projet = p.rowid';
$this->export_sql_end[$r] .=' WHERE d.fk_user = u.rowid'; $this->export_sql_end[$r] .=' WHERE ed.fk_expensereport = d.rowid AND d.fk_user_author = u.rowid';
$this->export_sql_end[$r] .=' AND d.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('expensereport',1).')';
@ -216,87 +223,102 @@ class modExpenseReport extends DolibarrModules
$r=0; $r=0;
// Example to declare a Left Menu entry: fk_mainmenu=home,fk_leftmenu=modulesadmintools // Example to declare a Left Menu entry: fk_mainmenu=home,fk_leftmenu=modulesadmintools
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=accountancy', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry 'type'=>'left', // This is a Left menu entry
'titre'=>'TripsAndExpenses', 'titre'=>'TripsAndExpenses',
'mainmenu'=>'accountancy', 'mainmenu'=>'hrm',
'leftmenu'=>'expensereport', 'leftmenu'=>'expensereport',
'url'=>'/expensereport/index.php', 'url'=>'/expensereport/index.php',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100, 'position'=>100,
'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++; $r++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=accountancy,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry 'type'=>'left', // This is a Left menu entry
'titre'=>'New', 'titre'=>'New',
'mainmenu'=>'accountancy', 'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detail', 'leftmenu'=>'expensereport_detailnew',
'url'=>'/expensereport/card.php?action=create', 'url'=>'/expensereport/card.php?action=create',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100, 'position'=>100,
'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'perms'=>'$user->rights->expensereport->creer', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++; $r++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=accountancy,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry 'type'=>'left', // This is a Left menu entry
'titre'=>'List', 'titre'=>'List',
'mainmenu'=>'accountancy', 'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detail', 'leftmenu'=>'expensereport_detaillist',
'url'=>'/expensereport/list.php', 'url'=>'/expensereport/list.php',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100, 'position'=>100,
'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++; $r++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=accountancy,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport_detaillist', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry
'titre'=>'ListToApprove',
'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detaillist_approve',
'url'=>'/expensereport/list.php?search_state=2',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100,
'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'$user->rights->expensereport->approve', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry 'type'=>'left', // This is a Left menu entry
'titre'=>'Statistics', 'titre'=>'Statistics',
'mainmenu'=>'accountancy', 'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detail', 'leftmenu'=>'expensereport_detail',
'url'=>'/expensereport/stats/index.php', 'url'=>'/expensereport/stats/index.php',
'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100, 'position'=>100,
'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++; $r++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=accountancy,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) // Disabled, not yet stable
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry 'type'=>'left', // This is a Left menu entry
'titre'=>'ExportTripCSV', 'titre'=>'ExportTripCSV',
'mainmenu'=>'accountancy', 'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detail', 'leftmenu'=>'expensereport_detail',
'url'=>'/expensereport/export_csv.php', 'url'=>'/expensereport/export_csv.php',
'langs'=>'expensereport', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'expensereport', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100, 'position'=>100,
'enabled'=>'$conf->global->DEPLACEMENT_TO_CLEAN', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'$conf->global->DEPLACEMENT_TO_CLEAN', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++; $r++;
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=accountancy,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
'type'=>'left', // This is a Left menu entry 'type'=>'left', // This is a Left menu entry
'titre'=>'Synchro_Compta', 'titre'=>'Synchro_Compta',
'mainmenu'=>'accountancy', 'mainmenu'=>'hrm',
'leftmenu'=>'expensereport_detail', 'leftmenu'=>'expensereport_detail',
'url'=>'/expensereport/synchro_compta.php', 'url'=>'/expensereport/synchro_compta.php',
'langs'=>'expensereport', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'expensereport', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100, 'position'=>100,
'enabled'=>'$conf->global->DEPLACEMENT_TO_CLEAN', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. 'enabled'=>'$conf->global->DEPLACEMENT_TO_CLEAN', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++; $r++;
@ -314,13 +336,12 @@ class modExpenseReport extends DolibarrModules
{ {
global $conf; global $conf;
// Remove permissions and default values
$this->remove($options); $this->remove($options);
$result=$this->_load_tables('/deplacement/sql/');
$sql = array( $sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'teclib' AND entity = ".$conf->entity, "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('teclib','deplacement',".$conf->entity.")" "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard','deplacement',".$conf->entity.")"
); );
return $this->_init($sql,$options); return $this->_init($sql,$options);
@ -340,6 +361,4 @@ class modExpenseReport extends DolibarrModules
return $this->_remove($sql,$options); return $this->_remove($sql,$options);
} }
}
}

View File

@ -228,7 +228,7 @@ class modFacture extends DolibarrModules
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facturedet as fd'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facturedet as fd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture';
$this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('facture',1).')';
$r++; $r++;
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
@ -284,7 +284,7 @@ class modFacture extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('facture',1).')';
$r++; $r++;
} }

View File

@ -147,7 +147,7 @@ class modFicheinter extends DolibarrModules
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'fichinter as f, '.MAIN_DB_PREFIX.'fichinterdet as fd, '.MAIN_DB_PREFIX.'societe as s)'; $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'fichinter as f, '.MAIN_DB_PREFIX.'fichinterdet as fd, '.MAIN_DB_PREFIX.'societe as s)';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_fichinter'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_fichinter';
$this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('intervention',1).')';
$r++; $r++;
} }

View File

@ -297,7 +297,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facture_fourn_det as fd'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facture_fourn_det as fd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn';
$this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
$r++; $r++;
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
@ -351,7 +351,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
$r++; $r++;
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
@ -369,7 +369,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f, '.MAIN_DB_PREFIX.'commande_fournisseurdet as fd'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f, '.MAIN_DB_PREFIX.'commande_fournisseurdet as fd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande';
$this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_order',1).')';
} }

View File

@ -81,7 +81,7 @@ class modMargin extends DolibarrModules
// New pages on tabs // New pages on tabs
$this->tabs = array( $this->tabs = array(
'product:+margin:Margins:margins:$user->rights->margins->liretous:/margin/tabs/productMargins.php?id=__ID__', 'product:+margin:Margins:margins:$user->rights->margins->liretous:/margin/tabs/productMargins.php?id=__ID__',
'thirdparty:+margin:Margins:margins:empty($user->societe_id) && $user->rights->margins->liretous:/margin/tabs/thirdpartyMargins.php?socid=__ID__' 'thirdparty:+margin:Margins:margins:empty($user->societe_id) && $user->rights->margins->liretous && ($societe->client > 0):/margin/tabs/thirdpartyMargins.php?socid=__ID__'
); );

View File

@ -94,21 +94,21 @@ class modProjet extends DolibarrModules
$this->const[$r][3] = ""; $this->const[$r][3] = "";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
$this->const[$r][0] = "PROJECT_TASK_ADDON_PDF"; $this->const[$r][0] = "PROJECT_TASK_ADDON_PDF";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = ""; $this->const[$r][2] = "";
$this->const[$r][3] = 'Name of PDF/ODT tasks manager class'; $this->const[$r][3] = 'Name of PDF/ODT tasks manager class';
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
$this->const[$r][0] = "PROJECT_TASK_ADDON"; $this->const[$r][0] = "PROJECT_TASK_ADDON";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_task_simple"; $this->const[$r][2] = "mod_task_simple";
$this->const[$r][3] = 'Name of Numbering Rule task manager class'; $this->const[$r][3] = 'Name of Numbering Rule task manager class';
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
$this->const[$r][0] = "PROJECT_TASK_ADDON_PDF_ODT_PATH"; $this->const[$r][0] = "PROJECT_TASK_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/tasks"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/tasks";
@ -155,7 +155,7 @@ class modProjet extends DolibarrModules
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'export'; $this->rights[$r][4] = 'export';
$r++; $r++;
$this->rights[$r][0] = 141; // id de la permission $this->rights[$r][0] = 141; // id de la permission
$this->rights[$r][1] = "Lire tous les projets et tâches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission $this->rights[$r][1] = "Lire tous les projets et tâches (y compris prives qui ne me sont pas affectes)"; // libelle de la permission
@ -189,7 +189,7 @@ class modProjet extends DolibarrModules
$this->export_label[$r]='ProjectsAndTasksLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='ProjectsAndTasksLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("projet","export")); $this->export_permission[$r]=array(array("projet","export"));
$this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid'); $this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid');
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label', $this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text", 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text",
@ -199,11 +199,11 @@ class modProjet extends DolibarrModules
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company', $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',
's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company', 's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
'p.rowid'=>"project",'p.ref'=>"project",'p.datec'=>"project",'p.dateo'=>"project",'p.datee'=>"project",'p.duree'=>"project",'p.fk_statut'=>"project",'p.description'=>"project"); 'p.rowid'=>"project",'p.ref'=>"project",'p.datec'=>"project",'p.dateo'=>"project",'p.datee'=>"project",'p.duree'=>"project",'p.fk_statut'=>"project",'p.description'=>"project");
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country', $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country',
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
'p.rowid'=>"ProjectId",'p.ref'=>"RefProject",'p.datec'=>"DateCreation",'p.dateo'=>"DateStart",'p.datee'=>"DateEnd",'p.fk_statut'=>'Status','p.description'=>"Description"); 'p.rowid'=>"ProjectId",'p.ref'=>"RefProject",'p.datec'=>"DateCreation",'p.dateo'=>"DateStart",'p.datee'=>"DateEnd",'p.fk_statut'=>'Status','p.description'=>"Description");
// Add fields for project // Add fields for project
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array()); $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array());
// Add extra fields // Add extra fields
@ -239,7 +239,7 @@ class modProjet extends DolibarrModules
$this->export_entities_array[$r][$fieldname]='project'; $this->export_entities_array[$r][$fieldname]='project';
} }
} }
// End add extra fields // End add extra fields
// Add fields for tasks // Add fields for tasks
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateStart",'pt.datee'=>"TaskDateEnd",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"PlannedWorkload",'pt.progress'=>"Progress",'pt.description'=>"TaskDescription")); $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateStart",'pt.datee'=>"TaskDateEnd",'pt.duration_effective'=>"DurationEffective",'pt.planned_workload'=>"PlannedWorkload",'pt.progress'=>"Progress",'pt.description'=>"TaskDescription"));
@ -277,10 +277,10 @@ class modProjet extends DolibarrModules
$this->export_entities_array[$r][$fieldname]='projecttask'; $this->export_entities_array[$r][$fieldname]='projecttask';
} }
} }
// End add extra fields // End add extra fields
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('ptt.task_date'=>'TaskTimeDate','ptt.task_duration'=>"TimesSpent",'ptt.fk_user'=>"TaskTimeUser",'ptt.note'=>"TaskTimeNote")); $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('ptt.task_date'=>'TaskTimeDate','ptt.task_duration'=>"TimesSpent",'ptt.fk_user'=>"TaskTimeUser",'ptt.note'=>"TaskTimeNote"));
$this->export_entities_array[$r]=array_merge($this->export_entities_array[$r], array('ptt.task_date'=>'task_time','ptt.task_duration'=>"task_time",'ptt.fk_user'=>"task_time",'ptt.note'=>"task_time")); $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r], array('ptt.task_date'=>'task_time','ptt.task_duration'=>"task_time",'ptt.fk_user'=>"task_time",'ptt.note'=>"task_time"));
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'projet as p'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'projet as p';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_extrafields as extra ON p.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_extrafields as extra ON p.rowid = extra.fk_object';
@ -289,7 +289,7 @@ class modProjet extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task,"; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task,";
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' AND p.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND p.entity IN ('.getEntity('project',1).')';
} }
@ -344,12 +344,12 @@ class modProjet extends DolibarrModules
return 0; return 0;
} }
} }
$sql = array( $sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity, "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','invoice',".$conf->entity.")" "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','invoice',".$conf->entity.")"
); );
$sql = array( $sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity, "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','project',".$conf->entity.")", "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','project',".$conf->entity.")",

View File

@ -186,7 +186,7 @@ class modPropale extends DolibarrModules
$this->export_sql_end[$r] .=', '.MAIN_DB_PREFIX.'propaldet as cd'; $this->export_sql_end[$r] .=', '.MAIN_DB_PREFIX.'propaldet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_propal'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_propal';
$this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('propal',1).')';
} }

View File

@ -132,21 +132,7 @@ class modSalaries extends DolibarrModules
// Exports // Exports
//-------- //--------
$r=0; $r=0;
/*
$r++;
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Payment of salaries';
$this->export_permission[$r]=array(array("tax","charges","export"));
$this->export_fields_array[$r]=array('cc.libelle'=>"Type",'c.rowid'=>"IdSocialContribution",'c.libelle'=>"Label",'c.date_ech'=>'DateDue','c.periode'=>'Period','c.amount'=>"AmountExpected","c.paye"=>"Status",'p.rowid'=>'PaymentId','p.datep'=>'DatePayment','p.amount'=>'AmountPayment','p.num_paiement'=>'Numero');
$this->export_TypeFields_array[$r]=array('cc.libelle'=>"List:c_chargesociales:libelle:id",'c.libelle'=>"Text",'c.date_ech'=>'Date','c.periode'=>'Period','c.amount'=>"Number","c.paye"=>"Boolean",'p.datep'=>'Date','p.amount'=>'Number','p.num_paiement'=>'Number');
$this->export_entities_array[$r]=array('cc.libelle'=>"tax_type",'c.rowid'=>"tax",'c.libelle'=>'tax','c.date_ech'=>'tax','c.periode'=>'tax','c.amount'=>"tax","c.paye"=>"tax",'p.rowid'=>'payment','p.datep'=>'payment','p.amount'=>'payment','p.num_paiement'=>'payment');
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'c_chargesociales as cc, '.MAIN_DB_PREFIX.'chargesociales as c';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementcharge as p ON p.fk_charge = c.rowid';
$this->export_sql_end[$r] .=' WHERE c.fk_type = cc.id';
$this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity;
*/
} }

View File

@ -382,7 +382,7 @@ class modSociete extends DolibarrModules
$this->import_icon[$r]='company'; $this->import_icon[$r]='company';
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'societe','extra'=>MAIN_DB_PREFIX.'societe_extrafields'); // List of tables to insert into (insert done in same order) $this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'societe','extra'=>MAIN_DB_PREFIX.'societe_extrafields'); // List of tables to insert into (insert done in same order)
$this->import_fields_array[$r]=array('s.nom'=>"Name*",'s.status'=>"Status",'s.client'=>"Customer*",'s.fournisseur'=>"Supplier*",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"CustomerAccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_departement'=>"StateId",'s.fk_pays'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'s.fk_typent'=>"ThirdPartyType",'s.fk_effectif'=>"Staff","s.fk_forme_juridique"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','s.default_lang'=>'DefaultLanguage','s.barcode'=>'BarCode','s.datec'=>"DateCreation"); $this->import_fields_array[$r]=array('s.nom'=>"Name*",'s.status'=>"Status",'s.client'=>"Customer*",'s.fournisseur'=>"Supplier*",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"CustomerAccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_departement'=>"StateId",'s.fk_pays'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.idprof5'=>"ProfId5",'s.idprof6'=>"ProfId6",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'s.fk_typent'=>"ThirdPartyType",'s.fk_effectif'=>"Staff","s.fk_forme_juridique"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','s.default_lang'=>'DefaultLanguage','s.barcode'=>'BarCode','s.datec'=>"DateCreation");
// Add extra fields // Add extra fields
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity = ".$conf->entity; $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity = ".$conf->entity;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -398,7 +398,7 @@ class modSociete extends DolibarrModules
// End add extra fields // End add extra fields
$this->import_fieldshidden_array[$r]=array('s.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'societe'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_fieldshidden_array[$r]=array('s.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'societe'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_convertvalue_array[$r]=array( $this->import_convertvalue_array[$r]=array(
's.fk_typent'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ctypent.class.php','class'=>'Ctypent','method'=>'fetch','dict'=>'DictionaryCompanyType'), 's.fk_typent'=>array('rule'=>'fetchidfromcodeorlabel','classfile'=>'/core/class/ctypent.class.php','class'=>'Ctypent','method'=>'fetch','dict'=>'DictionaryCompanyType'),
's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'), 's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'),
's.fk_stcomm'=>array('rule'=>'zeroifnull'), 's.fk_stcomm'=>array('rule'=>'zeroifnull'),
's.code_client'=>array('rule'=>'getcustomercodeifauto'), 's.code_client'=>array('rule'=>'getcustomercodeifauto'),
@ -407,8 +407,8 @@ class modSociete extends DolibarrModules
's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto') 's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto')
); );
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
$this->import_examplevalues_array[$r]=array('s.nom'=>"MyBigCompany",'s.status'=>"0 (closed) or 1 (active)",'s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1','s.datec'=>dol_print_date(dol_now(),'%Y-%m-%d'),'s.code_client'=>"CU01-0001 or empty or 'auto'",'s.code_fournisseur'=>"SU01-0001 or empty or 'auto'",'s.address'=>"61 jump street",'s.zip'=>"123456",'s.town'=>"Big town",'s.fk_pays'=>'US, FR, DE...','s.phone'=>"0101010101",'s.fax'=>"0101010102",'s.url'=>"http://mycompany.com",'s.email'=>"test@mycompany.com",'s.siret'=>"",'s.siren'=>"",'s.ape'=>"",'s.idprof4'=>"",'s.tva_intra'=>"FR0123456789",'s.capital'=>"10000",'s.note_private'=>"This is an example of private note for record",'s.note_public'=>"This is an example of public note for record",'s.fk_typent'=>"2",'s.fk_effectif'=>"3","s.fk_forme_juridique"=>"1",'s.fk_prospectlevel'=>'PL_MEDIUM','s.fk_stcomm'=>'0','s.default_lang'=>'en_US','s.barcode'=>'123456789'); $this->import_examplevalues_array[$r]=array('s.nom'=>"MyBigCompany",'s.status'=>"0 (closed) or 1 (active)",'s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1','s.datec'=>dol_print_date(dol_now(),'%Y-%m-%d'),'s.code_client'=>"CU01-0001 or empty or 'auto'",'s.code_fournisseur'=>"SU01-0001 or empty or 'auto'",'s.address'=>"61 jump street",'s.zip'=>"123456",'s.town'=>"Big town",'s.fk_pays'=>'US, FR, DE...','s.phone'=>"0101010101",'s.fax'=>"0101010102",'s.url'=>"http://mycompany.com",'s.email'=>"test@mycompany.com",'s.siret'=>"",'s.siren'=>"",'s.ape'=>"",'s.idprof4'=>"",'s.idprof5'=>"",'s.idprof6'=>"",'s.tva_intra'=>"FR0123456789",'s.capital'=>"10000",'s.note_private'=>"This is an example of private note for record",'s.note_public'=>"This is an example of public note for record",'s.fk_typent'=>"2",'s.fk_effectif'=>"3","s.fk_forme_juridique"=>"1",'s.fk_prospectlevel'=>'PL_MEDIUM','s.fk_stcomm'=>'0','s.default_lang'=>'en_US','s.barcode'=>'123456789','s.datec'=>"2015-01-01 or 2015-01-01 12:30:00");
// Import list of contact and attributes // Import list of contact and attributes
$r++; $r++;
@ -437,7 +437,7 @@ class modSociete extends DolibarrModules
's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'), 's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'),
); );
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r]=array('s.birthday'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_regex_array[$r]=array('s.birthday'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
$this->import_examplevalues_array[$r]=array('s.fk_soc'=>'MyBigCompany','s.civility'=>"MR",'s.lastname'=>"Smith",'s.firstname'=>'John','s.address'=>'61 jump street','s.zip'=>'75000','s.town'=>'Bigtown','s.fk_pays'=>'US, FR, DE...','s.datec'=>'1972-10-10','s.poste'=>"Director",'s.phone'=>"5551122",'s.phone_perso'=>"5551133",'s.phone_mobile'=>"5551144",'s.fax'=>"5551155",'s.email'=>"johnsmith@email.com",'s.note_private'=>"My private note",'s.note_public'=>"My public note"); $this->import_examplevalues_array[$r]=array('s.fk_soc'=>'MyBigCompany','s.civility'=>"MR",'s.lastname'=>"Smith",'s.firstname'=>'John','s.address'=>'61 jump street','s.zip'=>'75000','s.town'=>'Bigtown','s.fk_pays'=>'US, FR, DE...','s.datec'=>'1972-10-10','s.poste'=>"Director",'s.phone'=>"5551122",'s.phone_perso'=>"5551133",'s.phone_mobile'=>"5551144",'s.fax'=>"5551155",'s.email'=>"johnsmith@email.com",'s.note_private'=>"My private note",'s.note_public'=>"My public note");
// Import Bank Accounts // Import Bank Accounts

View File

@ -131,7 +131,7 @@ class modStock extends DolibarrModules
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e';
$this->export_sql_end[$r] .=' WHERE p.rowid = ps.fk_product AND ps.fk_entrepot = e.rowid'; $this->export_sql_end[$r] .=' WHERE p.rowid = ps.fk_product AND ps.fk_entrepot = e.rowid';
$this->export_sql_end[$r] .=' AND e.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND e.entity IN ('.getEntity('stock',1).')';
// Imports // Imports

View File

@ -133,7 +133,7 @@ class modTax extends DolibarrModules
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'c_chargesociales as cc, '.MAIN_DB_PREFIX.'chargesociales as c'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'c_chargesociales as cc, '.MAIN_DB_PREFIX.'chargesociales as c';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementcharge as p ON p.fk_charge = c.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementcharge as p ON p.fk_charge = c.rowid';
$this->export_sql_end[$r] .=' WHERE c.fk_type = cc.id'; $this->export_sql_end[$r] .=' WHERE c.fk_type = cc.id';
$this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('tax',1).')';
} }

View File

@ -220,7 +220,7 @@ class modUser extends DolibarrModules
} }
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'user as u'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'user as u';
$this->export_sql_end[$r] .=' WHERE u.entity IN (0,'.$conf->entity.')'; $this->export_sql_end[$r] .=' WHERE u.entity IN ('.getEntity('user',1).')';
} }

View File

@ -6,7 +6,7 @@
* *
* 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
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -16,7 +16,6 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/ */
/** /**

View File

@ -5,7 +5,7 @@
* *
* 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
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -15,7 +15,6 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/ */
/** /**
@ -25,16 +24,17 @@
$res=0; $res=0;
require '../main.inc.php'; require '../main.inc.php';
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'); require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formmail.class.php"); require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formprojet.class.php"); require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'); require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
require_once(DOL_DOCUMENT_ROOT."/core/lib/expensereport.lib.php"); require_once DOL_DOCUMENT_ROOT . '/core/lib/expensereport.lib.php';
require_once(DOL_DOCUMENT_ROOT."/core/lib/price.lib.php"); require_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php';
dol_include_once('/expensereport/core/modules/expensereport/modules_expensereport.php'); require_once DOL_DOCUMENT_ROOT . '/core/modules/expensereport/modules_expensereport.php';
dol_include_once("/expensereport/class/expensereport.class.php"); require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
$langs->load("trips"); $langs->load("trips");
@ -68,7 +68,16 @@ if (! empty($conf->multicompany->enabled) && ! empty($conf->entity) && $conf->en
$rootfordata.='/'.$conf->entity; $rootfordata.='/'.$conf->entity;
} }
$conf->expensereport->dir_output = $rootfordata.'/expensereport'; $conf->expensereport->dir_output = $rootfordata.'/expensereport';
$conf->expensereport->dir_output = $rootfordata.'/expensereport';
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
@ -78,7 +87,7 @@ $conf->expensereport->dir_output = $rootfordata.'/expensereport';
if ($cancel) $action=''; if ($cancel) $action='';
if ($action == 'confirm_delete' && $_GET["confirm"] == "yes" && $id > 0 && $user->rights->expensereport->supprimer) if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->supprimer)
{ {
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$result=$object->delete($id); $result=$object->delete($id);
@ -103,9 +112,10 @@ if ($action == 'add' && $user->rights->expensereport->creer)
$object->fk_c_expensereport_statuts = 1; $object->fk_c_expensereport_statuts = 1;
$object->fk_c_paiement = GETPOST('fk_c_paiement','int'); $object->fk_c_paiement = GETPOST('fk_c_paiement','int');
$object->fk_user_validator = GETPOST('fk_user_validator','int'); $object->fk_user_validator = GETPOST('fk_user_validator','int');
$object->note = GETPOST('note'); $object->note_public = GETPOST('note_public');
$object->note_private = GETPOST('note_private');
if ($object->periode_existe($user,dol_print_date($object->date_debut, 'dayrfc'),dol_print_date($object->date_fin, 'dayrfc'))) if ($object->periode_existe($user,$object->date_debut,$object->date_fin))
{ {
$error++; $error++;
setEventMessage($langs->trans("ErrorDoubleDeclaration"),'errors'); setEventMessage($langs->trans("ErrorDoubleDeclaration"),'errors');
@ -147,7 +157,8 @@ if ($action == 'update' && $user->rights->expensereport->creer)
} }
$object->fk_c_paiement = GETPOST('fk_c_paiement','int'); $object->fk_c_paiement = GETPOST('fk_c_paiement','int');
$object->note = GETPOST('note'); $object->note_public = GETPOST('note_public');
$object->note_private = GETPOST('note_private');
$result = $object->update($user); $result = $object->update($user);
if ($result > 0) if ($result > 0)
@ -166,67 +177,95 @@ if ($action == "confirm_save" && GETPOST("confirm") == "yes" && $id > 0 && $user
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id); $object->fetch($id);
$result = $object->setValidate($user); $result = $object->setValidate($user);
if ($result > 0) if ($result > 0)
{ {
// Send mail // Define output language
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
// Send mail $outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
// TO $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
$destinataire = new User($db); }
$destinataire->fetch($object->fk_user_validator); }
$emailTo = $destinataire->email;
// FROM if ($result > 0 && $object->fk_user_validator > 0)
$expediteur = new User($db); {
$expediteur->fetch($object->fk_user_author); $langs->load("mails");
$emailFrom = $expediteur->email;
// SUBJECT // TO
$subject = "' ERP - Note de frais à valider"; $destinataire = new User($db);
$destinataire->fetch($object->fk_user_validator);
$emailTo = $destinataire->email;
// CONTENT // FROM
$message = "Bonjour {$destinataire->firstname},\n\n"; $expediteur = new User($db);
$message.= "Veuillez trouver en pièce jointe une nouvelle note de frais à valider.\n"; $expediteur->fetch($object->fk_user_author);
$message.= "- Déclarant : {$expediteur->firstname} {$expediteur->lastname}\n"; $emailFrom = $expediteur->email;
$message.= "- Période : du {$object->date_debut} au {$object->date_fin}\n";
$message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
$message.= "Bien cordialement,\n' SI";
// Génération du pdf avant attachement // SUBJECT
$object->setDocModel($user,""); $subject = $langs->trans("ExpenseReportWaitingForApproval");
$resultPDF = expensereport_pdf_create($db,$id,'',"",$langs);
if($resultPDF): // CONTENT
// ATTACHMENT $link = $urlwithroot.'/expenserecord/card.php?id='.$object->id;
$filename=array(); $filedir=array(); $mimetype=array(); $message = $langs->trans("ExpenseReportWaitingForApprovalMessage", $expediteur->getFullName($langs), get_date_range($object->date_debut,$object->date_fin,'',$langs), $link);
array_push($filename,dol_sanitizeFileName($object->ref).".pdf");
array_push($filedir,$conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref) . "/" . dol_sanitizeFileName($object->ref).".pdf");
array_push($mimetype,"application/pdf");
// PREPARE SEND // Rebuild pdf
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename); /*
$object->setDocModel($user,"");
$resultPDF = expensereport_pdf_create($db,$id,'',"",$langs);
if(!$mailfile->error): if($resultPDF):
// ATTACHMENT
$filename=array(); $filedir=array(); $mimetype=array();
array_push($filename,dol_sanitizeFileName($object->ref).".pdf");
array_push($filedir,$conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref) . "/" . dol_sanitizeFileName($object->ref).".pdf");
array_push($mimetype,"application/pdf");
*/
// PREPARE SEND
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename);
if ($mailfile)
{
// SEND // SEND
$result=$mailfile->sendfile(); $result=$mailfile->sendfile();
if ($result): if ($result)
Header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id); {
exit; $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($emailFrom,2),$mailfile->getValidAddress($emailTo,2));
endif; setEventMessage($mesg);
header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id);
else: exit;
}
$mesg="Impossible d'envoyer l'email."; else
{
endif; $langs->load("other");
// END - Send mail if ($mailfile->error)
else: {
dol_print_error($db,$resultPDF); $mesg='';
exit; $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
endif; $mesg.='<br>'.$mailfile->error;
setEventMessage($mesg,'errors');
}
else
{
setEventMessage('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', 'warnings');
}
}
}
else
{
setEventMessages($mailfile->error,$mailfile->errors,'errors');
$action='';
} }
} }
else else
@ -240,6 +279,27 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id); $object->fetch($id);
$result = $object->set_save_from_refuse($user); $result = $object->set_save_from_refuse($user);
if ($result > 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
if ($result > 0) if ($result > 0)
{ {
// Send mail // Send mail
@ -271,7 +331,7 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id
// Génération du pdf avant attachement // Génération du pdf avant attachement
$object->setDocModel($user,""); $object->setDocModel($user,"");
$resultPDF = expensereport_pdf_create($db,$id,'',"",$langs); $resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
if($resultPDF): if($resultPDF):
// ATTACHMENT // ATTACHMENT
@ -311,12 +371,33 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id
} }
// Approve // Approve
if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->to_validate) if ($action == "confirm_approve" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->approve)
{ {
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id); $object->fetch($id);
$result = $object->setApproved($user); $result = $object->setApproved($user);
if ($result > 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
if ($result > 0) if ($result > 0)
{ {
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) if (! empty($conf->global->DEPLACEMENT_TO_CLEAN))
@ -348,7 +429,7 @@ if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $
// Génération du pdf avant attachement // Génération du pdf avant attachement
$object->setDocModel($user,""); $object->setDocModel($user,"");
$resultPDF = expensereport_pdf_create($db,$id,'',"",$langs); $resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
if($resultPDF): if($resultPDF):
// ATTACHMENT // ATTACHMENT
@ -394,12 +475,33 @@ if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $
} }
} }
if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->to_validate) if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->approve)
{ {
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id); $object->fetch($id);
$result = $object->set_refuse($user,GETPOST('detail_refuse')); $result = $object->setDeny($user,GETPOST('detail_refuse'));
if ($result > 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
if ($result > 0) if ($result > 0)
{ {
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) if (! empty($conf->global->DEPLACEMENT_TO_CLEAN))
@ -456,34 +558,54 @@ if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user
} }
//var_dump($user->id == $object->fk_user_validator);exit; //var_dump($user->id == $object->fk_user_validator);exit;
if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && !empty($_POST['detail_cancel']) && $id > 0 && $user->rights->expensereport->creer) if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_cancel') && $id > 0 && $user->rights->expensereport->creer)
{ {
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id); $object->fetch($id);
if ($user->id == $object->fk_user_valid || $user->id == $object->fk_user_author) if ($user->id == $object->fk_user_valid || $user->id == $object->fk_user_author)
{ {
$result = $object->set_cancel($user,$_POST['detail_cancel']); $result = $object->set_cancel($user,GETPOST('detail_cancel'));
if ($result > 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
if ($result > 0) if ($result > 0)
{ {
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) if (! empty($conf->global->DEPLACEMENT_TO_CLEAN))
{ {
// Send mail // Send mail
// TO // TO
$destinataire = new User($db); $destinataire = new User($db);
$destinataire->fetch($object->fk_user_author); $destinataire->fetch($object->fk_user_author);
$emailTo = $destinataire->email; $emailTo = $destinataire->email;
// FROM // FROM
$expediteur = new User($db); $expediteur = new User($db);
$expediteur->fetch($object->fk_user_cancel); $expediteur->fetch($object->fk_user_cancel);
$emailFrom = $expediteur->email; $emailFrom = $expediteur->email;
// SUBJECT // SUBJECT
$subject = "' ERP - Note de frais annulée"; $subject = "' ERP - Note de frais annulée";
// CONTENT // CONTENT
$message = "Bonjour {$destinataire->firstname},\n\n"; $message = "Bonjour {$destinataire->firstname},\n\n";
$message.= "Votre note de frais \"{$object->ref}\" vient d'être annulée.\n"; $message.= "Votre note de frais \"{$object->ref}\" vient d'être annulée.\n";
@ -491,10 +613,10 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && !empty($_POST['d
$message.= "- Motif d'annulation : {$_POST['detail_cancel']}\n"; $message.= "- Motif d'annulation : {$_POST['detail_cancel']}\n";
$message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n"; $message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
$message.= "Bien cordialement,\n' SI"; $message.= "Bien cordialement,\n' SI";
// PREPARE SEND // PREPARE SEND
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message); $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message);
if(!$mailfile->error) if(!$mailfile->error)
{ {
// SEND // SEND
@ -523,12 +645,33 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && !empty($_POST['d
} }
} }
if ($action == "confirm_paid" && $_GET['confirm']=="yes" && $id > 0 && $user->rights->expensereport->to_paid) if ($action == "confirm_paid" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->to_paid)
{ {
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id,$user); $object->fetch($id);
$result = $object->setPaid($user); $result = $object->setPaid($user);
if ($result > 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
if ($result > 0) if ($result > 0)
{ {
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) if (! empty($conf->global->DEPLACEMENT_TO_CLEAN))
@ -557,7 +700,7 @@ if ($action == "confirm_paid" && $_GET['confirm']=="yes" && $id > 0 && $user->ri
// Génération du pdf avant attachement // Génération du pdf avant attachement
$object->setDocModel($user,""); $object->setDocModel($user,"");
$resultPDF = expensereport_pdf_create($db,$id,'',"",$langs); $resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
// PREPARE SEND // PREPARE SEND
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message); $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message);
@ -626,6 +769,27 @@ if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 &&
if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid)
{ {
$result = $object->setStatut(0); $result = $object->setStatut(0);
if ($result > 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
if ($result > 0) if ($result > 0)
{ {
header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id); header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id);
@ -665,7 +829,7 @@ if ($action == "addline")
$vatrate=GETPOST('vatrate'); $vatrate=GETPOST('vatrate');
$object_ligne->fk_c_tva = $vatrate; $object_ligne->fk_c_tva = $vatrate;
$object_ligne->vatrate = $vatrate; $object_ligne->vatrate = $vatrate;
$object_ligne->fk_projet = $fk_projet; $object_ligne->fk_projet = $fk_projet;
if (! GETPOST('fk_c_type_fees') > 0) if (! GETPOST('fk_c_type_fees') > 0)
@ -734,7 +898,7 @@ if ($action == "addline")
$action=''; $action='';
} }
if ($action == 'confirm_delete_line' && $_POST["confirm"] == "yes") if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes")
{ {
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id); $object->fetch($id);
@ -747,6 +911,26 @@ if ($action == 'confirm_delete_line' && $_POST["confirm"] == "yes")
$result=$object->deleteline($_GET["rowid"]); $result=$object->deleteline($_GET["rowid"]);
if ($result >= 0) if ($result >= 0)
{ {
if ($result > 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
$object->update_totaux_del($object_ligne->total_ht,$object_ligne->total_tva); $object->update_totaux_del($object_ligne->total_ht,$object_ligne->total_tva);
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_GET['id']); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_GET['id']);
exit; exit;
@ -789,6 +973,26 @@ if ($action == "updateligne" )
$result = $object->updateline($rowid, $type_fees_id, $projet_id, $c_tva, $comments, $qty, $value_unit, $date, $object_id); $result = $object->updateline($rowid, $type_fees_id, $projet_id, $c_tva, $comments, $qty, $value_unit, $date, $object_id);
if ($result >= 0) if ($result >= 0)
{ {
if ($result > 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
$object->recalculer($object_id); $object->recalculer($object_id);
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object_id); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object_id);
exit; exit;
@ -800,20 +1004,6 @@ if ($action == "updateligne" )
} }
} }
if ($action == "recalc" && $id > 0)
{
$object = new ExpenseReport($db);
$object->fetch($id);
if($object->recalculer($id) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_GET['id']);
exit;
}
else
{
setEventMessages($object->error, $object->errors, 'errors');
}
}
/* /*
* Generer ou regenerer le document PDF * Generer ou regenerer le document PDF
@ -834,7 +1024,7 @@ if ($action == 'builddoc') // En get ou en post
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
$result=expensereport_pdf_create($db, $depl->id, '', $depl->modelpdf, $outputlangs); $result=expensereport_pdf_create($db, $depl, '', $depl->modelpdf, $outputlangs);
if ($result <= 0) if ($result <= 0)
{ {
dol_print_error($db,$result); dol_print_error($db,$result);
@ -945,21 +1135,36 @@ if ($action == 'create')
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
// Public note
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("Note").'</td>'; print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
print '<td>'; print '<td valign="top" colspan="2">';
print '<textarea name="note" class="flat" rows="'.ROWS_3.'" cols="100">'.GETPOST('note').'</textarea>';
print '</td>'; $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print '</tr>'; print $doleditor->Create(1);
print '</td></tr>';
// Private note
if (empty($user->societe_id)) {
print '<tr>';
print '<td class="border" valign="top">' . $langs->trans('NotePrivate') . '</td>';
print '<td valign="top" colspan="2">';
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
print '</td></tr>';
}
print '<tbody>'; print '<tbody>';
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<center>'; print '<div align="center">';
print '<input type="submit" value="'.$langs->trans("AddTrip").'" name="bouton" class="button" />'; print '<input type="submit" value="'.$langs->trans("AddTrip").'" name="bouton" class="button" />';
print ' &nbsp; &nbsp; <input type="button" value="'.$langs->trans("Cancel").'" class="button" onclick="history.go(-1)" />'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="'.$langs->trans("Cancel").'" class="button" onclick="history.go(-1)" />';
print '</center>'; print '</div>';
print '</form>'; print '</form>';
} }
@ -1009,8 +1214,6 @@ else
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
} }
print '<table class="border" style="width:100%;">'; print '<table class="border" style="width:100%;">';
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
@ -1083,19 +1286,34 @@ else
print '</td></tr>'; print '</td></tr>';
} }
// Public note
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("Note").'</td>'; print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
print '<td>'; print '<td valign="top" colspan="2">';
print '<textarea name="note" class="flat" rows="'.ROWS_2.'" cols="70">'.$object->note.'</textarea>';
print '</td>'; $doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print '</tr>'; print $doleditor->Create(1);
print '</td></tr>';
// Private note
if (empty($user->societe_id)) {
print '<tr>';
print '<td class="border" valign="top">' . $langs->trans('NotePrivate') . '</td>';
print '<td valign="top" colspan="2">';
$doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
print '</td></tr>';
}
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" value="'.$langs->trans("Modify").'" name="bouton" class="button"> &nbsp; &nbsp; '; print '<input type="submit" value="'.$langs->trans("Modify").'" name="bouton" class="button">';
print '<input type="button" value="'.$langs->trans("Cancel").'" class="button" onclick="history.go(-1)" />'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="'.$langs->trans("Cancel").'" class="button" onclick="history.go(-1)" />';
print '</div>'; print '</div>';
print '</form>'; print '</form>';
@ -1120,7 +1338,7 @@ else
endif; endif;
if ($action == 'validate'): if ($action == 'validate'):
$ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_validate","","",1); $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
endif; endif;
@ -1129,22 +1347,24 @@ else
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
endif; endif;
if ($action == 'cancel'): if ($action == 'cancel')
$array_input = array(array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_cancel",'size'=>"50",'value'=>"")); {
$ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("ConfirmCancelTrip"),"","confirm_cancel",$array_input,"",0); $array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_cancel",'size'=>"50",'value'=>""));
if ($ret == 'html') print '<br>'; $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Cancel"),"","confirm_cancel",$array_input,"",1);
endif; if ($ret == 'html') print '<br>';
}
if ($action == 'brouillonner'): if ($action == 'brouillonner'):
$ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1); $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
endif; endif;
if ($action == 'refuse'): if ($action == 'refuse') // Deny
$array_input = array('text'=>$langs->trans("ConfirmRefuseTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_refuse",'size'=>"50",'value'=>"")); {
$ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1); $array_input = array('text'=>$langs->trans("ConfirmRefuseTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_refuse",'size'=>"50",'value'=>""));
if ($ret == 'html') print '<br>'; $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1);
endif; if ($ret == 'html') print '<br>';
}
if ($action == 'delete_line') if ($action == 'delete_line')
{ {
@ -1180,8 +1400,12 @@ else
print '<td>'.$object->getLibStatut(4).'</td>'; print '<td>'.$object->getLibStatut(4).'</td>';
print '</tr>'; print '</tr>';
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("Note").'</td>'; print '<td>'.$langs->trans("NotePublic").'</td>';
print '<td>'.$object->note.'</td>'; print '<td>'.$object->note_public.'</td>';
print '</tr>';
print '<tr>';
print '<td>'.$langs->trans("NotePrivate").'</td>';
print '<td>'.$object->note_private.'</td>';
print '</tr>'; print '</tr>';
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("AmountHT").'</td>'; print '<td>'.$langs->trans("AmountHT").'</td>';
@ -1211,7 +1435,7 @@ else
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("DATE_SAVE").'</td>'; print '<td>'.$langs->trans("DATE_SAVE").'</td>';
print '<td>'.$object->date_create.'</td></tr>'; print '<td>'.dol_print_date($object->date_create,'dayhour').'</td></tr>';
print '</tr>'; print '</tr>';
if($object->fk_c_expensereport_statuts==6) if($object->fk_c_expensereport_statuts==6)
{ {
@ -1227,8 +1451,8 @@ else
print '<td>'.$object->date_paiement.'</td></tr>'; print '<td>'.$object->date_paiement.'</td></tr>';
print '</tr>'; print '</tr>';
} }
if($object->fk_c_expensereport_statuts<3) if($object->fk_c_expensereport_statuts<3) // informed
{ {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("VALIDATOR").'</td>'; print '<td>'.$langs->trans("VALIDATOR").'</td>';
@ -1259,24 +1483,24 @@ else
print '</tr>'; print '</tr>';
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("DATE_CANCEL").'</td>'; print '<td>'.$langs->trans("DATE_CANCEL").'</td>';
print '<td>'.$object->date_cancel.'</td></tr>'; print '<td>'.dol_print_date($object->date_cancel,'dayhour').'</td></tr>';
print '</tr>'; print '</tr>';
} }
else else
{ {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("VALIDOR").'</td>'; print '<td>'.$langs->trans("Approbator").'</td>';
print '<td>'; print '<td>';
if ($object->fk_user_valid > 0) if ($object->fk_user_approve > 0)
{ {
$userfee=new User($db); $userapp=new User($db);
$userfee->fetch($object->fk_user_valid); $userapp->fetch($object->fk_user_approve);
print $userfee->getNomUrl(1); print $userapp->getNomUrl(1);
} }
print '</td></tr>'; print '</td></tr>';
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("DATE_VALIDE").'</td>'; print '<td>'.$langs->trans("DateApprove").'</td>';
print '<td>'.$object->date_valide.'</td></tr>'; print '<td>'.dol_print_date($object->date_approve,'dayhour').'</td></tr>';
print '</tr>'; print '</tr>';
} }
@ -1291,7 +1515,7 @@ else
print '</td></tr>'; print '</td></tr>';
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("DATE_REFUS").'</td>'; print '<td>'.$langs->trans("DATE_REFUS").'</td>';
print '<td>'.$object->date_refuse; print '<td>'.dol_print_date($object->date_refuse,'dayhour');
if ($object->detail_refuse) print ' - '.$object->detail_refuse; if ($object->detail_refuse) print ' - '.$object->detail_refuse;
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -1398,7 +1622,7 @@ else
} }
print '</tr>'; print '</tr>';
} }
if ($action == 'editline' && $objp->rowid == GETPOST('rowid')) if ($action == 'editline' && $objp->rowid == GETPOST('rowid'))
{ {
//modif ligne!!!!! //modif ligne!!!!!
@ -1631,7 +1855,7 @@ if ($action != 'create' && $action != 'edit')
} }
/* Si l'état est "En attente d'approbation" /* Si l'état est "En attente d'approbation"
* ET user à droit de "to_validate" * ET user à droit de "approve"
* ET fk_user_validator == user courant * ET fk_user_validator == user courant
* Afficher : "Valider" / "Refuser" / "Supprimer" * Afficher : "Valider" / "Refuser" / "Supprimer"
*/ */
@ -1644,7 +1868,7 @@ if ($action != 'create' && $action != 'edit')
} }
} }
if ($user->rights->expensereport->to_validate && $object->fk_c_expensereport_statuts == 2) if ($user->rights->expensereport->approve && $object->fk_c_expensereport_statuts == 2)
{ {
//if($object->fk_user_validator==$user->id) //if($object->fk_user_validator==$user->id)
//{ //{
@ -1681,7 +1905,7 @@ if ($action != 'create' && $action != 'edit')
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$id.'">'.$langs->trans('Cancel').'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$id.'">'.$langs->trans('Cancel').'</a>';
} }
if($user->rights->expensereport->supprimer) if($user->rights->expensereport->supprimer)
{ {
// Supprimer // Supprimer
@ -1690,11 +1914,11 @@ if ($action != 'create' && $action != 'edit')
} }
/* Si l'état est "Payée" /* Si l'état est "Payée"
* ET user à droit "to_validate" * ET user à droit "approve"
* ET user à droit "to_paid" * ET user à droit "to_paid"
* Afficher : "Annuler" * Afficher : "Annuler"
*/ */
if ($user->rights->expensereport->to_validate && $user->rights->expensereport->to_paid && $object->fk_c_expensereport_statuts==6) if ($user->rights->expensereport->approve && $user->rights->expensereport->to_paid && $object->fk_c_expensereport_statuts==6)
{ {
// Annuler // Annuler
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$id.'">'.$langs->trans('Cancel').'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=cancel&id='.$id.'">'.$langs->trans('Cancel').'</a>';

View File

@ -19,12 +19,14 @@ class ExpenseReport extends CommonObject
var $total_ht; var $total_ht;
var $total_tva; var $total_tva;
var $total_ttc; var $total_ttc;
var $note; var $note_public;
var $note_private;
var $date_debut; var $date_debut;
var $date_fin; var $date_fin;
var $fk_user_validator; var $fk_user_validator;
var $fk_c_expensereport_statuts; // -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé var $status;
var $fk_c_expensereport_statuts; // -- 1=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied
var $fk_c_paiement; var $fk_c_paiement;
var $user_author_infos; var $user_author_infos;
@ -54,10 +56,14 @@ class ExpenseReport extends CommonObject
var $fk_user_cancel; var $fk_user_cancel;
// Validation // Validation
var $date_valide; var $date_valid;
var $fk_user_valid; var $fk_user_valid;
var $user_valid_infos; var $user_valid_infos;
// Approve
var $date_approve;
var $fk_user_approve;
// Paiement // Paiement
var $date_paiement; var $date_paiement;
var $fk_user_paid; var $fk_user_paid;
@ -129,7 +135,8 @@ class ExpenseReport extends CommonObject
$sql.= ",fk_user_validator"; $sql.= ",fk_user_validator";
$sql.= ",fk_c_expensereport_statuts"; $sql.= ",fk_c_expensereport_statuts";
$sql.= ",fk_c_paiement"; $sql.= ",fk_c_paiement";
$sql.= ",note"; $sql.= ",note_public";
$sql.= ",note_private";
$sql.= ") VALUES("; $sql.= ") VALUES(";
$sql.= "'(PROV)'"; $sql.= "'(PROV)'";
$sql.= ", ".$this->total_ht; $sql.= ", ".$this->total_ht;
@ -142,7 +149,8 @@ class ExpenseReport extends CommonObject
$sql.= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null"); $sql.= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null");
$sql.= ", ".($this->fk_c_expensereport_statuts > 1 ? $this->fk_c_expensereport_statuts:0); $sql.= ", ".($this->fk_c_expensereport_statuts > 1 ? $this->fk_c_expensereport_statuts:0);
$sql.= ", ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null"); $sql.= ", ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null");
$sql.= ", ".($this->note?"'".$this->db->escape($this->note)."'":"null"); $sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ", ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
@ -225,7 +233,8 @@ class ExpenseReport extends CommonObject
$sql.= " , fk_user_paid = ".($this->fk_user_paid > 0 ? $this->fk_user_paid:"null"); $sql.= " , fk_user_paid = ".($this->fk_user_paid > 0 ? $this->fk_user_paid:"null");
$sql.= " , fk_c_expensereport_statuts = ".($this->fk_c_expensereport_statuts >= 0 ? $this->fk_c_expensereport_statuts:'0'); $sql.= " , fk_c_expensereport_statuts = ".($this->fk_c_expensereport_statuts >= 0 ? $this->fk_c_expensereport_statuts:'0');
$sql.= " , fk_c_paiement = ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null"); $sql.= " , fk_c_paiement = ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null");
$sql.= " , note = ".(!empty($this->note)?"'".$this->db->escape($this->note)."'":"''"); $sql.= " , note_public = ".(!empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"''");
$sql.= " , note_private = ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"''");
$sql.= " , detail_refuse = ".(!empty($this->detail_refuse)?"'".$this->db->escape($this->detail_refuse)."'":"''"); $sql.= " , detail_refuse = ".(!empty($this->detail_refuse)?"'".$this->db->escape($this->detail_refuse)."'":"''");
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
@ -253,13 +262,13 @@ class ExpenseReport extends CommonObject
{ {
global $conf,$db; global $conf,$db;
$sql = "SELECT d.rowid, d.ref, d.note,"; // DEFAULT $sql = "SELECT d.rowid, d.ref, d.note_public, d.note_private,"; // DEFAULT
$sql.= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel,"; // ACTIONS $sql.= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel,"; // ACTIONS
$sql.= " d.date_refuse, d.date_cancel,"; // ACTIONS $sql.= " d.date_refuse, d.date_cancel,"; // ACTIONS
$sql.= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int) $sql.= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int)
$sql.= " d.date_debut, d.date_fin, d.date_create, d.date_valide, d.date_paiement,"; // DATES (datetime) $sql.= " d.date_debut, d.date_fin, d.date_create, d.date_valid, d.date_approve, d.date_paiement,"; // DATES (datetime)
$sql.= " d.fk_user_author, d.fk_user_validator, d.fk_c_expensereport_statuts as status, d.fk_c_paiement,"; $sql.= " d.fk_user_author, d.fk_user_validator, d.fk_c_expensereport_statuts as status, d.fk_c_paiement,";
$sql.= " d.fk_user_valid, d.fk_user_paid,"; // FOREING KEY 2 (int) $sql.= " d.fk_user_valid, d.fk_user_approve, d.fk_user_paid,";
$sql.= " dp.libelle as libelle_paiement, dp.code as code_paiement"; // INNER JOIN paiement $sql.= " dp.libelle as libelle_paiement, dp.code as code_paiement"; // INNER JOIN paiement
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." d LEFT JOIN ".MAIN_DB_PREFIX."c_paiement dp ON d.fk_c_paiement = dp.id"; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." d LEFT JOIN ".MAIN_DB_PREFIX."c_paiement dp ON d.fk_c_paiement = dp.id";
if ($ref) $sql.= " WHERE d.ref = '".$this->db->escape($ref)."'"; if ($ref) $sql.= " WHERE d.ref = '".$this->db->escape($ref)."'";
@ -278,24 +287,27 @@ class ExpenseReport extends CommonObject
$this->total_ht = $obj->total_ht; $this->total_ht = $obj->total_ht;
$this->total_tva = $obj->total_tva; $this->total_tva = $obj->total_tva;
$this->total_ttc = $obj->total_ttc; $this->total_ttc = $obj->total_ttc;
$this->note = $obj->note; $this->note_public = $obj->note_public;
$this->note_private = $obj->note_private;
$this->detail_refuse = $obj->detail_refuse; $this->detail_refuse = $obj->detail_refuse;
$this->detail_cancel = $obj->detail_cancel; $this->detail_cancel = $obj->detail_cancel;
$this->date_debut = $obj->date_debut; $this->date_debut = $this->db->jdate($obj->date_debut);
$this->date_fin = $obj->date_fin; $this->date_fin = $this->db->jdate($obj->date_fin);
$this->date_paiement = $obj->date_paiement; $this->date_paiement = $this->db->jdate($obj->date_paiement);
$this->date_valide = $obj->date_valide; $this->date_valid = $this->db->jdate($obj->date_valid);
$this->date_create = $obj->date_create; $this->date_approve = $this->db->jdate($obj->date_approve);
$this->date_refuse = $obj->date_refuse; $this->date_create = $this->db->jdate($obj->date_create);
$this->date_cancel = $obj->date_cancel; $this->date_refuse = $this->db->jdate($obj->date_refuse);
$this->date_cancel = $this->db->jdate($obj->date_cancel);
$this->fk_user_author = $obj->fk_user_author; $this->fk_user_author = $obj->fk_user_author;
$this->fk_user_validator = $obj->fk_user_validator; $this->fk_user_validator = $obj->fk_user_validator;
$this->fk_user_valid = $obj->fk_user_valid; $this->fk_user_valid = $obj->fk_user_valid;
$this->fk_user_paid = $obj->fk_user_paid;
$this->fk_user_refuse = $obj->fk_user_refuse; $this->fk_user_refuse = $obj->fk_user_refuse;
$this->fk_user_cancel = $obj->fk_user_cancel; $this->fk_user_cancel = $obj->fk_user_cancel;
$this->fk_user_approve = $obj->fk_user_approve;
$this->fk_user_paid = $obj->fk_user_paid;
$user_author = new User($this->db); $user_author = new User($this->db);
if ($this->fk_user_author > 0) $user_author->fetch($this->fk_user_author); if ($this->fk_user_author > 0) $user_author->fetch($this->fk_user_author);
@ -404,10 +416,12 @@ class ExpenseReport extends CommonObject
$sql = "SELECT f.rowid,"; $sql = "SELECT f.rowid,";
$sql.= " f.date_create as datec,"; $sql.= " f.date_create as datec,";
$sql.= " f.tms as date_modification,"; $sql.= " f.tms as date_modification,";
$sql.= " f.date_valide as datev,"; $sql.= " f.date_valid as datev,";
$sql.= " f.fk_user_author,"; $sql.= " f.date_approve as datea,";
$sql.= " f.fk_user_author as fk_user_creation,";
$sql.= " f.fk_user_modif as fk_user_modification,"; $sql.= " f.fk_user_modif as fk_user_modification,";
$sql.= " f.fk_user_validator"; $sql.= " f.fk_user_valid,";
$sql.= " f.fk_user_approve";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as f"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as f";
$sql.= " WHERE f.rowid = ".$id; $sql.= " WHERE f.rowid = ".$id;
$sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.entity = ".$conf->entity;
@ -424,11 +438,18 @@ class ExpenseReport extends CommonObject
$this->date_creation = $this->db->jdate($obj->datec); $this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->date_modification); $this->date_modification = $this->db->jdate($obj->date_modification);
$this->date_validation = $this->db->jdate($obj->datev); $this->date_validation = $this->db->jdate($obj->datev);
$this->date_approbation = $this->db->jdate($obj->datea);
$cuser = new User($this->db); $cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author); $cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser; $this->user_creation = $cuser;
if ($obj->fk_user_creation)
{
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_creation);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) if ($obj->fk_user_valid)
{ {
$vuser = new User($this->db); $vuser = new User($this->db);
@ -452,6 +473,67 @@ class ExpenseReport extends CommonObject
} }
/**
* Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/
function initAsSpecimen()
{
global $user,$langs,$conf;
$now=dol_now();
// Initialise parametres
$this->id=0;
$this->ref = 'SPECIMEN';
$this->specimen=1;
$this->date_create = $now;
$this->date_debut = $now;
$this->date_fin = $now;
$this->date_approve = $now;
$this->status = 5;
$this->fk_c_expensereport_statuts = 5;
$this->fk_user_author = $user->id;
$this->fk_user_valid = $user->id;
$this->fk_user_approve = $user->id;
$this->fk_user_validator = $user->id;
$this->note_private='Private note';
$this->note_public='SPECIMEN';
$nbp = 5;
$xnbp = 0;
while ($xnbp < $nbp)
{
$line=new ExpenseReportLine($this->db);
$line->comments=$langs->trans("Comment")." ".$xnbp;
$line->date=($now-3600*(1+$xnbp));
$line->total_ht=100;
$line->total_tva=20;
$line->total_ttc=120;
$line->qty=1;
$line->fk_c_tva=20;
$line->tva_taux=20;
$line->value_unit=120;
$line->fk_expensereport=0;
$line->type_fees_code='TRA';
$line->projet_ref = 'ABC';
$this->lines[$xnbp]=$line;
$xnbp++;
$this->total_ht+=$line->total_ht;
$this->total_tva+=$line->total_tva;
$this->total_ttc+=$line->total_ttc;
}
}
/** /**
* fetch_line_by_project * fetch_line_by_project
* *
@ -739,14 +821,14 @@ class ExpenseReport extends CommonObject
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
$this->date_debut = $objp->date_debut; $this->date_debut = $this->db->jdate($objp->date_debut);
$expld_date_debut = explode("-",$this->date_debut);
$this->date_debut = $expld_date_debut[0].$expld_date_debut[1].$expld_date_debut[2];
// Création du ref_number suivant // Création du ref_number suivant
if($ref_next) if($ref_next)
{ {
$this->ref = strtoupper($user->login).$expld_car."NDF".$this->ref.$expld_car.$this->date_debut; $prefix="ER";
if (! empty($conf->global->EXPENSE_REPORT_PREFIX)) $prefix=$conf->global->EXPENSE_REPORT_PREFIX;
$this->ref = strtoupper($user->login).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d');
} }
if ($this->fk_c_expensereport_statuts != 2) if ($this->fk_c_expensereport_statuts != 2)
@ -775,7 +857,7 @@ class ExpenseReport extends CommonObject
} }
/** /**
* set_to_validate * set_save_from_refuse
* *
* @param User $user User * @param User $user User
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
@ -793,9 +875,7 @@ class ExpenseReport extends CommonObject
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
$this->date_debut = $objp->date_debut; $this->date_debut = $this->db->jdate($objp->date_debut);
$expld_date_debut = explode("-",$this->date_debut);
$this->date_debut = $expld_date_debut[0].$expld_date_debut[1].$expld_date_debut[2];
if ($this->fk_c_expensereport_statuts != 2) if ($this->fk_c_expensereport_statuts != 2)
{ {
@ -829,13 +909,15 @@ class ExpenseReport extends CommonObject
*/ */
function setApproved($user) function setApproved($user)
{ {
// date de validation $now=dol_now();
$this->date_valide = $this->db->idate(gmmktime());
// date approval
$this->date_approve = $this->db->idate($now);
if ($this->fk_c_expensereport_statuts != 5) if ($this->fk_c_expensereport_statuts != 5)
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET ref = '".$this->ref."', fk_c_expensereport_statuts = 5, fk_user_approve = ".$user->id.","; $sql.= " SET ref = '".$this->ref."', fk_c_expensereport_statuts = 5, fk_user_approve = ".$user->id.",";
$sql.= " date_valide='".$this->date_valide."'"; $sql.= " date_approve='".$this->date_approve."'";
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
@ -854,15 +936,15 @@ class ExpenseReport extends CommonObject
} }
/** /**
* set_refuse * setDeny
* *
* @param User $user User * @param User $user User
* @param Details $details Details * @param Details $details Details
*/ */
function set_refuse($user,$details) function setDeny($user,$details)
{ {
$now = dol_now(); $now = dol_now();
// date de refus // date de refus
if ($this->fk_c_expensereport_statuts != 99) if ($this->fk_c_expensereport_statuts != 99)
{ {
@ -870,6 +952,7 @@ class ExpenseReport extends CommonObject
$sql.= " SET ref = '".$this->ref."', fk_c_expensereport_statuts = 99, fk_user_refuse = ".$user->id.","; $sql.= " SET ref = '".$this->ref."', fk_c_expensereport_statuts = 99, fk_user_refuse = ".$user->id.",";
$sql.= " date_refuse='".$this->db->idate($now)."',"; $sql.= " date_refuse='".$this->db->idate($now)."',";
$sql.= " detail_refuse='".$this->db->escape($details)."'"; $sql.= " detail_refuse='".$this->db->escape($details)."'";
$sql.= " fk_user_approve=NULL,";
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
@ -887,7 +970,7 @@ class ExpenseReport extends CommonObject
} }
else else
{ {
dol_syslog(get_class($this)."::set_refuse expensereport already with refuse status", LOG_WARNING); dol_syslog(get_class($this)."::setDeny expensereport already with refuse status", LOG_WARNING);
} }
} }
@ -899,16 +982,17 @@ class ExpenseReport extends CommonObject
*/ */
function setPaid($user) function setPaid($user)
{ {
$this->date_paiement = $this->db->idate(gmmktime()); $now= dol_now();
$this->date_paiement = $this->db->idate($now);
if ($this->fk_c_expensereport_statuts != 6) if ($this->fk_c_expensereport_statuts != 6)
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET fk_c_expensereport_statuts = 6, fk_user_paid = ".$user->id.","; $sql.= " SET fk_c_expensereport_statuts = 6, fk_user_paid = ".$user->id.",";
$sql.= " date_paiement='".$this->date_paiement."'"; $sql.= " date_paiement='".$this->db->idate($this->date_paiement)."'";
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
dol_syslog(get_class($this)."::setPaid sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::setPaid sql=".$sql, LOG_DEBUG);
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
return 1; return 1;
@ -954,38 +1038,6 @@ class ExpenseReport extends CommonObject
} }
} }
/**
* set_to_validate
*
* @param User $user User
* @return int <0 if KO, >0 if OK
*/
function set_to_valide($user)
{
if ($this->fk_c_expensereport_statuts != 2)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET fk_c_expensereport_statuts = 2, fk_user_validator = ".$this->fk_user_validator;
$sql.= ' WHERE rowid = '.$this->id;
dol_syslog(get_class($this)."::set_to_valide sql=".$sql, LOG_DEBUG);
if ($this->db->query($sql))
{
return 1;
}
else
{
$this->error=$this->db->error();
return -1;
}
}
else
{
dol_syslog(get_class($this)."::set_to_valide expensereport already with to-valide status", LOG_WARNING);
}
}
/** /**
* set_cancel * set_cancel
* *
@ -1236,9 +1288,9 @@ class ExpenseReport extends CommonObject
* @param Date $date_fin End date * @param Date $date_fin End date
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function periode_existe($user,$date_debut,$date_fin) function periode_existe($user, $date_debut, $date_fin)
{ {
$sql = "SELECT rowid,date_debut,date_fin"; $sql = "SELECT rowid, date_debut, date_fin";
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql.= " WHERE fk_user_author = '{$user->id}'"; $sql.= " WHERE fk_user_author = '{$user->id}'";
@ -1250,10 +1302,8 @@ class ExpenseReport extends CommonObject
if ($num_lignes>0) if ($num_lignes>0)
{ {
$date_d_form = explode("-",$date_debut); // 1 $date_d_form = $date_debut;
$date_f_form = explode("-",$date_fin); // 2 $date_f_form = $date_fin;
$date_d_form = mktime(12,0,0,$date_d_form[1],$date_d_form[2],$date_d_form[0]);
$date_f_form = mktime(12,0,0,$date_f_form[1],$date_f_form[2],$date_f_form[0]);
$existe = false; $existe = false;
@ -1261,12 +1311,10 @@ class ExpenseReport extends CommonObject
{ {
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
$date_d_req = explode("-",$objp->date_debut); // 3 $date_d_req = $this->db->jdate($objp->date_debut); // 3
$date_f_req = explode("-",$objp->date_fin); // 4 $date_f_req = $this->db->jdate($objp->date_fin); // 4
$date_d_req = mktime(12,0,0,$date_d_req[1],$date_d_req[2],$date_d_req[0]);
$date_f_req = mktime(12,0,0,$date_f_req[1],$date_f_req[2],$date_f_req[0]);
if(!($date_f_form < $date_d_req OR $date_d_form > $date_f_req)) $existe = true; if (!($date_f_form < $date_d_req || $date_d_form > $date_f_req)) $existe = true;
$i++; $i++;
} }
@ -1299,7 +1347,7 @@ class ExpenseReport extends CommonObject
$sql = "SELECT fk_user"; $sql = "SELECT fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."user_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd"; $sql.= " FROM ".MAIN_DB_PREFIX."user_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd";
$sql.= " WHERE ur.fk_id = rd.id and module = 'expensereport' AND perms = 'to_validate'"; // Permission 'Approve'; $sql.= " WHERE ur.fk_id = rd.id and module = 'expensereport' AND perms = 'approve'"; // Permission 'Approve';
dol_syslog(get_class($this)."::fetch_users_approver_expensereport sql=".$sql); dol_syslog(get_class($this)."::fetch_users_approver_expensereport sql=".$sql);
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -1321,6 +1369,41 @@ class ExpenseReport extends CommonObject
return -1; return -1;
} }
} }
/**
* Create a document onto disk accordign to template module.
*
* @param string $modele Force le mnodele a utiliser ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$langs;
$langs->load("trips");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->EXPENSEREPORT_ADDON_PDF))
{
$modele = $conf->global->EXPENSEREPORT_ADDON_PDF;
}
else
{
$modele = 'standard';
}
}
$modelpath = "core/modules/expensereport/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
} }
@ -1374,14 +1457,12 @@ class ExpenseReportLine
function fetch($rowid) function fetch($rowid)
{ {
$sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_projet, fde.date,'; $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_projet, fde.date,';
$sql.= ' fde.fk_c_tva, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; $sql.= ' fde.fk_c_tva as tva_taux, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,';
$sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,';
$sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref,'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref';
$sql.= ' tva.rowid as tva_id, tva.taux as tva_taux';
$sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det fde'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det fde';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees ctf ON fde.fk_c_type_fees=ctf.id'; $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees ctf ON fde.fk_c_type_fees=ctf.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet pjt ON fde.fk_projet=pjt.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet pjt ON fde.fk_projet=pjt.rowid';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_tva tva ON fde.fk_c_tva=tva.rowid';
$sql.= ' WHERE fde.rowid = '.$rowid; $sql.= ' WHERE fde.rowid = '.$rowid;
$result = $this->db->query($sql); $result = $this->db->query($sql);

View File

@ -49,7 +49,7 @@ class ExpenseReportStats extends Stats
*/ */
function __construct($db, $socid=0, $userid=0) function __construct($db, $socid=0, $userid=0)
{ {
global $conf; global $conf, $user;
$this->db = $db; $this->db = $db;
$this->socid = $socid; $this->socid = $socid;
@ -59,24 +59,33 @@ class ExpenseReportStats extends Stats
$this->from = MAIN_DB_PREFIX.$object->table_element; $this->from = MAIN_DB_PREFIX.$object->table_element;
$this->field='total_ht'; $this->field='total_ht';
$this->where = " fk_c_expensereport_statuts > 0 and date_valide > '2000-01-01'"; $this->where = " fk_c_expensereport_statuts > 0 and date_valid > '2000-01-01'";
//$this->where.= " AND entity = ".$conf->entity; //$this->where.= " AND entity = ".$conf->entity;
if ($this->socid) if ($this->socid)
{ {
$this->where.=" AND fk_soc = ".$this->socid; $this->where.=" AND fk_soc = ".$this->socid;
} }
if ($this->userid > 0) $this->where.=' AND fk_user_author = '.$this->userid;
// Only me and subordinates
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous))
{
$childids = $user->getAllChildIds();
$childids[]=$user->id;
$this->where.=" AND fk_user_author IN (".(join(',',$childids)).")";
}
if ($this->userid > 0) $this->where.=' AND fk_user_author = '.$this->userid;
} }
/** /**
* Renvoie le nombre de facture par annee * Return nb of expense report per year
* *
* @return array Array of values * @return array Array of values
*/ */
function getNbByYear() function getNbByYear()
{ {
$sql = "SELECT YEAR(date_valide) as dm, count(*)"; $sql = "SELECT YEAR(date_valid) as dm, count(*)";
$sql.= " FROM ".$this->from; $sql.= " FROM ".$this->from;
$sql.= " GROUP BY dm DESC"; $sql.= " GROUP BY dm DESC";
$sql.= " WHERE ".$this->where; $sql.= " WHERE ".$this->where;
@ -93,9 +102,9 @@ class ExpenseReportStats extends Stats
*/ */
function getNbByMonth($year) function getNbByMonth($year)
{ {
$sql = "SELECT MONTH(date_valide) as dm, count(*)"; $sql = "SELECT MONTH(date_valid) as dm, count(*)";
$sql.= " FROM ".$this->from; $sql.= " FROM ".$this->from;
$sql.= " WHERE YEAR(date_valide) = ".$year; $sql.= " WHERE YEAR(date_valid) = ".$year;
$sql.= " AND ".$this->where; $sql.= " AND ".$this->where;
$sql.= " GROUP BY dm"; $sql.= " GROUP BY dm";
$sql.= $this->db->order('dm','DESC'); $sql.= $this->db->order('dm','DESC');
@ -114,9 +123,9 @@ class ExpenseReportStats extends Stats
*/ */
function getAmountByMonth($year) function getAmountByMonth($year)
{ {
$sql = "SELECT date_format(date_valide,'%m') as dm, sum(".$this->field.")"; $sql = "SELECT date_format(date_valid,'%m') as dm, sum(".$this->field.")";
$sql.= " FROM ".$this->from; $sql.= " FROM ".$this->from;
$sql.= " WHERE date_format(date_valide,'%Y') = '".$year."'"; $sql.= " WHERE date_format(date_valid,'%Y') = '".$year."'";
$sql.= " AND ".$this->where; $sql.= " AND ".$this->where;
$sql.= " GROUP BY dm"; $sql.= " GROUP BY dm";
$sql.= $this->db->order('dm','DESC'); $sql.= $this->db->order('dm','DESC');
@ -134,9 +143,9 @@ class ExpenseReportStats extends Stats
*/ */
function getAverageByMonth($year) function getAverageByMonth($year)
{ {
$sql = "SELECT date_format(date_valide,'%m') as dm, avg(".$this->field.")"; $sql = "SELECT date_format(date_valid,'%m') as dm, avg(".$this->field.")";
$sql.= " FROM ".$this->from; $sql.= " FROM ".$this->from;
$sql.= " WHERE date_format(date_valide,'%Y') = '".$year."'"; $sql.= " WHERE date_format(date_valid,'%Y') = '".$year."'";
$sql.= " AND ".$this->where; $sql.= " AND ".$this->where;
$sql.= " GROUP BY dm"; $sql.= " GROUP BY dm";
$sql.= $this->db->order('dm','DESC'); $sql.= $this->db->order('dm','DESC');
@ -151,7 +160,7 @@ class ExpenseReportStats extends Stats
*/ */
function getAllByYear() function getAllByYear()
{ {
$sql = "SELECT date_format(date_valide,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg"; $sql = "SELECT date_format(date_valid,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg";
$sql.= " FROM ".$this->from; $sql.= " FROM ".$this->from;
$sql.= " WHERE ".$this->where; $sql.= " WHERE ".$this->where;
$sql.= " GROUP BY year"; $sql.= " GROUP BY year";

View File

@ -69,7 +69,13 @@ $totalnb=$totalsum=0;
$sql = "SELECT tf.code, tf.label, count(de.rowid) as nb, sum(de.total_ht) as km"; $sql = "SELECT tf.code, tf.label, count(de.rowid) as nb, sum(de.total_ht) as km";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."expensereport_det as de, ".MAIN_DB_PREFIX."c_type_fees as tf"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."expensereport_det as de, ".MAIN_DB_PREFIX."c_type_fees as tf";
$sql.= " WHERE de.fk_expensereport = d.rowid AND de.fk_c_type_fees = tf.id"; $sql.= " WHERE de.fk_expensereport = d.rowid AND de.fk_c_type_fees = tf.id";
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) $sql.=' AND d.fk_user_author IN ('.join(',',$childids).')';
// RESTRICT RIGHTS
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous))
{
$sql.= " AND d.fk_user_author IN (".join(',',$childids).")\n";
}
$sql.= " GROUP BY tf.code, tf.label"; $sql.= " GROUP BY tf.code, tf.label";
$result = $db->query($sql); $result = $db->query($sql);

View File

@ -6,7 +6,7 @@
* *
* 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
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -16,7 +16,6 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/ */
/** /**
@ -37,8 +36,24 @@ $socid = $_GET["socid"]?$_GET["socid"]:'';
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'expensereport','',''); $result = restrictedArea($user, 'expensereport','','');
$search_ref=GETPOST('search_ref'); $search_ref = GETPOST('search_ref');
$search_user = GETPOST('search_user','int');
$search_state = GETPOST('search_state','int');
$month_start = GETPOST("month_start","int");
$year_start = GETPOST("year_start","int");
$month_end = GETPOST("month_end","int");
$year_end = GETPOST("year_end","int");
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
{
$search_ref="";
$search_user="";
$search_state="";
$month_start="";
$year_start="";
$month_end="";
$year_end="";
}
/* /*
* View * View
@ -48,20 +63,11 @@ $html = new Form($db);
$formother = new FormOther($db); $formother = new FormOther($db);
$expensereporttmp=new ExpenseReport($db); $expensereporttmp=new ExpenseReport($db);
llxHeader(); llxHeader('', $langs->trans("ListOfExpenseReports"));
$max_year = 5; $max_year = 5;
$min_year = 5; $min_year = 5;
$month_start = $_GET['month_start'];
$year_start = $_GET['year_start'];
$month_end = $_GET['month_end'];
$year_end = $_GET['year_end'];
$search_ref = GETPOST('search_ref');
$search_user = GETPOST('search_user','int');
$search_state = GETPOST('search_state','int');
$sortorder = $_GET["sortorder"]; $sortorder = $_GET["sortorder"];
$sortfield = $_GET["sortfield"]; $sortfield = $_GET["sortfield"];
$page = $_GET["page"]; $page = $_GET["page"];
@ -84,13 +90,14 @@ $sql.= " u.rowid as id_user, u.firstname, u.lastname";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport d\n"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport d\n";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user u ON d.fk_user_author = u.rowid\n"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user u ON d.fk_user_author = u.rowid\n";
// WHERE // WHERE
if(!empty($search_ref)){ if(!empty($search_ref)){
$sql.= " WHERE d.ref LIKE '%".$db->escape($search_ref)."%'\n"; $sql.= " WHERE d.ref LIKE '%".$db->escape($search_ref)."%'\n";
}else{ }else{
$sql.= " WHERE 1 = 1\n"; $sql.= " WHERE 1 = 1\n";
} }
// DATE START // DATE START
if ($month_start > 0) { if ($month_start > 0) {
if ($year_start > 0) { if ($year_start > 0) {
@ -148,13 +155,15 @@ if ($month_start > 0) {
} }
} }
} }
if (!empty($search_user) && $search_user > 0) $sql.= " AND d.fk_user_author = ".$search_user."\n";
if (!empty($search_user) && $search_user != -1) $sql.= " AND d.fk_user_author = '$search_user'\n";
if($search_state != '') $sql.= " AND d.fk_c_expensereport_statuts = '$search_state'\n"; if($search_state != '') $sql.= " AND d.fk_c_expensereport_statuts = '$search_state'\n";
// RESTRICT RIGHTS // RESTRICT RIGHTS
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)){ if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous))
$sql.= " AND d.fk_user_author = '{$user->id}'\n"; {
$childids = $user->getAllChildIds();
$childids[]=$user->id;
$sql.= " AND d.fk_user_author IN (".join(',',$childids).")\n";
} }
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
@ -180,10 +189,10 @@ if ($resql)
print_liste_field_titre($langs->trans("TotalVAT"),$_SERVER["PHP_SELF"],"d.total_tva","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("TotalVAT"),$_SERVER["PHP_SELF"],"d.total_tva","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("TotalTTC"),$_SERVER["PHP_SELF"],"d.total_ttc","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("TotalTTC"),$_SERVER["PHP_SELF"],"d.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Statut"),$_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Statut"),$_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre(); print '<td class="liste_titre">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
// FILTRES // Filters
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" size="15" type="text" name="search_ref" value="'.$search_ref.'">'; print '<input class="flat" size="15" type="text" name="search_ref" value="'.$search_ref.'">';
@ -221,9 +230,11 @@ if ($resql)
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
select_expensereport_statut($search_state,'search_state'); select_expensereport_statut($search_state,'search_state');
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right" width="20px">';
print ' <input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans('Search').'">'; print '<td class="liste_titre" align="right">';
print "</td>"; print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -222,7 +222,9 @@ print '</td></tr>';
*/ */
// User // User
print '<tr><td>'.$langs->trans("User").'</td><td>'; print '<tr><td>'.$langs->trans("User").'</td><td>';
print $form->select_dolusers($userid,'userid',1); $include='';
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) $include='hierarchy';
print $form->select_dolusers($userid,'userid',1,'',0,$include);
print '</td></tr>'; print '</td></tr>';
// Year // Year
print '<tr><td>'.$langs->trans("Year").'</td><td>'; print '<tr><td>'.$langs->trans("Year").'</td><td>';

View File

@ -3,7 +3,7 @@
* *
* 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
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -13,7 +13,6 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/ */
require '../main.inc.php'; require '../main.inc.php';
@ -137,12 +136,12 @@ else:
print '&nbsp;<input type="submit" class="button" value="'.$langs->trans("ViewAccountSynch").'">'; print '&nbsp;<input type="submit" class="button" value="'.$langs->trans("ViewAccountSynch").'">';
print "</form>"; print "</form>";
$sql = "SELECT d.fk_bank_account, d.ref, d.rowid, d.date_valide, d.fk_user_author, d.total_ttc, d.integration_compta, d.fk_c_expensereport_statuts"; $sql = "SELECT d.fk_bank_account, d.ref, d.rowid, d.date_valid, d.fk_user_author, d.total_ttc, d.integration_compta, d.fk_c_expensereport_statuts";
$sql.= " ,CONCAT(u.firstname,' ',u.lastname) as declarant_NDF"; $sql.= " ,CONCAT(u.firstname,' ',u.lastname) as declarant_NDF";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport d"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport d";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user u ON d.fk_user_author = u.rowid"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user u ON d.fk_user_author = u.rowid";
$sql.= " WHERE d.fk_c_expensereport_statuts = 6"; $sql.= " WHERE d.fk_c_expensereport_statuts = 6";
$sql.= " ORDER BY d.date_valide DESC"; $sql.= " ORDER BY d.date_valid DESC";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql): if ($resql):
@ -170,7 +169,7 @@ else:
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td>'.$objp->ref.'</td>'; print '<td>'.$objp->ref.'</td>';
print '<td>'.dol_print_date($db->jdate($objp->date_valide),'day').'</td>'; print '<td>'.dol_print_date($db->jdate($objp->date_valid),'day').'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objp->fk_user_author.'">'.img_object($langs->trans("ShowUser"),"user").' '.$objp->declarant_NDF.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objp->fk_user_author.'">'.img_object($langs->trans("ShowUser"),"user").' '.$objp->declarant_NDF.'</a></td>';
print '<td align="center">'.$objp->total_ttc.' '.$langs->trans("EURO").'</td>'; print '<td align="center">'.$objp->total_ttc.' '.$langs->trans("EURO").'</td>';

View File

@ -60,7 +60,9 @@ $entitytoicon = array(
'warehouse' => 'stock', 'warehouse' => 'stock',
'category' => 'category', 'category' => 'category',
'shipment' => 'sending', 'shipment' => 'sending',
'shipment_line'=> 'sending' 'shipment_line'=> 'sending',
'expensereport'=> 'trip',
'expensereport_line'=> 'trip'
); );
// Translation code // Translation code
@ -95,7 +97,9 @@ $entitytolang = array(
'project' => 'Projects', 'project' => 'Projects',
'projecttask' => 'Tasks', 'projecttask' => 'Tasks',
'task_time' => 'TaskTimeSpent', 'task_time' => 'TaskTimeSpent',
'action' => 'Action' 'action' => 'Action',
'expensereport'=> 'ExpenseReport',
'expensereport_line'=> 'ExpenseReportLine',
); );
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array(); $array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();

View File

@ -907,7 +907,7 @@ class CommandeFournisseur extends CommonOrder
$sql.= ", entity"; $sql.= ", entity";
$sql.= ", fk_soc"; $sql.= ", fk_soc";
$sql.= ", date_creation"; $sql.= ", date_creation";
//$sql.= ", date_livraison"; $sql.= ", date_livraison";
$sql.= ", fk_user_author"; $sql.= ", fk_user_author";
$sql.= ", fk_statut"; $sql.= ", fk_statut";
$sql.= ", source"; $sql.= ", source";
@ -919,12 +919,12 @@ class CommandeFournisseur extends CommonOrder
$sql.= " VALUES ("; $sql.= " VALUES (";
$sql.= "''"; $sql.= "''";
$sql.= ", '".$this->ref_supplier."'"; $sql.= ", '".$this->ref_supplier."'";
$sql.= ", '".$this->note_private."'"; $sql.= ", '".$this->db->escape($this->note_private)."'";
$sql.= ", '".$this->note_public."'"; $sql.= ", '".$this->db->escape($this->note_public)."'";
$sql.= ", ".$conf->entity; $sql.= ", ".$conf->entity;
$sql.= ", ".$this->socid; $sql.= ", ".$this->socid;
$sql.= ", '".$this->db->idate($now)."'"; $sql.= ", '".$this->db->idate($now)."'";
//$sql.= ", '".$this->db->idate($now)."'"; $sql.= ", ".($this->date_livraison?"'".$this->db->idate($this->date_livraison)."'":"null");
$sql.= ", ".$user->id; $sql.= ", ".$user->id;
$sql.= ", 0"; $sql.= ", 0";
$sql.= ", " . $this->source; $sql.= ", " . $this->source;

View File

@ -0,0 +1,545 @@
<?php
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file dev/skeletons/commandefournisseurdispatch.class.php
* \ingroup fournisseur stock
* \brief This file is an example for a CRUD class file (Create/Read/Update/Delete)
* Initialy built by build_class_from_table on 2015-02-24 10:38
*/
// Put here all includes required by your class file
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
/**
* Class to manage table commandefournisseurdispatch
*/
class CommandeFournisseurDispatch extends CommonObject
{
var $db; //!< To store db handler
var $error; //!< To return error code (or message)
var $errors=array(); //!< To return several error codes (or messages)
var $element='commandefournisseurdispatch'; //!< Id that identify managed objects
var $table_element='commande_fournisseur_dispatch'; //!< Name of table without prefix where object is stored
var $id;
var $fk_commande;
var $fk_product;
var $fk_commandefourndet;
var $qty;
var $fk_entrepot;
var $fk_user;
var $datec='';
var $comment;
var $status;
var $tms='';
var $batch;
var $eatby='';
var $sellby='';
/**
* Constructor
*
* @param DoliDb $db Database handler
*/
function __construct($db)
{
$this->db = $db;
// List of language codes for status
$this->statuts[0] = 'Received';
$this->statuts[1] = 'Approved';
$this->statuts[2] = 'Denied';
$this->statutshort[0] = 'Received';
$this->statutshort[1] = 'Approved';
$this->statutshort[2] = 'Denied';
return 1;
}
/**
* Create object into database
*
* @param User $user User that creates
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, Id of created object if OK
*/
function create($user, $notrigger=0)
{
global $conf, $langs;
$error=0;
// Clean parameters
if (isset($this->fk_commande)) $this->fk_commande=trim($this->fk_commande);
if (isset($this->fk_product)) $this->fk_product=trim($this->fk_product);
if (isset($this->fk_commandefourndet)) $this->fk_commandefourndet=trim($this->fk_commandefourndet);
if (isset($this->qty)) $this->qty=trim($this->qty);
if (isset($this->fk_entrepot)) $this->fk_entrepot=trim($this->fk_entrepot);
if (isset($this->fk_user)) $this->fk_user=trim($this->fk_user);
if (isset($this->comment)) $this->comment=trim($this->comment);
if (isset($this->status)) $this->status=trim($this->status);
if (isset($this->batch)) $this->batch=trim($this->batch);
// Check parameters
// Put here code to add control on parameters values
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."(";
$sql.= "fk_commande,";
$sql.= "fk_product,";
$sql.= "fk_commandefourndet,";
$sql.= "qty,";
$sql.= "fk_entrepot,";
$sql.= "fk_user,";
$sql.= "datec,";
$sql.= "comment,";
$sql.= "status,";
$sql.= "batch,";
$sql.= "eatby,";
$sql.= "sellby";
$sql.= ") VALUES (";
$sql.= " ".(! isset($this->fk_commande)?'NULL':"'".$this->fk_commande."'").",";
$sql.= " ".(! isset($this->fk_product)?'NULL':"'".$this->fk_product."'").",";
$sql.= " ".(! isset($this->fk_commandefourndet)?'NULL':"'".$this->fk_commandefourndet."'").",";
$sql.= " ".(! isset($this->qty)?'NULL':"'".$this->qty."'").",";
$sql.= " ".(! isset($this->fk_entrepot)?'NULL':"'".$this->fk_entrepot."'").",";
$sql.= " ".(! isset($this->fk_user)?'NULL':"'".$this->fk_user."'").",";
$sql.= " ".(! isset($this->datec) || dol_strlen($this->datec)==0?'NULL':"'".$this->db->idate($this->datec)."'").",";
$sql.= " ".(! isset($this->comment)?'NULL':"'".$this->db->escape($this->comment)."'").",";
$sql.= " ".(! isset($this->status)?'NULL':"'".$this->status."'").",";
$sql.= " ".(! isset($this->batch)?'NULL':"'".$this->db->escape($this->batch)."'").",";
$sql.= " ".(! isset($this->eatby) || dol_strlen($this->eatby)==0?'NULL':"'".$this->db->idate($this->eatby)."'").",";
$sql.= " ".(! isset($this->sellby) || dol_strlen($this->sellby)==0?'NULL':"'".$this->db->idate($this->sellby)."'")."";
$sql.= ")";
$this->db->begin();
dol_syslog(__METHOD__, LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
}
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
else
{
$this->db->commit();
return $this->id;
}
}
/**
* Load object in memory from the database
*
* @param int $id Id object
* @param string $ref Ref
* @return int <0 if KO, >0 if OK
*/
function fetch($id,$ref='')
{
global $langs;
$sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.fk_commande,";
$sql.= " t.fk_product,";
$sql.= " t.fk_commandefourndet,";
$sql.= " t.qty,";
$sql.= " t.fk_entrepot,";
$sql.= " t.fk_user,";
$sql.= " t.datec,";
$sql.= " t.comment,";
$sql.= " t.status,";
$sql.= " t.tms,";
$sql.= " t.batch,";
$sql.= " t.eatby,";
$sql.= " t.sellby";
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
if ($ref) $sql.= " WHERE t.ref = '".$ref."'";
else $sql.= " WHERE t.rowid = ".$id;
dol_syslog(get_class($this)."::fetch");
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->num_rows($resql))
{
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
$this->fk_commande = $obj->fk_commande;
$this->fk_product = $obj->fk_product;
$this->fk_commandefourndet = $obj->fk_commandefourndet;
$this->qty = $obj->qty;
$this->fk_entrepot = $obj->fk_entrepot;
$this->fk_user = $obj->fk_user;
$this->datec = $this->db->jdate($obj->datec);
$this->comment = $obj->comment;
$this->status = $obj->status;
$this->tms = $this->db->jdate($obj->tms);
$this->batch = $obj->batch;
$this->eatby = $this->db->jdate($obj->eatby);
$this->sellby = $this->db->jdate($obj->sellby);
}
$this->db->free($resql);
return 1;
}
else
{
$this->error="Error ".$this->db->lasterror();
return -1;
}
}
/**
* Update object into database
*
* @param User $user User that modifies
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
function update($user, $notrigger=0)
{
global $conf, $langs;
$error=0;
// Clean parameters
if (isset($this->fk_commande)) $this->fk_commande=trim($this->fk_commande);
if (isset($this->fk_product)) $this->fk_product=trim($this->fk_product);
if (isset($this->fk_commandefourndet)) $this->fk_commandefourndet=trim($this->fk_commandefourndet);
if (isset($this->qty)) $this->qty=trim($this->qty);
if (isset($this->fk_entrepot)) $this->fk_entrepot=trim($this->fk_entrepot);
if (isset($this->fk_user)) $this->fk_user=trim($this->fk_user);
if (isset($this->comment)) $this->comment=trim($this->comment);
if (isset($this->status)) $this->status=trim($this->status);
if (isset($this->batch)) $this->batch=trim($this->batch);
// Check parameters
// Put here code to add a control on parameters values
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
$sql.= " fk_commande=".(isset($this->fk_commande)?$this->fk_commande:"null").",";
$sql.= " fk_product=".(isset($this->fk_product)?$this->fk_product:"null").",";
$sql.= " fk_commandefourndet=".(isset($this->fk_commandefourndet)?$this->fk_commandefourndet:"null").",";
$sql.= " qty=".(isset($this->qty)?$this->qty:"null").",";
$sql.= " fk_entrepot=".(isset($this->fk_entrepot)?$this->fk_entrepot:"null").",";
$sql.= " fk_user=".(isset($this->fk_user)?$this->fk_user:"null").",";
$sql.= " datec=".(dol_strlen($this->datec)!=0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
$sql.= " comment=".(isset($this->comment)?"'".$this->db->escape($this->comment)."'":"null").",";
$sql.= " status=".(isset($this->status)?$this->status:"null").",";
$sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
$sql.= " batch=".(isset($this->batch)?"'".$this->db->escape($this->batch)."'":"null").",";
$sql.= " eatby=".(dol_strlen($this->eatby)!=0 ? "'".$this->db->idate($this->eatby)."'" : 'null').",";
$sql.= " sellby=".(dol_strlen($this->sellby)!=0 ? "'".$this->db->idate($this->sellby)."'" : 'null')."";
$sql.= " WHERE rowid=".$this->id;
$this->db->begin();
dol_syslog(__METHOD__);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
}
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
else
{
$this->db->commit();
return 1;
}
}
/**
* Delete object in database
*
* @param User $user User that deletes
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
function delete($user, $notrigger=0)
{
global $conf, $langs;
$error=0;
$this->db->begin();
if (! $error)
{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql.= " WHERE rowid=".$this->id;
dol_syslog(__METHOD__);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
}
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
else
{
$this->db->commit();
return 1;
}
}
/**
* Load an object from its id and create a new one in database
*
* @param int $fromid Id of object to clone
* @return int New id of clone
*/
function createFromClone($fromid)
{
global $user,$langs;
$error=0;
$object=new Commandefournisseurdispatch($this->db);
$this->db->begin();
// Load source object
$object->fetch($fromid);
$object->id=0;
$object->statut=0;
// Clear fields
// ...
// Create clone
$result=$object->create($user);
// Other options
if ($result < 0)
{
$this->error=$object->error;
$error++;
}
if (! $error)
{
}
// End
if (! $error)
{
$this->db->commit();
return $object->id;
}
else
{
$this->db->rollback();
return -1;
}
}
/**
* Return label of the status of object
*
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto
* @return string Label
*/
function getLibStatut($mode=0)
{
return $this->LibStatut($this->status,$mode);
}
/**
* Return label of a status
*
* @param int $statut Id statut
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
* @return string Label of status
*/
function LibStatut($statut,$mode=0)
{
global $langs;
$langs->load('orders');
if ($mode == 0)
{
return $langs->trans($this->statuts[$statut]);
}
if ($mode == 1)
{
return $langs->trans($this->statutshort[$statut]);
}
if ($mode == 2)
{
return $langs->trans($this->statuts[$statut]);
}
if ($mode == 3)
{
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut0');
if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]),'statut1');
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut3');
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut5');
}
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]),'statut1').' '.$langs->trans($this->statuts[$statut]);
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut5').' '.$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]),'statut1');
if ($statut==2) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]),'statut3');
if ($statut==3) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]),'statut5');
}
}
/**
* Initialise object with example values
* Id must be 0 if object instance is a specimen
*
* @return void
*/
function initAsSpecimen()
{
$this->id=0;
$this->fk_commande='';
$this->fk_product='';
$this->fk_commandefourndet='';
$this->qty='';
$this->fk_entrepot='';
$this->fk_user='';
$this->datec='';
$this->comment='';
$this->status='';
$this->tms='';
$this->batch='';
$this->eatby='';
$this->sellby='';
}
}

View File

@ -262,7 +262,7 @@ class ProductFournisseur extends Product
$sql.= " ".$availability.","; $sql.= " ".$availability.",";
$sql.= " ".$newnpr.","; $sql.= " ".$newnpr.",";
$sql.= $conf->entity.","; $sql.= $conf->entity.",";
$sql.= $this->delivery_time_days; $sql.= $delivery_time_days;
$sql.=")"; $sql.=")";
dol_syslog(get_class($this)."::update_buyprice", LOG_DEBUG); dol_syslog(get_class($this)."::update_buyprice", LOG_DEBUG);

View File

@ -69,6 +69,8 @@ $hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (!
$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); $hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); $hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
$datelivraison=dol_mktime(GETPOST('liv_hour','int'), GETPOST('liv_min','int'), GETPOST('liv_sec','int'), GETPOST('liv_month','int'), GETPOST('liv_day','int'),GETPOST('liv_year','int'));
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
@ -144,8 +146,6 @@ if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer)
// date de livraison // date de livraison
if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->creer) if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->creer)
{ {
$datelivraison=dol_mktime(GETPOST('liv_hour','int'), GETPOST('liv_min','int'), GETPOST('liv_sec','int'), GETPOST('liv_month','int'), GETPOST('liv_day','int'),GETPOST('liv_year','int'));
$result=$object->set_date_livraison($user,$datelivraison); $result=$object->set_date_livraison($user,$datelivraison);
if ($result < 0) if ($result < 0)
{ {
@ -783,9 +783,8 @@ if ($action == 'update_extras')
{ {
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
if ($ret < 0) $error++;
if($ret < 0) $error++;
if (!$error) if (!$error)
{ {
@ -800,7 +799,6 @@ if ($action == 'update_extras')
{ {
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{ {
$result=$object->insertExtraFields(); $result=$object->insertExtraFields();
if ($result < 0) if ($result < 0)
@ -844,6 +842,7 @@ if ($action == 'add' && $user->rights->fournisseur->commande->creer)
$object->fk_account = GETPOST('fk_account', 'int'); $object->fk_account = GETPOST('fk_account', 'int');
$object->note_private = GETPOST('note_private'); $object->note_private = GETPOST('note_private');
$object->note_public = GETPOST('note_public'); $object->note_public = GETPOST('note_public');
$object->date_livraison = $datelivraison;
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@ -1275,6 +1274,16 @@ if ($action=="create")
$form->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id'); $form->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id');
print '</td></tr>'; print '</td></tr>';
// Planned delivery date
print '<tr><td>';
print $langs->trans('DateDeliveryPlanned');
print '</td>';
print '<td>';
$usehourmin=0;
if (! empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin=1;
$form->select_date($datelivraison?$datelivraison:-1,'liv_',$usehourmin,$usehourmin,'',"set");
print '</td></tr>';
// Bank Account // Bank Account
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER) && ! empty($conf->banque->enabled)) if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER) && ! empty($conf->banque->enabled))
{ {

View File

@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_order/modules_commandefou
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load('orders'); $langs->load('orders');
@ -106,6 +107,7 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
$qty = "qty_".$reg[1]."_".$reg[2]; $qty = "qty_".$reg[1]."_".$reg[2];
$ent = "entrepot_".$reg[1]."_".$reg[2]; $ent = "entrepot_".$reg[1]."_".$reg[2];
$pu = "pu_".$reg[1]."_".$reg[2]; $pu = "pu_".$reg[1]."_".$reg[2];
$fk_commandefourndet = "fk_commandefourndet_".$reg[1]."_".$reg[2];
$lot = "lot_number_".$reg[1]."_".$reg[2]; $lot = "lot_number_".$reg[1]."_".$reg[2];
$dDLUO = dol_mktime(12, 0, 0, $_POST['dluo_'.$reg[1]."_".$reg[2].'month'], $_POST['dluo_'.$reg[1]."_".$reg[2].'day'], $_POST['dluo_'.$reg[1]."_".$reg[2].'year']); $dDLUO = dol_mktime(12, 0, 0, $_POST['dluo_'.$reg[1]."_".$reg[2].'month'], $_POST['dluo_'.$reg[1]."_".$reg[2].'day'], $_POST['dluo_'.$reg[1]."_".$reg[2].'year']);
$dDLC = dol_mktime(12, 0, 0, $_POST['dlc_'.$reg[1]."_".$reg[2].'month'], $_POST['dlc_'.$reg[1]."_".$reg[2].'day'], $_POST['dlc_'.$reg[1]."_".$reg[2].'year']); $dDLC = dol_mktime(12, 0, 0, $_POST['dlc_'.$reg[1]."_".$reg[2].'month'], $_POST['dlc_'.$reg[1]."_".$reg[2].'day'], $_POST['dlc_'.$reg[1]."_".$reg[2].'year']);
@ -129,7 +131,7 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
} }
else else
{ {
$result = $commande->dispatchProduct($user, GETPOST($prod,'int'), GETPOST($qty), GETPOST($ent,'int'), GETPOST($pu), GETPOST("comment"), $dDLC, $dDLUO, GETPOST($lot)); $result = $commande->dispatchProduct($user, GETPOST($prod,'int'), GETPOST($qty), GETPOST($ent,'int'), GETPOST($pu), GETPOST("comment"), $dDLC, $dDLUO, GETPOST($lot, 'alpha'), GETPOST($fk_commandefourndet, 'int'));
if ($result < 0) if ($result < 0)
{ {
setEventMessages($commande->error, $commande->errors, 'errors'); setEventMessages($commande->error, $commande->errors, 'errors');
@ -173,6 +175,11 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
* View * View
*/ */
$form = new Form($db);
$warehouse_static = new Entrepot($db);
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
$help_url='EN:CommandeFournisseur'; $help_url='EN:CommandeFournisseur';
if (!empty($conf->productbatch->enabled)) if (!empty($conf->productbatch->enabled))
{ {
@ -183,9 +190,6 @@ else
llxHeader('',$langs->trans("OrderCard"),$help_url); llxHeader('',$langs->trans("OrderCard"),$help_url);
} }
$form = new Form($db);
$warehouse_static = new Entrepot($db);
$now=dol_now(); $now=dol_now();
$id = GETPOST('id','int'); $id = GETPOST('id','int');
@ -282,7 +286,7 @@ if ($id > 0 || ! empty($ref))
print '<input type="hidden" name="action" value="dispatch">'; print '<input type="hidden" name="action" value="dispatch">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
// Set $products_dispatched with qty dispatech for each product id // Set $products_dispatched with qty dispatched for each product id
$products_dispatched = array(); $products_dispatched = array();
$sql = "SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty"; $sql = "SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd";
@ -421,6 +425,7 @@ if ($id > 0 || ! empty($ref))
print '<tr '.$bc[$var].' name="dluo'.$suffix.'">'; print '<tr '.$bc[$var].' name="dluo'.$suffix.'">';
print '<td>'; print '<td>';
print '<input name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">';
print '<input name="product'.$suffix.'" type="hidden" value="'.$objp->fk_product.'">'; print '<input name="product'.$suffix.'" type="hidden" value="'.$objp->fk_product.'">';
print '<input name="pu'.$suffix.'" type="hidden" value="'.$up_ht_disc.'"><!-- This is a up including discount -->'; print '<input name="pu'.$suffix.'" type="hidden" value="'.$up_ht_disc.'"><!-- This is a up including discount -->';
print '</td>'; print '</td>';
@ -441,8 +446,8 @@ if ($id > 0 || ! empty($ref))
print '<td align="right">'; print '<td align="right">';
if (empty($conf->productbatch->enabled) || $objp->tobatch!=1) if (empty($conf->productbatch->enabled) || $objp->tobatch!=1)
{ {
print '<input name="product'.$suffix.'" type="hidden" value="'.$objp->fk_product.'">';
print '<input name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">'; print '<input name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">';
print '<input name="product'.$suffix.'" type="hidden" value="'.$objp->fk_product.'">';
print '<input name="pu'.$suffix.'" type="hidden" value="'.$up_ht_disc.'"><!-- This is a up including discount -->'; print '<input name="pu'.$suffix.'" type="hidden" value="'.$up_ht_disc.'"><!-- This is a up including discount -->';
} }
print '<input id="qty'.$suffix.'" name="qty'.$suffix.'" type="text" size="8" value="'.($remaintodispatch).'">'; print '<input id="qty'.$suffix.'" name="qty'.$suffix.'" type="text" size="8" value="'.($remaintodispatch).'">';
@ -578,8 +583,10 @@ if ($id > 0 || ! empty($ref))
// Status // Status
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS))
{ {
print '<td>'; print '<td align="right">';
print $objp->status; $supplierorderdispatch->status = (empty($objp->status)?0:$objp->status);
//print $supplierorderdispatch->status;
print $supplierorderdispatch->getLibStatut(5);
print '</td>'; print '</td>';
} }

View File

@ -45,7 +45,7 @@ $search_user=GETPOST('search_user');
$search_ht=GETPOST('search_ht'); $search_ht=GETPOST('search_ht');
$search_ttc=GETPOST('search_ttc'); $search_ttc=GETPOST('search_ttc');
$sall=GETPOST('search_all'); $sall=GETPOST('search_all');
$search_status=GETPOST('search_status','int'); $search_status=(GETPOST('search_status','int')!=''?GETPOST('search_status','int'):GETPOST('statut','int'));
$page = GETPOST('page','int'); $page = GETPOST('page','int');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');

View File

@ -1073,7 +1073,7 @@ elseif ($action == 'update_extras')
{ {
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
if($ret < 0) $error++; if($ret < 0) $error++;

View File

@ -4,7 +4,7 @@
* *
* 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
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -13,8 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program. If not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
/** /**

View File

@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/import.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/import.lib.php';
$langs->load("exports"); $langs->load("exports");
$langs->load("compta");
$langs->load("errors"); $langs->load("errors");
// Security check // Security check

View File

@ -486,11 +486,14 @@ IMG;
$execmethod=(empty($conf->global->MAIN_EXEC_USE_POPEN)?1:2); // 1 or 2 $execmethod=(empty($conf->global->MAIN_EXEC_USE_POPEN)?1:2); // 1 or 2
$name=str_replace('.odt', '', $name); $name=preg_replace('/\.odt/i', '', $name);
if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT)) { if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT))
$command = $conf->global->MAIN_DOL_SCRIPTS_ROOT.'/scripts/odt2pdf/odt2pdf.sh '.$name; {
}else { $command = $conf->global->MAIN_DOL_SCRIPTS_ROOT.'/scripts/odt2pdf/odt2pdf.sh '.$name.' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
$command = '../../scripts/odt2pdf/odt2pdf.sh '.$name; }
else
{
$command = '../../scripts/odt2pdf/odt2pdf.sh '.$name.' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
} }
@ -620,7 +623,7 @@ IMG;
public function getvalue($valuename) public function getvalue($valuename)
{ {
$searchreg="/\\[".$valuename."\\](.*)\\[\\/".$valuename."\\]/"; $searchreg="/\\[".$valuename."\\](.*)\\[\\/".$valuename."\\]/";
preg_match($searchreg, $this->contentXml, $matches); preg_match($searchreg, $this->contentXml, $matches);
$this->contentXml = preg_replace($searchreg, "", $this->contentXml); $this->contentXml = preg_replace($searchreg, "", $this->contentXml);
return $matches[1]; return $matches[1];
} }

View File

@ -318,7 +318,8 @@ if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->read)
{ {
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$board=new ActionComm($db); $board=new ActionComm($db);
$dashboardlines[] = $board->load_board($user);
$dashboardlines[] = $board->load_board($user);
} }
// Number of customer orders a deal // Number of customer orders a deal

12451
htdocs/install/filelist.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1161,4 +1161,4 @@ ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_b
UPDATE llx_bank_url set url = REPLACE( url, 'fiche.php', 'card.php'); UPDATE llx_bank_url set url = REPLACE( url, 'fiche.php', 'card.php');
-- Add id commandefourndet in llx_commande_fournisseur_dispatch to correct /fourn/commande/dispatch.php display when several times same product in supplier order -- Add id commandefourndet in llx_commande_fournisseur_dispatch to correct /fourn/commande/dispatch.php display when several times same product in supplier order
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_commandefourndet INT(11) NOT NULL DEFAULT '0' AFTER fk_product; ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_commandefourndet INTEGER NOT NULL DEFAULT 0 AFTER fk_product;

View File

@ -62,6 +62,12 @@ create table llx_payment_loan
fk_user_modif integer fk_user_modif integer
)ENGINE=innodb; )ENGINE=innodb;
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN date_livraison datetime;
-- Add id commandefourndet in llx_commande_fournisseur_dispatch to correct /fourn/commande/dispatch.php display when several times same product in supplier order
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_commandefourndet INTEGER NOT NULL DEFAULT 0 AFTER fk_product;
-- Remove menu entries of removed or renamed modules -- Remove menu entries of removed or renamed modules
DELETE FROM llx_menu where module = 'printipp'; DELETE FROM llx_menu where module = 'printipp';
@ -161,10 +167,9 @@ ALTER TABLE llx_stock_mouvement ADD COLUMN sellby date DEFAULT NULL;
CREATE TABLE llx_expensereport ( CREATE TABLE llx_expensereport (
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
ref varchar(50) NOT NULL, ref varchar(50) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_number_int integer DEFAULT NULL, ref_number_int integer DEFAULT NULL,
ref_ext integer, ref_ext integer,
@ -175,30 +180,33 @@ CREATE TABLE llx_expensereport (
total_ttc double(24,8) DEFAULT 0, total_ttc double(24,8) DEFAULT 0,
date_debut date NOT NULL, date_debut date NOT NULL,
date_fin date NOT NULL, date_fin date NOT NULL,
date_paiement datetime,
date_valide datetime,
date_create datetime NOT NULL, date_create datetime NOT NULL,
date_valid datetime,
date_approve datetime,
date_refuse datetime,
date_cancel datetime,
date_paiement datetime,
tms timestamp, tms timestamp,
fk_user_author integer NOT NULL, fk_user_author integer NOT NULL,
fk_user_modif integer DEFAULT NULL, fk_user_modif integer DEFAULT NULL,
fk_user_valid integer DEFAULT NULL,
fk_user_validator integer DEFAULT NULL, fk_user_validator integer DEFAULT NULL,
fk_user_approve integer DEFAULT NULL,
fk_user_refuse integer DEFAULT NULL,
fk_user_cancel integer DEFAULT NULL,
fk_user_paid integer DEFAULT NULL,
fk_c_expensereport_statuts integer NOT NULL, -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé fk_c_expensereport_statuts integer NOT NULL, -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé
fk_c_paiement integer DEFAULT NULL, fk_c_paiement integer DEFAULT NULL,
note text, note_public text,
note_private text, note_private text,
fk_user_valid integer DEFAULT NULL,
fk_user_paid integer DEFAULT NULL,
detail_refuse varchar(255) DEFAULT NULL, detail_refuse varchar(255) DEFAULT NULL,
date_cancel datetime,
date_refuse datetime,
detail_cancel varchar(255) DEFAULT NULL, detail_cancel varchar(255) DEFAULT NULL,
fk_user_cancel integer DEFAULT NULL, integration_compta integer DEFAULT NULL, -- not used
fk_user_refuse integer DEFAULT NULL,
integration_compta integer DEFAULT NULL,
fk_bank_account integer DEFAULT NULL, fk_bank_account integer DEFAULT NULL,
model_pdf varchar(50) DEFAULT NULL model_pdf varchar(50) DEFAULT NULL
) ENGINE=innodb; ) ENGINE=innodb;
CREATE TABLE llx_expensereport_det CREATE TABLE llx_expensereport_det
( (
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
@ -229,6 +237,4 @@ CREATE TABLE llx_expensereport_det
) ENGINE=innodb; ) ENGINE=innodb;
ALTER TABLE llx_projet ADD COLUMN budget_amount double(24,8); ALTER TABLE llx_projet ADD COLUMN budget_amount double(24,8);
>>>>>>> Upstream/develop

View File

@ -29,27 +29,28 @@ CREATE TABLE llx_expensereport (
total_ttc double(24,8) DEFAULT 0, total_ttc double(24,8) DEFAULT 0,
date_debut date NOT NULL, date_debut date NOT NULL,
date_fin date NOT NULL, date_fin date NOT NULL,
date_paiement datetime,
date_valide datetime,
date_create datetime NOT NULL, date_create datetime NOT NULL,
date_valid datetime,
date_approve datetime,
date_refuse datetime,
date_cancel datetime,
date_paiement datetime,
tms timestamp, tms timestamp,
fk_user_author integer NOT NULL, fk_user_author integer NOT NULL,
fk_user_modif integer DEFAULT NULL, fk_user_modif integer DEFAULT NULL,
fk_user_valid integer DEFAULT NULL,
fk_user_validator integer DEFAULT NULL, fk_user_validator integer DEFAULT NULL,
fk_user_approve integer DEFAULT NULL,
fk_user_refuse integer DEFAULT NULL,
fk_user_cancel integer DEFAULT NULL,
fk_user_paid integer DEFAULT NULL,
fk_c_expensereport_statuts integer NOT NULL, -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé fk_c_expensereport_statuts integer NOT NULL, -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé
fk_c_paiement integer DEFAULT NULL, fk_c_paiement integer DEFAULT NULL,
note text, note_public text,
note_private text, note_private text,
fk_user_valid integer DEFAULT NULL,
fk_user_approve integer DEFAULT NULL,
fk_user_paid integer DEFAULT NULL,
detail_refuse varchar(255) DEFAULT NULL, detail_refuse varchar(255) DEFAULT NULL,
date_cancel datetime,
date_refuse datetime,
detail_cancel varchar(255) DEFAULT NULL, detail_cancel varchar(255) DEFAULT NULL,
fk_user_cancel integer DEFAULT NULL, integration_compta integer DEFAULT NULL, -- not used
fk_user_refuse integer DEFAULT NULL,
integration_compta integer DEFAULT NULL,
fk_bank_account integer DEFAULT NULL, fk_bank_account integer DEFAULT NULL,
model_pdf varchar(50) DEFAULT NULL model_pdf varchar(50) DEFAULT NULL
) ENGINE=innodb; ) ENGINE=innodb;

View File

@ -9,13 +9,13 @@ Menuaccount=Buchhaltung Konten
Menuthirdpartyaccount=Partnerkonten Menuthirdpartyaccount=Partnerkonten
MenuTools=Werkzeuge MenuTools=Werkzeuge
ConfigAccountingExpert=Configuration of the module accounting expert ConfigAccountingExpert=Konfiguration des Experten Buchhaltungsmodul
Journaux=Journale Journaux=Journale
JournalFinancial=Finanz-Journale JournalFinancial=Finanz-Journale
Exports=Exports Exports=Exports
Export=Export Export=Exportieren
Modelcsv=Exportmodell Modelcsv=Exportmodell
OptionsDeactivatedForThisExportModel=For this export model, options are deactivated OptionsDeactivatedForThisExportModel=Für dieses Exportierungsmodell, sind die Einstellungen deaktiviert
Selectmodelcsv=Wählen Sie ein Exportmodell Selectmodelcsv=Wählen Sie ein Exportmodell
Modelcsv_normal=Klassischer Export Modelcsv_normal=Klassischer Export
Modelcsv_CEGID=Export zu CEGID Expert Modelcsv_CEGID=Export zu CEGID Expert
@ -27,12 +27,12 @@ Selectchartofaccounts=Kontenplan wählen
Validate=Freigeben Validate=Freigeben
Addanaccount=Fügen Sie ein Buchhaltungskonto hinzu Addanaccount=Fügen Sie ein Buchhaltungskonto hinzu
AccountAccounting=Buchhaltungs Konto AccountAccounting=Buchhaltungs Konto
Ventilation=Breakdown Ventilation=Abbauen
ToDispatch=Zu versenden ToDispatch=Zu versenden
Dispatched=Versandt Dispatched=Versandt
CustomersVentilation=Breakdown customers CustomersVentilation=Kundenabbau
SuppliersVentilation=Breakdown suppliers SuppliersVentilation=Lieferantenabbau
TradeMargin=Handelsspanne TradeMargin=Handelsspanne
Reports=Berichte Reports=Berichte
ByCustomerInvoice=Nach Kundenrechnungen ByCustomerInvoice=Nach Kundenrechnungen
@ -41,81 +41,81 @@ NewAccount=Neues Buchhaltungskonto
Update=Aktualisieren Update=Aktualisieren
List=Liste List=Liste
Create=Erstelle Create=Erstelle
UpdateAccount=Modification of an accounting account UpdateAccount=Änderung eines Bilanz-Kontos
UpdateMvts=Modification of a movement UpdateMvts=Änderung einer Bewegung
WriteBookKeeping=Record accounts in general ledger WriteBookKeeping=Konten ins Hauptbuch übernehmen
Bookkeeping=Hauptbuch Bookkeeping=Hauptbuch
AccountBalanceByMonth=Kontostand pro Monat AccountBalanceByMonth=Kontostand pro Monat
AccountingVentilation=Breakdown accounting AccountingVentilation=Rechnungswesenabbau
AccountingVentilationSupplier=Breakdown accounting supplier AccountingVentilationSupplier=Abbau von Buchhaltungs-Lieferanten
AccountingVentilationCustomer=Breakdown accounting customer AccountingVentilationCustomer=Abbau von Buchhaltungs-Kunden
Line=Zeile Line=Zeile
CAHTF=Total purchase supplier HT CAHTF=Total purchase supplier HT
InvoiceLines=Lines of invoice to be ventilated InvoiceLines=Rechnungszeile bereinigen
InvoiceLinesDone=Ventilated lines of invoice InvoiceLinesDone=Bereinigte Rechnungszeilen
IntoAccount=In the accounting account IntoAccount=Im Buchhaltungs-Konto
Ventilate=erörtern Ventilate=erörtern
VentilationAuto=Automatic breakdown VentilationAuto=Automatischer Abbau
Processing=Bearbeitung Processing=Bearbeitung
EndProcessing=Das Ende der Verarbeitung EndProcessing=Das Ende der Verarbeitung
AnyLineVentilate=Any lines to ventilate AnyLineVentilate=Beliebige Zeile zu bereinigen
SelectedLines=Gewählte Zeilen SelectedLines=Gewählte Zeilen
Lineofinvoice=Rechnungszeile Lineofinvoice=Rechnungszeile
VentilatedinAccount=Ventilated successfully in the accounting account VentilatedinAccount=Erfolgreich im Rechnungskonto bereinigt
NotVentilatedinAccount=Not ventilated in the accounting account NotVentilatedinAccount=Nicht im Rechnungskonto bereinigt
ACCOUNTING_SEPARATORCSV=Column separator in export file ACCOUNTING_SEPARATORCSV=Spaltentrennzeichen in Exportdatei
ACCOUNTING_LIMIT_LIST_VENTILATION=Number of elements to be breakdown shown by page (maximum recommended : 50) ACCOUNTING_LIMIT_LIST_VENTILATION=Anzahl der Elemente, die Aufgliederung nach Seite angezeigt werden (empfohlenes Maximum: 50)
ACCOUNTING_LIST_SORT_VENTILATION_TODO=Begin the sorting of the breakdown pages "Has to breakdown" by the most recent elements ACCOUNTING_LIST_SORT_VENTILATION_TODO=Beginnen Sie die Sortierung der Abbau Seiten "Muss sortiert werden" durch die aktuellen Elemente
ACCOUNTING_LIST_SORT_VENTILATION_DONE=Begin the sorting of the breakdown pages "Breakdown" by the most recent elements ACCOUNTING_LIST_SORT_VENTILATION_DONE=Beginnen Sie die Sortierung der Abbau Seiten "Abbau" durch die aktuellen Elemente
AccountLength=Length of the accounting accounts shown in Dolibarr AccountLength=Länge der in Dolibarr gezeigten Rechnungskonten
AccountLengthDesc=Function allowing to feign a length of accounting account by replacing spaces by the zero figure. This function touches only the display, it does not modify the accounting accounts registered in Dolibarr. For the export, this function is necessary to be compatible with certain software. AccountLengthDesc=Function allowing to feign a length of accounting account by replacing spaces by the zero figure. This function touches only the display, it does not modify the accounting accounts registered in Dolibarr. For the export, this function is necessary to be compatible with certain software.
ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounts ACCOUNTING_LENGTH_GACCOUNT=Länge der Finanzbuchführung
ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounts ACCOUNTING_LENGTH_AACCOUNT=Länge der Partner
ACCOUNTING_SELL_JOURNAL=Verkaufsjournal ACCOUNTING_SELL_JOURNAL=Verkaufsjournal
ACCOUNTING_PURCHASE_JOURNAL=Einkaufsjournal ACCOUNTING_PURCHASE_JOURNAL=Einkaufsjournal
ACCOUNTING_BANK_JOURNAL=Bankauszug ACCOUNTING_BANK_JOURNAL=Bankauszug
ACCOUNTING_CASH_JOURNAL=Kassenbeleg ACCOUNTING_CASH_JOURNAL=Kassenbeleg
ACCOUNTING_MISCELLANEOUS_JOURNAL=Verschiedenes Journal ACCOUNTING_MISCELLANEOUS_JOURNAL=Verschiedenes Journal
ACCOUNTING_SOCIAL_JOURNAL=Social journal ACCOUNTING_SOCIAL_JOURNAL=Sozial-Journal
ACCOUNTING_ACCOUNT_TRANSFER_CASH=Account of transfer ACCOUNTING_ACCOUNT_TRANSFER_CASH=Konto der Transaktion
ACCOUNTING_ACCOUNT_SUSPENSE=Account of wait ACCOUNTING_ACCOUNT_SUSPENSE=Konto der Warte
ACCOUNTING_PRODUCT_BUY_ACCOUNT=Accounting account by default for bought products (if not defined in the product sheet) ACCOUNTING_PRODUCT_BUY_ACCOUNT=Buchhaltungskonto standardmäßig für die gekauften Produkte (wenn nicht im Produktblatt definiert)
ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Accounting account by default for the sold products (if not defined in the product sheet) ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Buchhaltungskonto standardmäßig für die verkauften Produkte (wenn nicht im Produktblatt definiert)
ACCOUNTING_SERVICE_BUY_ACCOUNT=Accounting account by default for the bought services (if not defined in the service sheet) ACCOUNTING_SERVICE_BUY_ACCOUNT=Buchhaltungskonto standardmäßig für die gekauften Dienstleistungen (wenn nicht im Produktblatt definiert)
ACCOUNTING_SERVICE_SOLD_ACCOUNT=Accounting account by default for the sold services (if not defined in the service sheet) ACCOUNTING_SERVICE_SOLD_ACCOUNT=Buchhaltungskonto standardmäßig für die verkauften Dienstleistungen (wenn nicht im Produktblatt definiert)
Doctype=Dokumententyp Doctype=Dokumententyp
Docdate=Datum Docdate=Datum
Docref=Referenz Docref=Referenz
Numerocompte=Konto Numerocompte=Konto
Code_tiers=Thirdparty Code_tiers=Partner
Labelcompte=Label account Labelcompte=Label-Account
Debit=Soll Debit=Soll
Credit=Haben Credit=Haben
Amount=Betrag Amount=Betrag
Sens=Sens Sens=Sens
Codejournal=Journal Codejournal=Journal
DelBookKeeping=Delete the records of the general ledger DelBookKeeping=Löschen Sie die Einträge des Hauptbuchs
SellsJournal=Verkaufsjournal SellsJournal=Verkaufsjournal
PurchasesJournal=Einkaufsjournal PurchasesJournal=Einkaufsjournal
DescSellsJournal=Verkaufsjournal DescSellsJournal=Verkaufsjournal
DescPurchasesJournal=Einkaufsjournal DescPurchasesJournal=Einkaufsjournal
BankJournal=Bankauszug BankJournal=Bankauszug
DescBankJournal=Bank journal including all the types of payments other than cash DescBankJournal=Bankjournal enthält alle Arten von anderen Zahlungsmitteln als Barzahlungen
CashJournal=Kassenbeleg CashJournal=Kassenbeleg
DescCashJournal=Cash journal including the type of payment cash DescCashJournal=Barjournal enthält die Zahlungsart: bar
CashPayment=Barzahlung CashPayment=Barzahlung
@ -125,36 +125,36 @@ CustomerInvoicePayment=Rechnungszahlung (Kunde)
ThirdPartyAccount=Partner Konto ThirdPartyAccount=Partner Konto
NewAccountingMvt=Neue Änderung NewAccountingMvt=Neue Änderung
NumMvts=Number of movement NumMvts=Anzahl der Änderungen
ListeMvts=List of the movement ListeMvts=Liste der Bewegungen
ErrorDebitCredit=Soll und Haben können nicht gleichzeitig eingegeben werden ErrorDebitCredit=Soll und Haben können nicht gleichzeitig eingegeben werden
ReportThirdParty=List thirdparty account ReportThirdParty=Liste der Partner Konten
DescThirdPartyReport=Consult here the list of the thirdparty customers and the suppliers and their accounting accounts DescThirdPartyReport=Konsultieren Sie hier die Liste der Drittkunden und die Anbieter und ihre Buchhaltungskonten
ListAccounts=List of the accounting accounts ListAccounts=Liste der Abrechnungskonten
Pcgversion=Version des Plans Pcgversion=Version des Plans
Pcgtype=Kontenklasse Pcgtype=Kontenklasse
Pcgsubtype=Unterkontenklasse Pcgsubtype=Unterkontenklasse
Accountparent=Root of the account Accountparent=Wurzeln des Kontos
Active=Auszug Active=Auszug
NewFiscalYear=Neues fiskalisches Jahr NewFiscalYear=Neues fiskalisches Jahr
DescVentilCustomer=Consult here the annual breakdown accounting of your invoices customers DescVentilCustomer=Konsultieren Sie hier die jährliche Aufteilung der Buchhaltung Ihrer Rechnungs-Kunden
TotalVente=Total turnover HT TotalVente=Totaler Umsatz
TotalMarge=Gesamt-Spanne TotalMarge=Gesamt-Spanne
DescVentilDoneCustomer=Consult here the list of the lines of invoices customers and their accounting account DescVentilDoneCustomer=Konsultieren Sie hier die Liste der Zeilen der Rechnungs-Kunden und deren Abbrechnungskonto
DescVentilTodoCustomer=Ventilate your lines of customer invoice with an accounting account DescVentilTodoCustomer=Bereinigen Sie die Zeilen der Kundenrechnung mit einem Rechnungskonto
ChangeAccount=Change the accounting account for lines selected by the account: ChangeAccount=Ändern sie das Abrechnungskonto für markierte Zeilen durch das Konto:
Vide=- Vide=-
DescVentilSupplier=Consult here the annual breakdown accounting of your invoices suppliers DescVentilSupplier=Konsultieren Sie hier die jährliche Aufteilung der Buchhaltung, Ihrer Rechnungen der Lieferanten
DescVentilTodoSupplier=Ventilate your lines of invoice supplier with an accounting account DescVentilTodoSupplier=Bereinigen Sie die Zeilen der Rechnung für Lieferanten, mit einem Abrechnungskonto
DescVentilDoneSupplier=Consult here the list of the lines of invoices supplier and their accounting account DescVentilDoneSupplier=Konsultieren Sie hier die Liste der Zeilen der Rechnungs-Kunden und deren Abbrechnungskonto
ValidateHistory=Automatisch geltend machen ValidateHistory=Automatisch geltend machen
ErrorAccountancyCodeIsAlreadyUse=Fehler, Sie können dieses Buchaltungskonto nicht löschen, da es benutzt wird. ErrorAccountancyCodeIsAlreadyUse=Fehler, Sie können dieses Buchaltungskonto nicht löschen, da es benutzt wird.
FicheVentilation=Breakdown card FicheVentilation=Abbau-Karte

View File

@ -60,7 +60,7 @@ SupplierOrderSentByEMail=Lieferantenbestellung %s per E-Mail versendet
SupplierInvoiceSentByEMail=Lieferantenrechnung %s per E-Mail versendet SupplierInvoiceSentByEMail=Lieferantenrechnung %s per E-Mail versendet
ShippingSentByEMail=Lieferung %s per Email versendet ShippingSentByEMail=Lieferung %s per Email versendet
ShippingValidated= Sendung %s freigegeben ShippingValidated= Sendung %s freigegeben
InterventionSentByEMail=Intervention %s sent by EMail InterventionSentByEMail=Intervention %s gesendet via E-Mail
NewCompanyToDolibarr= Partner erstellt NewCompanyToDolibarr= Partner erstellt
DateActionPlannedStart= Geplantes Startdatum DateActionPlannedStart= Geplantes Startdatum
DateActionPlannedEnd= Geplantes Enddatum DateActionPlannedEnd= Geplantes Enddatum
@ -69,7 +69,7 @@ DateActionDoneEnd= Effektives Ende
DateActionStart= Startdatum DateActionStart= Startdatum
DateActionEnd= Enddatum DateActionEnd= Enddatum
AgendaUrlOptions1=Sie können die Ausgabe über folgende Parameter filtern: AgendaUrlOptions1=Sie können die Ausgabe über folgende Parameter filtern:
AgendaUrlOptions2=<b>login=%s</b> to restrict output to actions created by or assigned to user <b>%s</b>. AgendaUrlOptions2=<b>Login =%s</b> für die Ausgabe an Aktionen erstellt, die von oder an den Benutzer <b>%s</b> zugeordnet beschränken.
AgendaUrlOptions3=<b>logina=%s</b> begrenzt die Ausgabe auf von Benutzer <b>%s</b> erstellte Maßnahmen. AgendaUrlOptions3=<b>logina=%s</b> begrenzt die Ausgabe auf von Benutzer <b>%s</b> erstellte Maßnahmen.
AgendaUrlOptions4=<b>logint=%s</b> begrenzt die Ausgabe auf von Benutzer <b>%s</b> betroffene Maßnahmen. AgendaUrlOptions4=<b>logint=%s</b> begrenzt die Ausgabe auf von Benutzer <b>%s</b> betroffene Maßnahmen.
AgendaUrlOptionsProject=<b>project=PROJECT_ID</b> begrenzt die die Ausgabe auf Maßnahmen im Zusammenhang mit Projekt <b>PROJECT_ID</b>. AgendaUrlOptionsProject=<b>project=PROJECT_ID</b> begrenzt die die Ausgabe auf Maßnahmen im Zusammenhang mit Projekt <b>PROJECT_ID</b>.

View File

@ -348,7 +348,7 @@ ChequeNumber=Schecknummer
ChequeOrTransferNumber=Scheck-/Überweisungsnummer ChequeOrTransferNumber=Scheck-/Überweisungsnummer
ChequeMaker=Scheckaussteller ChequeMaker=Scheckaussteller
ChequeBank=Scheckbank ChequeBank=Scheckbank
CheckBank=Check CheckBank=Prüfen
NetToBePaid=Netto Zahlbetrag NetToBePaid=Netto Zahlbetrag
PhoneNumber=Tel PhoneNumber=Tel
FullPhoneNumber=Telefon FullPhoneNumber=Telefon
@ -389,7 +389,7 @@ DisabledBecausePayments=Nicht möglich, da es Zahlungen gibt
CantRemovePaymentWithOneInvoicePaid=Die Zahlung kann nicht entfernt werden, da es mindestens eine Rechnung gibt, die als bezahlt markiert ist CantRemovePaymentWithOneInvoicePaid=Die Zahlung kann nicht entfernt werden, da es mindestens eine Rechnung gibt, die als bezahlt markiert ist
ExpectedToPay=Erwartete Zahlung ExpectedToPay=Erwartete Zahlung
PayedByThisPayment=mit dieser Zahlung beglichen PayedByThisPayment=mit dieser Zahlung beglichen
ClosePaidInvoicesAutomatically=Classify "Paid" all standard, situation or replacement invoices entirely paid. ClosePaidInvoicesAutomatically=Markiert alle Standard- oder Ersatzrechnungen als "bezahlt", wenn diese vollständig beglichen sind.
ClosePaidCreditNotesAutomatically=Markiert alle Gutschriften als "bezahlt", wenn diese vollständig beglichen sind. ClosePaidCreditNotesAutomatically=Markiert alle Gutschriften als "bezahlt", wenn diese vollständig beglichen sind.
AllCompletelyPayedInvoiceWillBeClosed=Alle Rechnungen ohne ausstehende Zahlungen werden automatisch geschlossen und als "bezahlt" markiert. AllCompletelyPayedInvoiceWillBeClosed=Alle Rechnungen ohne ausstehende Zahlungen werden automatisch geschlossen und als "bezahlt" markiert.
ToMakePayment=Bezahlen ToMakePayment=Bezahlen
@ -400,7 +400,7 @@ RevenueStamp=Steuermarke
YouMustCreateInvoiceFromThird=Diese Option steht nur zur Verfügung, wenn eine Rechnung vom Reiter "Kunde" eines Partners aus erstellt wird YouMustCreateInvoiceFromThird=Diese Option steht nur zur Verfügung, wenn eine Rechnung vom Reiter "Kunde" eines Partners aus erstellt wird
PDFCrabeDescription=Rechnungs-Modell Crabe. Eine vollständige Rechnung (Empfohlene Vorlage) PDFCrabeDescription=Rechnungs-Modell Crabe. Eine vollständige Rechnung (Empfohlene Vorlage)
TerreNumRefModelDesc1=Liefert eine Nummer mit dem Format %syymm-nnnn für Standard-Rechnungen und %syymm-nnnn für Gutschriften, wobei yy=Jahr, mm=Monat und nnnn eine lückenlose Folge ohne Überlauf auf 0 ist TerreNumRefModelDesc1=Liefert eine Nummer mit dem Format %syymm-nnnn für Standard-Rechnungen und %syymm-nnnn für Gutschriften, wobei yy=Jahr, mm=Monat und nnnn eine lückenlose Folge ohne Überlauf auf 0 ist
MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for credit notes and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 MarsNumRefModelDesc1=Liefert eine Nummer mit dem Format %syymm-nnnn für Standard-Rechnungen, %syymm-nnnn für den Austausch von Rechnungen, %syymm-nnnn für Gutschriften und %syymm-nnnn für Gutschrifen wobei yy=Jahr, mm=Monat und nnnn eine lückenlose Folge ohne Überlauf auf 0 ist
TerreNumRefModelError=Eine Rechnung, beginnend mit $ syymm existiert bereits und ist nicht kompatibel mit diesem Modell der Reihe. Entfernen oder umbenennen, um dieses Modul. TerreNumRefModelError=Eine Rechnung, beginnend mit $ syymm existiert bereits und ist nicht kompatibel mit diesem Modell der Reihe. Entfernen oder umbenennen, um dieses Modul.
##### Types de contacts ##### ##### Types de contacts #####
TypeContact_facture_internal_SALESREPFOLL=Repräsentative Follow-up Kundenrechnung TypeContact_facture_internal_SALESREPFOLL=Repräsentative Follow-up Kundenrechnung
@ -420,11 +420,11 @@ InvoiceSituationDesc=Create a new situation following an already existing one
SituationAmount=Situation invoice amount(net) SituationAmount=Situation invoice amount(net)
SituationDeduction=Situation subtraction SituationDeduction=Situation subtraction
Progress=Progress Progress=Progress
ModifyAllLines=Modify all lines ModifyAllLines=Bearbeite alle Zeilen
CreateNextSituationInvoice=Create next situation CreateNextSituationInvoice=Create next situation
NotLastInCycle=This invoice in not the last in cycle and must not be modified. NotLastInCycle=This invoice in not the last in cycle and must not be modified.
DisabledBecauseNotLastInCycle=The next situation already exists. DisabledBecauseNotLastInCycle=The next situation already exists.
DisabledBecauseFinal=This situation is final. DisabledBecauseFinal=This situation is final.
CantBeLessThanMinPercent=The progress can't be smaller than its value in the previous situation. CantBeLessThanMinPercent=The progress can't be smaller than its value in the previous situation.
NoSituations=No opened situations NoSituations=No opened situations
InvoiceSituationLast=Final and general invoice InvoiceSituationLast=Allgemeine Endrechnung

View File

@ -3,7 +3,7 @@ RefProject=Projekt-Nr.
ProjectId=Projekt-ID ProjectId=Projekt-ID
Project=Projekt Project=Projekt
Projects=Projekte Projects=Projekte
ProjectStatus=Project status ProjectStatus=Projekt Status
SharedProject=Jeder SharedProject=Jeder
PrivateProject=Kontakte zum Projekt PrivateProject=Kontakte zum Projekt
MyProjectsDesc=Hier können Sie nur die Projekte einsehen, bei welchen Sie als Kontakt hinzugefügt sind. MyProjectsDesc=Hier können Sie nur die Projekte einsehen, bei welchen Sie als Kontakt hinzugefügt sind.
@ -103,7 +103,7 @@ CloneContacts=Dupliziere Kontakte
CloneNotes=Dupliziere Hinweise CloneNotes=Dupliziere Hinweise
CloneProjectFiles=Dupliziere verbundene Projektdateien CloneProjectFiles=Dupliziere verbundene Projektdateien
CloneTaskFiles=Clone task(s) joined files (if task(s) cloned) CloneTaskFiles=Clone task(s) joined files (if task(s) cloned)
CloneMoveDate=Update project/tasks dates from now ? CloneMoveDate=Projekt / Aufgaben Daten vom aktuellen Zeitpunkt updaten?
ConfirmCloneProject=Möchten Sie dieses Projekt wirklich duplizieren? ConfirmCloneProject=Möchten Sie dieses Projekt wirklich duplizieren?
ProjectReportDate=Passe Aufgaben-Datum dem Projekt-Startdatum an ProjectReportDate=Passe Aufgaben-Datum dem Projekt-Startdatum an
ErrorShiftTaskDate=Es ist nicht möglich, das Aufgabendatum dem neuen Projektdatum anzupassen ErrorShiftTaskDate=Es ist nicht möglich, das Aufgabendatum dem neuen Projektdatum anzupassen

View File

@ -4,8 +4,8 @@ Sending=Sendung
Sendings=Sendungen Sendings=Sendungen
Shipment=Sendung Shipment=Sendung
Shipments=Lieferungen Shipments=Lieferungen
ShowSending=Show Sending ShowSending=Zeige Sendung
Receivings=Receipts Receivings=Beleg
SendingsArea=Versandübersicht SendingsArea=Versandübersicht
ListOfSendings=Versandliste ListOfSendings=Versandliste
SendingMethod=Versandart SendingMethod=Versandart
@ -15,7 +15,7 @@ SearchASending=Suche Sendung
StatisticsOfSendings=Versandstatistik StatisticsOfSendings=Versandstatistik
NbOfSendings=Anzahl der Sendungen NbOfSendings=Anzahl der Sendungen
NumberOfShipmentsByMonth=Anzahl der Sendungen nach Monaten NumberOfShipmentsByMonth=Anzahl der Sendungen nach Monaten
SendingCard=Shipment card SendingCard=Sendungs-Karte
NewSending=Neue Sendung NewSending=Neue Sendung
CreateASending=Erzeuge eine Sendung CreateASending=Erzeuge eine Sendung
CreateSending=Sendung erzeugen CreateSending=Sendung erzeugen
@ -38,7 +38,7 @@ StatusSendingCanceledShort=Storno
StatusSendingDraftShort=Entwurf StatusSendingDraftShort=Entwurf
StatusSendingValidatedShort=Freigegeben StatusSendingValidatedShort=Freigegeben
StatusSendingProcessedShort=Fertig StatusSendingProcessedShort=Fertig
SendingSheet=Shipment sheet SendingSheet=Sendungs Blatt
Carriers=Spediteure Carriers=Spediteure
Carrier=Spediteur Carrier=Spediteur
CarriersArea=Spediteursübersicht CarriersArea=Spediteursübersicht
@ -55,19 +55,19 @@ StatsOnShipmentsOnlyValidated=Versandstatistik (nur Freigegebene). Das Datum ist
DateDeliveryPlanned=Geplantes Zustellungsdatum DateDeliveryPlanned=Geplantes Zustellungsdatum
DateReceived=Datum der Zustellung DateReceived=Datum der Zustellung
SendShippingByEMail=Verand per E-Mail SendShippingByEMail=Verand per E-Mail
SendShippingRef=Submission of shipment %s SendShippingRef=Abgabe der Sendung %s
ActionsOnShipping=Anmerkungen zur Sendung ActionsOnShipping=Anmerkungen zur Sendung
LinkToTrackYourPackage=Link zur Sendungsnachverfolgung LinkToTrackYourPackage=Link zur Sendungsnachverfolgung
ShipmentCreationIsDoneFromOrder=Aktuell ist die Erstellung der neuen Sendung über die Bestellkarte erfolgt. ShipmentCreationIsDoneFromOrder=Aktuell ist die Erstellung der neuen Sendung über die Bestellkarte erfolgt.
RelatedShippings=Related shipments RelatedShippings=Ähnliche Sendungen
ShipmentLine=Sendungszeilen ShipmentLine=Sendungszeilen
CarrierList=Liste der Transporter CarrierList=Liste der Transporter
SendingRunning=Product from ordered customer orders SendingRunning=Die Produktion von dem bestellten Kundenaufträge
SuppliersReceiptRunning=Product from ordered supplier orders SuppliersReceiptRunning=Produkt aus Lieferantenbestellung
ProductQtyInCustomersOrdersRunning=Product quantity into opened customers orders ProductQtyInCustomersOrdersRunning=Produktmenge in geöffneter Kunden Bestellungen
ProductQtyInSuppliersOrdersRunning=Product quantity into opened suppliers orders ProductQtyInSuppliersOrdersRunning=Produktmenge in geöffneter Lieferantenbestellungen
ProductQtyInShipmentAlreadySent=Product quantity from opended customer order already sent ProductQtyInShipmentAlreadySent=Produktmenge aus geöffneter Kundenbestellung bereits versandt
ProductQtyInSuppliersShipmentAlreadyRecevied=Product quantity from opened supplier order already received ProductQtyInSuppliersShipmentAlreadyRecevied=Produktmenge aus Lieferantenbestellung bereits erhalten
# Sending methods # Sending methods
SendingMethodCATCH=Abholung durch Kunden SendingMethodCATCH=Abholung durch Kunden

View File

@ -8,6 +8,11 @@ VersionExperimental=Experimental
VersionDevelopment=Development VersionDevelopment=Development
VersionUnknown=Unknown VersionUnknown=Unknown
VersionRecommanded=Recommended VersionRecommanded=Recommended
FileCheck=Files Integrity
FilesMissing=Missing Files
FilesUpdated=Updated Files
FileCheckDolibarr=Check Dolibarr Files Integrity
XmlNotFound=Xml File of Dolibarr Integrity Not Found
SessionId=Session ID SessionId=Session ID
SessionSaveHandler=Handler to save sessions SessionSaveHandler=Handler to save sessions
SessionSavePath=Storage session localization SessionSavePath=Storage session localization
@ -1588,3 +1593,5 @@ SortOrder=Sort order
Format=Format Format=Format
TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both customers and suppliers payment type TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both customers and suppliers payment type
IncludePath=Include path (defined into variable %s) IncludePath=Include path (defined into variable %s)
ExpenseReportsSetup=Setup of module Expense Reports
TemplatePDFExpenseReports=Document templates to generate expense report document

View File

@ -79,7 +79,7 @@ ErrorModuleRequireJavascript=Javascript must not be disabled to have this featur
ErrorPasswordsMustMatch=Both typed passwords must match each other ErrorPasswordsMustMatch=Both typed passwords must match each other
ErrorContactEMail=A technical error occured. Please, contact administrator to following email <b>%s</b> en provide the error code <b>%s</b> in your message, or even better by adding a screen copy of this page. ErrorContactEMail=A technical error occured. Please, contact administrator to following email <b>%s</b> en provide the error code <b>%s</b> in your message, or even better by adding a screen copy of this page.
ErrorWrongValueForField=Wrong value for field number <b>%s</b> (value '<b>%s</b>' does not match regex rule <b>%s</b>) ErrorWrongValueForField=Wrong value for field number <b>%s</b> (value '<b>%s</b>' does not match regex rule <b>%s</b>)
ErrorFieldValueNotIn=Wrong value for field number <b>%s</b> (value '<b>%s</b>' is not a value available into field <b>%s</b> of table <b>%s</b>) ErrorFieldValueNotIn=Wrong value for field number <b>%s</b> (value '<b>%s</b>' is not a value available into field <b>%s</b> of table <b>%s</b> = <b>%s</b>)
ErrorFieldRefNotIn=Wrong value for field number <b>%s</b> (value '<b>%s</b>' is not a <b>%s</b> existing ref) ErrorFieldRefNotIn=Wrong value for field number <b>%s</b> (value '<b>%s</b>' is not a <b>%s</b> existing ref)
ErrorsOnXLines=Errors on <b>%s</b> source record(s) ErrorsOnXLines=Errors on <b>%s</b> source record(s)
ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus) ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus)

View File

@ -141,6 +141,7 @@ Cancel=Cancel
Modify=Modify Modify=Modify
Edit=Edit Edit=Edit
Validate=Validate Validate=Validate
ValidateAndApprove=Validate and Approve
ToValidate=To validate ToValidate=To validate
Save=Save Save=Save
SaveAs=Save As SaveAs=Save As

View File

@ -250,3 +250,7 @@ PriceExpressionEditorHelp3=In both product/service and supplier prices there are
PriceExpressionEditorHelp4=In product/service price only: <b>#supplier_min_price#</b><br>In supplier prices only: <b>#supplier_quantity# and #supplier_tva_tx#</b> PriceExpressionEditorHelp4=In product/service price only: <b>#supplier_min_price#</b><br>In supplier prices only: <b>#supplier_quantity# and #supplier_tva_tx#</b>
PriceMode=Price mode PriceMode=Price mode
PriceNumeric=Number PriceNumeric=Number
DefaultPrice=Default price
ComposedProductDIncDecStock=Increase/Decrease stock on parent change
ComposedProduct=Sub-product
MinSupplierPrice=Minimun supplier price

View File

@ -8,8 +8,10 @@ SharedProject=Everybody
PrivateProject=Contacts of project PrivateProject=Contacts of project
MyProjectsDesc=This view is limited to projects you are a contact for (whatever is the type). MyProjectsDesc=This view is limited to projects you are a contact for (whatever is the type).
ProjectsPublicDesc=This view presents all projects you are allowed to read. ProjectsPublicDesc=This view presents all projects you are allowed to read.
ProjectsPublicTaskDesc=This view presents all projects and tasks you are allowed to read.
ProjectsDesc=This view presents all projects (your user permissions grant you permission to view everything). ProjectsDesc=This view presents all projects (your user permissions grant you permission to view everything).
MyTasksDesc=This view is limited to projects or tasks you are a contact for (whatever is the type). MyTasksDesc=This view is limited to projects or tasks you are a contact for (whatever is the type).
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. 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). TasksDesc=This view presents all projects and tasks (your user permissions grant you permission to view everything).
ProjectsArea=Projects area ProjectsArea=Projects area

View File

@ -47,6 +47,7 @@ PMPValue=Weighted average price
PMPValueShort=WAP PMPValueShort=WAP
EnhancedValueOfWarehouses=Warehouses value EnhancedValueOfWarehouses=Warehouses value
UserWarehouseAutoCreate=Create a warehouse automatically when creating a user UserWarehouseAutoCreate=Create a warehouse automatically when creating a user
IndependantSubProductStock=Product stock and subproduct stock are independant
QtyDispatched=Quantity dispatched QtyDispatched=Quantity dispatched
QtyDispatchedShort=Qty dispatched QtyDispatchedShort=Qty dispatched
QtyToDispatchShort=Qty to dispatch QtyToDispatchShort=Qty to dispatch

View File

@ -1,4 +1,6 @@
# Dolibarr language file - Source file is en_US - trips # Dolibarr language file - Source file is en_US - trips
ExpenseReport=Expense report
ExpenseReports=Expense reports
Trip=Expense report Trip=Expense report
Trips=Expense reports Trips=Expense reports
TripsAndExpenses=Expenses reports TripsAndExpenses=Expenses reports
@ -14,24 +16,28 @@ FeesKilometersOrAmout=Amount or kilometers
DeleteTrip=Delete expense report DeleteTrip=Delete expense report
ConfirmDeleteTrip=Are you sure you want to delete this expense report ? ConfirmDeleteTrip=Are you sure you want to delete this expense report ?
ListTripsAndExpenses=List of expense reports ListTripsAndExpenses=List of expense reports
ListToApprove=Waiting for approval
ExpensesArea=Expense reports area ExpensesArea=Expense reports area
SearchATripAndExpense=Search an expense report SearchATripAndExpense=Search an expense report
ClassifyRefunded=Classify 'Refunded' ClassifyRefunded=Classify 'Refunded'
ExpenseReportWaitingForApproval=A new expense report has been submitted for approval
ExpenseReportWaitingForApprovalMessage=A new expense report has been submitted and is waiting for approval.\n- User: %s\n- Period: %s\nClick here to validate: %s
TripId=Id expense report TripId=Id expense report
AnyOtherInThisListCanValidate=Person to inform for validation. AnyOtherInThisListCanValidate=Person to inform for validation.
TripSociete=Information company TripSociete=Information company
TripSalarie=Informations user TripSalarie=Informations user
TripNDF=Informations expense report TripNDF=Informations expense report
DeleteLine=Delete a ligne of the expense report DeleteLine=Delete a ligne of the expense report
ConfirmDeleteLine=Are you sure you want to delete this line ? ConfirmDeleteLine=Are you sure you want to delete this line ?
PDFStandardExpenseReports=Standard template to generate a PDF document for expense report
ExpenseReportLine=Expense report line
TF_OTHER=Other TF_OTHER=Other
TF_TRANSPORTATION=Transportation
TF_LUNCH=Lunch TF_LUNCH=Lunch
TF_METRO=Metro TF_METRO=Metro
TF_TRAIN=Train TF_TRAIN=Train
TF_BUS=Bus TF_BUS=Bus
TF_CAR=Car
TF_PEAGE=Toll TF_PEAGE=Toll
TF_ESSENCE=Fuel TF_ESSENCE=Fuel
TF_HOTEL=Hostel TF_HOTEL=Hostel
@ -61,10 +67,11 @@ MOTIF_REFUS=Reason
MOTIF_CANCEL=Reason MOTIF_CANCEL=Reason
DATE_REFUS=Deny date DATE_REFUS=Deny date
DATE_CANCEL=Cancelation date DATE_SAVE=Validation date
DATE_VALIDE=Validation date DATE_VALIDE=Validation date
DateApprove=Approving date
DATE_CANCEL=Cancelation date
DATE_PAIEMENT=Payment date DATE_PAIEMENT=Payment date
DATE_SAVE=Recording date
Deny=Deny Deny=Deny
TO_PAID=Pay TO_PAID=Pay

View File

@ -633,7 +633,7 @@ Permission181=Consulter les commandes fournisseurs
Permission182=Créer/modifier les commandes fournisseurs Permission182=Créer/modifier les commandes fournisseurs
Permission183=Valider les commandes fournisseurs Permission183=Valider les commandes fournisseurs
Permission184=Approuver les commandes fournisseurs Permission184=Approuver les commandes fournisseurs
Permission185=Passer les commandes fournisseurs et les annuler Permission185=Passer les commandes fournisseurs
Permission186=Accuser réception des commandes fournisseurs Permission186=Accuser réception des commandes fournisseurs
Permission187=Clôturer les commandes fournisseurs Permission187=Clôturer les commandes fournisseurs
Permission188=Annuler les commandes fournisseurs Permission188=Annuler les commandes fournisseurs
@ -1507,7 +1507,7 @@ CashDeskThirdPartyForSell=Tiers générique à utiliser par défaut pour les ven
CashDeskBankAccountForSell=Compte par défaut à utiliser pour l'encaissement en liquide CashDeskBankAccountForSell=Compte par défaut à utiliser pour l'encaissement en liquide
CashDeskBankAccountForCheque= Compte par défaut à utiliser pour l'encaissement en chèque CashDeskBankAccountForCheque= Compte par défaut à utiliser pour l'encaissement en chèque
CashDeskBankAccountForCB= Compte par défaut à utiliser pour l'encaissement en carte de crédit CashDeskBankAccountForCB= Compte par défaut à utiliser pour l'encaissement en carte de crédit
CashDeskDoNotDecreaseStock=Ne pas réduire le stock quand une vente est faite depuis le Point de Vente. Sinon, la réduction est faite par défaut. CashDeskDoNotDecreaseStock=Désactiver la réduction de stock quand une vente est faite depuis le Point de Vente. Si "non", la réduction du stock est faite d'office par le module Point de Vente, quelque soit le mode choisi dans la configuration du module stock.
CashDeskIdWareHouse=Forcer et restreindre l'emplacement/entrepôt à utiliser pour la réduction de stock CashDeskIdWareHouse=Forcer et restreindre l'emplacement/entrepôt à utiliser pour la réduction de stock
StockDecreaseForPointOfSaleDisabled=Réduction de stock lors de l'utilisation du Point de Vente désactivée StockDecreaseForPointOfSaleDisabled=Réduction de stock lors de l'utilisation du Point de Vente désactivée
CashDeskYouDidNotDisableStockDecease=Vous n'avez pas désactivé la réduction de stocks lors de la réalisation d'une vente depuis le Point de Vente. Aussi, un entrepôt/emplacement est nécessaire. CashDeskYouDidNotDisableStockDecease=Vous n'avez pas désactivé la réduction de stocks lors de la réalisation d'une vente depuis le Point de Vente. Aussi, un entrepôt/emplacement est nécessaire.

View File

@ -125,7 +125,7 @@ BankAccountNumber=Numéro de compte
BankAccountNumberKey=Clé RIB BankAccountNumberKey=Clé RIB
SpecialCode=Code spécial SpecialCode=Code spécial
ExportStringFilter=%% permet de remplacer 1 ou plusieurs caractères dans le texte ExportStringFilter=%% permet de remplacer 1 ou plusieurs caractères dans le texte
ExportDateFilter=YYYY, YYYYMM, YYYYMMDD: filtre pour une année/mois/jour<br>YYYY+YYYY, YYYYMM+YYYYMM, YYYYMMDD+YYYYMMDD: filtre pour une plage année/mois/jour<br> > YYYY, > YYYYMM, > YYYYMMDD': filtre pour une date supérieure à une année/mois/jour donné<br> < YYYY, < YYYYMM, < YYYYMMDD: filtre pour une date inférieure à une année/mois/jour donné ExportDateFilter=AAAA, AAAAMM, AAAAMMJJ: filtre pour une année/mois/jour<br>AAAA+AAAA, AAAAMM+AAAAMM, AAAAMMJJ+AAAAMMJJ: filtre pour une plage année/mois/jour<br> > AAAA, > AAAAMM, > AAAAMMJJ': filtre pour une date supérieure à une année/mois/jour donné<br> < AAAA, < AAAAMM, < AAAAMMJJ: filtre pour une date inférieure à une année/mois/jour donné
ExportNumericFilter='NNNNN' filtres sur une valeur<br>'NNNNN+NNNNN' filtres sur une place de valeurs<br>'&gt;NNNNN' filtres sur les valeurs plus petites<br>'&gt;NNNNN' filtres sur les valeurs plus grandes ExportNumericFilter='NNNNN' filtres sur une valeur<br>'NNNNN+NNNNN' filtres sur une place de valeurs<br>'&gt;NNNNN' filtres sur les valeurs plus petites<br>'&gt;NNNNN' filtres sur les valeurs plus grandes
## filters ## filters
SelectFilterFields=Si vous voulez filtrer sur certaines valeurs, saisissez ces valeurs. SelectFilterFields=Si vous voulez filtrer sur certaines valeurs, saisissez ces valeurs.

View File

@ -13,9 +13,9 @@ ConfigAccountingExpert=Konfiguracija modula računovodskega strokovnjaka
Journaux=Revije Journaux=Revije
JournalFinancial=Finančne revije JournalFinancial=Finančne revije
Exports=Izvoz Exports=Izvoz
Export=Export Export=Izvoz
Modelcsv=Model izvoza Modelcsv=Model izvoza
OptionsDeactivatedForThisExportModel=For this export model, options are deactivated OptionsDeactivatedForThisExportModel=Za ta izvozni model so opcije deaktivirane
Selectmodelcsv=Izberite model izvoza Selectmodelcsv=Izberite model izvoza
Modelcsv_normal=Classic izvoz Modelcsv_normal=Classic izvoz
Modelcsv_CEGID=Izvoz v CEGID Expert Modelcsv_CEGID=Izvoz v CEGID Expert
@ -68,11 +68,11 @@ Lineofinvoice=Line računa
VentilatedinAccount=Uspešno prezračen v obračunskem računu VentilatedinAccount=Uspešno prezračen v obračunskem računu
NotVentilatedinAccount=Ni prezračen v obračunskem računu NotVentilatedinAccount=Ni prezračen v obračunskem računu
ACCOUNTING_SEPARATORCSV=Column separator in export file ACCOUNTING_SEPARATORCSV=Ločilo za stolpce v izvozni datoteki
ACCOUNTING_LIMIT_LIST_VENTILATION=Number of elements to be breakdown shown by page (maximum recommended : 50) ACCOUNTING_LIMIT_LIST_VENTILATION=Število elementov za pregled po straneh (največ priporočeno: 50)
ACCOUNTING_LIST_SORT_VENTILATION_TODO=Begin the sorting of the breakdown pages "Has to breakdown" by the most recent elements ACCOUNTING_LIST_SORT_VENTILATION_TODO=Začni sortiranje strani za pregled "potrebno pregledati" z najnovejšimi elementi
ACCOUNTING_LIST_SORT_VENTILATION_DONE=Begin the sorting of the breakdown pages "Breakdown" by the most recent elements ACCOUNTING_LIST_SORT_VENTILATION_DONE=Začni sortiranje strani za pregled "Pregledano" z najnovejšimi elementi
AccountLength=Dolžina računovodstva računov prikazan v Dolibarrju AccountLength=Dolžina računovodstva računov prikazan v Dolibarrju
AccountLengthDesc=Funkcija omogoča, da Predstavljati dolžino obračunskega računa z zamenjavo prostorov z ničelno sliki. Ta funkcija se dotakne le zaslon, ne spreminja računovodskih račune registrirane v Dolibarrju. Za izvoz, to funkcijo je potrebno, da so združljivi z določeno programsko opremo. AccountLengthDesc=Funkcija omogoča, da Predstavljati dolžino obračunskega računa z zamenjavo prostorov z ničelno sliki. Ta funkcija se dotakne le zaslon, ne spreminja računovodskih račune registrirane v Dolibarrju. Za izvoz, to funkcijo je potrebno, da so združljivi z določeno programsko opremo.
@ -130,7 +130,7 @@ ListeMvts=Seznam gibanja
ErrorDebitCredit=Debetne in Credit ne more imeti vrednosti hkrati ErrorDebitCredit=Debetne in Credit ne more imeti vrednosti hkrati
ReportThirdParty=Seznam thirdparty račun ReportThirdParty=Seznam thirdparty račun
DescThirdPartyReport=Posvetujejo tukaj seznam thirdparty kupcev in dobaviteljev in njihovih računovodskih računov DescThirdPartyReport=Tukaj poglejte seznam kupcev in dobaviteljev in njihovih računovodskih računov
ListAccounts=Seznam računovodskih računov ListAccounts=Seznam računovodskih računov
@ -142,19 +142,19 @@ Active=Izjava
NewFiscalYear=Novo poslovno leto NewFiscalYear=Novo poslovno leto
DescVentilCustomer=Consult here the annual breakdown accounting of your invoices customers DescVentilCustomer=Tukaj poglejte letni pregled vaših računov kupcem
TotalVente=Skupni prihodek HT TotalVente=Skupni prihodek HT
TotalMarge=Skupaj prodajna marža TotalMarge=Skupaj prodajna marža
DescVentilDoneCustomer=Posvetujejo tukaj seznam vrstic računov strank in njihovo računovodsko račun DescVentilDoneCustomer=Tukaj poglejte seznam vrstic na računih za kupce in njihovih računovodskih računov
DescVentilTodoCustomer=Prezračite svoje linije računa stranke z računovodsko račun DescVentilTodoCustomer=Prezračite svoje linije računa stranke z računovodsko račun
ChangeAccount=Spremenite računovodsko račun linij, ki jih na račun izbranih: ChangeAccount=Spremenite računovodsko račun linij, ki jih na račun izbranih:
Vide=- Vide=-
DescVentilSupplier=Consult here the annual breakdown accounting of your invoices suppliers DescVentilSupplier=Tukaj poglejte letni pregled računov vaših dobaviteljev
DescVentilTodoSupplier=Prezračite svoje linije dobavitelja na računu z računovodsko račun DescVentilTodoSupplier=Prezračite svoje linije dobavitelja na računu z računovodsko račun
DescVentilDoneSupplier=Posvetujejo tukaj seznam vrstic računov dobaviteljem in njihovo računovodsko račun DescVentilDoneSupplier=Tukaj poglejte seznam vrstic na računih dobaviteljev in njihovih računovodskih računov
ValidateHistory=Potrditi Samodejno ValidateHistory=Potrditi Samodejno
ErrorAccountancyCodeIsAlreadyUse=Napaka, ne morete izbrisati to računovodsko račun, ker se uporablja ErrorAccountancyCodeIsAlreadyUse=Napaka, ne morete izbrisati to računovodsko račun, ker se uporablja
FicheVentilation=Breakdown card FicheVentilation=Kartica pregleda

View File

@ -56,8 +56,8 @@ UseSearchToSelectCompany=Za izbiranje partnerjev uporabite polja z avtomatsko iz
ActivityStateToSelectCompany= Dodaj opcijo filtra za prikaz/skritje partnerjev, ki so trenutno neaktivni ali so prekinili aktivnosti ActivityStateToSelectCompany= Dodaj opcijo filtra za prikaz/skritje partnerjev, ki so trenutno neaktivni ali so prekinili aktivnosti
UseSearchToSelectContactTooltip=Če je partnerjev zelo veliko (> 100 000), lahko hitrost povišate z nastavitvijo konstante SOCIETE_DONOTSEARCH_ANYWHERE na 1 v Nastavitve->Ostale nastavitve. Iskanje bo s tem omejeno na začetek niza. UseSearchToSelectContactTooltip=Če je partnerjev zelo veliko (> 100 000), lahko hitrost povišate z nastavitvijo konstante SOCIETE_DONOTSEARCH_ANYWHERE na 1 v Nastavitve->Ostale nastavitve. Iskanje bo s tem omejeno na začetek niza.
UseSearchToSelectContact=Zaizbiro kontakta uporabite polja z avtomatsko izpolnitvijo (namesto uporabe seznama). UseSearchToSelectContact=Zaizbiro kontakta uporabite polja z avtomatsko izpolnitvijo (namesto uporabe seznama).
DelaiedFullListToSelectCompany=Wait you press a key before loading content of thirdparties combo list (This may increase performance if you have a large number of thirdparties) DelaiedFullListToSelectCompany=Čakanje na pritisk tipke pred nalaganjem vsebine kombiniranega seznama partnerjev (to lahko izboljša zmogljivosti, če imate veliko število partnerjev)
DelaiedFullListToSelectContact=Wait you press a key before loading content of contact combo list (This may increase performance if you have a large number of contact) DelaiedFullListToSelectContact=Čakanje na pritisk tipke pred nalaganjem vsebine kombiniranega seznama kontaktov (to lahko izboljša zmogljivosti, če imate veliko število kontaktov)
SearchFilter=Opcije iskalnega filtra SearchFilter=Opcije iskalnega filtra
NumberOfKeyToSearch=Število znakov za sproženje iskanja: %s ViewFullDateActions=Prikaži celotne datume aktivnosti na tretjem listu NumberOfKeyToSearch=Število znakov za sproženje iskanja: %s ViewFullDateActions=Prikaži celotne datume aktivnosti na tretjem listu
ViewFullDateActions=Prikaz polnih datumov aktivnosti v tretjem zavihku ViewFullDateActions=Prikaz polnih datumov aktivnosti v tretjem zavihku
@ -70,7 +70,7 @@ PreviewNotAvailable=Predogled ni na voljo
ThemeCurrentlyActive=Trenutno aktivna tema ThemeCurrentlyActive=Trenutno aktivna tema
CurrentTimeZone=Časovni pas PHP strežnika CurrentTimeZone=Časovni pas PHP strežnika
MySQLTimeZone=Časovni pas MySql (baze podatkov) MySQLTimeZone=Časovni pas MySql (baze podatkov)
TZHasNoEffect=Dates are stored and returned by database server as if they were kept as submited string. The timezone has effect only when using UNIX_TIMESTAMP function (that should not be used by Dolibarr, so database TZ should have no effect, even if changed after data was entered). TZHasNoEffect=Podatkovni strežnik shranjuje in prikazuje podatke, kot da bi bili shranjeni v predloženih nizih. Časovna cona učinkuje samo, če uporabljate funkcijo UNIX_TIMESTAMP (te Dolibarr ne sme uporabljati, zato TZ baza ne bi smela imeti nmobenega učinka, tudi če se spremeni po vnosu podatkov).
Space=Presledek Space=Presledek
Table=Tabela Table=Tabela
Fields=Polja Fields=Polja
@ -210,7 +210,7 @@ ModulesJobDesc=Poslovni moduli zagotavljajo enostavne prednastavitve aplikacije
ModulesMarketPlaceDesc=Več modulov si lahko naložite preko zunanjih web strani na internetu... ModulesMarketPlaceDesc=Več modulov si lahko naložite preko zunanjih web strani na internetu...
ModulesMarketPlaces=Več modulov... ModulesMarketPlaces=Več modulov...
DoliStoreDesc=DoliStore, uradna tržnica za Dolibarr ERP/CRM zunanje module DoliStoreDesc=DoliStore, uradna tržnica za Dolibarr ERP/CRM zunanje module
DoliPartnersDesc=List with some companies that can provide/develop on-demand modules or features (Note: any Open Source company knowning PHP language can provide you specific development) DoliPartnersDesc=Seznam podjetij, ki lahko zagotovijo/razvijejo module po želji (opomba: vsako odprtokodno podjetje z znanjem PHP jezika vam lahko zagotovi specifičen razvoj)
WebSiteDesc=Ponudniki spletnih strani, na katerih lahko poiščete več modulov... WebSiteDesc=Ponudniki spletnih strani, na katerih lahko poiščete več modulov...
URL=Link URL=Link
BoxesAvailable=Polja, ki so na voljo BoxesAvailable=Polja, ki so na voljo
@ -222,7 +222,7 @@ AutomaticIfJavascriptDisabled=Avtomatsko, če je Javascript onemogočen
AvailableOnlyIfJavascriptNotDisabled=Na voljo samo, če JavaScript ni onemogočen AvailableOnlyIfJavascriptNotDisabled=Na voljo samo, če JavaScript ni onemogočen
AvailableOnlyIfJavascriptAndAjaxNotDisabled=Na voljo samo, če JavaScript in Ajax nista onemogočena AvailableOnlyIfJavascriptAndAjaxNotDisabled=Na voljo samo, če JavaScript in Ajax nista onemogočena
Required=Zahtevano Required=Zahtevano
UsedOnlyWithTypeOption=Used by some agenda option only UsedOnlyWithTypeOption=Uporablja se samo pri nekaterih ocijah agende
Security=Varnost Security=Varnost
Passwords=Gesla Passwords=Gesla
DoNotStoreClearPassword=Ne shranjujte v bazi podatkov celih gesel, temveč samo šifrirane vrednosti (priporočena aktivacija) DoNotStoreClearPassword=Ne shranjujte v bazi podatkov celih gesel, temveč samo šifrirane vrednosti (priporočena aktivacija)
@ -294,7 +294,7 @@ DoNotUseInProduction=Ne uporabljajte v proizvodnji
ThisIsProcessToFollow=To je nastavitev za proces: ThisIsProcessToFollow=To je nastavitev za proces:
StepNb=Korak %s StepNb=Korak %s
FindPackageFromWebSite=Poiščite paket, ki omogoča funkcijo, ki jo želite (na primer na spletni strani %s). FindPackageFromWebSite=Poiščite paket, ki omogoča funkcijo, ki jo želite (na primer na spletni strani %s).
DownloadPackageFromWebSite=Download package %s. DownloadPackageFromWebSite=Prenesi paket %s.
UnpackPackageInDolibarrRoot=Razpakiraj paketno datoteko v Dolibarr korensko mapo <b>%s</b> UnpackPackageInDolibarrRoot=Razpakiraj paketno datoteko v Dolibarr korensko mapo <b>%s</b>
SetupIsReadyForUse=Instalacija je zaključena in Dolibarr je pripravljen na uporabo s to novo komponento. SetupIsReadyForUse=Instalacija je zaključena in Dolibarr je pripravljen na uporabo s to novo komponento.
NotExistsDirect=Ni definirana alternativna korenska mapa.<br> NotExistsDirect=Ni definirana alternativna korenska mapa.<br>
@ -304,7 +304,7 @@ YouCanSubmitFile=Izberi modul:
CurrentVersion=Trenutna različica Dolibarr CurrentVersion=Trenutna različica Dolibarr
CallUpdatePage=Pojdite na stran za nadgradnjo strukture in podatkov v podatkovni bazi: %s. CallUpdatePage=Pojdite na stran za nadgradnjo strukture in podatkov v podatkovni bazi: %s.
LastStableVersion=Zadnja stabilna različica LastStableVersion=Zadnja stabilna različica
UpdateServerOffline=Update server offline UpdateServerOffline=Posodobitev strežnika brez povezave
GenericMaskCodes=Vnesete lahko kakršnokoli številčno masko. V tej maski lahko uporabite naslednje oznake:<br><b>{000000}</b> ustreza številki, ki se poveča pri vsakem %s. Vnesite toliko ničel, kot je želena dolžina števca. Števec se bo zapolnil z ničlami na levi strani, da bi velikost ustrezala maski. <br><b>{000000+000}</b> enako kot prej, vendar je desno od znaka + odmik, ki je uporabljen na prvi %s. <br><b>{000000@x}</b> enako kot prej, vendar se števec resetira na 0, ko se doseže mesec x (x je med 1 in 12). Če je uporabljena ta opcija, ,in je x enak ali večji od 2, je zahtevana tudi sekvenca {yy}{mm} ali {yyyy}{mm}. <br><b>{dd}</b> dan (01 do 31).<br><b>{mm}</b> mesec (01 do 12).<br><b>{yy}</b>, <b>{yyyy}</b> ali <b>{y}</b> leto, izraženo z 2, 4 ali 1 številko. <br> GenericMaskCodes=Vnesete lahko kakršnokoli številčno masko. V tej maski lahko uporabite naslednje oznake:<br><b>{000000}</b> ustreza številki, ki se poveča pri vsakem %s. Vnesite toliko ničel, kot je želena dolžina števca. Števec se bo zapolnil z ničlami na levi strani, da bi velikost ustrezala maski. <br><b>{000000+000}</b> enako kot prej, vendar je desno od znaka + odmik, ki je uporabljen na prvi %s. <br><b>{000000@x}</b> enako kot prej, vendar se števec resetira na 0, ko se doseže mesec x (x je med 1 in 12). Če je uporabljena ta opcija, ,in je x enak ali večji od 2, je zahtevana tudi sekvenca {yy}{mm} ali {yyyy}{mm}. <br><b>{dd}</b> dan (01 do 31).<br><b>{mm}</b> mesec (01 do 12).<br><b>{yy}</b>, <b>{yyyy}</b> ali <b>{y}</b> leto, izraženo z 2, 4 ali 1 številko. <br>
GenericMaskCodes2=<b>{cccc}</b> koda klienta z n znaki<br><b>{cccc000}</b> koda klienta z n znaki se nadaljuje s števcem stranke. Ta namenski števec stranke se resetira obenem z globalnim števcem.<br><b>{tttt}</b> Koda partnerja z n znaki (glejte slovar-tipi partnerjev).<br> GenericMaskCodes2=<b>{cccc}</b> koda klienta z n znaki<br><b>{cccc000}</b> koda klienta z n znaki se nadaljuje s števcem stranke. Ta namenski števec stranke se resetira obenem z globalnim števcem.<br><b>{tttt}</b> Koda partnerja z n znaki (glejte slovar-tipi partnerjev).<br>
GenericMaskCodes3=Vsi ostali znaki v maski bodo ostali nedotaknjeni.<br>Presledki niso dovoljeni.<br> GenericMaskCodes3=Vsi ostali znaki v maski bodo ostali nedotaknjeni.<br>Presledki niso dovoljeni.<br>
@ -383,12 +383,12 @@ ExtrafieldSelectList = Izberi iz tabele
ExtrafieldSeparator=Ločilo ExtrafieldSeparator=Ločilo
ExtrafieldCheckBox=Potrditveno polje ExtrafieldCheckBox=Potrditveno polje
ExtrafieldRadio=Radijski gumb ExtrafieldRadio=Radijski gumb
ExtrafieldCheckBoxFromList= Checkbox from table ExtrafieldCheckBoxFromList= Potrditveno polje iz tabele
ExtrafieldParamHelpselect=Seznam parametrov mora biti kot ključ,vrednost<br><br> na primer : <br>1,vrednost1<br>2,vrednost2<br>3,vrednost3<br>...<br><br>Če želite imeti seznam odvisen od drugega :<br>1,vrednost1|parent_list_code:parent_key<br>2,vrednost2|parent_list_code:parent_key ExtrafieldParamHelpselect=Seznam parametrov mora biti kot ključ,vrednost<br><br> na primer : <br>1,vrednost1<br>2,vrednost2<br>3,vrednost3<br>...<br><br>Če želite imeti seznam odvisen od drugega :<br>1,vrednost1|parent_list_code:parent_key<br>2,vrednost2|parent_list_code:parent_key
ExtrafieldParamHelpcheckbox=Seznam parametrov mora biti kot ključ,vrednost<br><br> na primer : <br>1,vrednost1<br>2,vrednost2<br>3,vrednost3<br>... ExtrafieldParamHelpcheckbox=Seznam parametrov mora biti kot ključ,vrednost<br><br> na primer : <br>1,vrednost1<br>2,vrednost2<br>3,vrednost3<br>...
ExtrafieldParamHelpradio=Seznam parametrov mora biti kot ključ,vrednost<br><br> na primer : <br>1,vrednost1<br>2,vrednost2<br>3,vrednost3<br>... ExtrafieldParamHelpradio=Seznam parametrov mora biti kot ključ,vrednost<br><br> na primer : <br>1,vrednost1<br>2,vrednost2<br>3,vrednost3<br>...
ExtrafieldParamHelpsellist=Seznam parametrov iz tabele<br>Syntax : table_name:label_field:id_field::filter<br>Primer : c_typent:libelle:id::filter<br><br>filter je lahko enostaven test (npr active=1) za prikaz samo aktivnih vrednsost <br> če želite filtrirati fpo dodatnih poljih, uporabite sintakso extra.fieldcode=... (kjer je field code koda dodatnega polja)<br><br>če želite, da je seznam odvisen od drugega :<br>c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelpsellist=Seznam parametrov iz tabele<br>Syntax : table_name:label_field:id_field::filter<br>Primer : c_typent:libelle:id::filter<br><br>filter je lahko enostaven test (npr active=1) za prikaz samo aktivnih vrednsost <br> če želite filtrirati fpo dodatnih poljih, uporabite sintakso extra.fieldcode=... (kjer je field code koda dodatnega polja)<br><br>če želite, da je seznam odvisen od drugega :<br>c_typent:libelle:id:parent_list_code|parent_column:filter
ExtrafieldParamHelpchkbxlst=Parameters list comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value <br> if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another :<br>c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelpchkbxlst=Seznam parametrov iz tabele<br>Syntax : table_name:label_field:id_field::filter<br>Primer : c_typent:libelle:id::filter<br><br>filter je lahko enostaven test (npr active=1) za prikaz samo aktivne vrednosti <br> če želite filtrirati po dodatnih poljih, uporabite sintakso extra.fieldcode=... (kjer je field code koda dodatnega polja)<br><br>če želite, da je seznam odvisen od drugega :<br>c_typent:libelle:id:parent_list_code|parent_column:filter
LibraryToBuildPDF=Uporabljena knjižnica za ustvarjanje PDF LibraryToBuildPDF=Uporabljena knjižnica za ustvarjanje PDF
WarningUsingFPDF=Pozor: vaš <b>conf.php</b> vsebuje direktivo <b>dolibarr_pdf_force_fpdf=1</b>. To pomeni, da uporabljate knjižnico FPDF za generiranje PDF datotek. Ta knjižnica je stara in ne podpira številnih značilnosti (Unicode, transparentnost slike, cirilico, arabske in azijske jezike, ...), zado lahko med generiranjem PDF pride do napak.<br>Za rešitev tega problema in polno podporo PDF generiranja, prosimo da naložite <a href="http://www.tcpdf.org/" target="_blank">TCPDF knjižnico</a>, nato označite kot komentar ali odstranite vrstico <b>$dolibarr_pdf_force_fpdf=1</b>, in namesto nje dodajte <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b> WarningUsingFPDF=Pozor: vaš <b>conf.php</b> vsebuje direktivo <b>dolibarr_pdf_force_fpdf=1</b>. To pomeni, da uporabljate knjižnico FPDF za generiranje PDF datotek. Ta knjižnica je stara in ne podpira številnih značilnosti (Unicode, transparentnost slike, cirilico, arabske in azijske jezike, ...), zado lahko med generiranjem PDF pride do napak.<br>Za rešitev tega problema in polno podporo PDF generiranja, prosimo da naložite <a href="http://www.tcpdf.org/" target="_blank">TCPDF knjižnico</a>, nato označite kot komentar ali odstranite vrstico <b>$dolibarr_pdf_force_fpdf=1</b>, in namesto nje dodajte <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
LocalTaxDesc=V nekaterih državah so na vsako vrstico računa vezani 2 ali 3 davki. V takem primeru izberite tip in stopnjo drugega in tretjega davka. Možni tipi so:<br>1 : lokalni davek na proizvode in storitve brez DDV (DDV se ne obračuna na lokalni davek)<br>2 : lokalni davek na proizvode in storitve pred DDV (DDV se obračuna na znesek + lokalni davek)<br>3 : lokalni davek na proizvode brez DDV (DDV se ne obračuna na lokalni davek)<br>4 : lokalni davek na proizvode pred DDV (DDV se obračuna na znesek + lokalni davek)<br>5 : lokalni davek na storitve brez DDV (DDV se ne obračuna na lokalni davek)<br>6 : lokalni davek na storitve pred DDV (DDV se obračuna na znesek + lokalni davek) LocalTaxDesc=V nekaterih državah so na vsako vrstico računa vezani 2 ali 3 davki. V takem primeru izberite tip in stopnjo drugega in tretjega davka. Možni tipi so:<br>1 : lokalni davek na proizvode in storitve brez DDV (DDV se ne obračuna na lokalni davek)<br>2 : lokalni davek na proizvode in storitve pred DDV (DDV se obračuna na znesek + lokalni davek)<br>3 : lokalni davek na proizvode brez DDV (DDV se ne obračuna na lokalni davek)<br>4 : lokalni davek na proizvode pred DDV (DDV se obračuna na znesek + lokalni davek)<br>5 : lokalni davek na storitve brez DDV (DDV se ne obračuna na lokalni davek)<br>6 : lokalni davek na storitve pred DDV (DDV se obračuna na znesek + lokalni davek)
@ -407,7 +407,7 @@ InitEmptyBarCode=Začetna vrednost za naslednjih %s praznih zapisov
EraseAllCurrentBarCode=Zbrišite vse trenutne vrednosti črtnih kod EraseAllCurrentBarCode=Zbrišite vse trenutne vrednosti črtnih kod
ConfirmEraseAllCurrentBarCode=Ali zares želite izbrisati vse trenutne vrednosti črtnih kod ? ConfirmEraseAllCurrentBarCode=Ali zares želite izbrisati vse trenutne vrednosti črtnih kod ?
AllBarcodeReset=Vse vrednosti črtnih kod so bile odstranjene AllBarcodeReset=Vse vrednosti črtnih kod so bile odstranjene
NoBarcodeNumberingTemplateDefined=No numbering barcode template enabled into barcode module setup. NoBarcodeNumberingTemplateDefined=Nobena številčna predloga črtne kode ni omogočena v mudulu za nastavitev črtnih kod.
NoRecordWithoutBarcodeDefined=Noben zapis ni definiran brez črtne kode. NoRecordWithoutBarcodeDefined=Noben zapis ni definiran brez črtne kode.
# Modules # Modules
@ -450,7 +450,7 @@ Module55Desc=Upravljanje črtnih kod
Module56Name=Telefonija Module56Name=Telefonija
Module56Desc=Integracija telefonije Module56Desc=Integracija telefonije
Module57Name=Trajniki Module57Name=Trajniki
Module57Desc=Standing orders and withdrawal management. Also includes generation of SEPA file for european countries. Module57Desc=Upravljanje trajnikov in nakazil. Vključuje tudi generiranje SEPA za evropske države.
Module58Name=Klic s klikom Module58Name=Klic s klikom
Module58Desc=Integracija klica s klikom Module58Desc=Integracija klica s klikom
Module59Name=Vaš zaznamek Module59Name=Vaš zaznamek
@ -482,7 +482,7 @@ Module320Desc=Dodajanje vira RSS na prikazane Dolibarr strani
Module330Name=Zaznamki Module330Name=Zaznamki
Module330Desc=Upravljanje zaznamkov Module330Desc=Upravljanje zaznamkov
Module400Name=Projekti/priložnosti/možnosti Module400Name=Projekti/priložnosti/možnosti
Module400Desc=Management of projects, opportunities or leads. You can then assign any element (invoice, order, proposal, intervention, ...) to a project and get a transversal view from the project view. Module400Desc=Upravljanje projektov, priložnosti ali potencialov. Nato lahko dodate vse druge elemente (račun, naročilo, ponudbo, intervencijo, ...) k tem projektom, da dobite transverzalni pogled iz projektnega pogleda.
Module410Name=Internetni koledar Module410Name=Internetni koledar
Module410Desc=Integracija internetnega koledarja Module410Desc=Integracija internetnega koledarja
Module500Name=Posebni stroški (davki, socialni prispevki, dividende) Module500Name=Posebni stroški (davki, socialni prispevki, dividende)
@ -512,7 +512,7 @@ Module2500Desc=Shranjevanje dokumentov in dajanje v skupno rabo
Module2600Name=Spletne storitve Module2600Name=Spletne storitve
Module2600Desc=Omogočanje Dolibarr strežnika za spletne storitve Module2600Desc=Omogočanje Dolibarr strežnika za spletne storitve
Module2650Name=Spletne storitve (klient) Module2650Name=Spletne storitve (klient)
Module2650Desc=Enable the Dolibarr web services client (Can be used to push data/requests to external servers. Supplier orders supported only for the moment) Module2650Desc=Vključitev Dolibarr klienta za mrežni servis (lahko se uporablja za potisk podatkov/zahtev na zunanji strežnik. Zaenkrat so podprta samo naročila pri dobaviteljih)
Module2700Name=Gravatar Module2700Name=Gravatar
Module2700Desc=Uporaba online Gravatar storitev (www.gravatar.com) za prikaz fotografij uporabnikov/članov (na osnovi njihovih emailov). Potreben je internetni dostop Module2700Desc=Uporaba online Gravatar storitev (www.gravatar.com) za prikaz fotografij uporabnikov/članov (na osnovi njihovih emailov). Potreben je internetni dostop
Module2800Desc=FTP Client Module2800Desc=FTP Client
@ -526,8 +526,8 @@ Module6000Name=Potek dela
Module6000Desc=Upravljanje poteka dela Module6000Desc=Upravljanje poteka dela
Module20000Name=Upravljanje zahtevkov za dopust Module20000Name=Upravljanje zahtevkov za dopust
Module20000Desc=Določitev in sledenje zahtevkov za dopustov zaposlenih Module20000Desc=Določitev in sledenje zahtevkov za dopustov zaposlenih
Module39000Name=Product batch Module39000Name=Paket proizvodov
Module39000Desc=Batch or serial number, eat-by and sell-by date management on products Module39000Desc=Paket serijskih številk, upravljanje proizvodov po datumu prevzema in datumu prodaje
Module50000Name=PayBox Module50000Name=PayBox
Module50000Desc=Modul za omogočanje strani za spletno plačevanje s kreditno kartico - PayBox Module50000Desc=Modul za omogočanje strani za spletno plačevanje s kreditno kartico - PayBox
Module50100Name=Prodajalne Module50100Name=Prodajalne
@ -544,8 +544,8 @@ Module59000Name=Marže
Module59000Desc=Modul za upravljanje z maržami Module59000Desc=Modul za upravljanje z maržami
Module60000Name=Provizije Module60000Name=Provizije
Module60000Desc=Modul za upravljanje s provizijami Module60000Desc=Modul za upravljanje s provizijami
Module150010Name=Batch number, eat-by date and sell-by date Module150010Name=Paketna številka, datum prevzema in datum prodaje
Module150010Desc=batch number, eat-by date and sell-by date management for product Module150010Desc=paketna številka, upravljanje proizvodov po datumu prevzema in datumu prodaje
Permission11=Branje računov Permission11=Branje računov
Permission12=Kreiranje/Spreminjanje računov Permission12=Kreiranje/Spreminjanje računov
Permission13=Preklic potrditve računov Permission13=Preklic potrditve računov
@ -575,7 +575,7 @@ Permission67=Izvoz intervencij
Permission71=Branje članov Permission71=Branje članov
Permission72=Kreiranje/spreminjanje članov Permission72=Kreiranje/spreminjanje članov
Permission74=Brisanje članov Permission74=Brisanje članov
Permission75=Setup types of membership Permission75=Nastavitev tipov članov
Permission76=Izvoz podatkov Permission76=Izvoz podatkov
Permission78=Branje naročnin Permission78=Branje naročnin
Permission79=Kreiranje/spreminjanje naročnin Permission79=Kreiranje/spreminjanje naročnin
@ -598,8 +598,8 @@ Permission106=Izvoz pošiljk
Permission109=Brisanje pošiljk Permission109=Brisanje pošiljk
Permission111=Branje finančnih postavk Permission111=Branje finančnih postavk
Permission112=Kreiranje/spreminjanje/brisanje in primerjava transakcij Permission112=Kreiranje/spreminjanje/brisanje in primerjava transakcij
Permission113=Setup financial accounts (create, manage categories) Permission113=Nastavitve finančnih kontov (kreiranje, upravljanje kategorij)
Permission114=Reconciliate transactions Permission114=Pobotanje transkacij
Permission115=Izvoz transakcij in računovodskih izkazov Permission115=Izvoz transakcij in računovodskih izkazov
Permission116=Transfer med računi Permission116=Transfer med računi
Permission117=Upravljanje pošiljanja čekov Permission117=Upravljanje pošiljanja čekov
@ -764,7 +764,7 @@ Permission55001=Branje anket
Permission55002=Kreiranje/spreminjanje anket Permission55002=Kreiranje/spreminjanje anket
Permission59001=Branje komercialnih marž Permission59001=Branje komercialnih marž
Permission59002=Določitev komercialnih marž Permission59002=Določitev komercialnih marž
Permission59003=Read every user margin Permission59003=Branje vsake uporabniške marže
DictionaryCompanyType=Tip partnerjev DictionaryCompanyType=Tip partnerjev
DictionaryCompanyJuridicalType=Pravna oblika partnerjev DictionaryCompanyJuridicalType=Pravna oblika partnerjev
DictionaryProspectLevel=Nivo potenciala možne stranke DictionaryProspectLevel=Nivo potenciala možne stranke
@ -828,11 +828,11 @@ LocalTax2IsUsedExampleES= V Španiji, samostojnimi in neodvisni strokovnjaki, ki
LocalTax2IsNotUsedExampleES= V Španiji so poslovne niso predmet davčnega sistema modulov. LocalTax2IsNotUsedExampleES= V Španiji so poslovne niso predmet davčnega sistema modulov.
CalcLocaltax=Poročila CalcLocaltax=Poročila
CalcLocaltax1ES=Prodaja - Nabava CalcLocaltax1ES=Prodaja - Nabava
CalcLocaltax1Desc=Local Taxes reports are calculated with the difference between localtaxes sales and localtaxes purchases CalcLocaltax1Desc=Poročila o lokalnih davkih so izračunana kot razlika med nabavnimi in prodajnimi davki
CalcLocaltax2ES=Nabava CalcLocaltax2ES=Nabava
CalcLocaltax2Desc=Local Taxes reports are the total of localtaxes purchases CalcLocaltax2Desc=Poročila o lokalnih davkih so seštevek nabavnih davkov
CalcLocaltax3ES=Prodaja CalcLocaltax3ES=Prodaja
CalcLocaltax3Desc=Local Taxes reports are the total of localtaxes sales CalcLocaltax3Desc=Poročila o lokalnih davkih so seštevek prodajnih davkov
LabelUsedByDefault=Privzet naziv, če za kodo ne obstaja prevod LabelUsedByDefault=Privzet naziv, če za kodo ne obstaja prevod
LabelOnDocuments=Naslov na dokumentu LabelOnDocuments=Naslov na dokumentu
NbOfDays=Število dni NbOfDays=Število dni
@ -1042,7 +1042,7 @@ SendingMailSetup=Nastavitev pošiljanja z elektronsko pošto
SendmailOptionNotComplete=Pozor, na nekaterih Linux sistemih mora za pošiljanje pošte z vašega naslova nastavitev vsebovati opcijo -ba (parameter mail.force_extra_parameters v vaši datoteki php.ini). Če nekateri prejemniki nikoli ne dobijo pošte, poskusite popraviti PHP parameter z mail.force_extra_parameters = -ba). SendmailOptionNotComplete=Pozor, na nekaterih Linux sistemih mora za pošiljanje pošte z vašega naslova nastavitev vsebovati opcijo -ba (parameter mail.force_extra_parameters v vaši datoteki php.ini). Če nekateri prejemniki nikoli ne dobijo pošte, poskusite popraviti PHP parameter z mail.force_extra_parameters = -ba).
PathToDocuments=Pot do dokumentov PathToDocuments=Pot do dokumentov
PathDirectory=Mapa PathDirectory=Mapa
SendmailOptionMayHurtBuggedMTA=Feature to send mails using method "PHP mail direct" will generate a mail message that might be not correctly parsed by some receiving mail servers. Result is that some mails can't be read by people hosted by those bugged platforms. It's case for some Internet providers (Ex: Orange in France). This is not a problem into Dolibarr nor into PHP but onto receiving mail server. You can however add option MAIN_FIX_FOR_BUGGED_MTA to 1 into setup - other to modify Dolibarr to avoid this. However, you may experience problem with other servers that respect strictly the SMTP standard. The other solution (recommended) is to use the method "SMTP socket library" that has no disadvantages. SendmailOptionMayHurtBuggedMTA=Funkcija za pošiljanje pošte z uporabo metode "PHP mail DIRECT" bo ustvarila poštno sporočilo, ki ga morda nekateri poštni strežniki ne bodo pravilno razčlenili. Posledica tega je, da nekatere pošte ne bodo mogli brati uporabniki, ki gostujejo na takih platformah. To veljalo za nekaj internetnih ponudnikov (npr.: Orange v Franciji). Problem ni v Dolibarr niti v PHP, ampak v sprejemanju poštnega strežnika. Lahko pa v nastavitvah dodate opcijo MAIN_FIX_FOR_BUGGED_MTA kot 1. v setup, da bi se temu izognili brez modifikacije Dolibarr. Vendar pa lahko pride do težav z drugimi strežniki, ki strogo spoštujejo SMTP standard. Druga rešitev (priporočena) je uporaba metode "SMTP socket knjižnice", ki nima teh slabosti.
TranslationSetup=Konfiguracija prevoda TranslationSetup=Konfiguracija prevoda
TranslationDesc=Izbira na zaslonu vidnega jezika se lahko spremeni:<br>* Globalno preko menija <strong>Domov - Nastavitve - Prikaz</strong><br>* Samo za uporabnike preko zavihka <strong>Nastavitev zaslona uporabnika</strong> (klik na login na vrhu ekrana). TranslationDesc=Izbira na zaslonu vidnega jezika se lahko spremeni:<br>* Globalno preko menija <strong>Domov - Nastavitve - Prikaz</strong><br>* Samo za uporabnike preko zavihka <strong>Nastavitev zaslona uporabnika</strong> (klik na login na vrhu ekrana).
TotalNumberOfActivatedModules=Skupno število aktiviranih modulov za lastnosti: <b>%s</b> TotalNumberOfActivatedModules=Skupno število aktiviranih modulov za lastnosti: <b>%s</b>
@ -1061,7 +1061,7 @@ BrowserIsOK=Uporabljate spletni brskalnik %s. Ta brskalnik je ustrezen tako gled
BrowserIsKO=Uporabljate spletni brskalnik %s. Ta brskalnik je slaba izbira glede varnosti, zmogljivosti in zanesljivosti. Priporočamo uporabo Firefox, Chrome, Opera ali Safari. BrowserIsKO=Uporabljate spletni brskalnik %s. Ta brskalnik je slaba izbira glede varnosti, zmogljivosti in zanesljivosti. Priporočamo uporabo Firefox, Chrome, Opera ali Safari.
XDebugInstalled=Naložen je XDebug XDebugInstalled=Naložen je XDebug
XCacheInstalled=Naložen je XCache. XCacheInstalled=Naložen je XCache.
AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink. Third parties will appears with name "CC12345 - SC45678 - The big company coorp", instead of "The big company coorp". AddRefInList=Prikaz referenčnega seznama kupcev/dobaviteljev (izberite seznam ali combobox) in večine hiper povezav. Partnerji bodo prikazani z imenom "CC12345 - SC45678 - The big company coorp", namesto kot "The big company coorp".
FieldEdition=%s premenjenih polj FieldEdition=%s premenjenih polj
FixTZ=Fiksiranje časovne cone FixTZ=Fiksiranje časovne cone
FillThisOnlyIfRequired=Primer: +2 (uporabite samo, če se pojavijo težave s časovno cono) FillThisOnlyIfRequired=Primer: +2 (uporabite samo, če se pojavijo težave s časovno cono)
@ -1087,7 +1087,7 @@ ModuleCompanyCodeAquarium=Predlaga računovodsko kodo, sestavljeno iz "401" in k
ModuleCompanyCodePanicum=Predlaga prazno računovodsko kodo. ModuleCompanyCodePanicum=Predlaga prazno računovodsko kodo.
ModuleCompanyCodeDigitaria=Računovodska koda je odvisna od kode partnerja. Koda je sestavljena iz črke "C" prvih 5 znakov kode partnerja. ModuleCompanyCodeDigitaria=Računovodska koda je odvisna od kode partnerja. Koda je sestavljena iz črke "C" prvih 5 znakov kode partnerja.
UseNotifications=Uporaba sporočil UseNotifications=Uporaba sporočil
NotificationsDesc=EMails notifications feature allows you to silently send automatic mail, for some Dolibarr events. Targets of notifications can be defined:<br>* per third parties contacts (customers or suppliers), one third party at time.<br>* or by setting a global target email address on module setup page. NotificationsDesc=Funkcija sporočil po E-pošti omogoča tiho pošiljanje avtomatskih e-mailov o nekaterih Dolibarr dogodkih. Ciljo obvestil so lahko definirani kot:<br>* kontakti pri partnerjih (kupcih ali dobaviteljih), en partner naenkrat.<br>* ali z nastavitvijo globalnega ciljnega email naslova na strani za nastavitev modula.
ModelModules=Predloge dokumentov ModelModules=Predloge dokumentov
DocumentModelOdt=Ustvari dokumente iz predlog OpenDocuments (.ODT ali .ODS datoteke v programih OpenOffice, KOffice, TextEdit ,...) DocumentModelOdt=Ustvari dokumente iz predlog OpenDocuments (.ODT ali .ODS datoteke v programih OpenOffice, KOffice, TextEdit ,...)
WatermarkOnDraft=Vodni žig na osnutku dokumenta WatermarkOnDraft=Vodni žig na osnutku dokumenta
@ -1151,7 +1151,7 @@ AddDeliveryAddressAbility=Dodaj možen datum dobave
UseOptionLineIfNoQuantity=Vrstica proizvoda/storitve z vrednostjo 0 se smatra kot opcija UseOptionLineIfNoQuantity=Vrstica proizvoda/storitve z vrednostjo 0 se smatra kot opcija
FreeLegalTextOnProposal=Poljubno besedilo na komercialni ponudbi FreeLegalTextOnProposal=Poljubno besedilo na komercialni ponudbi
WatermarkOnDraftProposal=Vodni tisk na osnutkih komercialnih ponudb (brez, če je prazno) WatermarkOnDraftProposal=Vodni tisk na osnutkih komercialnih ponudb (brez, če je prazno)
BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL=Ask for bank account destination of proposal BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL=Vprašajte za ciljni bančni račun ponudbe
##### Orders ##### ##### Orders #####
OrdersSetup=Nastavitve upravljanja z naročili OrdersSetup=Nastavitve upravljanja z naročili
OrdersNumberingModules=Moduli za številčenje naročil OrdersNumberingModules=Moduli za številčenje naročil
@ -1161,7 +1161,7 @@ ValidOrderAfterPropalClosed=Za potrditev naročila po zaključku ponudbe, naj ne
FreeLegalTextOnOrders=Poljubno besedilo na naročilih FreeLegalTextOnOrders=Poljubno besedilo na naročilih
WatermarkOnDraftOrders=Vodni tisk na osnutkih naročil (brez, če je prazno) WatermarkOnDraftOrders=Vodni tisk na osnutkih naročil (brez, če je prazno)
ShippableOrderIconInList=Dodaj ikono na seznamnaročil, ki označuje, če je naročilo pripravljeno za odpremo ShippableOrderIconInList=Dodaj ikono na seznamnaročil, ki označuje, če je naročilo pripravljeno za odpremo
BANK_ASK_PAYMENT_BANK_DURING_ORDER=Ask for bank account destination of order BANK_ASK_PAYMENT_BANK_DURING_ORDER=Vprašaj za končni bančni račun naročila
##### Clicktodial ##### ##### Clicktodial #####
ClickToDialSetup=Nastavitve modula za klicanje s klikom ClickToDialSetup=Nastavitve modula za klicanje s klikom
ClickToDialUrlDesc=Po kliku na piktogram se izvede klic na Url. Na url lahko uporabite ikono<br><b>__PHONETO__</b> ki predstavlja telefon klicanega<br><b>__PHONEFROM__</b> ki predstavlja telefon klicatelja (vaša številka)<br><b>__LOGIN__</b> ki predstavlja vašo prijavo na klicanje s klikom (določena z vašo uporabniško kodo)<br><b>__PASS__</b> ki predstavlja vaše geslo za klicanje s klikom (določena z vašo uporabniško kodo). ClickToDialUrlDesc=Po kliku na piktogram se izvede klic na Url. Na url lahko uporabite ikono<br><b>__PHONETO__</b> ki predstavlja telefon klicanega<br><b>__PHONEFROM__</b> ki predstavlja telefon klicatelja (vaša številka)<br><b>__LOGIN__</b> ki predstavlja vašo prijavo na klicanje s klikom (določena z vašo uporabniško kodo)<br><b>__PASS__</b> ki predstavlja vaše geslo za klicanje s klikom (določena z vašo uporabniško kodo).
@ -1326,8 +1326,8 @@ YouMayFindPerfAdviceHere=Na tej strani najdete nekaj kontrol ali nasvetov, povez
NotInstalled=Ni nameščeno, zato to ni vzrok počasnosti strežnika NotInstalled=Ni nameščeno, zato to ni vzrok počasnosti strežnika
ApplicativeCache=Aplikativni predpomnilnik ApplicativeCache=Aplikativni predpomnilnik
MemcachedNotAvailable=Ni najden aplikativni predpomnilnik. Zmogljivost lahko izboljšate z namestitvijo predpomnilniškega strežnika Memcached in modula, ki zna uporabljati ta predpomnilniški strežnik.<br>Več informacij najdete tukaj <a href="http://wiki.dolibarr.org/index.php/Module_MemCached_EN">http://wiki.dolibarr.org/index.php/Module_MemCached_EN</a>.<br>Vedite, da veliko gostiteljev spletnih strani ne zagotavlja takega predpomnilniškega strežnika.. MemcachedNotAvailable=Ni najden aplikativni predpomnilnik. Zmogljivost lahko izboljšate z namestitvijo predpomnilniškega strežnika Memcached in modula, ki zna uporabljati ta predpomnilniški strežnik.<br>Več informacij najdete tukaj <a href="http://wiki.dolibarr.org/index.php/Module_MemCached_EN">http://wiki.dolibarr.org/index.php/Module_MemCached_EN</a>.<br>Vedite, da veliko gostiteljev spletnih strani ne zagotavlja takega predpomnilniškega strežnika..
MemcachedModuleAvailableButNotSetup=Module memcached for applicative cache found but setup of module is not complete. MemcachedModuleAvailableButNotSetup=Najden je predpomnilniški modul za aplikativni predpomnilnik, vendar nastavitev modula ni zaključena.
MemcachedAvailableAndSetup=Module memcached dedicated to use memcached server is enabled. MemcachedAvailableAndSetup=Vklopljen je predpomnilniški modul za predpomnilniški strežnik.
OPCodeCache=OPCode predpomnilnik OPCodeCache=OPCode predpomnilnik
NoOPCodeCacheFound=Ni najden OPCode predpomnilnik. Morda uporabljate drugačen OPCode predpomnilnik, kot sta XCache ali eAccelerator (v redu), morda pa nimate OPCode predpomnilnika (zelo slabo). NoOPCodeCacheFound=Ni najden OPCode predpomnilnik. Morda uporabljate drugačen OPCode predpomnilnik, kot sta XCache ali eAccelerator (v redu), morda pa nimate OPCode predpomnilnika (zelo slabo).
HTTPCacheStaticResources=HTTP predpomnilnik za statične vire (css, img, javascript) HTTPCacheStaticResources=HTTP predpomnilnik za statične vire (css, img, javascript)
@ -1397,19 +1397,19 @@ RSSUrlExample=Zanimiv vir RSS
MailingSetup=Nastavitev E-mail modula MailingSetup=Nastavitev E-mail modula
MailingEMailFrom=Naslov pošiljatelja (Od) za emaile, ki jih pošlje e-mailing modul MailingEMailFrom=Naslov pošiljatelja (Od) za emaile, ki jih pošlje e-mailing modul
MailingEMailError=Naslov za vračilo (Napake-za) emailov z napakami MailingEMailError=Naslov za vračilo (Napake-za) emailov z napakami
MailingDelay=Seconds to wait after sending next message MailingDelay=Čakanje v sekundah po pošiljanju naslednjega sporočila
##### Notification ##### ##### Notification #####
NotificationSetup=Nastavitev modula za obvestila po elektronski pošti NotificationSetup=Nastavitev modula za obvestila po elektronski pošti
NotificationEMailFrom=Naslov pošiljatelja (od) za emaile, ki se pošljejo kot obvestila NotificationEMailFrom=Naslov pošiljatelja (od) za emaile, ki se pošljejo kot obvestila
ListOfAvailableNotifications=List of events you can set notification on, for each thirdparty (go into thirdparty card to setup) or by setting a fixed email (List depends on activated modules) ListOfAvailableNotifications=Nastavitev dogodkov, za katere lahko pošljete obvestilo, za vsakega partnerja (nastavite na kartici partnerja) ali z nastavitvijo fiksnega emaila (seznam je odvisen od aktiviranega modula)
FixedEmailTarget=Popravi ciljni email FixedEmailTarget=Popravi ciljni email
##### Sendings ##### ##### Sendings #####
SendingsSetup=Nastavitev modula za pošiljanje SendingsSetup=Nastavitev modula za pošiljanje
SendingsReceiptModel=Obrazci odpremnic SendingsReceiptModel=Obrazci odpremnic
SendingsNumberingModules=Moduli za številčenje pošiljk SendingsNumberingModules=Moduli za številčenje pošiljk
SendingsAbility=Support shipment sheets for customer deliveries SendingsAbility=Podpora za odpremnice za dobavo kupcem
NoNeedForDeliveryReceipts=V večini primerov se dobavnice uporabljajo tako kot dokument za dostavo kupcem (seznam proizvodov, ki jih je potrebno poslati), kakor tudi kot dokument, ki ga dobi in podpiše kupec. Zato je odpremnica podvojena funkcija, ki je redko aktivirana. NoNeedForDeliveryReceipts=V večini primerov se dobavnice uporabljajo tako kot dokument za dostavo kupcem (seznam proizvodov, ki jih je potrebno poslati), kakor tudi kot dokument, ki ga dobi in podpiše kupec. Zato je odpremnica podvojena funkcija, ki je redko aktivirana.
FreeLegalTextOnShippings=Free text on shipments FreeLegalTextOnShippings=Prosti tekst na pošiljkah
##### Deliveries ##### ##### Deliveries #####
DeliveryOrderNumberingModules=Modul za številčenje dobavnic DeliveryOrderNumberingModules=Modul za številčenje dobavnic
DeliveryOrderModel=Obrazci dobavnic DeliveryOrderModel=Obrazci dobavnic
@ -1420,7 +1420,7 @@ AdvancedEditor=Napredni urejevalnik
ActivateFCKeditor=Aktiviranje FCKeditor za: ActivateFCKeditor=Aktiviranje FCKeditor za:
FCKeditorForCompany=WYSIWIG kreiranje/urejanje opisa podjetij in opomb FCKeditorForCompany=WYSIWIG kreiranje/urejanje opisa podjetij in opomb
FCKeditorForProduct=WYSIWIG kreiranje/urejanje opisa proizvodov/storitev in opomb FCKeditorForProduct=WYSIWIG kreiranje/urejanje opisa proizvodov/storitev in opomb
FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). <font class="warning">Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formating when building PDF files.</font> FCKeditorForProductDetails=WYSIWIG kreiranje/urejanje vrstic za podrobnosti za vse entitete (ponudbe, naročila, računi, itd...). <font class="warning">Opozorilo: Uporaba te opcije resnično ni priporočljiva, ker lahko povzroči težave s posebnimi znaki in formatiranjem strani PDF datotek.</font>
FCKeditorForMailing= WYSIWIG kreiranje/urejanje pošte FCKeditorForMailing= WYSIWIG kreiranje/urejanje pošte
FCKeditorForUserSignature=WYSIWIG kreiranje/urejanje podpisa uporabnika FCKeditorForUserSignature=WYSIWIG kreiranje/urejanje podpisa uporabnika
FCKeditorForMail=WYSIWIG kreiranje/urejanje za vse pošte (razen Outils->eMailing) FCKeditorForMail=WYSIWIG kreiranje/urejanje za vse pošte (razen Outils->eMailing)
@ -1432,7 +1432,7 @@ OSCommerceTestKo2=Povezava s strežnikom '%s' uporabnika '%s' ni uspela.
##### Stock ##### ##### Stock #####
StockSetup=Nastavitve modula za skladišče StockSetup=Nastavitve modula za skladišče
UserWarehouse=Uporabi uporabnikova prilagojena skladišča UserWarehouse=Uporabi uporabnikova prilagojena skladišča
IfYouUsePointOfSaleCheckModule=If you use a Point of Sale module (POS module provided by default or another external module), this setup may be ignored by your Point Of Sale module. Most point of sales modules are designed to create immediatly an invoice and decrease stock by default whatever are options here. So, if you need or not to have a stock decrease when registering a sell from your Point Of Sale, check also your POS module set up. IfYouUsePointOfSaleCheckModule=Če uporabljate prodajni modul (privzeti POS modul ali drug zunanji modul), bo vaš Point Of Sale modul morda ignoriral to nastavitev. Večina prodajnih modulov privzeto takoj ustvari račun in zmanjša zalogo ne glede na opcijo, ki je tukaj izbrana. Če torej želite ali ne želite zmanjšati zalogo ob prodaji preko prodajnega modula, preverite tudi nastavitve vašega prodajnega modula.
##### Menu ##### ##### Menu #####
MenuDeleted=Izbrisan meni MenuDeleted=Izbrisan meni
TreeMenu=Drevesni meniji TreeMenu=Drevesni meniji
@ -1558,7 +1558,7 @@ ConfirmDeleteFiscalYear=Ali zares želite izbrisati to fiskalni leto?
Opened=Odprt Opened=Odprt
Closed=Zaključeno Closed=Zaključeno
AlwaysEditable=Lahko je vedno urejeno AlwaysEditable=Lahko je vedno urejeno
MAIN_APPLICATION_TITLE=Force visible name of application (warning: setting your own name here may break autofill login feature when using DoliDroid mobile application) MAIN_APPLICATION_TITLE=Prisilni prikaz imena aplikacije (opozorilo: če tukaj nastavite vaše lastno ime, lahko prekinete funkcijo avtomatskega vnosa uporabniškega imena pri uporabi mobilne aplikacije DoliDroid)
NbMajMin=Minimalno število velikih črk NbMajMin=Minimalno število velikih črk
NbNumMin=Minimalno število cifer NbNumMin=Minimalno število cifer
NbSpeMin=Minimalno število posebnih znakov NbSpeMin=Minimalno število posebnih znakov
@ -1568,4 +1568,4 @@ SalariesSetup=Nastavitev modula za plače
SortOrder=Sortiraj naročilo SortOrder=Sortiraj naročilo
Format=Format Format=Format
TypePaymentDesc=0:Tip plačila stranke, 1:Tip plačila dobavitelju, 2:Tip plačila stranke in dobavitelju TypePaymentDesc=0:Tip plačila stranke, 1:Tip plačila dobavitelju, 2:Tip plačila stranke in dobavitelju
IncludePath=Include path (defined into variable %s) IncludePath=Vključi pot (definirana v spremenljivki %s)

View File

@ -58,7 +58,7 @@ OrderSentByEMail=Naročilo kupca %s poslano po elektronski pošti
InvoiceSentByEMail=Račun kupcu %s poslan po elektronski pošti InvoiceSentByEMail=Račun kupcu %s poslan po elektronski pošti
SupplierOrderSentByEMail=Naročilo dobavitelju %s poslano po elektronski pošti SupplierOrderSentByEMail=Naročilo dobavitelju %s poslano po elektronski pošti
SupplierInvoiceSentByEMail=Račun odbavitelja %s poslan po elektronski pošti SupplierInvoiceSentByEMail=Račun odbavitelja %s poslan po elektronski pošti
ShippingSentByEMail=Shipment %s sent by EMail ShippingSentByEMail=Odpremnica %s poslana po EMailu
ShippingValidated= Pošiljka %s potrjena ShippingValidated= Pošiljka %s potrjena
InterventionSentByEMail=Intervencija %s poslana po E-pošti InterventionSentByEMail=Intervencija %s poslana po E-pošti
NewCompanyToDolibarr= Kreiran partner NewCompanyToDolibarr= Kreiran partner
@ -69,7 +69,7 @@ DateActionDoneEnd= Realen končni datum
DateActionStart= Začetni datum DateActionStart= Začetni datum
DateActionEnd= Končni datum DateActionEnd= Končni datum
AgendaUrlOptions1=V filtriran izhod lahko dodate tudi naslednje parametre: AgendaUrlOptions1=V filtriran izhod lahko dodate tudi naslednje parametre:
AgendaUrlOptions2=<b>login=%s</b> to restrict output to actions created by or assigned to user <b>%s</b>. AgendaUrlOptions2=<b>login=%s</b> za omejitev izhoda na aktivnosti, ki se nanašajo, ali jih je naredil uporabnik <b>%s</b>.
AgendaUrlOptions3=<b>logina=%s</b> za omejitev izhoda na aktivnosti v lasti uporabnika <b>%s</b>. AgendaUrlOptions3=<b>logina=%s</b> za omejitev izhoda na aktivnosti v lasti uporabnika <b>%s</b>.
AgendaUrlOptions4=<b>logint=%s</b> za omejitev izhoda na aktivnosti, ki se nanašajo na uporabnika <b>%s</b>. AgendaUrlOptions4=<b>logint=%s</b> za omejitev izhoda na aktivnosti, ki se nanašajo na uporabnika <b>%s</b>.
AgendaUrlOptionsProject=<b>projekt=PROJECT_ID</b> za omejitev izhoda na aktivnosti povezane s projektom<b>PROJECT_ID</b>. AgendaUrlOptionsProject=<b>projekt=PROJECT_ID</b> za omejitev izhoda na aktivnosti povezane s projektom<b>PROJECT_ID</b>.

View File

@ -1,16 +1,16 @@
# Dolibarr language file - Source file is en_US - bills # Dolibarr language file - Source file is en_US - bills
Bill=Račun Bill=Račun
Bills=Računi Bills=Računi
BillsCustomers=Customers invoices BillsCustomers=Računi za kupce
BillsCustomer=Customers invoice BillsCustomer=Račun za kupce
BillsSuppliers=Suppliers invoices BillsSuppliers=Računi dobaviteljev
BillsCustomersUnpaid=Unpaid customers invoices BillsCustomersUnpaid=Neplačani računi kupcev
BillsCustomersUnpaidForCompany=Neplačani računi kupcev za %s BillsCustomersUnpaidForCompany=Neplačani računi kupcev za %s
BillsSuppliersUnpaid=Neplačani računi dobaviteljev BillsSuppliersUnpaid=Neplačani računi dobaviteljev
BillsSuppliersUnpaidForCompany=Neplačani računi dobaviteljev za %s BillsSuppliersUnpaidForCompany=Neplačani računi dobaviteljev za %s
BillsLate=Zamujena plačila BillsLate=Zamujena plačila
BillsStatistics=Customers invoices statistics BillsStatistics=Statistika računov za kupce
BillsStatisticsSuppliers=Suppliers invoices statistics BillsStatisticsSuppliers=Statistika računov dobaviteljev
DisabledBecauseNotErasable=Onemogočen, ker ni možno brisanje DisabledBecauseNotErasable=Onemogočen, ker ni možno brisanje
InvoiceStandard=Standardni račun InvoiceStandard=Standardni račun
InvoiceStandardAsk=Standardni račun InvoiceStandardAsk=Standardni račun
@ -348,7 +348,7 @@ ChequeNumber=Ček N°
ChequeOrTransferNumber=Ček/Prenos N° ChequeOrTransferNumber=Ček/Prenos N°
ChequeMaker=Oddaja čeka ChequeMaker=Oddaja čeka
ChequeBank=Banka izdajalka čeka ChequeBank=Banka izdajalka čeka
CheckBank=Check CheckBank=Ček
NetToBePaid=Neto za plačilo NetToBePaid=Neto za plačilo
PhoneNumber=Tel PhoneNumber=Tel
FullPhoneNumber=Telefon FullPhoneNumber=Telefon
@ -389,7 +389,7 @@ DisabledBecausePayments=Ni možno zaradi nekaterih odprtih plačil
CantRemovePaymentWithOneInvoicePaid=Brisanje plačila ni možno, ker je vsaj en račun označen kot plačan CantRemovePaymentWithOneInvoicePaid=Brisanje plačila ni možno, ker je vsaj en račun označen kot plačan
ExpectedToPay=Pričakovano plačilo ExpectedToPay=Pričakovano plačilo
PayedByThisPayment=Plačano s tem plačilom PayedByThisPayment=Plačano s tem plačilom
ClosePaidInvoicesAutomatically=Classify "Paid" all standard, situation or replacement invoices entirely paid. ClosePaidInvoicesAutomatically=Označi s "Plačano" vse standardne, situacijske ali nadomestne račune, ki so bili v celoti plačani.
ClosePaidCreditNotesAutomatically=Označi s "Plačano" vse dobropise, ki so bili v celoti vrnjeni. ClosePaidCreditNotesAutomatically=Označi s "Plačano" vse dobropise, ki so bili v celoti vrnjeni.
AllCompletelyPayedInvoiceWillBeClosed=Vsi računi, ki nimajo neplačanih preostankov, bodo avtomatsko zaključeni v status "Plačano". AllCompletelyPayedInvoiceWillBeClosed=Vsi računi, ki nimajo neplačanih preostankov, bodo avtomatsko zaključeni v status "Plačano".
ToMakePayment=Plačati ToMakePayment=Plačati
@ -412,19 +412,19 @@ TypeContact_invoice_supplier_external_BILLING=Kontakt za račun dobavitelja
TypeContact_invoice_supplier_external_SHIPPING=Kontakt za pošiljanje pri dobavitelju TypeContact_invoice_supplier_external_SHIPPING=Kontakt za pošiljanje pri dobavitelju
TypeContact_invoice_supplier_external_SERVICE=Kontakt za servis pri dobavitelju TypeContact_invoice_supplier_external_SERVICE=Kontakt za servis pri dobavitelju
# Situation invoices # Situation invoices
InvoiceFirstSituationAsk=First situation invoice InvoiceFirstSituationAsk=Račun za prvo situacijo
InvoiceFirstSituationDesc=The <b>situation invoices</b> are tied to situations related to a progression, for example the progression of a construction. Each situation is tied to an invoice. InvoiceFirstSituationDesc=<b>Situacijski računi</b> so vezani na situacijo glede na napredek, na primer na napredek gradnje. Vska situacija je povezana z računom.
InvoiceSituation=Situation invoice InvoiceSituation=Situacijski račun
InvoiceSituationAsk=Invoice following the situation InvoiceSituationAsk=Račun, ki sledi situaciji
InvoiceSituationDesc=Create a new situation following an already existing one InvoiceSituationDesc=Ustvari novo situacijo, ki sledi obstoječi
SituationAmount=Situation invoice amount(net) SituationAmount=Vrednost računa za situacijo (neto)
SituationDeduction=Situation subtraction SituationDeduction=Odštevanje situacije
Progress=Progress Progress=Napredek
ModifyAllLines=Modify all lines ModifyAllLines=Uredi vse vrstice
CreateNextSituationInvoice=Create next situation CreateNextSituationInvoice=Ustvari naslednjo situacijo
NotLastInCycle=This invoice in not the last in cycle and must not be modified. NotLastInCycle=Ta račun ni zadnji v ciklu in ga ne morete spremeniti.
DisabledBecauseNotLastInCycle=The next situation already exists. DisabledBecauseNotLastInCycle=Naslednja situacija že obstaja.
DisabledBecauseFinal=This situation is final. DisabledBecauseFinal=Ta situacija je končna.
CantBeLessThanMinPercent=The progress can't be smaller than its value in the previous situation. CantBeLessThanMinPercent=Napredek ne more biti manjši, kot je vrednost prejšnje situacije
NoSituations=No opened situations NoSituations=Ni odprtih situacij
InvoiceSituationLast=Final and general invoice InvoiceSituationLast=Končni in skupni račun

View File

@ -33,6 +33,6 @@ IConfirmDonationReception=Prejemnik potrjuje prejem donacije v naslednjem znesku
MinimumAmount=Najmanjši znesek je %s MinimumAmount=Najmanjši znesek je %s
FreeTextOnDonations=Poljubno besedilo v nogi FreeTextOnDonations=Poljubno besedilo v nogi
FrenchOptions=Opcije za Francijo FrenchOptions=Opcije za Francijo
DONATION_ART200=Show article 200 from CGI if you are concerned DONATION_ART200=Prikaži člen 200 iz CGI, če se vas tiče
DONATION_ART238=Show article 238 from CGI if you are concerned DONATION_ART238=Prikaži člen 238 iz CGI, če se vas tiče
DONATION_ART885=Show article 885 from CGI if you are concerned DONATION_ART885=Prikaži člen 885 iz CGI, če se vas tiče

View File

@ -43,8 +43,8 @@ ECMDocsByContracts=Dokumenti, povezani s pogodbami
ECMDocsByInvoices=Dokumenti, povezani z računi za kupce ECMDocsByInvoices=Dokumenti, povezani z računi za kupce
ECMDocsByProducts=Dokumenti, povezani s proizvodi ECMDocsByProducts=Dokumenti, povezani s proizvodi
ECMDocsByProjects=Dokumenti, povezani s projekti ECMDocsByProjects=Dokumenti, povezani s projekti
ECMDocsByUsers=Documents linked to users ECMDocsByUsers=Dokumenti, povezani z uporabniki
ECMDocsByInterventions=Documents linked to interventions ECMDocsByInterventions=Dokumenti, povezani z intervencijami
ECMNoDirectoryYet=Ni kreiranih map ECMNoDirectoryYet=Ni kreiranih map
ShowECMSection=Prikaži mapo ShowECMSection=Prikaži mapo
DeleteSection=Odstrani mapo DeleteSection=Odstrani mapo

View File

@ -155,7 +155,7 @@ MigrationFinished=Prenos končan
LastStepDesc=<strong>Zadnji korak</strong>: Tukaj določite uporabniško ime in geslo, ki ju nameravate uporabiti za priklop v software. Ne izgubite ju, ker je to račun za administriranje vseh ostalih računov. LastStepDesc=<strong>Zadnji korak</strong>: Tukaj določite uporabniško ime in geslo, ki ju nameravate uporabiti za priklop v software. Ne izgubite ju, ker je to račun za administriranje vseh ostalih računov.
ActivateModule=Vključite modul %s ActivateModule=Vključite modul %s
ShowEditTechnicalParameters=Kliknite tukaj za prikaz/popravek naprednih parametrov (expertni način) ShowEditTechnicalParameters=Kliknite tukaj za prikaz/popravek naprednih parametrov (expertni način)
WarningUpgrade=Warning:\nDid your run a database backup first ?\nThis is highly recommanded: for example, due to some bugs into databases systems (for example mysql version 5.5.40), some data or tables may be lost during this process, so it is highly recommanded to have a complete dump of your database before starting migration.\n\nClick OK to start migration process... WarningUpgrade=Pozor:\nAli ste najprej naredili varnostno kopijo baze podatkov ?\nTo je zelo priporočeno: na primer zaradi nekaterih hroščev v sistemu baze podatkov (na primer mysql verzija 5.5.40), lahko med tem postopkom izgubite nekatere podatke ali tabele, zato je priporočeno imeti celotno kopijo vaše baze podatkov pred začetkom migracije.\n\nKliknite OK za začetek procesa migracije...
######### #########
# upgrade # upgrade
@ -207,7 +207,7 @@ MigrationProjectTaskTime=Posodobitev porabljenega časa v sekundah
MigrationActioncommElement=Posodobitev podatkov o aktivnostih MigrationActioncommElement=Posodobitev podatkov o aktivnostih
MigrationPaymentMode=Podatki, migracije za način plačila MigrationPaymentMode=Podatki, migracije za način plačila
MigrationCategorieAssociation=Migracija kategorij MigrationCategorieAssociation=Migracija kategorij
MigrationEvents=Migration of events to add event owner into assignement table MigrationEvents=Migracija dogodkov za dodajanje lastnika dogodka v dodelitveno tabelo
ShowNotAvailableOptions=Prikaži opcije, ki niso na voljo ShowNotAvailableOptions=Prikaži opcije, ki niso na voljo
HideNotAvailableOptions=Skrij opcije, ki niso na voljo HideNotAvailableOptions=Skrij opcije, ki niso na voljo

View File

@ -24,8 +24,8 @@ NameAndSignatureOfInternalContact=Ime in podpis serviserja :
NameAndSignatureOfExternalContact=Ime in podpis kupca : NameAndSignatureOfExternalContact=Ime in podpis kupca :
DocumentModelStandard=Standardni vzorec dokumenta za intervencijo DocumentModelStandard=Standardni vzorec dokumenta za intervencijo
InterventionCardsAndInterventionLines=Intervencije in vrstice na intervenciji InterventionCardsAndInterventionLines=Intervencije in vrstice na intervenciji
InterventionClassifyBilled=Classify "Billed" InterventionClassifyBilled=Označi kot "Zaračunano"
InterventionClassifyUnBilled=Classify "Unbilled" InterventionClassifyUnBilled=Označi kot "Nezaračunano"
StatusInterInvoiced=Zaračunano StatusInterInvoiced=Zaračunano
RelatedInterventions=Odvisne intervencije RelatedInterventions=Odvisne intervencije
ShowIntervention=Prikaži intervencijo ShowIntervention=Prikaži intervencijo
@ -34,8 +34,8 @@ SendInterventionByMail=Pošlji intervencijo po E-pošti
InterventionCreatedInDolibarr=Intervencija %s je ustvarjena InterventionCreatedInDolibarr=Intervencija %s je ustvarjena
InterventionValidatedInDolibarr=Intervencija %s je potrjena InterventionValidatedInDolibarr=Intervencija %s je potrjena
InterventionModifiedInDolibarr=Intervencija %s je spremenjena InterventionModifiedInDolibarr=Intervencija %s je spremenjena
InterventionClassifiedBilledInDolibarr=Intervention %s set as billed InterventionClassifiedBilledInDolibarr=Intervencijo %s označi kot "zaračunana"
InterventionClassifiedUnbilledInDolibarr=Intervention %s set as unbilled InterventionClassifiedUnbilledInDolibarr=Intervencijo %s označi kot "nezaračunana"
InterventionSentByEMail=Intervencija %s je poslana po E-pošti InterventionSentByEMail=Intervencija %s je poslana po E-pošti
InterventionDeletedInDolibarr=Intervencija %s je izbrisana InterventionDeletedInDolibarr=Intervencija %s je izbrisana
SearchAnIntervention=Poišči intervencijo SearchAnIntervention=Poišči intervencijo

View File

@ -261,7 +261,7 @@ days=dni
Hours=Ur Hours=Ur
Minutes=Minut Minutes=Minut
Seconds=Sekund Seconds=Sekund
Weeks=Weeks Weeks=Tednov
Today=Danes Today=Danes
Yesterday=Včeraj Yesterday=Včeraj
Tomorrow=Jutri Tomorrow=Jutri

View File

@ -16,20 +16,20 @@ SupplierOrder=Naročilo pri dobavitelju
SuppliersOrders=Naročila pri dobaviteljih SuppliersOrders=Naročila pri dobaviteljih
SuppliersOrdersRunning=Trenutna naročila pri dobaviteljih SuppliersOrdersRunning=Trenutna naročila pri dobaviteljih
CustomerOrder=Naročilo kupca CustomerOrder=Naročilo kupca
CustomersOrders=Customers orders CustomersOrders=Naročila kupcev
CustomersOrdersRunning=Trenutna naročila kupcev CustomersOrdersRunning=Trenutna naročila kupcev
CustomersOrdersAndOrdersLines=Naročila kupcev in vrstice naročil CustomersOrdersAndOrdersLines=Naročila kupcev in vrstice naročil
OrdersToValid=Customers orders to validate OrdersToValid=Naročila kupcev za potrditev
OrdersToBill=Customers orders delivered OrdersToBill=Naročila kupcev za fakturiranje
OrdersInProcess=Customers orders in process OrdersInProcess=Naročila kupcev v obdelavi
OrdersToProcess=Customers orders to process OrdersToProcess=Naročila kupcev za obdelavo
SuppliersOrdersToProcess=Naročila pri dobaviteljih za obdelavo SuppliersOrdersToProcess=Naročila pri dobaviteljih za obdelavo
StatusOrderCanceledShort=Preklicano StatusOrderCanceledShort=Preklicano
StatusOrderDraftShort=Osnutek StatusOrderDraftShort=Osnutek
StatusOrderValidatedShort=Potrjeno StatusOrderValidatedShort=Potrjeno
StatusOrderSentShort=V postopku StatusOrderSentShort=V postopku
StatusOrderSent=Pošiljanje v teku StatusOrderSent=Pošiljanje v teku
StatusOrderOnProcessShort=Ordered StatusOrderOnProcessShort=Naročeno
StatusOrderProcessedShort=Obdelano StatusOrderProcessedShort=Obdelano
StatusOrderToBillShort=Za fakturiranje StatusOrderToBillShort=Za fakturiranje
StatusOrderToBill2Short=Za fakturiranje StatusOrderToBill2Short=Za fakturiranje
@ -41,7 +41,7 @@ StatusOrderReceivedAllShort=Prejeto v celoti
StatusOrderCanceled=Preklicano StatusOrderCanceled=Preklicano
StatusOrderDraft=Osnutek (potrebno potrditi) StatusOrderDraft=Osnutek (potrebno potrditi)
StatusOrderValidated=Potrjeno StatusOrderValidated=Potrjeno
StatusOrderOnProcess=Ordered - Standby reception StatusOrderOnProcess=Naročeno - čaka na prevzem
StatusOrderProcessed=Obdelano StatusOrderProcessed=Obdelano
StatusOrderToBill=Za fakturiranje StatusOrderToBill=Za fakturiranje
StatusOrderToBill2=Za fakturiranje StatusOrderToBill2=Za fakturiranje
@ -50,8 +50,8 @@ StatusOrderRefused=Zavrnjeno
StatusOrderReceivedPartially=Delno prejeto StatusOrderReceivedPartially=Delno prejeto
StatusOrderReceivedAll=Prejeto v celoti StatusOrderReceivedAll=Prejeto v celoti
ShippingExist=Pošiljka ne obstaja ShippingExist=Pošiljka ne obstaja
ProductQtyInDraft=Product quantity into draft orders ProductQtyInDraft=Količina proizvoda v osnutkih naročil
ProductQtyInDraftOrWaitingApproved=Product quantity into draft or approved orders, not yet ordered ProductQtyInDraftOrWaitingApproved=Količina proizvoda v osnutku ali odobrenem naročilu, ki še ni naročen
DraftOrWaitingApproved=Osnutek ali odobritev, še ne naročen DraftOrWaitingApproved=Osnutek ali odobritev, še ne naročen
DraftOrWaitingShipped=Osnutek ali potrditev, še ne odposlan DraftOrWaitingShipped=Osnutek ali potrditev, še ne odposlan
MenuOrdersToBill=Naročila za fakturiranje MenuOrdersToBill=Naročila za fakturiranje

View File

@ -47,7 +47,7 @@ Notify_PROJECT_CREATE=Ustvarjanje projekta
Notify_TASK_CREATE=Ustvarjena naloga Notify_TASK_CREATE=Ustvarjena naloga
Notify_TASK_MODIFY=Spremenjena naloga Notify_TASK_MODIFY=Spremenjena naloga
Notify_TASK_DELETE=Izbrisana naloga Notify_TASK_DELETE=Izbrisana naloga
SeeModuleSetup=See module setup SeeModuleSetup=Glejte nastavitev modula
NbOfAttachedFiles=Število pripetih datotek/dokumentov NbOfAttachedFiles=Število pripetih datotek/dokumentov
TotalSizeOfAttachedFiles=Skupna velikost pripetih datotek/dokumentov TotalSizeOfAttachedFiles=Skupna velikost pripetih datotek/dokumentov
MaxSize=Največja velikost MaxSize=Največja velikost
@ -203,26 +203,26 @@ ForgetIfNothing=Če niste zahtevali te spremembe, enostavno pozabite na ta email
##### Calendar common ##### ##### Calendar common #####
AddCalendarEntry=Dodaj vnos v koledar %s AddCalendarEntry=Dodaj vnos v koledar %s
NewCompanyToDolibarr=Company %s added NewCompanyToDolibarr=Podjetje %s dodano
ContractValidatedInDolibarr=Contract %s validated ContractValidatedInDolibarr=Pogodba %s potrjena
ContractCanceledInDolibarr=Contract %s canceled ContractCanceledInDolibarr=Pogodba %s preklicana
ContractClosedInDolibarr=Contract %s closed ContractClosedInDolibarr=Pogodba %s zaključena
PropalClosedSignedInDolibarr=Proposal %s signed PropalClosedSignedInDolibarr=Ponudba %s podpisana
PropalClosedRefusedInDolibarr=Proposal %s refused PropalClosedRefusedInDolibarr=Ponudba %s zavrnjena
PropalValidatedInDolibarr=Proposal %s validated PropalValidatedInDolibarr=Ponudba %s potrjena
PropalClassifiedBilledInDolibarr=Proposal %s classified billed PropalClassifiedBilledInDolibarr=Ponudba %s je označena kot "zaračunana"
InvoiceValidatedInDolibarr=Invoice %s validated InvoiceValidatedInDolibarr=Račun %s potrjen
InvoicePaidInDolibarr=Invoice %s changed to paid InvoicePaidInDolibarr=Račun %s spremenjen v 'plačano'
InvoiceCanceledInDolibarr=Invoice %s canceled InvoiceCanceledInDolibarr=Račun %s preklican
PaymentDoneInDolibarr=Payment %s done PaymentDoneInDolibarr=Plačilo %s izvršeno
CustomerPaymentDoneInDolibarr=Customer payment %s done CustomerPaymentDoneInDolibarr=Plačilo kupca %s izvršeno
SupplierPaymentDoneInDolibarr=Supplier payment %s done SupplierPaymentDoneInDolibarr=Plačilo dobavitelju %s izvršeno
MemberValidatedInDolibarr=Member %s validated MemberValidatedInDolibarr=Član %s potrjen
MemberResiliatedInDolibarr=Member %s resiliated MemberResiliatedInDolibarr=Član %s obnovljen
MemberDeletedInDolibarr=Member %s deleted MemberDeletedInDolibarr=Član %s izbrisan
MemberSubscriptionAddedInDolibarr=Subscription for member %s added MemberSubscriptionAddedInDolibarr=Naročnina za člana %s dodana
ShipmentValidatedInDolibarr=Shipment %s validated ShipmentValidatedInDolibarr=Pošiljka %s potrjena
ShipmentDeletedInDolibarr=Shipment %s deleted ShipmentDeletedInDolibarr=Pošiljka %s izbrisana
##### Export ##### ##### Export #####
Export=Izvoz Export=Izvoz
ExportsArea=Področje izvoza ExportsArea=Področje izvoza

View File

@ -35,6 +35,6 @@ MessageKO=Sporočilo na strani za preklic plačila
NewPayboxPaymentReceived=Novo Paybox plačilo prejeto NewPayboxPaymentReceived=Novo Paybox plačilo prejeto
NewPayboxPaymentFailed=Zavrnjen poskus novega Paybox plačila NewPayboxPaymentFailed=Zavrnjen poskus novega Paybox plačila
PAYBOX_PAYONLINE_SENDEMAIL=E-poštno opozorilo po plačilu (uspešno ali zavrnjeno) PAYBOX_PAYONLINE_SENDEMAIL=E-poštno opozorilo po plačilu (uspešno ali zavrnjeno)
PAYBOX_PBX_SITE=Value for PBX SITE PAYBOX_PBX_SITE=Vrednost za PBX SITE
PAYBOX_PBX_RANG=Value for PBX Rang PAYBOX_PBX_RANG=Vrednost za PBX Rang
PAYBOX_PBX_IDENTIFIANT=Value for PBX ID PAYBOX_PBX_IDENTIFIANT=Vrednost za PBX ID

Some files were not shown because too many files have changed in this diff Show More