Merge pull request #5 from Dolibarr/develop

Get current develop
This commit is contained in:
Tobias Sekan 2020-01-16 10:30:04 +01:00 committed by GitHub
commit 7de9a94624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
112 changed files with 4205 additions and 2697 deletions

View File

@ -254,6 +254,7 @@ before_script:
fi fi
- sudo a2enmod rewrite actions fastcgi alias - sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension = libzip.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi - sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
@ -285,7 +286,7 @@ script:
# Ensure we catch errors # Ensure we catch errors
set -e set -e
#parallel-lint --exclude htdocs/includes --blame . #parallel-lint --exclude htdocs/includes --blame .
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/composer/autoload_static.php --blame . parallel-lint --exclude dev/namespacemig --exclude dev/initdata/dbf/includes --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/composer/autoload_static.php --blame .
set +e set +e
echo echo

View File

@ -231,3 +231,8 @@ $dolibarr_main_prod='0';
# Default value: 0 (use database value if exist) # Default value: 0 (use database value if exist)
# Examples: # Examples:
# $dolibarr_mailing_limit_sendbycli='0'; # $dolibarr_mailing_limit_sendbycli='0';
# dolibarr_distrib
# A key to identify the distribution used for first installation
$dolibarr_distrib = 'deb';

View File

@ -1 +1,2 @@
htdocs/install/doctemplates/websites/website_template-corporate.zip htdocs/install/doctemplates/websites/website_template-corporate.zip
htdocs/install/doctemplates/websites/website_template-stellar.zip

View File

@ -110,7 +110,7 @@ Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\m
; Mysql data files (does not overwrite if exists) ; Mysql data files (does not overwrite if exists)
Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db" Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
; Dolibarr ; Dolibarr
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php" Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,sabre\sabre\*\tests,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,initdemo\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*" Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,initdemo\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png" Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php" Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"

View File

@ -146,7 +146,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1);
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
*/ */
$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
$dir=''; $dir='';
$needtoclose=0; $needtoclose=0;

View File

@ -0,0 +1,231 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 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 <https://www.gnu.org/licenses/>.
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
/**
* \file dev/initdata/import-dbf.php
* \brief Script example to create a table from a large DBF file (openoffice)
* To purge data, you can have a look at purge-data.php
*/
// Test si mode batch
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__) . '/';
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;
}
// Recupere root dolibarr
$path = dirname($_SERVER["PHP_SELF"]);
require $path . "./../htdocs/master.inc.php";
require $path . "/includes/dbase.class.php";
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
/*
* Main
*/
@set_time_limit(0);
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
$filepath = $argv[1];
$filepatherr = $filepath . '.err';
$startchar = empty($argv[2]) ? 0 : (int) $argv[2];
$deleteTable = empty($argv[3]) ? 1 : 0;
$startlinenb = empty($argv[3]) ? 1 : (int) $argv[3];
$endlinenb = empty($argv[4]) ? 0 : (int) $argv[4];
if (empty($filepath)) {
print "Usage: php $script_file myfilepath.dbf [removeChatColumnName] [startlinenb] [endlinenb]\n";
print "Example: php $script_file myfilepath.dbf 0 2 1002\n";
print "\n";
exit(-1);
}
if (!file_exists($filepath)) {
print "Error: File " . $filepath . " not found.\n";
print "\n";
exit(-1);
}
$ret = $user->fetch('', 'admin');
if (!$ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
exit;
}
$user->getrights();
// Ask confirmation
if (!$confirmed) {
print "Hit Enter to continue or CTRL+C to stop...\n";
$input = trim(fgets(STDIN));
}
// Open input and output files
$fhandle = dbase_open($filepath, 0);
if (!$fhandle) {
print 'Error: Failed to open file ' . $filepath . "\n";
exit(1);
}
$fhandleerr = fopen($filepatherr, 'w');
if (!$fhandleerr) {
print 'Error: Failed to open file ' . $filepatherr . "\n";
exit(1);
}
$langs->setDefaultLang($defaultlang);
$record_numbers = dbase_numrecords($fhandle);
$table_name = substr(basename($filepath), 0, strpos(basename($filepath), '.'));
print 'Info: ' . $record_numbers . " lines in file \n";
$header = dbase_get_header_info($fhandle);
if ($deleteTable) {
$db->query("DROP TABLE IF EXISTS `$table_name`");
}
$sqlCreate = "CREATE TABLE IF NOT EXISTS `$table_name` ( `id` INT(11) NOT NULL AUTO_INCREMENT ";
$fieldArray = array("`id`");
foreach ($header as $value) {
$fieldName = substr(str_replace('_', '', $value['name']), $startchar);
$fieldArray[] = "`$fieldName`";
$sqlCreate .= ", `" . $fieldName . "` VARCHAR({$value['length']}) NULL DEFAULT NULL ";
}
$sqlCreate .= ", PRIMARY KEY (`id`)) ENGINE = InnoDB";
$resql = $db->query($sqlCreate);
if ($resql !== false) {
print "Table $table_name created\n";
} else {
var_dump($db->errno());
print "Impossible : " . $sqlCreate . "\n";
die();
}
$i = 0;
$nboflines++;
$fields = implode(',', $fieldArray);
//var_dump($fieldArray);die();
$maxLength = 0;
for ($i = 1; $i <= $record_numbers; $i++) {
if ($startlinenb && $i < $startlinenb)
continue;
if ($endlinenb && $i > $endlinenb)
continue;
$row = dbase_get_record_with_names($fhandle, $i);
if ($row === false || (isset($row["deleted"]) && $row["deleted"] == '1'))
continue;
$sqlInsert = "INSERT INTO `$table_name`($fields) VALUES (null,";
array_shift($row); // remove delete column
foreach ($row as $value) {
$sqlInsert .= "'" . $db->escape(utf8_encode($value)) . "', ";
}
replaceable_echo(implode("\t", $row));
$sqlInsert = rtrim($sqlInsert, ', ');
$sqlInsert .= ")";
$resql = $db->query($sqlInsert);
if ($resql === false) {
print "Impossible : " . $sqlInsert . "\n";
var_dump($row, $db->errno());
die();
}
// $fields = (object) $row;
// var_dump($fields);
continue;
}
die();
// commit or rollback
print "Nb of lines qualified: " . $nboflines . "\n";
print "Nb of errors: " . $error . "\n";
if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) {
print "Rollback any changes.\n";
$db->rollback();
} else {
print "Commit all changes.\n";
$db->commit();
}
$db->close();
fclose($fhandle);
fclose($fhandleerr);
exit($error);
/**
* replaceable_echo
*
* @param string $message Message
* @param int $force_clear_lines Force clear messages
* @return void
*/
function replaceable_echo($message, $force_clear_lines = null)
{
static $last_lines = 0;
if (!is_null($force_clear_lines)) {
$last_lines = $force_clear_lines;
}
$toss = array();
$status = 0;
$term_width = exec('tput cols', $toss, $status);
if ($status) {
$term_width = 64; // Arbitrary fall-back term width.
}
$line_count = 0;
foreach (explode("\n", $message) as $line) {
$line_count += count(str_split($line, $term_width));
}
// Erasure MAGIC: Clear as many lines as the last output had.
for ($i = 0; $i < $last_lines; $i++) {
// Return to the beginning of the line
echo "\r";
// Erase to the end of the line
echo "\033[K";
// Move cursor Up a line
echo "\033[1A";
// Return to the beginning of the line
echo "\r";
// Erase to the end of the line
echo "\033[K";
// Return to the beginning of the line
echo "\r";
// Can be consolodated into
// echo "\r\033[K\033[1A\r\033[K\r";
}
$last_lines = $line_count;
echo $message . "\n";
}

View File

@ -0,0 +1,241 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 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 <https://www.gnu.org/licenses/>.
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
/**
* \file dev/initdata/import-product.php
* \brief Script example to insert products from a csv file.
* To purge data, you can have a look at purge-data.php
*/
// Test si mode batch
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__) . '/';
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;
}
// Recupere root dolibarr
$path = preg_replace('/importdb-products.php/i', '', $_SERVER["PHP_SELF"]);
require $path . "../../htdocs/master.inc.php";
require $path . "includes/dbase.class.php";
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
//$delimiter = ',';
//$enclosure = '"';
//$linelength = 10000;
//$escape = '/';
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
$tvas = [
'1' => "20.00",
'2' => "5.50",
'3' => "0.00",
'4' => "20.60",
'5' => "19.60",
];
$tvasD = [
'1' => "20",
'2' => "5.5",
'3' => "0",
'4' => "20",
'5' => "20",
];
/*
* Main
*/
@set_time_limit(0);
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
$table = $argv[1];
if (empty($argv[1])) {
print "Error: Which table ?\n";
print "\n";
exit(-1);
}
$ret = $user->fetch('', 'admin');
if (!$ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
exit;
}
$sql = "SELECT * FROM `$table` WHERE 1";
$resql = $db->query($sql);
if ($resql)
while ($fields = $db->fetch_array($resql)) {
$errorrecord = 0;
if ($fields === false)
continue;
$nboflines++;
$produit = new Product($db);
$produit->type = 0;
$produit->status = 1;
$produit->ref = trim($fields['REF']);
if ($produit->ref == '')
continue;
print "Process line nb " . $j . ", ref " . $produit->ref;
$produit->label = trim($fields['LIBELLE']);
if ($produit->label == '')
$produit->label = $produit->ref;
if (empty($produit->label))
continue;
//$produit->description = trim($fields[4] . "\n" . ($fields[5] ? $fields[5] . ' x ' . $fields[6] . ' x ' . $fields[7] : ''));
// $produit->volume = price2num($fields[8]);
// $produit->volume_unit = 0;
$produit->weight = price2num($fields['MASSE']);
$produit->weight_units = 0; // -3 = g
//$produit->customcode = $fields[10];
$produit->barcode = str_pad($fields['CODE'], 12, "0", STR_PAD_LEFT);
$produit->barcode_type = '2';
$produit->import_key = $fields['CODE'];
$produit->status = 1;
$produit->status_buy = 1;
$produit->finished = 1;
// $produit->multiprices[0] = price2num($fields['TARIF0']);
// $produit->multiprices[1] = price2num($fields['TARIF1']);
// $produit->multiprices[2] = price2num($fields['TARIF2']);
// $produit->multiprices[3] = price2num($fields['TARIF3']);
// $produit->multiprices[4] = price2num($fields['TARIF4']);
// $produit->multiprices[5] = price2num($fields['TARIF5']);
// $produit->multiprices[6] = price2num($fields['TARIF6']);
// $produit->multiprices[7] = price2num($fields['TARIF7']);
// $produit->multiprices[8] = price2num($fields['TARIF8']);
// $produit->multiprices[9] = price2num($fields['TARIF9']);
// $produit->price_min = null;
// $produit->price_min_ttc = null;
// $produit->price = price2num($fields[11]);
// $produit->price_ttc = price2num($fields[12]);
// $produit->price_base_type = 'TTC';
// $produit->tva_tx = price2num($fields[13]);
$produit->tva_tx = (int) ($tvas[$fields['CODTVA']]);
$produit->tva_npr = 0;
// $produit->cost_price = price2num($fields[16]);
//compta
$produit->accountancy_code_buy = trim($fields['COMACH']);
$produit->accountancy_code_sell = trim($fields['COMVEN']);
// $produit->accountancy_code_sell_intra=trim($fields['COMVEN']);
// $produit->accountancy_code_sell_export=trim($fields['COMVEN']);
// Extrafields
// $produit->array_options['options_ecotaxdeee'] = price2num($fields[17]);
$produit->seuil_stock_alerte = $fields['STALERTE'];
$ret = $produit->create($user, 0);
if ($ret < 0) {
print " - Error in create result code = " . $ret . " - " . $produit->errorsToString();
$errorrecord++;
} else {
print " - Creation OK with ref " . $produit->ref . " - id = " . $ret;
}
dol_syslog("Add prices");
// If we use price level, insert price for each level
if (!$errorrecord && 1) {
//$ret1 = $produit->updatePrice($produit->price_ttc, $produit->price_base_type, $user, $produit->tva_tx, $produit->price_min, 1, $produit->tva_npr, 0, 0, array());
$ret1 = false;
for ($i = 0; $i < 10; $i++) {
if ($fields['TARIF' . ($i)] == 0)
continue;
$ret1 = $ret1 || $produit->updatePrice(price2num($fields['TARIF' . ($i)]), 'HT', $user, $produit->tva_tx, $produit->price_min, $i + 1, $produit->tva_npr, 0, 0, array()) < 0;
}
if ($ret1) {
print " - Error in updatePrice result " . $produit->errorsToString();
$errorrecord++;
} else {
print " - updatePrice OK";
}
}
// dol_syslog("Add multilangs");
// Add alternative languages
// if (!$errorrecord && 1) {
// $produit->multilangs['fr_FR'] = array('label' => $produit->label, 'description' => $produit->description, 'note' => $produit->note_private);
// $produit->multilangs['en_US'] = array('label' => $fields[3], 'description' => $produit->description, 'note' => $produit->note_private);
//
// $ret = $produit->setMultiLangs($user);
// if ($ret < 0) {
// print " - Error in setMultiLangs result code = " . $ret . " - " . $produit->errorsToString();
// $errorrecord++;
// } else {
// print " - setMultiLangs OK";
// }
// }
dol_syslog("Add stocks");
// stocks
if (!$errorrecord && $fields['STOCK'] != 0) {
$rets = $produit->correct_stock($user, 1, $fields['STOCK'], 0, 'Stock importé');
if ($rets < 0) {
print " - Error in correct_stock result " . $produit->errorsToString();
$errorrecord++;
} else {
print " - correct_stock OK";
}
}
//update date créa
if (!$errorrecord) {
$date = substr($fields['DATCREA'], 0, 4) . '-' . substr($fields['DATCREA'], 4, 2) . '-' . substr($fields['DATCREA'], 6, 2);
$retd = $db->query("UPDATE `llx_product` SET `datec` = '$date 00:00:00' WHERE `llx_product`.`rowid` = $produit->id");
if ($retd < 1) {
print " - Error in update date créa result " . $produit->errorsToString();
$errorrecord++;
} else {
print " - update date créa OK";
}
}
print "\n";
if ($errorrecord) {
print( 'Error on record nb ' . $i . " - " . $produit->errorsToString() . "\n");
var_dump($db);
die();
$error++; // $errorrecord will be reset
}
$j++;
} else
die("error : $sql");
// commit or rollback
print "Nb of lines qualified: " . $nboflines . "\n";
print "Nb of errors: " . $error . "\n";
$db->close();
exit($error);

View File

@ -0,0 +1,355 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 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 <https://www.gnu.org/licenses/>.
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
/**
* \file dev/initdata/import-product.php
* \brief Script example to insert products from a csv file.
* To purge data, you can have a look at purge-data.php
*/
// Test si mode batch
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__) . '/';
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;
}
// Recupere root dolibarr
$path = preg_replace('/importdb-thirdparties.php/i', '', $_SERVER["PHP_SELF"]);
require $path . "../../htdocs/master.inc.php";
require $path . "includes/dbase.class.php";
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
//$delimiter = ',';
//$enclosure = '"';
//$linelength = 10000;
//$escape = '/';
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
$civilPrivate = array("MLLE",
"MM",
"MM/MADAME",
"MME",
"MME.",
"MME²",
"MMONSIEUR",
"MMR",
"MOBNSIEUR",
"MOMSIEUR",
"MON SIEUR",
"MONDIAL",
"MONIEUR",
"MONJSIEUR",
"MONNSIEUR",
"MONRIEUR",
"MONS",
"MONSIEÕR",
"MONSIER",
"MONSIERU",
"MONSIEU",
"monsieue",
"MONSIEUR",
"Monsieur     \"",
"MONSIEUR    \"",
"MONSIEUR   E",
"MONSIEUR  DENIS",
"MONSIEUR ET MME",
"MONSIEUR!",
"MONSIEUR.",
"MONSIEUR.MADAME",
"MONSIEUR3",
"MONSIEURN",
"MONSIEURT",
"MONSIEUR£",
"MONSIEYR",
"Monsigur",
"MONSIIEUR",
"MONSIUER",
"MONSIZEUR",
"MOPNSIEUR",
"MOSIEUR",
"MR",
"Mr  Mme",
"Mr - MME",
"MR BLANC",
"MR ET MME",
"mr mm",
"MR OU MME",
"Mr.",
"MR/MME",
"MRME",
"MRR",
"Mrs",
"Mademoiselle",
"MADAOME",
"madamme",
"MADAME",
"M0NSIEUR",
"M.et Madame",
"M. ET MR",
"M.",
"M%",
"M MME",
"M ET MME",
"M",
"M CROCE",
"M DIEVART",
);
/*
* Main
*/
@set_time_limit(0);
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
$table = $argv[1];
if (empty($argv[1])) {
print "Error: Quelle table ?\n";
print "\n";
exit(-1);
}
$ret = $user->fetch('', 'admin');
if (!$ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
exit;
}
$sql = "SELECT * FROM `$table` WHERE 1 "; //ORDER BY REMISE DESC,`LCIVIL` DESC";
$resql = $db->query($sql);
//$db->begin();
if ($resql)
while ($fields = $db->fetch_array($resql)) {
$i++;
$errorrecord = 0;
if ($startlinenb && $i < $startlinenb)
continue;
if ($endlinenb && $i > $endlinenb)
continue;
$nboflines++;
$object = new Societe($db);
$object->import_key = $fields['CODE'];
$object->state = 1;
$object->client = 3;
$object->fournisseur = 0;
$object->name = $fields['FCIVIL'] . ' ' . $fields['FNOM'];
//$object->name_alias = $fields[0] != $fields[13] ? trim($fields[0]) : '';
$date = $fields['DATCREA'] ? $fields['DATCREA'] : ($fields['DATMOD'] ? $fields['DATMOD'] : '20200101');
$object->code_client = 'CU' . substr($date, 2, 2) . substr($date, 4, 2) . '-' . str_pad(substr($fields['CODE'], 0, 5), 5, "0", STR_PAD_LEFT);
$object->address = trim($fields['FADR1']);
if ($fields['FADR2'])
$object->address .= "\n" . trim($fields['FADR2']);
if ($fields['FADR3'])
$object->address .= "\n" . trim($fields['FADR3']);
$object->zip = trim($fields['FPOSTE']);
$object->town = trim($fields['FVILLE']);
if ($fields['FPAYS'])
$object->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['FPAYS']))), 'c_country', 'label', 'rowid');
else
$object->country_id = 1;
$object->phone = trim($fields['FTEL']) ? trim($fields['FTEL']) : trim($fields['FCONTACT']);
$object->phone = substr($object->phone, 0, 20);
$object->fax = trim($fields['FFAX']) ? trim($fields['FFAX']) : trim($fields['FCONTACT']);
$object->fax = substr($object->fax, 0, 20);
$object->email = trim($fields['FMAIL']);
// $object->idprof2 = trim($fields[29]);
$object->tva_intra = str_replace(['.', ' '], '', $fields['TVAINTRA']);
$object->tva_intra = substr($object->tva_intra, 0, 20);
$object->default_lang = 'fr_FR';
$object->cond_reglement_id = dol_getIdFromCode($db, 'PT_ORDER', 'c_payment_term', 'code', 'rowid', 1);
$object->multicurrency_code = 'EUR';
if ($fields['REMISE'] != '0.00') {
$object->remise_percent = abs($fields['REMISE']);
}
// $object->code_client = $fields[9];
// $object->code_fournisseur = $fields[10];
if ($fields['FCIVIL']) {
$labeltype = in_array($fields['FCIVIL'], $civilPrivate) ? 'TE_PRIVATE' : 'TE_SMALL';
$object->typent_id = dol_getIdFromCode($db, $labeltype, 'c_typent', 'code');
}
// Set price level
$object->price_level = $fields['TARIF'] + 1;
// if ($labeltype == 'Revendeur')
// $object->price_level = 2;
print "Process line nb " . $i . ", code " . $fields['CODE'] . ", name " . $object->name;
// Extrafields
$object->array_options['options_banque'] = $fields['BANQUE'];
$object->array_options['options_banque2'] = $fields['BANQUE2'];
$object->array_options['options_banquevalid'] = $fields['VALID'];
if (!$errorrecord) {
$ret = $object->create($user);
if ($ret < 0) {
print " - Error in create result code = " . $ret . " - " . $object->errorsToString();
$errorrecord++;
var_dump($object->code_client, $db);
die();
} else {
print " - Creation OK with name " . $object->name . " - id = " . $ret;
}
}
if (!$errorrecord) {
dol_syslog("Set price level");
$object->set_price_level($object->price_level, $user);
}
if (!$errorrecord && @$object->remise_percent) {
dol_syslog("Set remise client");
$object->set_remise_client($object->remise_percent, 'Importé', $user);
}
dol_syslog("Add contact");
// Insert an invoice contact if there is an invoice email != standard email
if (!$errorrecord && ($fields['LCIVIL'] || $fields['LNOM'])) {
$madame = array("MADAME",
"MADEMOISELLE",
"MELLE",
"MLLE",
"MM",
"Mme",
"MNE",
);
$monsieur = array("M",
"M ET MME",
"M MME",
"M.",
"M. MME",
"M. OU Mme",
"M.ou Madame",
"MONSEUR",
"MONSIER",
"MONSIEU",
"MONSIEUR",
"monsieur:mme",
"MONSIEUR¨",
"MONSIEZUR",
"MONSIUER",
"MONSKIEUR",
"MR",
);
$ret1 = $ret2 = 0;
$contact = new Contact($db);
if (in_array($fields['LCIVIL'], $madame)) {
// une dame
$contact->civility_id = 'MME';
$contact->lastname = $fields['LNOM'];
} elseif (in_array($fields['LCIVIL'], $monsieur)) {
// un monsieur
$contact->civility_id = 'MR';
$contact->lastname = $fields['LNOM'];
} elseif (in_array($fields['LCIVIL'], ['DOCTEUR'])) {
// un monsieur
$contact->civility_id = 'DR';
$contact->lastname = $fields['LNOM'];
} else {
// un a rattraper
$contact->lastname = $fields['LCIVIL'] . " " . $fields['LNOM'];
}
$contact->address = trim($fields['LADR1']);
if ($fields['LADR2'])
$contact->address .= "\n" . trim($fields['LADR2']);
if ($fields['LADR3'])
$contact->address .= "\n" . trim($fields['LADR3']);
$contact->zip = trim($fields['LPOSTE']);
$contact->town = trim($fields['LVILLE']);
if ($fields['FPAYS'])
$contact->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['LPAYS']))), 'c_country', 'label', 'rowid');
else
$contact->country_id = 1;
$contact->email = $fields['LMAIL'];
$contact->phone = trim($fields['LTEL']) ? trim($fields['LTEL']) : trim($fields['LCONTACT']);
$contact->fax = trim($fields['LFAX']) ? trim($fields['LFAX']) : trim($fields['LCONTACT']);
$contact->socid = $object->id;
$ret1 = $contact->create($user);
if ($ret1 > 0) {
//$ret2=$contact->add_contact($object->id, 'BILLING');
}
if ($ret1 < 0 || $ret2 < 0) {
print " - Error in create contact result code = " . $ret1 . " " . $ret2 . " - " . $contact->errorsToString();
$errorrecord++;
} else {
print " - create contact OK";
}
}
//update date créa
if (!$errorrecord) {
$datec = substr($date, 0, 4) . '-' . substr($date, 4, 2) . '-' . substr($date, 6, 2);
$retd = $db->query("UPDATE `llx_societe` SET `datec` = '$datec 00:00:00' WHERE `rowid` = $object->id");
if ($retd < 1) {
print " - Error in update date créa result " . $object->errorsToString();
$errorrecord++;
} else {
print " - update date créa OK";
}
}
print "\n";
if ($errorrecord) {
print( 'Error on record nb ' . $i . " - " . $object->errorsToString() . "\n");
var_dump($db, $object, $contact);
// $db->rollback();
die();
$error++; // $errorrecord will be reset
}
$j++;
} else
die("error : $sql");
$db->commit();
// commit or rollback
print "Nb of lines qualified: " . $nboflines . "\n";
print "Nb of errors: " . $error . "\n";
$db->close();
exit($error);

View File

@ -0,0 +1,402 @@
<?php
/**
* \file dev/initdata/dbf/includes/dbase.class.php
* \ingroup dev
* \brief Class to manage DBF databases
*/
// source : https://github.com/donfbecker/php-dbase
define('DBASE_RDONLY', 0);
define('DBASE_WRONLY', 1);
define('DBASE_RDWR', 2);
define('DBASE_TYPE_DBASE', 0);
define('DBASE_TYPE_FOXPRO', 1);
/**
* Class for DBase
*/
class DBase
{
private $fd;
private $headerLength = 0;
private $fields = array();
private $fieldCount = 0;
private $recordLength = 0;
private $recordCount = 0;
//resource dbase_open ( string $filename , int $mode )
public static function open($filename, $mode)
{
if (!file_exists($filename))
return false;
$modes = array('r', 'w', 'r+');
$mode = $modes[$mode];
$fd = fopen($filename, $mode);
if (!$fd)
return false;
return new DBase($fd);
}
//resource dbase_create ( string $filename , array $fields [, int $type = DBASE_TYPE_DBASE ] )
public static function create($filename, $fields, $type = DBASE_TYPE_DBASE)
{
if (file_exists($filename))
return false;
$fd = fopen($filename, 'c+');
if (!$fd)
return false;
// Byte 0 (1 byte): Valid dBASE for DOS file; bits 0-2 indicate version number, bit 3
// indicates the presence of a dBASE for DOS memo file, bits 4-6 indicate the
// presence of a SQL table, bit 7 indicates the presence of any memo file
// (either dBASE m PLUS or dBASE for DOS)
self::putChar8($fd, 5);
// Byte 1-3 (3 bytes): Date of last update; formatted as YYMMDD
self::putChar8($fd, date('Y') - 1900);
self::putChar8($fd, date('m'));
self::putChar8($fd, date('d'));
// Byte 4-7 (32-bit number): Number of records in the database file. Currently 0
self::putInt32($fd, 0);
// Byte 8-9 (16-bit number): Number of bytes in the header.
self::putInt16($fd, 32 + (32 * count($fields)) + 1);
// Byte 10-11 (16-bit number): Number of bytes in record.
// Make sure the include the byte for deleted flag
$len = 1;
foreach ($fields as &$field)
$len += self::length($field);
self::putInt16($fd, $len);
// Byte 12-13 (2 bytes): Reserved, 0 filled.
self::putInt16($fd, 0);
// Byte 14 (1 byte): Flag indicating incomplete transaction
// The ISMARKEDO function checks this flag. BEGIN TRANSACTION sets it to 1, END TRANSACTION and ROLLBACK reset it to 0.
self::putChar8($fd, 0);
// Byte 15 (1 byte): Encryption flag. If this flag is set to 1, the message Database encrypted appears. Changing this flag to 0 removes the message, but does not decrypt the file.
self::putChar8($fd, 0);
// Byte 16-27 (12 bytes): Reserved for dBASE for DOS in a multi-user environment
self::putInt32($fd, 0);
self::putInt32($fd, 0);
self::putInt32($fd, 0);
// Byte 28 (1 byte): Production .mdx file flag; 0x01 if there is a production .mdx file, 0x00 if not
self::putChar8($fd, 0);
// Byte 29 (1 byte): Language driver ID
// (no clue what this is)
self::putChar8($fd, 0);
// Byte 30-31 (2 bytes): Reserved, 0 filled.
self::putInt16($fd, 0);
// Byte 32 - n (32 bytes each): Field descriptor array
foreach ($fields as &$field) {
self::putString($fd, $field[0], 11); // Byte 0 - 10 (11 bytes): Field name in ASCII (zero-filled)
self::putString($fd, $field[1], 1); // Byte 11 (1 byte): Field type in ASCII (C, D, F, L, M, or N)
self::putInt32($fd, 0); // Byte 12 - 15 (4 bytes): Reserved
self::putChar8($fd, self::length($field)); // Byte 16 (1 byte): Field length in binary. The maximum length of a field is 254 (0xFE).
self::putChar8($fd, $field[3]); // Byte 17 (1 byte): Field decimal count in binary
self::putInt16($fd, 0); // Byte 18 - 19 (2 bytes): Work area ID
self::putChar8($fd, 0); // Byte 20 (1 byte): Example (??)
self::putInt32($fd, 0); // Byte 21 - 30 (10 bytes): Reserved
self::putInt32($fd, 0);
self::putInt16($fd, 0);
self::putChar8($fd, 0); // Byte 31 (1 byte): Production MDX field flag; 1 if field has an index tag in the production MDX file, 0 if not
}
// Byte n + 1 (1 byte): 0x0D as the field descriptor array terminator
self::putChar8($fd, 0x0D);
return new DBase($fd);
}
// Create DBase instance
private function __construct($fd)
{
$this->fd = $fd;
// Byte 4-7 (32-bit number): Number of records in the database file. Currently 0
fseek($this->fd, 4, SEEK_SET);
$this->recordCount = self::getInt32($fd);
// Byte 8-9 (16-bit number): Number of bytes in the header.
fseek($this->fd, 8, SEEK_SET);
$this->headerLength = self::getInt16($fd);
// Number of fields is (headerLength - 33) / 32)
$this->fieldCount = ($this->headerLength - 33) / 32;
// Byte 10-11 (16-bit number): Number of bytes in record.
fseek($this->fd, 10, SEEK_SET);
$this->recordLength = self::getInt16($fd);
// Byte 32 - n (32 bytes each): Field descriptor array
fseek($fd, 32, SEEK_SET);
for ($i = 0; $i < $this->fieldCount; $i++) {
$data = fread($this->fd, 32);
$field = array_map('trim', unpack('a11name/a1type/c4/c1length/c1precision/s1workid/c1example/c10/c1production', $data));
$this->fields[] = $field;
}
}
//bool dbase_close ( resource $dbase_identifier )
public function close()
{
fclose($this->fd);
}
//array dbase_get_header_info ( resource $dbase_identifier )
public function get_header_info()
{
return $this->fields;
}
//int dbase_numfields ( resource $dbase_identifier )
public function numfields()
{
return $this->fieldCount;
}
//int dbase_numrecords ( resource $dbase_identifier )
public function numrecords()
{
return $this->recordCount;
}
//bool dbase_add_record ( resource $dbase_identifier , array $record )
public function add_record($record)
{
if (count($record) != $this->fieldCount)
return false;
// Seek to end of file, minus the end of file marker
fseek($this->fd, 0, SEEK_END);
// Put the deleted flag
self::putChar8($this->fd, 0x20);
// Put the record
if (!$this->putRecord($record))
return false;
// Update the record count
fseek($this->fd, 4);
self::putInt32($this->fd, ++$this->recordCount);
return true;
}
//bool dbase_replace_record ( resource $dbase_identifier , array $record , int $record_number )
public function replace_record($record, $record_number)
{
if (count($record) != $this->fieldCount)
return false;
if ($record_number < 1 || $record_number > $this->recordCount)
return false;
// Skip to the record location, plus the 1 byte for the deleted flag
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)) + 1);
return $this->putRecord($record);
}
//bool dbase_delete_record ( resource $dbase_identifier , int $record_number )
public function delete_record($record_number)
{
if ($record_number < 1 || $record_number > $this->recordCount)
return false;
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)));
self::putChar8($this->fd, 0x2A);
return true;
}
//array dbase_get_record ( resource $dbase_identifier , int $record_number )
public function get_record($record_number)
{
if ($record_number < 1 || $record_number > $this->recordCount)
return false;
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)));
$record = array(
'deleted' => self::getChar8($this->fd) == 0x2A ? 1 : 0
);
foreach ($this->fields as $i => &$field) {
$value = trim(fread($this->fd, $field['length']));
if ($field['type'] == 'L') {
$value = strtolower($value);
if ($value == 't' || $value == 'y')
$value = true;
elseif ($value == 'f' || $value == 'n')
$value = false;
else
$value = null;
}
$record[$i] = $value;
}
return $record;
}
//array dbase_get_record_with_names ( resource $dbase_identifier , int $record_number )
public function get_record_with_names($record_number)
{
if ($record_number < 1 || $record_number > $this->recordCount)
return false;
$record = $this->get_record($record_number);
foreach ($this->fields as $i => &$field) {
$record[$field['name']] = $record[$i];
unset($record[$i]);
}
return $record;
}
//bool dbase_pack ( resource $dbase_identifier )
public function pack()
{
$in_offset = $out_offset = $this->headerLength;
$new_count = 0;
$rec_count = $this->recordCount;
while ($rec_count > 0) {
fseek($this->fd, $in_offset, SEEK_SET);
$record = fread($this->fd, $this->recordLength);
$deleted = substr($record, 0, 1);
if ($deleted != '*') {
fseek($this->fd, $out_offset, SEEK_SET);
fwrite($this->fd, $record);
$out_offset += $this->recordLength;
$new_count++;
}
$in_offset += $this->recordLength;
$rec_count--;
}
ftruncate($this->fd, $out_offset);
// Update the record count
fseek($this->fd, 4);
self::putInt32($this->fd, $new_count);
}
/*
* A few utilitiy functions
*/
private static function length($field)
{
switch ($field[1]) {
case 'D': // Date: Numbers and a character to separate month, day, and year (stored internally as 8 digits in YYYYMMDD format)
return 8;
case 'T': // DateTime (YYYYMMDDhhmmss.uuu) (FoxPro)
return 18;
case 'M': // Memo (ignored): All ASCII characters (stored internally as 10 digits representing a .dbt block number, right justified, padded with whitespaces)
case 'N': // Number: -.0123456789 (right justified, padded with whitespaces)
case 'F': // Float: -.0123456789 (right justified, padded with whitespaces)
case 'C': // String: All ASCII characters (padded with whitespaces up to the field's length)
return $field[2];
case 'L': // Boolean: YyNnTtFf? (? when not initialized)
return 1;
}
return 0;
}
/*
* Functions for reading and writing bytes
*/
private static function getChar8($fd)
{
return ord(fread($fd, 1));
}
private static function putChar8($fd, $value)
{
return fwrite($fd, chr($value));
}
private static function getInt16($fd, $n = 1)
{
$data = fread($fd, 2 * $n);
$i = unpack("S$n", $data);
if ($n == 1)
return (int) $i[1];
else
return array_merge($i);
}
private static function putInt16($fd, $value)
{
return fwrite($fd, pack('S', $value));
}
private static function getInt32($fd, $n = 1)
{
$data = fread($fd, 4 * $n);
$i = unpack("L$n", $data);
if ($n == 1)
return (int) $i[1];
else
return array_merge($i);
}
private static function putInt32($fd, $value)
{
return fwrite($fd, pack('L', $value));
}
private static function putString($fd, $value, $length = 254)
{
$ret = fwrite($fd, pack('A' . $length, $value));
}
private function putRecord($record)
{
foreach ($this->fields as $i => &$field) {
$value = $record[$i];
// Number types are right aligned with spaces
if ($field['type'] == 'N' || $field['type'] == 'F' && strlen($value) < $field['length']) {
$value = str_repeat(' ', $field['length'] - strlen($value)) . $value;
}
self::putString($this->fd, $value, $field['length']);
}
return true;
}
}
if (!function_exists('dbase_open')) {
function dbase_open($filename, $mode)
{
return DBase::open($filename, $mode);
}
function dbase_create($filename, $fields, $type = DBASE_TYPE_DBASE)
{
return DBase::create($filename, $fields, $type);
}
function dbase_close($dbase_identifier)
{
return $dbase_identifier->close();
}
function dbase_get_header_info($dbase_identifier)
{
return $dbase_identifier->get_header_info();
}
function dbase_numfields($dbase_identifier)
{
$dbase_identifier->numfields();
}
function dbase_numrecords($dbase_identifier)
{
return $dbase_identifier->numrecords();
}
function dbase_add_record($dbase_identifier, $record)
{
return $dbase_identifier->add_record($record);
}
function dbase_delete_record($dbase_identifier, $record_number)
{
return $dbase_identifier->delete_record($record_number);
}
function dbase_replace_record($dbase_identifier, $record, $record_number)
{
return $dbase_identifier->replace_record($record, $record_number);
}
function dbase_get_record($dbase_identifier, $record_number)
{
return $dbase_identifier->get_record($record_number);
}
function dbase_get_record_with_names($dbase_identifier, $record_number)
{
return $dbase_identifier->get_record_with_names($record_number);
}
function dbase_pack($dbase_identifier)
{
return $dbase_identifier->pack();
}
}

View File

@ -26,7 +26,7 @@
// Test si mode batch // Test si mode batch
$sapi_type = php_sapi_name(); $sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit; exit;
} }

View File

@ -27,7 +27,7 @@
// Test si mode batch // Test si mode batch
$sapi_type = php_sapi_name(); $sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit; exit;
} }

View File

@ -27,7 +27,7 @@
// Test si mode batch // Test si mode batch
$sapi_type = php_sapi_name(); $sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit; exit;
} }

View File

@ -27,7 +27,7 @@
// Test si mode batch // Test si mode batch
$sapi_type = php_sapi_name(); $sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit; exit;
} }

View File

@ -27,7 +27,7 @@
// Test si mode batch // Test si mode batch
$sapi_type = php_sapi_name(); $sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit; exit;
} }

View File

@ -30,7 +30,7 @@ $sapi_type = php_sapi_name();
$script_file = basename(__FILE__); $script_file = basename(__FILE__);
$path=dirname(__FILE__).'/'; $path=dirname(__FILE__).'/';
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit; exit;
} }

View File

@ -30,7 +30,7 @@ $sapi_type = php_sapi_name();
$script_file = basename(__FILE__); $script_file = basename(__FILE__);
$path=dirname(__FILE__).'/'; $path=dirname(__FILE__).'/';
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit; exit;
} }

View File

@ -30,7 +30,7 @@ $sapi_type = php_sapi_name();
$script_file = basename(__FILE__); $script_file = basename(__FILE__);
$path=dirname(__FILE__).'/'; $path=dirname(__FILE__).'/';
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer mailing-send.php en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit; exit;
} }

View File

@ -6,6 +6,7 @@
<exclude-pattern type="relative">build/html</exclude-pattern> <exclude-pattern type="relative">build/html</exclude-pattern>
<exclude-pattern type="relative">build/aps</exclude-pattern> <exclude-pattern type="relative">build/aps</exclude-pattern>
<exclude-pattern type="relative">dev/namespacemig</exclude-pattern> <exclude-pattern type="relative">dev/namespacemig</exclude-pattern>
<exclude-pattern type="relative">dev/initdata/dbf/includes</exclude-pattern>
<exclude-pattern type="relative">documents</exclude-pattern> <exclude-pattern type="relative">documents</exclude-pattern>
<exclude-pattern type="relative">htdocs/core/class/lessc.class.php</exclude-pattern> <exclude-pattern type="relative">htdocs/core/class/lessc.class.php</exclude-pattern>
<exclude-pattern type="relative">htdocs/custom</exclude-pattern> <exclude-pattern type="relative">htdocs/custom</exclude-pattern>

View File

@ -704,9 +704,9 @@ class AccountancyExport
print $end_line; print $end_line;
foreach ($objectLines as $line) { foreach ($objectLines as $line) {
$date_creation = dol_print_date($line->date_creation, '%d%m%Y'); $date_creation = dol_print_date($line->date_creation, '%Y%m%d');
$date_doc = dol_print_date($line->doc_date, '%d%m%Y'); $date_doc = dol_print_date($line->doc_date, '%Y%m%d');
$date_valid = dol_print_date($line->date_validated, '%d%m%Y'); $date_valid = dol_print_date($line->date_validated, '%Y%m%d');
// FEC:JournalCode // FEC:JournalCode
print $line->code_journal.$separator; print $line->code_journal.$separator;

View File

@ -1747,7 +1747,7 @@ else
{ {
print '<tr><td>'.$langs->trans("Categories").'</td>'; print '<tr><td>'.$langs->trans("Categories").'</td>';
print '<td colspan="2">'; print '<td colspan="2">';
print $form->showCategories($object->id, 'member', 1); print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -531,7 +531,7 @@ if ($rowid > 0)
{ {
print '<tr><td>'.$langs->trans("Categories").'</td>'; print '<tr><td>'.$langs->trans("Categories").'</td>';
print '<td colspan="2">'; print '<td colspan="2">';
print $form->showCategories($object->id, 'member', 1); print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -65,7 +65,7 @@ $subscription = GETPOST("subscription", "int");
$duration_value = GETPOST('duration_value', 'int'); $duration_value = GETPOST('duration_value', 'int');
$duration_unit = GETPOST('duration_unit', 'alpha'); $duration_unit = GETPOST('duration_unit', 'alpha');
$vote = GETPOST("vote", "int"); $vote = GETPOST("vote", "int");
$comment = GETPOST("comment", 'alphanohtml'); $comment = GETPOST("comment", 'none');
$mail_valid = GETPOST("mail_valid", 'none'); $mail_valid = GETPOST("mail_valid", 'none');
// Security check // Security check
@ -363,7 +363,9 @@ if ($action == 'create')
print '</td></tr>'; print '</td></tr>';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'; print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3"></textarea></td></tr>'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('comment', $object->note, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%');
$doleditor->Create();
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>'; print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -806,10 +808,12 @@ if ($rowid > 0)
print '</td></tr>'; print '</td></tr>';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'; print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
print '<textarea name="comment" wrap="soft" class="centpercent" rows="3">'.$object->note.'</textarea></td></tr>'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('comment', $object->note, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%');
$doleditor->Create();
print "</td></tr>";
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>'; print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); $doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%');
$doleditor->Create(); $doleditor->Create();
print "</td></tr>"; print "</td></tr>";

View File

@ -180,11 +180,11 @@ if ($action == 'install')
$modulename = preg_replace('/module_/', '', $original_file); $modulename = preg_replace('/module_/', '', $original_file);
$modulename = preg_replace('/\-([0-9][0-9\.]*)\.zip$/i', '', $modulename); $modulename = preg_replace('/\-([0-9][0-9\.]*)\.zip$/i', '', $modulename);
// Search dir $modulename // Search dir $modulename
$modulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename; // Example .../mymodule $modulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename; // Example ./mymodule
//var_dump($modulenamedir);
if (!dol_is_dir($modulenamedir)) if (!dol_is_dir($modulenamedir))
{ {
$modulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename; // Example .../htdocs/mymodule $modulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename; // Example ./htdocs/mymodule
//var_dump($modulenamedir); //var_dump($modulenamedir);
if (!dol_is_dir($modulenamedir)) if (!dol_is_dir($modulenamedir))
{ {
@ -207,6 +207,7 @@ if ($action == 'install')
$modulenamearrays = explode("\n", $metafile); $modulenamearrays = explode("\n", $metafile);
} }
$modulenamearrays[$modulename] = $modulename; $modulenamearrays[$modulename] = $modulename;
//var_dump($modulenamearrays);exit;
foreach ($modulenamearrays as $modulenameval) { foreach ($modulenamearrays as $modulenameval) {
if (strpos($modulenameval, '#') === 0) continue; // Discard comments if (strpos($modulenameval, '#') === 0) continue; // Discard comments
@ -216,15 +217,14 @@ if ($action == 'install')
// Now we install the module // Now we install the module
if (!$error) if (!$error)
{ {
//var_dump($dirins);
@dol_delete_dir_recursive($dirins.'/'.$modulenameval); // delete the zip file @dol_delete_dir_recursive($dirins.'/'.$modulenameval); // delete the zip file
dol_syslog("We copy now directory ".$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval." into target dir ".$dirins.'/'.$modulenameval); dol_syslog("We copy now directory ".$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval." into target dir ".$dirins.'/'.$modulenameval);
$result = dolCopyDir($conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval, $dirins.'/'.$modulenameval, '0444', 1); $result = dolCopyDir($modulenamedir, $dirins.'/'.$modulenameval, '0444', 1);
if ($result <= 0) if ($result <= 0)
{ {
dol_syslog('Failed to call dolCopyDir result='.$result." with param ".$modulenamedir." and ".$dirins.'/'.$modulenameval, LOG_WARNING); dol_syslog('Failed to call dolCopyDir result='.$result." with param ".$modulenamedir." and ".$dirins.'/'.$modulenameval, LOG_WARNING);
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorFailToCopyDir", $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval, $dirins.'/'.$modulenameval), null, 'errors'); setEventMessages($langs->trans("ErrorFailToCopyDir", $modulenamedir, $dirins.'/'.$modulenameval), null, 'errors');
$error++; $error++;
} }
} }

View File

@ -28,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("install");
$langs->load("errors");
if (! $user->admin) if (! $user->admin)
accessforbidden(); accessforbidden();
@ -66,21 +68,123 @@ if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2)
print '<br>'; print '<br>';
} }
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print "\n"; print "\n";
$ErrorPicturePath = "../../theme/eldy/img/error.png";
$WarningPicturePath = "../../theme/eldy/img/warning.png";
$OkayPicturePath = "../../theme/eldy/img/tick.png";
// Get PHP version print '<tr><td width="220">'.$langs->trans("Version").'</td><td>';
$phpversion=version_php();
print '<tr class="oddeven"><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n";
$arrayphpminversionerror = array(5,5,0);
$arrayphpminversionwarning = array(5,5,0);
if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0)
{
print '<img src="'.$ErrorPicturePath.'" alt="Error"> '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror));
}
elseif (versioncompare(versionphparray(), $arrayphpminversionwarning) < 0)
{
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning));
}
else
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.versiontostring(versionphparray());
}
print '</td></tr>';
print '<tr><td>GET and POST support</td><td>';
if (! isset($_GET["testget"]) && ! isset($_POST["testpost"]) && ! isset($_GET["mainmenu"]))
{
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("PHPSupportPOSTGETKo");
print ' (<a href="'.$_SERVER["PHP_SELF"].'?testget=ok">'.$langs->trans("Recheck").'</a>)';
}
else
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportPOSTGETOk");
}
print '</td></tr>';
print '<tr><td>Sessions support</td><td>';
if (! function_exists("session_id"))
{
print '<img src="'.$ErrorPicturePath.'" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportSessions");
}
else
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportSessions");
}
print '</td></tr>';
print '<tr><td>GD support</td><td>';
if (! function_exists("imagecreate"))
{
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupportGD");
}
else
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportGD");
}
print '</td></tr>';
print '<tr><td>Curl support</td><td>';
if (! function_exists("curl_init"))
{
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupportCurl");
}
else
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportCurl");
}
print '</td></tr>';
print '<tr><td>UTF-8 support</td><td>';
if (! function_exists("utf8_encode"))
{
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupportUTF8");
}
else
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportUTF8");
}
print '</td></tr>';
print '<tr><td>Intl support</td><td>';
if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@localhost')
{
if (! function_exists("locale_get_primary_language") || ! function_exists("locale_get_region"))
{
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupportIntl");
}
else
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportIntl");
}
}
print '<tr><td>Zip support</td><td>';
if (!class_exists('ZipArchive'))
{
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupport", "Zip");
}
else
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupport", "Zip");
}
print '</td></tr>';
print '</table>'; print '</table>';
print '<br>'; print '<br>';
// Get php_info array // Get php_info array
$phparray=phpinfo_array(); $phparray=phpinfo_array();
foreach($phparray as $key => $value) foreach($phparray as $key => $value)

View File

@ -81,9 +81,9 @@ $type=$db->type;
$help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad'; $help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad';
llxHeader('', '', $help_url); llxHeader('', '', $help_url);
print '<script type="text/javascript">
jQuery(document).ready(function() {';
?> ?>
<script type="text/javascript">
jQuery(document).ready(function() {
function hideoptions () { function hideoptions () {
jQuery("#mysql_options").hide(); jQuery("#mysql_options").hide();
@ -242,7 +242,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print '<input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" checked />'; print '<input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" checked />';
print '<label for="checkbox_sql_structure">'.$langs->trans('ExportStructure').'</label>'; print '<label for="checkbox_sql_structure">'.$langs->trans('ExportStructure').'</label>';
print '</legend>'; print '</legend>';
print '<input type="checkbox" name="drop"'.((! isset($_GET["drop"]) && ! isset($_POST["drop"])) || GETPOST('drop'))?' checked':''.' id="checkbox_dump_drop" />'; print '<input type="checkbox" name="drop"'.(((! isset($_GET["drop"]) && ! isset($_POST["drop"])) || GETPOST('drop'))?' checked':'').' id="checkbox_dump_drop" />';
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>'; print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
print '<br>'; print '<br>';
print '</fieldset>'; print '</fieldset>';
@ -534,6 +534,8 @@ print '</div>';
print '</form>'; print '</form>';
print '</fieldset>'; print '</fieldset>';
print "<br>\n"; print "<br>\n";
print "<!-- Dump of a server -->\n"; print "<!-- Dump of a server -->\n";
@ -548,7 +550,7 @@ print $langs->trans("BackupDescX").'<br><br>';
print '<div id="backupfilesleft" class="fichehalfleft">'; print '<div id="backupfilesleft" class="fichehalfleft">';
print load_fiche_titre($title?$title:$langs->trans("BackupDumpWizard")); print load_fiche_titre($title?$title:$langs->trans("BackupZipWizard"));
print '<label for="zipfilename_template">'.$langs->trans("FileNameToGenerate").'</label><br>'; print '<label for="zipfilename_template">'.$langs->trans("FileNameToGenerate").'</label><br>';
$prefix='documents'; $prefix='documents';

View File

@ -48,6 +48,11 @@ class Categories extends DolibarrApi
3 => 'member', 3 => 'member',
4 => 'contact', 4 => 'contact',
5 => 'account', 5 => 'account',
//6 => 'project',
//7 => 'user',
//8 => 'bank_line',
//9 => 'warehouse',
//10 => 'actioncomm',
); );
/** /**

View File

@ -54,6 +54,7 @@ class Categorie extends CommonObject
const TYPE_ACCOUNT = 'bank_account'; const TYPE_ACCOUNT = 'bank_account';
const TYPE_BANK_LINE = 'bank_line'; const TYPE_BANK_LINE = 'bank_line';
const TYPE_WAREHOUSE = 'warehouse'; const TYPE_WAREHOUSE = 'warehouse';
const TYPE_ACTIONCOMM = 'actioncomm';
/** /**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
@ -77,6 +78,7 @@ class Categorie extends CommonObject
'user' => 7, 'user' => 7,
'bank_line' => 8, 'bank_line' => 8,
'warehouse' => 9, 'warehouse' => 9,
'actioncomm' => 10,
); );
/** /**
@ -93,6 +95,7 @@ class Categorie extends CommonObject
7 => 'user', 7 => 'user',
8 => 'bank_line', 8 => 'bank_line',
9 => 'warehouse', 9 => 'warehouse',
10 => 'actioncomm',
); );
/** /**
@ -111,6 +114,7 @@ class Categorie extends CommonObject
'bank_account' => 'account', 'bank_account' => 'account',
'project' => 'project', 'project' => 'project',
'warehouse'=> 'warehouse', 'warehouse'=> 'warehouse',
'actioncomm' => 'actioncomm',
); );
/** /**
@ -129,6 +133,7 @@ class Categorie extends CommonObject
'bank_account'=> 'account', 'bank_account'=> 'account',
'project' => 'project', 'project' => 'project',
'warehouse'=> 'warehouse', 'warehouse'=> 'warehouse',
'actioncomm' => 'actioncomm',
); );
/** /**
@ -147,6 +152,7 @@ class Categorie extends CommonObject
'bank_account' => 'Account', 'bank_account' => 'Account',
'project' => 'Project', 'project' => 'Project',
'warehouse'=> 'Entrepot', 'warehouse'=> 'Entrepot',
'actioncomm' => 'ActionComm',
); );
/** /**
@ -164,6 +170,7 @@ class Categorie extends CommonObject
'account' => 'bank_account', 'account' => 'bank_account',
'project' => 'projet', 'project' => 'projet',
'warehouse'=> 'entrepot', 'warehouse'=> 'entrepot',
'actioncomm' => 'actioncomm',
); );
/** /**
@ -214,6 +221,7 @@ class Categorie extends CommonObject
* @see Categorie::TYPE_PROJECT * @see Categorie::TYPE_PROJECT
* @see Categorie::TYPE_BANK_LINE * @see Categorie::TYPE_BANK_LINE
* @see Categorie::TYPE_WAREHOUSE * @see Categorie::TYPE_WAREHOUSE
* @see Categorie::TYPE_ACTIONCOMM
*/ */
public $type; public $type;

View File

@ -59,7 +59,13 @@ elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCate
elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; } elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; }
elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; } elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
elseif ($type == Categorie::TYPE_WAREHOUSE) { $title=$langs->trans("StocksCategoriesArea"); $typetext='warehouse'; } elseif ($type == Categorie::TYPE_WAREHOUSE) { $title=$langs->trans("StocksCategoriesArea"); $typetext='warehouse'; }
else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; } elseif ($type == Categorie::TYPE_ACTIONCOMM) {
$title = $langs->trans("ActionCommCategoriesArea");
$typetext = 'actioncomm';
} else {
$title = $langs->trans("CategoriesArea");
$typetext = 'unknown';
}
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');

View File

@ -44,6 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.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.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("companies", "other", "commercial", "bills", "orders", "agenda")); $langs->loadLangs(array("companies", "other", "commercial", "bills", "orders", "agenda"));
@ -374,6 +375,10 @@ if (empty($reshook) && $action == 'add')
{ {
if (!$object->error) if (!$object->error)
{ {
// Category association
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
unset($_SESSION['assignedtouser']); unset($_SESSION['assignedtouser']);
$moreparam = ''; $moreparam = '';
@ -595,6 +600,10 @@ if (empty($reshook) && $action == 'update')
if ($result > 0) if ($result > 0)
{ {
// Category association
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
unset($_SESSION['assignedtouser']); unset($_SESSION['assignedtouser']);
$db->commit(); $db->commit();
@ -1000,6 +1009,14 @@ if ($action == 'create')
print '</td></tr>'; print '</td></tr>';
} }
if ($conf->categorie->enabled) {
// Categories
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
print $form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, '', 0, '100%');
print "</td></tr>";
}
print '</table>'; print '</table>';
@ -1411,6 +1428,19 @@ if ($id > 0)
print $form->select_dolusers($object->userdoneid > 0 ? $object->userdoneid : -1, 'doneby', 1); print $form->select_dolusers($object->userdoneid > 0 ? $object->userdoneid : -1, 'doneby', 1);
print '</td></tr>'; print '</td></tr>';
} }
// Tags-Categories
if ($conf->categorie->enabled) {
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
$c = new Categorie($db);
$cats = $c->containing($object->id, Categorie::TYPE_ACTIONCOMM);
$arrayselected = array();
foreach ($cats as $cat) {
$arrayselected[] = $cat->id;
}
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
print "</td></tr>";
}
print '</table>'; print '</table>';
@ -1717,6 +1747,12 @@ if ($id > 0)
} }
print '</td></tr>'; print '</td></tr>';
} }
// Categories
if ($conf->categorie->enabled) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td colspan="3">';
print $form->showCategories($object->id, Categorie::TYPE_ACTIONCOMM, 1);
print "</td></tr>";
}
print '</table>'; print '</table>';

View File

@ -1510,6 +1510,50 @@ class ActionComm extends CommonObject
return $result; return $result;
} }
/**
* Sets object to supplied categories.
*
* Deletes object from existing categories not supplied.
* Adds it to non existing supplied categories.
* Existing categories are left untouch.
*
* @param int[]|int $categories Category or categories IDs
* @return void
*/
public function setCategories($categories)
{
// Handle single category
if (! is_array($categories)) {
$categories = array($categories);
}
// Get current categories
include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$c = new Categorie($this->db);
$existing = $c->containing($this->id, Categorie::TYPE_ACTIONCOMM, 'id');
// Diff
if (is_array($existing)) {
$to_del = array_diff($existing, $categories);
$to_add = array_diff($categories, $existing);
} else {
$to_del = array(); // Nothing to delete
$to_add = $categories;
}
// Process
foreach($to_del as $del) {
if ($c->fetch($del) > 0) {
$c->del_type($this, Categorie::TYPE_ACTIONCOMM);
}
}
foreach ($to_add as $add) {
if ($c->fetch($add) > 0) {
$c->add_type($this, Categorie::TYPE_ACTIONCOMM);
}
}
return;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**

View File

@ -491,7 +491,7 @@ if ($object->id > 0)
$langs->load("categories"); $langs->load("categories");
print '<tr><td>'.$langs->trans("CustomersCategoriesShort").'</td>'; print '<tr><td>'.$langs->trans("CustomersCategoriesShort").'</td>';
print '<td>'; print '<td>';
print $form->showCategories($object->id, 'customer', 1); print $form->showCategories($object->id, Categorie::TYPE_CUSTOMER, 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -3541,9 +3541,10 @@ class Propal extends CommonObject
* @param string $get_params Parametres added to url * @param string $get_params Parametres added to url
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $addlinktonotes Add linkt to notes
* @return string String with URL * @return string String with URL
*/ */
public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
@ -3609,6 +3610,22 @@ class Propal extends CommonObject
if ($withpicto != 2) $result .= $this->ref; if ($withpicto != 2) $result .= $this->ref;
$result .= $linkend; $result .= $linkend;
if ($addlinktonotes)
{
$txttoshow = ($user->socid > 0 ? $this->note_public : $this->note_private);
if ($txttoshow)
{
$notetoshow = $langs->trans("ViewPrivateNote").':<br>'.dol_string_nohtmltag($txttoshow, 1);
$result .= ' <span class="note inline-block">';
$result .= '<a href="'.DOL_URL_ROOT.'/comm/propal/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">';
$result .= img_picto('', 'note');
$result .= '</a>';
//$result.=img_picto($langs->trans("ViewNote"),'object_generic');
//$result.='</a>';
$result .= '</span>';
}
}
return $result; return $result;
} }

View File

@ -13,6 +13,7 @@
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com> * Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* 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
@ -75,15 +76,12 @@ $search_zip = GETPOST('search_zip', 'alpha');
$search_state = trim(GETPOST("search_state")); $search_state = trim(GETPOST("search_state"));
$search_country = GETPOST("search_country", 'int'); $search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_day = GETPOST("search_day", "int"); $search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_month = GETPOST("search_month", "int"); $search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_year = GETPOST("search_year", "int"); $search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int'));
$search_dayfin = GETPOST("search_dayfin", "int"); $search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int'));
$search_month_end = GETPOST("search_month_end", "int"); $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
$search_yearfin = GETPOST("search_yearfin", "int"); $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
$search_daydelivery = GETPOST("search_daydelivery", "int");
$search_monthdelivery = GETPOST("search_monthdelivery", "int");
$search_yeardelivery = GETPOST("search_yeardelivery", "int");
$search_availability = GETPOST('search_availability', 'int'); $search_availability = GETPOST('search_availability', 'int');
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); $search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
$search_btn = GETPOST('button_search', 'alpha'); $search_btn = GETPOST('button_search', 'alpha');
@ -219,15 +217,12 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_type = ''; $search_type = '';
$search_country = ''; $search_country = '';
$search_type_thirdparty = ''; $search_type_thirdparty = '';
$search_year = ''; $search_date_start='';
$search_month = ''; $search_date_end='';
$search_day = ''; $search_dateend_start='';
$search_yearfin = ''; $search_dateend_end='';
$search_month_end = ''; $search_datedelivery_start='';
$search_dayfin = ''; $search_datedelivery_end='';
$search_yeardelivery = '';
$search_monthdelivery = '';
$search_daydelivery = '';
$search_availability = ''; $search_availability = '';
$viewstatut = ''; $viewstatut = '';
$object_statut = ''; $object_statut = '';
@ -275,6 +270,7 @@ $sql .= " ava.rowid as availability,";
$sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,'; $sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,'; $sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
$sql .= ' p.note_public, p.note_private,';
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,"; $sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
$sql .= ' u.login'; $sql .= ' u.login';
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
@ -313,6 +309,7 @@ if (!$user->rights->societe->client->voir && !$socid) //restriction
{ {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
} }
if ($search_town) $sql .= natural_search('s.town', $search_town); if ($search_town) $sql .= natural_search('s.town', $search_town);
if ($search_zip) $sql .= natural_search("s.zip", $search_zip); if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
if ($search_state) $sql .= natural_search("state.nom", $search_state); if ($search_state) $sql .= natural_search("state.nom", $search_state);
@ -341,9 +338,12 @@ if ($viewstatut != '' && $viewstatut != '-1')
{ {
$sql .= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')'; $sql .= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')';
} }
$sql .= dolSqlDateFilter("p.datep", $search_day, $search_month, $search_year); if ($search_date_start) $sql .= " AND p.datep >= '" . $db->idate($search_date_start) . "'";
$sql .= dolSqlDateFilter("p.fin_validite", $search_dayfin, $search_month_end, $search_yearfin); if ($search_date_end) $sql .= " AND p.datep <= '" . $db->idate($search_date_end) . "'";
$sql .= dolSqlDateFilter("p.date_livraison", $search_daydelivery, $search_monthdelivery, $search_yeardelivery); if ($search_dateend_start) $sql .= " AND p.fin_validite >= '" . $db->idate($search_dateend_start) . "'";
if ($search_dateend_end) $sql .= " AND p.fin_validite <= '" . $db->idate($search_dateend_end) . "'";
if ($search_datedelivery_start) $sql .= " AND p.date_livraison >= '" . $db->idate($search_datedelivery_start) . "'";
if ($search_datedelivery_end) $sql .= " AND p.date_livraison <= '" . $db->idate($search_datedelivery_end) . "'";
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale); if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale);
if ($search_user > 0) if ($search_user > 0)
{ {
@ -415,9 +415,12 @@ if ($resql)
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($sall) $param .= '&sall='.urlencode($sall); if ($sall) $param .= '&sall='.urlencode($sall);
if ($search_day) $param .= '&search_day='.urlencode($search_day); if ($search_date_start) $param .= '&search_date_start='.urlencode($search_date_start);
if ($search_month) $param .= '&search_month='.urlencode($search_month); if ($search_date_end) $param .= '&search_date_end='.urlencode($search_date_end);
if ($search_year) $param .= '&search_year='.urlencode($search_year); if ($search_dateend_start) $param .= '&search_dateend_start='.urlencode($search_dateend_start);
if ($search_dateend_end) $param .= '&search_dateend_end='.urlencode($search_dateend_end);
if ($search_datedelivery_start) $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start);
if ($search_datedelivery_end) $param .= '&search_datedelivery_end='.urlencode($search_datedelivery_end);
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref); if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
if ($search_refcustomer) $param .= '&search_refcustomer='.urlencode($search_refcustomer); if ($search_refcustomer) $param .= '&search_refcustomer='.urlencode($search_refcustomer);
if ($search_refproject) $param .= '&search_refproject='.urlencode($search_refproject); if ($search_refproject) $param .= '&search_refproject='.urlencode($search_refproject);
@ -594,34 +597,43 @@ if ($resql)
// Date // Date
if (!empty($arrayfields['p.date']['checked'])) if (!empty($arrayfields['p.date']['checked']))
{ {
print '<td class="liste_titre nowraponall" align="center">'; print '<td class="liste_titre center">';
//print $langs->trans('Month').': '; print '<div class="nowrap">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25" type="text" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">'; print $langs->trans('From') . ' ';
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">'; print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
//print '&nbsp;'.$langs->trans('Year').': '; print '</div>';
$formother->select_year($search_year, 'search_year', 1, 20, 5); print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
print '</div>';
print '</td>'; print '</td>';
} }
// Date end // Date end
if (!empty($arrayfields['p.fin_validite']['checked'])) if (!empty($arrayfields['p.fin_validite']['checked']))
{ {
print '<td class="liste_titre nowraponall" align="center">'; print '<td class="liste_titre center">';
//print $langs->trans('Month').': '; print '<div class="nowrap">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25" type="text" maxlength="2" name="search_dayfin" value="'.dol_escape_htmltag($search_dayfin).'">'; print $langs->trans('From') . ' ';
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_month_end" value="'.dol_escape_htmltag($search_month_end).'">'; print $form->selectDate($search_dateend_start?$search_dateend_start:-1, 'search_dateend_start', 0, 0, 1);
//print '&nbsp;'.$langs->trans('Year').': '; print '</div>';
$formother->select_year($search_yearfin, 'search_yearfin', 1, 20, 5); print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_dateend_end?$search_dateend_end:-1, 'search_dateend_end', 0, 0, 1);
print '</div>';
print '</td>'; print '</td>';
} }
// Date delivery // Date delivery
if (!empty($arrayfields['p.date_livraison']['checked'])) if (!empty($arrayfields['p.date_livraison']['checked']))
{ {
print '<td class="liste_titre nowraponall" align="center">'; print '<td class="liste_titre center">';
//print $langs->trans('Month').': '; print '<div class="nowrap">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25" type="text" size="1" maxlength="2" name="search_daydelivery" value="'.dol_escape_htmltag($search_daydelivery).'">'; print $langs->trans('From') . ' ';
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_monthdelivery" value="'.dol_escape_htmltag($search_monthdelivery).'">'; print $form->selectDate($search_datedelivery_start?$search_datedelivery_start:-1, 'search_datedelivery_start', 0, 0, 1);
//print '&nbsp;'.$langs->trans('Year').': '; print '</div>';
$formother->select_year($search_yeardelivery, 'search_yeardelivery', 1, 20, 5); print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_datedelivery_end?$search_datedelivery_end:-1, 'search_datedelivery_end', 0, 0, 1);
print '</div>';
print '</td>'; print '</td>';
} }
// Availability // Availability
@ -764,6 +776,8 @@ if ($resql)
$objectstatic->id = $obj->rowid; $objectstatic->id = $obj->rowid;
$objectstatic->ref = $obj->ref; $objectstatic->ref = $obj->ref;
$objectstatic->note_public = $obj->note_public;
$objectstatic->note_private = $obj->note_private;
$companystatic->id = $obj->socid; $companystatic->id = $obj->socid;
$companystatic->name = $obj->name; $companystatic->name = $obj->name;
@ -784,18 +798,11 @@ if ($resql)
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref // Picto + Ref
print '<td class="nobordernopadding nowrap">'; print '<td class="nobordernopadding nowrap">';
print $objectstatic->getNomUrl(1, '', '', 0, 1); print $objectstatic->getNomUrl(1, '', '', 0, 1, 1);
print '</td>'; print '</td>';
// Warning // Warning
$warnornote = ''; $warnornote = '';
if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) $warnornote .= img_warning($langs->trans("Late")); if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) $warnornote .= img_warning($langs->trans("Late"));
if (!empty($obj->note_private))
{
$warnornote .= ($warnornote ? ' ' : '');
$warnornote .= '<span class="note">';
$warnornote .= '<a href="note.php?id='.$obj->rowid.'">'.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').'</a>';
$warnornote .= '</span>';
}
if ($warnornote) if ($warnornote)
{ {
print '<td style="min-width: 20px" class="nobordernopadding nowrap">'; print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
@ -945,7 +952,7 @@ if ($resql)
// Amount HT // Amount HT
if (!empty($arrayfields['p.total_ht']['checked'])) if (!empty($arrayfields['p.total_ht']['checked']))
{ {
print '<td class="right">'.price($obj->total_ht)."</td>\n"; print '<td class="nowrap right">'.price($obj->total_ht)."</td>\n";
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht';
$totalarray['val']['p.total_ht'] += $obj->total_ht; $totalarray['val']['p.total_ht'] += $obj->total_ht;
@ -953,7 +960,7 @@ if ($resql)
// Amount VAT // Amount VAT
if (!empty($arrayfields['p.total_vat']['checked'])) if (!empty($arrayfields['p.total_vat']['checked']))
{ {
print '<td class="right">'.price($obj->total_vat)."</td>\n"; print '<td class="nowrap right">'.price($obj->total_vat)."</td>\n";
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_vat'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_vat';
$totalarray['val']['p.total_vat'] += $obj->total_vat; $totalarray['val']['p.total_vat'] += $obj->total_vat;
@ -961,7 +968,7 @@ if ($resql)
// Amount TTC // Amount TTC
if (!empty($arrayfields['p.total_ttc']['checked'])) if (!empty($arrayfields['p.total_ttc']['checked']))
{ {
print '<td class="right">'.price($obj->total_ttc)."</td>\n"; print '<td class="nowrap right">'.price($obj->total_ttc)."</td>\n";
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ttc'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ttc';
$totalarray['val']['p.total_ttc'] += $obj->total_ttc; $totalarray['val']['p.total_ttc'] += $obj->total_ttc;
@ -982,7 +989,7 @@ if ($resql)
} }
} }
print '<td class="right">'.price($totalInvoiced)."</td>\n"; print '<td class="nowrap right">'.price($totalInvoiced)."</td>\n";
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht_invoiced'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht_invoiced';
$totalarray['val']['p.total_ht_invoiced'] += $obj->total_ht_invoiced; $totalarray['val']['p.total_ht_invoiced'] += $obj->total_ht_invoiced;
@ -1003,7 +1010,7 @@ if ($resql)
} }
} }
print '<td class="right">'.price($totalInvoiced)."</td>\n"; print '<td class="nowrap right">'.price($totalInvoiced)."</td>\n";
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_invoiced'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_invoiced';
$totalarray['val']['p.total_invoiced'] += $obj->total_invoiced; $totalarray['val']['p.total_invoiced'] += $obj->total_invoiced;

View File

@ -1447,6 +1447,7 @@ class Commande extends CommonOrder
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc); $localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
// Clean vat code // Clean vat code
$reg = array();
$vat_src_code = ''; $vat_src_code = '';
if (preg_match('/\((.*)\)/', $txtva, $reg)) if (preg_match('/\((.*)\)/', $txtva, $reg))
{ {
@ -3558,9 +3559,10 @@ class Commande extends CommonOrder
* @param int $short ??? * @param int $short ???
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $addlinktonotes Add linkt to notes
* @return string String with URL * @return string String with URL
*/ */
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
{ {
global $conf, $langs, $user; global $conf, $langs, $user;
@ -3627,6 +3629,22 @@ class Commande extends CommonOrder
if ($withpicto != 2) $result .= $this->ref; if ($withpicto != 2) $result .= $this->ref;
$result .= $linkend; $result .= $linkend;
if ($addlinktonotes)
{
$txttoshow = ($user->socid > 0 ? $this->note_public : $this->note_private);
if ($txttoshow)
{
$notetoshow = $langs->trans("ViewPrivateNote").':<br>'.dol_string_nohtmltag($txttoshow, 1);
$result .= ' <span class="note inline-block">';
$result .= '<a href="'.DOL_URL_ROOT.'/commande/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">';
$result .= img_picto('', 'note');
$result .= '</a>';
//$result.=img_picto($langs->trans("ViewNote"),'object_generic');
//$result.='</a>';
$result .= '</span>';
}
}
return $result; return $result;
} }

View File

@ -56,12 +56,10 @@ $confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array'); $toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'orderlist'; $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'orderlist';
$search_orderyear = GETPOST("search_orderyear", "int"); $search_dateorder_start = dol_mktime(0, 0, 0, GETPOST('search_dateorder_startmonth', 'int'), GETPOST('search_dateorder_startday', 'int'), GETPOST('search_dateorder_startyear', 'int'));
$search_ordermonth = GETPOST("search_ordermonth", "int"); $search_dateorder_end = dol_mktime(23, 59, 59, GETPOST('search_dateorder_endmonth', 'int'), GETPOST('search_dateorder_endday', 'int'), GETPOST('search_dateorder_endyear', 'int'));
$search_orderday = GETPOST("search_orderday", "int"); $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
$search_deliveryyear = GETPOST("search_deliveryyear", "int"); $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
$search_deliverymonth = GETPOST("search_deliverymonth", "int");
$search_deliveryday = GETPOST("search_deliveryday", "int");
$search_product_category = GETPOST('search_product_category', 'int'); $search_product_category = GETPOST('search_product_category', 'int');
$search_ref = GETPOST('search_ref', 'alpha') != '' ?GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha'); $search_ref = GETPOST('search_ref', 'alpha') != '' ?GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha');
$search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_ref_customer = GETPOST('search_ref_customer', 'alpha');
@ -197,12 +195,10 @@ if (empty($reshook))
$search_total_ht = ''; $search_total_ht = '';
$search_total_vat = ''; $search_total_vat = '';
$search_total_ttc = ''; $search_total_ttc = '';
$search_orderyear = ''; $search_dateorder_start ='';
$search_ordermonth = ''; $search_dateorder_end ='';
$search_orderday = ''; $search_datedelivery_start ='';
$search_deliveryday = ''; $search_datedelivery_end ='';
$search_deliverymonth = '';
$search_deliveryyear = '';
$search_project_ref = ''; $search_project_ref = '';
$search_project = ''; $search_project = '';
$viewstatut = ''; $viewstatut = '';
@ -311,8 +307,11 @@ if ($viewstatut <> '')
$sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed $sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed
} }
} }
$sql .= dolSqlDateFilter("c.date_commande", $search_orderday, $search_ordermonth, $search_orderyear);
$sql .= dolSqlDateFilter("c.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear); if ($search_dateorder_start) $sql .= " AND c.date_commande >= '" . $db->idate($search_dateorder_start) . "'";
if ($search_dateorder_end) $sql .= " AND c.date_commande <= '" . $db->idate($search_dateorder_end) . "'";
if ($search_datedelivery_start) $sql .= " AND c.date_livraison >= '" . $db->idate($search_datedelivery_start) . "'";
if ($search_datedelivery_end) $sql .= " AND c.date_livraison <= '" . $db->idate($search_datedelivery_end) . "'";
if ($search_town) $sql .= natural_search('s.town', $search_town); if ($search_town) $sql .= natural_search('s.town', $search_town);
if ($search_zip) $sql .= natural_search("s.zip", $search_zip); if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
if ($search_state) $sql .= natural_search("state.nom", $search_state); if ($search_state) $sql .= natural_search("state.nom", $search_state);
@ -327,6 +326,7 @@ if ($search_project_ref != '') $sql .= natural_search("p.ref", $search_project_r
if ($search_project != '') $sql .= natural_search("p.title", $search_project); if ($search_project != '') $sql .= natural_search("p.title", $search_project);
if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL"; if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
// Add where from extra fields // Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
// Add where from hooks // Add where from hooks
@ -405,12 +405,10 @@ if ($resql)
if ($sall) $param .= '&sall='.urlencode($sall); if ($sall) $param .= '&sall='.urlencode($sall);
if ($socid > 0) $param .= '&socid='.urlencode($socid); if ($socid > 0) $param .= '&socid='.urlencode($socid);
if ($viewstatut != '') $param .= '&viewstatut='.urlencode($viewstatut); if ($viewstatut != '') $param .= '&viewstatut='.urlencode($viewstatut);
if ($search_orderday) $param .= '&search_orderday='.urlencode($search_orderday); if ($search_dateorder_start) $param .= '&search_dateorder_start='.urlencode($search_dateorder_start);
if ($search_ordermonth) $param .= '&search_ordermonth='.urlencode($search_ordermonth); if ($search_dateorder_end) $param .= '&search_dateorder_end='.urlencode($search_dateorder_end);
if ($search_orderyear) $param .= '&search_orderyear='.urlencode($search_orderyear); if ($search_datedelivery_start) $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start);
if ($search_deliveryday) $param .= '&search_deliveryday='.urlencode($search_deliveryday); if ($search_datedelivery_end) $param .= '&search_datedelivery_end='.urlencode($search_datedelivery_end);
if ($search_deliverymonth) $param .= '&search_deliverymonth='.urlencode($search_deliverymonth);
if ($search_deliveryyear) $param .= '&search_deliveryyear='.urlencode($search_deliveryyear);
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref); if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
if ($search_company) $param .= '&search_company='.urlencode($search_company); if ($search_company) $param .= '&search_company='.urlencode($search_company);
if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer); if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer);
@ -646,18 +644,28 @@ if ($resql)
// Date order // Date order
if (!empty($arrayfields['c.date_commande']['checked'])) if (!empty($arrayfields['c.date_commande']['checked']))
{ {
print '<td class="liste_titre nowraponall" align="center">'; print '<td class="liste_titre center">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_orderday" value="'.$search_orderday.'">'; print '<div class="nowrap">';
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_ordermonth" value="'.$search_ordermonth.'">'; print $langs->trans('From') . ' ';
$formother->select_year($search_orderyear ? $search_orderyear : -1, 'search_orderyear', 1, 20, 5); print $form->selectDate($search_dateorder_start?$search_dateorder_start:-1, 'search_dateorder_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_dateorder_end?$search_dateorder_end:-1, 'search_dateorder_end', 0, 0, 1);
print '</div>';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['c.date_delivery']['checked'])) if (!empty($arrayfields['c.date_delivery']['checked']))
{ {
print '<td class="liste_titre nowraponall" align="center">'; print '<td class="liste_titre center">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_deliveryday" value="'.$search_deliveryday.'">'; print '<div class="nowrap">';
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_deliverymonth" value="'.$search_deliverymonth.'">'; print $langs->trans('From') . ' ';
$formother->select_year($search_deliveryyear ? $search_deliveryyear : -1, 'search_deliveryyear', 1, 20, 5); print $form->selectDate($search_datedelivery_start?$search_datedelivery_start:-1, 'search_datedelivery_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_datedelivery_end?$search_datedelivery_end:-1, 'search_datedelivery_end', 0, 0, 1);
print '</div>';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['c.total_ht']['checked'])) if (!empty($arrayfields['c.total_ht']['checked']))
@ -804,6 +812,8 @@ if ($resql)
$generic_commande->total_ht = $obj->total_ht; $generic_commande->total_ht = $obj->total_ht;
$generic_commande->total_tva = $obj->total_tva; $generic_commande->total_tva = $obj->total_tva;
$generic_commande->total_ttc = $obj->total_ttc; $generic_commande->total_ttc = $obj->total_ttc;
$generic_commande->note_public = $obj->note_public;
$generic_commande->note_private = $obj->note_private;
$projectstatic->id = $obj->project_id; $projectstatic->id = $obj->project_id;
$projectstatic->ref = $obj->project_ref; $projectstatic->ref = $obj->project_ref;
@ -818,7 +828,7 @@ if ($resql)
$generic_commande->getLinesArray(); // This set ->lines $generic_commande->getLinesArray(); // This set ->lines
print $generic_commande->getNomUrl(1, ($viewstatut != 2 ? 0 : $obj->fk_statut), 0, 0, 0, 1); print $generic_commande->getNomUrl(1, ($viewstatut != 2 ? 0 : $obj->fk_statut), 0, 0, 0, 1, 1);
// Show shippable Icon (create subloop, so may be slow) // Show shippable Icon (create subloop, so may be slow)
if ($conf->stock->enabled) if ($conf->stock->enabled)
@ -926,12 +936,6 @@ if ($resql)
if ($generic_commande->hasDelay()) { if ($generic_commande->hasDelay()) {
print img_picto($langs->trans("Late").' : '.$generic_commande->showDelay(), "warning"); print img_picto($langs->trans("Late").' : '.$generic_commande->showDelay(), "warning");
} }
if (!empty($obj->note_private) || !empty($obj->note_public))
{
print ' <span class="note">';
print '<a href="'.DOL_URL_ROOT.'/commande/note.php?id='.$obj->rowid.'">'.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').'</a>';
print '</span>';
}
$filename = dol_sanitizeFileName($obj->ref); $filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->commande->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref); $filedir = $conf->commande->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref);
@ -1054,7 +1058,7 @@ if ($resql)
// Amount HT // Amount HT
if (!empty($arrayfields['c.total_ht']['checked'])) if (!empty($arrayfields['c.total_ht']['checked']))
{ {
print '<td class="right">'.price($obj->total_ht)."</td>\n"; print '<td class="nowrap right">'.price($obj->total_ht)."</td>\n";
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'c.total_ht'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'c.total_ht';
$totalarray['val']['c.total_ht'] += $obj->total_ht; $totalarray['val']['c.total_ht'] += $obj->total_ht;
@ -1062,7 +1066,7 @@ if ($resql)
// Amount VAT // Amount VAT
if (!empty($arrayfields['c.total_vat']['checked'])) if (!empty($arrayfields['c.total_vat']['checked']))
{ {
print '<td class="right">'.price($obj->total_tva)."</td>\n"; print '<td class="nowrap right">'.price($obj->total_tva)."</td>\n";
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'c.total_tva'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'c.total_tva';
$totalarray['val']['c.total_tva'] += $obj->total_tva; $totalarray['val']['c.total_tva'] += $obj->total_tva;
@ -1070,7 +1074,7 @@ if ($resql)
// Amount TTC // Amount TTC
if (!empty($arrayfields['c.total_ttc']['checked'])) if (!empty($arrayfields['c.total_ttc']['checked']))
{ {
print '<td class="right">'.price($obj->total_ttc)."</td>\n"; print '<td class="nowrap right">'.price($obj->total_ttc)."</td>\n";
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'c.total_ttc'; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'c.total_ttc';
$totalarray['val']['c.total_ttc'] += $obj->total_ttc; $totalarray['val']['c.total_ttc'] += $obj->total_ttc;

View File

@ -690,7 +690,7 @@ else
// Categories // Categories
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, 'bank_account', 1); print $form->showCategories($object->id, Categorie::TYPE_ACCOUNT, 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr> /* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* *
@ -44,11 +44,15 @@ $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$search_ref = GETPOST('search_ref', 'int'); $search_ref = GETPOST('search_ref', 'int');
$search_user = GETPOST('search_user', 'alpha'); $search_user = GETPOST('search_user', 'alpha');
$search_label = GETPOST('search_label', 'alpha'); $search_label = GETPOST('search_label', 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_amount_deb = GETPOST('search_amount_deb', 'alpha'); $search_amount_deb = GETPOST('search_amount_deb', 'alpha');
$search_amount_cred = GETPOST('search_amount_cred', 'alpha'); $search_amount_cred = GETPOST('search_amount_cred', 'alpha');
$search_account = GETPOST('search_account', 'int'); $search_account = GETPOST('search_account', 'int');
$search_date = dol_mktime(0, 0, 0, GETPOST('date_docmonth', 'int'), GETPOST('date_docday', 'int'), GETPOST('date_docyear', 'int')); $search_accountancy_account = GETPOST("search_accountancy_account");
$search_accountancy_code = GETPOST("search_accountancy_code"); if ($search_accountancy_account == - 1) $search_accountancy_account = '';
$search_accountancy_subledger = GETPOST("search_accountancy_subledger");
if ($search_accountancy_subledger == - 1) $search_accountancy_subledger = '';
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
@ -81,12 +85,14 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
{ {
$search_ref=""; $search_ref="";
$search_label=""; $search_label="";
$search_date_start='';
$search_date_end='';
$search_amount_deb=""; $search_amount_deb="";
$search_amount_cred=""; $search_amount_cred="";
$search_account=''; $search_account='';
$search_accountancy_account = '';
$search_accountancy_subledger = '';
$typeid=""; $typeid="";
$search_date = '';
$search_accountancy_code = '';
} }
/* /*
@ -100,7 +106,7 @@ $formaccounting = new FormAccounting($db);
$variousstatic = new PaymentVarious($db); $variousstatic = new PaymentVarious($db);
$accountstatic = new Account($db); $accountstatic = new Account($db);
$sql = "SELECT v.rowid, v.sens, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank, v.accountancy_code,"; $sql = "SELECT v.rowid, v.sens, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank, v.accountancy_code, v.subledger_account,";
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number as bank_account_number, ba.fk_accountancy_journal as accountancy_journal, ba.label as blabel,"; $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number as bank_account_number, ba.fk_accountancy_journal as accountancy_journal, ba.label as blabel,";
$sql.= " pst.code as payment_code"; $sql.= " pst.code as payment_code";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_various as v"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_various as v";
@ -112,11 +118,13 @@ $sql.= " WHERE v.entity IN (".getEntity('payment_various').")";
// Search criteria // Search criteria
if ($search_ref) $sql.= " AND v.rowid=".$db->escape($search_ref); if ($search_ref) $sql.= " AND v.rowid=".$db->escape($search_ref);
if ($search_label) $sql.= natural_search(array('v.label'), $search_label); if ($search_label) $sql.= natural_search(array('v.label'), $search_label);
if ($search_date_start) $sql.= " AND v.datep >= '" . $db->idate($search_date_start) . "'";
if ($search_date_end) $sql.= " AND v.datep <= '" . $db->idate($search_date_end) . "'";
if ($search_amount_deb) $sql.= natural_search("v.amount", $search_amount_deb, 1); if ($search_amount_deb) $sql.= natural_search("v.amount", $search_amount_deb, 1);
if ($search_amount_cred) $sql.= natural_search("v.amount", $search_amount_cred, 1); if ($search_amount_cred) $sql.= natural_search("v.amount", $search_amount_cred, 1);
if ($search_account > 0) $sql.= " AND b.fk_account=".$db->escape($search_account); if ($search_account > 0) $sql.= " AND b.fk_account=".$db->escape($search_account);
if ($search_date) $sql.=" AND v.datep = '".$db->idate($search_date)."'"; if ($search_accountancy_account > 0) $sql.= " AND v.accountancy_code=".$db->escape($search_accountancy_account);
if ($search_accountancy_code > 0) $sql.=" AND v.accountancy_code=".$db->escape($search_accountancy_code); if ($search_accountancy_subledger > 0) $sql.= " AND v.subledger_account=".$db->escape($search_accountancy_subledger);
if ($typeid > 0) $sql.= " AND v.fk_typepayment=".$typeid; if ($typeid > 0) $sql.= " AND v.fk_typepayment=".$typeid;
if ($filtre) { if ($filtre) {
$filtre=str_replace(":", "=", $filtre); $filtre=str_replace(":", "=", $filtre);
@ -145,12 +153,14 @@ if ($result)
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref); if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_label) $param.='&search_label='.urlencode($search_label); if ($search_label) $param.='&search_label='.urlencode($search_label);
if ($search_date_start) $param.='&search_date_start='.urlencode($search_date_start);
if ($search_date_end) $param.='&search_date_end='.urlencode($search_date_end);
if ($typeid > 0) $param.='&typeid='.urlencode($typeid); if ($typeid > 0) $param.='&typeid='.urlencode($typeid);
if ($search_amount_deb) $param.='&search_amount_deb='.urlencode($search_amount_deb); if ($search_amount_deb) $param.='&search_amount_deb='.urlencode($search_amount_deb);
if ($search_amount_cred) $param.='&search_amount_cred='.urlencode($search_amount_cred); if ($search_amount_cred) $param.='&search_amount_cred='.urlencode($search_amount_cred);
if ($search_account > 0) $param.='&search_amount='.urlencode($search_account); if ($search_account > 0) $param.='&search_amount='.urlencode($search_account);
//if ($search_date) $param.='&search_date='.$search_date; if ($search_accountancy_account > 0) $param.='&search_accountancy_account='.urlencode($search_accountancy_account);
if ($search_accountancy_code > 0) $param.='&search_accountancy_code='.urlencode($search_accountancy_code); if ($search_accountancy_subledger > 0) $param.='&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
if ($optioncss != '') $param.='&amp;optioncss='.urlencode($optioncss); if ($optioncss != '') $param.='&amp;optioncss='.urlencode($optioncss);
@ -188,7 +198,13 @@ if ($result)
// Date // Date
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
print '<div class="nowrap">'; print '<div class="nowrap">';
print $form->selectDate($search_date, 'date_doc', 0, 0, 1); print $langs->trans('From') . ' ';
print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
print '</div>'; print '</div>';
print '</td>'; print '</td>';
@ -208,9 +224,17 @@ if ($result)
// Accounting account // Accounting account
if (!empty($conf->accounting->enabled)) if (!empty($conf->accounting->enabled))
{ {
// Accounting account
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<div class="nowrap">'; print '<div class="nowrap">';
print $formaccounting->select_account($search_accountancy_code, 'search_accountancy_code', 1, array(), 1, 1, 'maxwidth200'); print $formaccounting->select_account($search_accountancy_account, 'search_accountancy_account', 1, array (), 1, 1, 'maxwidth200');
print '</div>';
print '</td>';
// Subledger account
print '<td class="liste_titre">';
print '<div class="nowrap">';
print $formaccounting->select_auxaccount($search_accountancy_subledger, 'search_accountancy_subledger', 1, array (), 1, 1, 'maxwidth200');
print '</div>'; print '</div>';
print '</td>'; print '</td>';
} }
@ -235,7 +259,8 @@ if ($result)
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "v.datep,v.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "v.datep,v.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'left '); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'left ');
if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
if (!empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "v.accountancy_code", "", $param, '', $sortfield, $sortorder, 'left '); if (! empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccountingShort", $_SERVER["PHP_SELF"], "v.accountancy_code", "", $param, '', $sortfield, $sortorder, 'left ');
if (! empty($conf->accounting->enabled)) print_liste_field_titre("SubledgerAccount", $_SERVER["PHP_SELF"], "v.subledger_account", "", $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "v.amount", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "v.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "v.amount", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "v.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
@ -303,6 +328,13 @@ if ($result)
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Accounting subledger account
if (! empty($conf->accounting->enabled))
{
print '<td>' . length_accounta($obj->subledger_account) . '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Debit // Debit
print '<td class="nowrap right">'; print '<td class="nowrap right">';
if ($obj->sens == 0) if ($obj->sens == 0)
@ -312,7 +344,7 @@ if ($result)
} }
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='total_deb'; if (! $i) $totalarray['pos'][$totalarray['nbfield']]='total_deb';
print "</td>"; print '</td>';
// Credit // Credit
print '<td class="nowrap right">'; print '<td class="nowrap right">';

View File

@ -13,6 +13,7 @@
* Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat> * Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com> * Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* 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
@ -98,12 +99,10 @@ $search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_user = GETPOST('search_user', 'int'); $search_user = GETPOST('search_user', 'int');
$search_sale = GETPOST('search_sale', 'int'); $search_sale = GETPOST('search_sale', 'int');
$search_day = GETPOST('search_day', 'int'); $search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_month = GETPOST('search_month', 'int'); $search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_year = GETPOST('search_year', 'int'); $search_datelimit_start = dol_mktime(0, 0, 0, GETPOST('search_datelimit_startmonth', 'int'), GETPOST('search_datelimit_startday', 'int'), GETPOST('search_datelimit_startyear', 'int'));
$search_day_lim = GETPOST('search_day_lim', 'int'); $search_datelimit_end = dol_mktime(23, 59, 59, GETPOST('search_datelimit_endmonth', 'int'), GETPOST('search_datelimit_endday', 'int'), GETPOST('search_datelimit_endyear', 'int'));
$search_month_lim = GETPOST('search_month_lim', 'int');
$search_year_lim = GETPOST('search_year_lim', 'int');
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); $search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
$search_btn = GETPOST('button_search', 'alpha'); $search_btn = GETPOST('button_search', 'alpha');
$search_remove_btn = GETPOST('button_removefilter', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha');
@ -248,14 +247,12 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
$search_type = ''; $search_type = '';
$search_country = ''; $search_country = '';
$search_type_thirdparty = ''; $search_type_thirdparty = '';
$search_day = ''; $search_date_start = '';
$search_year = ''; $search_date_end = '';
$search_month = ''; $search_datelimit_start = '';
$search_datelimit_end = '';
$option = ''; $option = '';
$filter = ''; $filter = '';
$search_day_lim = '';
$search_year_lim = '';
$search_month_lim = '';
$toselect = ''; $toselect = '';
$search_array_options = array(); $search_array_options = array();
$search_categ_cus = 0; $search_categ_cus = 0;
@ -478,12 +475,15 @@ if ($search_status != '-1' && $search_status != '')
$sql .= " AND f.fk_statut IN (".$db->escape($search_status).")"; // When search_status is '1,2' for example $sql .= " AND f.fk_statut IN (".$db->escape($search_status).")"; // When search_status is '1,2' for example
} }
} }
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode); if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode);
if ($search_paymentterms > 0) $sql .= " AND f.fk_cond_reglement = ".$db->escape($search_paymentterms); if ($search_paymentterms > 0) $sql .= " AND f.fk_cond_reglement = ".$db->escape($search_paymentterms);
if ($search_module_source) $sql .= natural_search("f.module_source", $search_module_source); if ($search_module_source) $sql .= natural_search("f.module_source", $search_module_source);
if ($search_pos_source) $sql .= natural_search("f.pos_source", $search_pos_source); if ($search_pos_source) $sql .= natural_search("f.pos_source", $search_pos_source);
$sql .= dolSqlDateFilter("f.datef", $search_day, $search_month, $search_year); if ($search_date_start) $sql .= " AND f.datef >= '" . $db->idate($search_date_start) . "'";
$sql .= dolSqlDateFilter("f.date_lim_reglement", $search_day_lim, $search_month_lim, $search_year_lim); if ($search_date_end) $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'";
if ($search_datelimit_start) $sql .= " AND f.date_lim_reglement >= '" . $db->idate($search_datelimit_start) . "'";
if ($search_datelimit_end) $sql .= " AND f.date_lim_reglement <= '" . $db->idate($search_datelimit_end) . "'";
if ($option == 'late') $sql .= " AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'"; if ($option == 'late') $sql .= " AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'";
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".(int) $search_sale; if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".(int) $search_sale;
if ($search_user > 0) if ($search_user > 0)
@ -571,12 +571,10 @@ if ($resql)
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($sall) $param .= '&sall='.urlencode($sall); if ($sall) $param .= '&sall='.urlencode($sall);
if ($search_day) $param .= '&search_day='.urlencode($search_day); if ($search_date_start) $param .= '&search_date_start='.urlencode($search_date_start);
if ($search_month) $param .= '&search_month='.urlencode($search_month); if ($search_date_end) $param .= '&search_date_end='.urlencode($search_date_end);
if ($search_year) $param .= '&search_year='.urlencode($search_year); if ($search_datelimit_start) $param .= '&search_datelimit_start='.urlencode($search_datelimit_start);
if ($search_day_lim) $param .= '&search_day_lim='.urlencode($search_day_lim); if ($search_datelimit_end) $param .= '&search_datelimit_end='.urlencode($search_datelimit_end);
if ($search_month_lim) $param .= '&search_month_lim='.urlencode($search_month_lim);
if ($search_year_lim) $param .= '&search_year_lim='.urlencode($search_year_lim);
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref); if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
if ($search_refcustomer) $param .= '&search_refcustomer='.urlencode($search_refcustomer); if ($search_refcustomer) $param .= '&search_refcustomer='.urlencode($search_refcustomer);
if ($search_project_ref) $param .= '&search_project_ref='.urlencode($search_project_ref); if ($search_project_ref) $param .= '&search_project_ref='.urlencode($search_project_ref);
@ -752,20 +750,29 @@ if ($resql)
// Date invoice // Date invoice
if (!empty($arrayfields['f.date']['checked'])) if (!empty($arrayfields['f.date']['checked']))
{ {
print '<td class="liste_titre nowraponall" align="center">'; print '<td class="liste_titre center">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">'; print '<div class="nowrap">';
print '<input class="flat valignmiddle width25" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">'; print $langs->trans('From') . ' ';
$formother->select_year($search_year ? $search_year : -1, 'search_year', 1, 20, 5, 0, 0, '', 'widthauto valignmiddle'); print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
print '</div>';
print '</td>'; print '</td>';
} }
// Date due // Date due
if (!empty($arrayfields['f.date_lim_reglement']['checked'])) if (!empty($arrayfields['f.date_lim_reglement']['checked']))
{ {
print '<td class="liste_titre nowraponall" align="center">'; print '<td class="liste_titre center">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day_lim" value="'.dol_escape_htmltag($search_day_lim).'">'; print '<div class="nowrap">';
print '<input class="flat valignmiddle width25" type="text" size="1" maxlength="2" name="search_month_lim" value="'.dol_escape_htmltag($search_month_lim).'">'; print $langs->trans('From') . ' ';
$formother->select_year($search_year_lim ? $search_year_lim : -1, 'search_year_lim', 1, 20, 5, 0, 0, '', 'widthauto valignmiddle'); print $form->selectDate($search_datelimit_start?$search_datelimit_start:-1, 'search_datelimit_start', 0, 0, 1);
print '<br><input type="checkbox" name="search_option" value="late"'.($option == 'late' ? ' checked' : '').'> '.$langs->trans("Alert"); print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_datelimit_end?$search_datelimit_end:-1, 'search_datelimit_end', 0, 0, 1);
print '</div>';
print '</td>'; print '</td>';
} }
// Project ref // Project ref
@ -778,7 +785,7 @@ if ($resql)
{ {
print '<td class="liste_titre"><input class="flat maxwidth50imp" type="text" name="search_project" value="'.$search_project.'"></td>'; print '<td class="liste_titre"><input class="flat maxwidth50imp" type="text" name="search_project" value="'.$search_project.'"></td>';
} }
// Thirpdarty // Thirdparty
if (!empty($arrayfields['s.nom']['checked'])) if (!empty($arrayfields['s.nom']['checked']))
{ {
print '<td class="liste_titre"><input class="flat maxwidth75imp" type="text" name="search_societe" value="'.$search_societe.'"></td>'; print '<td class="liste_titre"><input class="flat maxwidth75imp" type="text" name="search_societe" value="'.$search_societe.'"></td>';

View File

@ -1364,7 +1364,7 @@ else
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td>'; print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
print $form->showCategories($object->id, 'contact', 1); print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2017 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2017 Juanjo Menent <jmenent@2byte.es>
@ -417,12 +417,12 @@ if (empty($reshook))
// Set if we used free entry or predefined product // Set if we used free entry or predefined product
$predef = ''; $predef = '';
$product_desc = (GETPOST('dp_desc') ?GETPOST('dp_desc') : ''); $product_desc = (GETPOST('dp_desc') ?GETPOST('dp_desc') : '');
$price_ht = GETPOST('price_ht'); $price_ht = price2num(GETPOST('price_ht'));
$price_ht_devise = GETPOST('multicurrency_price_ht'); $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'));
if (GETPOST('prod_entry_mode') == 'free') if (GETPOST('prod_entry_mode', 'alpha') == 'free')
{ {
$idprod = 0; $idprod = 0;
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0);
} }
else else
{ {
@ -430,7 +430,7 @@ if (empty($reshook))
$tva_tx = ''; $tva_tx = '';
} }
$qty = GETPOST('qty'.$predef); $qty = price2num(GETPOST('qty'.$predef));
$remise_percent = ((GETPOST('remise_percent'.$predef) != '') ? GETPOST('remise_percent'.$predef) : 0); $remise_percent = ((GETPOST('remise_percent'.$predef) != '') ? GETPOST('remise_percent'.$predef) : 0);
if ($qty == '') if ($qty == '')
@ -438,7 +438,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors');
$error++; $error++;
} }
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) if (GETPOST('prod_entry_mode', 'alpha') == 'free' && empty($idprod) && empty($product_desc))
{ {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors');
$error++; $error++;

View File

@ -1421,9 +1421,18 @@ class Contrat extends CommonObject
$pu_ht = price2num($pu_ht); $pu_ht = price2num($pu_ht);
$pu_ttc = price2num($pu_ttc); $pu_ttc = price2num($pu_ttc);
$pa_ht = price2num($pa_ht); $pa_ht = price2num($pa_ht);
if (!preg_match('/\((.*)\)/', $txtva)) {
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' // Clean vat code
$reg = array();
$vat_src_code = '';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
} }
$txtva = price2num($txtva);
$txlocaltax1 = price2num($txlocaltax1); $txlocaltax1 = price2num($txlocaltax1);
$txlocaltax2 = price2num($txlocaltax2); $txlocaltax2 = price2num($txlocaltax2);
$remise_percent = price2num($remise_percent); $remise_percent = price2num($remise_percent);
@ -1456,15 +1465,7 @@ class Contrat extends CommonObject
$this->db->begin(); $this->db->begin();
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc); $localtaxes_type = getLocalTaxesFromRate($txtva.($vat_src_code ? ' ('.$vat_src_code.')' : ''), 0, $this->societe, $mysoc);
// Clean vat code
$vat_src_code = '';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
// Calcul du total TTC et de la TVA pour la ligne a partir de // Calcul du total TTC et de la TVA pour la ligne a partir de
// qty, pu, remise_percent et txtva // qty, pu, remise_percent et txtva

View File

@ -1127,7 +1127,20 @@ class DolGraph
$this->stringtoshow .= '</script>'."\n"; $this->stringtoshow .= '</script>'."\n";
} }
/**
* Output HTML string to total value
*
* @return string HTML string to total value
*/
public function total()
{
$value = 0;
foreach($this->data as $valarray) // Loop on each x
{
$value += $valarray[1];
}
return $value;
}
/** /**
* Output HTML string to show graph * Output HTML string to show graph

View File

@ -3008,7 +3008,6 @@ class Form
* @param int $productid Id of product * @param int $productid Id of product
* @param string $htmlname Name of HTML field * @param string $htmlname Name of HTML field
* @param int $selected_supplier Pre-selected supplier if more than 1 result * @param int $selected_supplier Pre-selected supplier if more than 1 result
*
* @return string * @return string
*/ */
public function select_product_fourn_price($productid, $htmlname = 'productfournpriceid', $selected_supplier = '') public function select_product_fourn_price($productid, $htmlname = 'productfournpriceid', $selected_supplier = '')
@ -5911,6 +5910,7 @@ class Form
//var_dump($objecttmp->filter); //var_dump($objecttmp->filter);
$prefixforautocompletemode = $objecttmp->element; $prefixforautocompletemode = $objecttmp->element;
if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode = 'company'; if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode = 'company';
if ($prefixforautocompletemode == 'product') $prefixforautocompletemode='produit';
$confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
dol_syslog(get_class($this)."::selectForForms object->filter=".$objecttmp->filter, LOG_DEBUG); dol_syslog(get_class($this)."::selectForForms object->filter=".$objecttmp->filter, LOG_DEBUG);
@ -7843,4 +7843,171 @@ class Form
return $out; return $out;
} }
/**
* Output a combo list with invoices qualified for a third party
*
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id invoice preselected
* @param string $htmlname Name of HTML select
* @param int $maxlength Maximum length of label
* @param int $option_only Return only html options lines without the select tag
* @param string $show_empty Add an empty line ('1' or string to show for empty line)
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
* @param int $forcefocus Force focus on field (works with javascript only)
* @param int $disabled Disabled
* @param string $morecss More css added to the select component
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
* @param string $showproject 'all' = Show project info, ''=Hide project info
* @param User $usertofilter User object to use for filtering
* @return int Nbr of project if OK, <0 if KO
*/
public function selectInvoice($socid = -1, $selected = '', $htmlname = 'invoiceid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null)
{
global $user,$conf,$langs;
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (is_null($usertofilter))
{
$usertofilter = $user;
}
$out='';
$hideunselectables = false;
if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true;
if (empty($projectsListId))
{
if (empty($usertofilter->rights->projet->all->lire))
{
$projectstatic=new Project($this->db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter, 0, 1);
}
}
// Search all projects
$sql = 'SELECT f.rowid, f.ref as fref, "nolabel" as flabel, p.rowid as pid, f.ref,
p.title, p.fk_soc, p.fk_statut, p.public,';
$sql.= ' s.nom as name';
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc,';
$sql.= ' '.MAIN_DB_PREFIX.'facture as f';
$sql.= " WHERE p.entity IN (".getEntity('project').")";
$sql.= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement
//if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")";
//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
//if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
$sql.= " GROUP BY f.ref ORDER BY p.ref, f.ref ASC";
$resql=$this->db->query($sql);
if ($resql)
{
// Use select2 selector
if (! empty($conf->use_javascript_ajax))
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
$out.=$comboenhancement;
$morecss='minwidth200imp maxwidth500';
}
if (empty($option_only)) {
$out.= '<select class="valignmiddle flat'.($morecss?' '.$morecss:'').'"'.($disabled?' disabled="disabled"':'').' id="'.$htmlname.'" name="'.$htmlname.'">';
}
if (! empty($show_empty)) {
$out.= '<option value="0" class="optiongrey">';
if (! is_numeric($show_empty)) $out.=$show_empty;
else $out.='&nbsp;';
$out.= '</option>';
}
$num = $this->db->num_rows($resql);
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
// If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project.
if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($usertofilter->rights->societe->lire))
{
// Do nothing
}
else
{
if ($discard_closed == 1 && $obj->fk_statut == Project::STATUS_CLOSED)
{
$i++;
continue;
}
$labeltoshow = '';
if ($showproject == 'all')
{
$labeltoshow.=dol_trunc($obj->ref, 18); // Invoice ref
if ($obj->name) $labeltoshow.=' - '.$obj->name; // Soc name
$disabled=0;
if ($obj->fk_statut == Project::STATUS_DRAFT)
{
$disabled=1;
$labeltoshow.=' - '.$langs->trans("Draft");
}
elseif ($obj->fk_statut == Project::STATUS_CLOSED)
{
if ($discard_closed == 2) $disabled=1;
$labeltoshow.=' - '.$langs->trans("Closed");
}
elseif ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
{
$disabled=1;
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
}
}
if (!empty($selected) && $selected == $obj->rowid)
{
$out.= '<option value="'.$obj->rowid.'" selected';
//if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled
$out.= '>'.$labeltoshow.'</option>';
}
else
{
if ($hideunselectables && $disabled && ($selected != $obj->rowid))
{
$resultat='';
}
else
{
$resultat='<option value="'.$obj->rowid.'"';
if ($disabled) $resultat.=' disabled';
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
$resultat.='>';
$resultat.=$labeltoshow;
$resultat.='</option>';
}
$out.= $resultat;
}
}
$i++;
}
}
if (empty($option_only)) {
$out.= '</select>';
}
print $out;
$this->db->free($resql);
return $num;
}
else
{
dol_print_error($this->db);
return -1;
}
}
} }

View File

@ -233,7 +233,7 @@ class Utils
$outputdir = $conf->admin->dir_output.'/backup'; $outputdir = $conf->admin->dir_output.'/backup';
$result = dol_mkdir($outputdir); $result = dol_mkdir($outputdir);
$errormsg = '';
// MYSQL // MYSQL
if ($type == 'mysql' || $type == 'mysqli') if ($type == 'mysql' || $type == 'mysqli')
@ -296,7 +296,6 @@ class Utils
$paramclear .= ' -p"'.str_replace(array('"', '`'), array('\"', '\`'), $dolibarr_main_db_pass).'"'; $paramclear .= ' -p"'.str_replace(array('"', '`'), array('\"', '\`'), $dolibarr_main_db_pass).'"';
} }
$errormsg = '';
$handle = ''; $handle = '';
// Start call method to execute dump // Start call method to execute dump
@ -383,6 +382,8 @@ class Utils
{ {
// Get 2048 first chars of error message. // Get 2048 first chars of error message.
$errormsg = fgets($handle, 2048); $errormsg = fgets($handle, 2048);
//$ok=0;$errormsg=''; To force error
// Close file // Close file
if ($compression == 'none') fclose($handle); if ($compression == 'none') fclose($handle);
if ($compression == 'gz') gzclose($handle); if ($compression == 'gz') gzclose($handle);
@ -492,7 +493,7 @@ class Utils
} }
// Clean old files // Clean old files
if ($keeplastnfiles > 0) if (! $errormsg && $keeplastnfiles > 0)
{ {
$tmpfiles = dol_dir_list($conf->admin->dir_output.'/backup', 'files', 0, '', '(\.err|\.old|\.sav)$', 'date', SORT_DESC); $tmpfiles = dol_dir_list($conf->admin->dir_output.'/backup', 'files', 0, '', '(\.err|\.old|\.sav)$', 'date', SORT_DESC);
$i = 0; $i = 0;
@ -504,7 +505,7 @@ class Utils
} }
} }
return 0; return ($errormsg ? -1 : 0);
} }

View File

@ -2082,9 +2082,10 @@ function dol_uncompress($inputfile, $outputdir)
* @param string $outputfile Target file name (output directory must exists and be writable) * @param string $outputfile Target file name (output directory must exists and be writable)
* @param string $mode 'zip' * @param string $mode 'zip'
* @param string $excludefiles A regex pattern. For example: '/\.log$|\/temp\//' * @param string $excludefiles A regex pattern. For example: '/\.log$|\/temp\//'
* @param string $rootdirinzip Add a root dir level in zip file
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '') function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '', $rootdirinzip = '')
{ {
$foundhandler=0; $foundhandler=0;
@ -2145,7 +2146,8 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles =
{ {
// Get real and relative path for current file // Get real and relative path for current file
$filePath = $file->getRealPath(); $filePath = $file->getRealPath();
$relativePath = substr($filePath, strlen($inputdir) + 1); $relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($filePath, strlen($inputdir) + 1);
if (empty($excludefiles) || ! preg_match($excludefiles, $filePath)) if (empty($excludefiles) || ! preg_match($excludefiles, $filePath))
{ {
// Add current file to archive // Add current file to archive

View File

@ -1639,7 +1639,8 @@ function dol_bc($var, $moreclass = '')
} }
/** /**
* Return a formated address (part address/zip/town/state) according to country rules * Return a formated address (part address/zip/town/state) according to country rules.
* See https://en.wikipedia.org/wiki/Address
* *
* @param Object $object A company or contact object * @param Object $object A company or contact object
* @param int $withcountry 1=Add country into address string * @param int $withcountry 1=Add country into address string
@ -1656,6 +1657,8 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
$ret = ''; $ret = '';
$countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS $countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
// See format of addresses on https://en.wikipedia.org/wiki/Address
// Address // Address
if (empty($mode)) { if (empty($mode)) {
$ret .= $object->address; $ret .= $object->address;
@ -1692,7 +1695,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
{ {
$ret .= ($ret ? $sep : '').$object->zip; $ret .= ($ret ? $sep : '').$object->zip;
$ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : ''); $ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : '');
$ret .= ($object->state_id ? (' ('.($object->state_id).')') : ''); $ret .= ($object->state_code ? (' '.($object->state_code)) : '');
} }
else // Other: title firstname name \n address lines \n zip town \n country else // Other: title firstname name \n address lines \n zip town \n country
{ {
@ -6036,6 +6039,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null));
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
$substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : ''); $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : '');
$substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : '');
$birthday = dol_print_date($object->birth, 'day'); $birthday = dol_print_date($object->birth, 'day');

View File

@ -222,7 +222,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
public $export_permission; public $export_permission;
public $export_fields_array; public $export_fields_array;
public $export_TypeFields_array; public $export_TypeFields_array; // Array of key=>type where type can be 'Numeric', 'Date', 'Text', 'Boolean', 'Status', 'List:xxx:login:rowid'
public $export_entities_array; public $export_entities_array;
public $export_special_array; // special or computed field public $export_special_array; // special or computed field
public $export_dependencies_array; public $export_dependencies_array;

View File

@ -1,526 +0,0 @@
<?php
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.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 <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/modules/export/export_excel.modules.php
* \ingroup export
* \brief File of class to generate export file with Excel format
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
/**
* Class to build export files with Excel format
*/
class ExportExcel extends ModeleExports
{
/**
* @var string ID
*/
public $id;
/**
* @var string Export Excel label
*/
public $label;
public $extension;
/**
* Dolibarr version of the loaded document
* @var string
*/
public $version = 'dolibarr';
public $label_lib;
public $version_lib;
public $workbook; // Handle file
public $worksheet; // Handle sheet
public $row;
public $col;
public $file; // To save filename
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct($db)
{
global $conf, $langs;
$this->db = $db;
$this->id='excel'; // Same value then xxx in file name export_xxx.modules.php
$this->label='Excel 95 (old library)'; // Label of driver
$this->desc = $langs->trans('Excel95FormatDesc');
$this->extension='xls'; // Extension for generated file by this driver
$this->picto='mime/xls'; // Picto
$this->version='1.30'; // Driver version
$this->disabled = (in_array(constant('PHPEXCEL_PATH'), array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
if (empty($this->disabled))
{
// If driver use an external library, put its name here
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php';
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php';
require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php';
$this->label_lib='PhpWriteExcel';
$this->version_lib='unknown';
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel.php';
require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
$this->label_lib='PhpExcel';
$this->version_lib='1.8.0'; // No way to get info from library
}
}
$this->row=0;
}
/**
* getDriverId
*
* @return string
*/
public function getDriverId()
{
return $this->id;
}
/**
* getDriverLabel
*
* @return string Return driver label
*/
public function getDriverLabel()
{
return $this->label;
}
/**
* getDriverDesc
*
* @return string
*/
public function getDriverDesc()
{
return $this->desc;
}
/**
* getDriverExtension
*
* @return string
*/
public function getDriverExtension()
{
return $this->extension;
}
/**
* getDriverVersion
*
* @return string
*/
public function getDriverVersion()
{
return $this->version;
}
/**
* getLibLabel
*
* @return string
*/
public function getLibLabel()
{
return $this->label_lib;
}
/**
* getLibVersion
*
* @return string
*/
public function getLibVersion()
{
return $this->version_lib;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Open output file
*
* @param string $file File name to generate
* @param Translate $outputlangs Output language object
* @return int <0 if KO, >=0 if OK
*/
public function open_file($file, $outputlangs)
{
// phpcs:enable
global $user,$conf,$langs;
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO
}
dol_syslog(get_class($this)."::open_file file=".$file);
$this->file=$file;
$ret=1;
$outputlangs->load("exports");
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) {
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php';
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php';
require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php';
$this->workbook = new writeexcel_workbookbig($file);
$this->workbook->set_tempdir($conf->export->dir_temp); // Set temporary directory
$this->workbook->set_sheetname($outputlangs->trans("Sheet"));
$this->worksheet = &$this->workbook->addworksheet();
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel.php';
require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
if ($this->id == 'excel2007')
{
if (! class_exists('ZipArchive')) // For Excel2007, PHPExcel need ZipArchive
{
$langs->load("errors");
$this->error=$langs->trans('ErrorPHPNeedModule', 'zip');
return -1;
}
}
if (!empty($conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR)) {
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_discISAM;
$cacheSettings = array (
'dir' => $conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR
);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
}
$this->workbook = new PHPExcel();
$this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - '.DOL_APPLICATION_TITLE.' '.DOL_VERSION);
//$this->workbook->getProperties()->setLastModifiedBy('Dolibarr '.DOL_VERSION);
$this->workbook->getProperties()->setTitle(basename($file));
$this->workbook->getProperties()->setSubject(basename($file));
$this->workbook->getProperties()->setDescription(DOL_APPLICATION_TITLE.' '.DOL_VERSION);
$this->workbook->setActiveSheetIndex(0);
$this->workbook->getActiveSheet()->setTitle($outputlangs->trans("Sheet"));
$this->workbook->getActiveSheet()->getDefaultRowDimension()->setRowHeight(16);
}
return $ret;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Write header
*
* @param Translate $outputlangs Object lang to translate values
* @return int <0 if KO, >0 if OK
*/
public function write_header($outputlangs)
{
// phpcs:enable
//$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO
return 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Output title line into file
*
* @param array $array_export_fields_label Array with list of label of fields
* @param array $array_selected_sorted Array with list of field to export
* @param Translate $outputlangs Object lang to translate values
* @param array $array_types Array with types of fields
* @return int <0 if KO, >0 if OK
*/
public function write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types)
{
// phpcs:enable
global $conf;
// Create a format for the column headings
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO
$formatheader =$this->workbook->addformat();
$formatheader->set_bold();
$formatheader->set_color('blue');
//$formatheader->set_size(12);
//$formatheader->set_font("Courier New");
//$formatheader->set_align('center');
}
else
{
$this->workbook->getActiveSheet()->getStyle('1')->getFont()->setBold(true);
$this->workbook->getActiveSheet()->getStyle('1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
}
$this->col=0;
foreach($array_selected_sorted as $code => $value)
{
$alias=$array_export_fields_label[$code];
//print "dd".$alias;
if (empty($alias)) dol_print_error('', 'Bad value for field with code='.$code.'. Try to redefine export.');
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
$this->worksheet->write($this->row, $this->col, $outputlangs->transnoentities($alias), $formatheader);
}
else
{
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, $outputlangs->transnoentities($alias));
if (! empty($array_types[$code]) && in_array($array_types[$code], array('Date','Numeric','TextAuto'))) // Set autowidth for some types
{
$this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($this->col + 1))->setAutoSize(true);
}
}
$this->col++;
}
$this->row++;
return 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Output record line into file
*
* @param array $array_selected_sorted Array with list of field to export
* @param resource $objp A record from a fetch with all fields from select
* @param Translate $outputlangs Object lang to translate values
* @param array $array_types Array with types of fields
* @return int <0 if KO, >0 if OK
*/
public function write_record($array_selected_sorted, $objp, $outputlangs, $array_types)
{
// phpcs:enable
global $conf;
// Create a format for the column headings
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO
}
// Define first row
$this->col=0;
$reg=array();
foreach($array_selected_sorted as $code => $value)
{
if (strpos($code, ' as ') == 0) $alias=str_replace(array('.','-','(',')'), '_', $code);
else $alias=substr($code, strpos($code, ' as ') + 4);
if (empty($alias)) dol_print_error('', 'Bad value for field with code='.$code.'. Try to redefine export.');
$newvalue=$objp->$alias;
$newvalue=$this->excel_clean($newvalue);
$typefield=isset($array_types[$code])?$array_types[$code]:'';
if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7))
{
$array = unserialize($typefield);
$array = $array['options'];
$newvalue = $array[$newvalue];
}
// Traduction newvalue
if (preg_match('/^\((.*)\)$/i', $newvalue, $reg))
{
$newvalue=$outputlangs->transnoentities($reg[1]);
}
else
{
$newvalue=$outputlangs->convToOutputCharset($newvalue);
}
if (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/i', $newvalue))
{
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
$formatdate=$this->workbook->addformat();
$formatdate->set_num_format('yyyy-mm-dd');
//$formatdate->set_num_format(0x0f);
$arrayvalue=preg_split('/[.,]/', xl_parse_date($newvalue));
//print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).'<br>';
$newvalue=strval($arrayvalue[0]).'.'.strval($arrayvalue[1]); // $newvalue=strval(36892.521); directly does not work because . will be convert into , later
$this->worksheet->write($this->row, $this->col, $newvalue, PHPExcel_Shared_Date::PHPToExcel($formatdate));
}
else
{
$newvalue=dol_stringtotime($newvalue);
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, PHPExcel_Shared_Date::PHPToExcel($newvalue));
$coord=$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->getCoordinate();
$this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('yyyy-mm-dd');
}
}
elseif (preg_match('/^[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]$/i', $newvalue))
{
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
$formatdatehour=$this->workbook->addformat();
$formatdatehour->set_num_format('yyyy-mm-dd hh:mm:ss');
//$formatdatehour->set_num_format(0x0f);
$arrayvalue=preg_split('/[.,]/', xl_parse_date($newvalue));
//print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).'<br>';
$newvalue=strval($arrayvalue[0]).'.'.strval($arrayvalue[1]); // $newvalue=strval(36892.521); directly does not work because . will be convert into , later
$this->worksheet->write($this->row, $this->col, $newvalue, $formatdatehour);
}
else
{
$newvalue=dol_stringtotime($newvalue);
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, PHPExcel_Shared_Date::PHPToExcel($newvalue));
$coord=$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->getCoordinate();
$this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('yyyy-mm-dd h:mm:ss');
}
}
else
{
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
$this->worksheet->write($this->row, $this->col, $newvalue);
}
else
{
if ($typefield == 'Text' || $typefield == 'TextAuto')
{
//$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->setValueExplicit($newvalue, PHPExcel_Cell_DataType::TYPE_STRING);
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, (string) $newvalue);
$coord=$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->getCoordinate();
$this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@');
$this->workbook->getActiveSheet()->getStyle($coord)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
}
else
{
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, $newvalue);
}
}
}
$this->col++;
}
$this->row++;
return 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Write footer
*
* @param Translate $outputlangs Output language object
* @return int <0 if KO, >0 if OK
*/
public function write_footer($outputlangs)
{
// phpcs:enable
return 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Close Excel file
*
* @return int <0 if KO, >0 if OK
*/
public function close_file()
{
// phpcs:enable
global $conf;
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
$this->workbook->close();
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel/Writer/Excel5.php';
$objWriter = new PHPExcel_Writer_Excel5($this->workbook);
$objWriter->save($this->file);
$this->workbook->disconnectWorksheets();
unset($this->workbook);
}
return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Clean a cell to respect rules of Excel file cells
*
* @param string $newvalue String to clean
* @return string Value cleaned
*/
public function excel_clean($newvalue)
{
// phpcs:enable
// Rule Dolibarr: No HTML
$newvalue=dol_string_nohtmltag($newvalue);
return $newvalue;
}
/**
* Convert a column to letter (1->A, 0->B, 27->AA, ...)
*
* @param int $c Column position
* @return string Letter
*/
public function column2Letter($c)
{
$c = intval($c);
$letter = '';
if ($c <= 0) {
return '';
}
while ($c != 0) {
$p = ($c - 1) % 26;
$c = intval(($c - $p) / 26);
$letter = chr(65 + $p) . $letter;
}
return $letter;
}
}

View File

@ -1,135 +0,0 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.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 <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/modules/export/export_excel2007.modules.php
* \ingroup export
* \brief File of class to generate export file with Excel format
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/export/export_excel.modules.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
/**
* Class to build export files with Excel format
*/
class ExportExcel2007 extends ExportExcel
{
/**
* @var string ID
*/
public $id;
/**
* @var string label
*/
public $label;
public $extension;
/**
* Dolibarr version of the loaded document
* @var string
*/
public $version = 'dolibarr';
public $label_lib;
public $version_lib;
public $workbook; // Handle fichier
public $worksheet; // Handle onglet
public $row;
public $col;
public $file; // To save filename
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct($db)
{
global $conf, $langs;
$this->db = $db;
$this->id='excel2007'; // Same value then xxx in file name export_xxx.modules.php
$this->label='Excel 2007 (old library)'; // Label of driver
$this->desc = $langs->trans('Excel2007FormatDesc');
$this->extension='xlsx'; // Extension for generated file by this driver
$this->picto='mime/xls'; // Picto
$this->version='1.30'; // Driver version
$this->disabled = (in_array(constant('PHPEXCEL_PATH'), array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
if (empty($this->disabled))
{
// If driver use an external library, put its name here
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_workbookbig.inc.php';
require_once PHP_WRITEEXCEL_PATH.'class.writeexcel_worksheet.inc.php';
require_once PHP_WRITEEXCEL_PATH.'functions.writeexcel_utility.inc.php';
$this->label_lib='PhpWriteExcel';
$this->version_lib='unknown';
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel.php';
require_once PHPEXCEL_PATH.'PHPExcel/Style/Alignment.php';
$this->label_lib='PhpExcel';
$this->version_lib='1.8.0'; // No way to get info from library
}
}
$this->row=0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Close Excel file
*
* @return int <0 if KO, >0 if OK
*/
public function close_file()
{
// phpcs:enable
global $conf;
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
{
$this->workbook->close();
}
else
{
require_once PHPEXCEL_PATH.'PHPExcel/Writer/Excel5.php';
$objWriter = new PHPExcel_Writer_Excel2007($this->workbook);
$objWriter->save($this->file);
$this->workbook->disconnectWorksheets();
unset($this->workbook);
}
return 1;
}
}

View File

@ -219,7 +219,8 @@ class modAgenda extends DolibarrModules
); );
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=0', $this->menu[$r]=array(
'fk_menu'=>'r=0',
'type'=>'left', 'type'=>'left',
'titre'=>'Actions', 'titre'=>'Actions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -229,9 +230,11 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->myactions->read', 'perms'=>'$user->rights->agenda->myactions->read',
'enabled'=>'$conf->agenda->enabled', 'enabled'=>'$conf->agenda->enabled',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2,
);
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=1', $this->menu[$r]=array(
'fk_menu'=>'r=1',
'type'=>'left', 'type'=>'left',
'titre'=>'NewAction', 'titre'=>'NewAction',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -241,10 +244,12 @@ class modAgenda extends DolibarrModules
'perms'=>'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)', 'perms'=>'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)',
'enabled'=>'$conf->agenda->enabled', 'enabled'=>'$conf->agenda->enabled',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++; $r++;
// Calendar // Calendar
$this->menu[$r]=array('fk_menu'=>'r=1', $this->menu[$r]=array(
'fk_menu'=>'r=1',
'type'=>'left', 'type'=>'left',
'titre'=>'Calendar', 'titre'=>'Calendar',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -254,9 +259,11 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->myactions->read', 'perms'=>'$user->rights->agenda->myactions->read',
'enabled'=>'$conf->agenda->enabled', 'enabled'=>'$conf->agenda->enabled',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=3', $this->menu[$r]=array(
'fk_menu'=>'r=3',
'type'=>'left', 'type'=>'left',
'titre'=>'MenuToDoMyActions', 'titre'=>'MenuToDoMyActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -266,9 +273,11 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->myactions->read', 'perms'=>'$user->rights->agenda->myactions->read',
'enabled'=>'$conf->agenda->enabled', 'enabled'=>'$conf->agenda->enabled',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=3', $this->menu[$r]=array(
'fk_menu'=>'r=3',
'type'=>'left', 'type'=>'left',
'titre'=>'MenuDoneMyActions', 'titre'=>'MenuDoneMyActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -278,9 +287,11 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->myactions->read', 'perms'=>'$user->rights->agenda->myactions->read',
'enabled'=>'$conf->agenda->enabled', 'enabled'=>'$conf->agenda->enabled',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=3', $this->menu[$r]=array(
'fk_menu'=>'r=3',
'type'=>'left', 'type'=>'left',
'titre'=>'MenuToDoActions', 'titre'=>'MenuToDoActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -290,9 +301,11 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->allactions->read', 'perms'=>'$user->rights->agenda->allactions->read',
'enabled'=>'$user->rights->agenda->allactions->read', 'enabled'=>'$user->rights->agenda->allactions->read',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=3', $this->menu[$r]=array(
'fk_menu'=>'r=3',
'type'=>'left', 'type'=>'left',
'titre'=>'MenuDoneActions', 'titre'=>'MenuDoneActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -302,11 +315,13 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->allactions->read', 'perms'=>'$user->rights->agenda->allactions->read',
'enabled'=>'$user->rights->agenda->allactions->read', 'enabled'=>'$user->rights->agenda->allactions->read',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
// List // List
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=1', $this->menu[$r]=array(
'fk_menu'=>'r=1',
'type'=>'left', 'type'=>'left',
'titre'=>'List', 'titre'=>'List',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -316,9 +331,11 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->myactions->read', 'perms'=>'$user->rights->agenda->myactions->read',
'enabled'=>'$conf->agenda->enabled', 'enabled'=>'$conf->agenda->enabled',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=8', $this->menu[$r]=array(
'fk_menu'=>'r=8',
'type'=>'left', 'type'=>'left',
'titre'=>'MenuToDoMyActions', 'titre'=>'MenuToDoMyActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -328,9 +345,11 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->myactions->read', 'perms'=>'$user->rights->agenda->myactions->read',
'enabled'=>'$conf->agenda->enabled', 'enabled'=>'$conf->agenda->enabled',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=8', $this->menu[$r]=array(
'fk_menu'=>'r=8',
'type'=>'left', 'type'=>'left',
'titre'=>'MenuDoneMyActions', 'titre'=>'MenuDoneMyActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -340,9 +359,11 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->myactions->read', 'perms'=>'$user->rights->agenda->myactions->read',
'enabled'=>'$conf->agenda->enabled', 'enabled'=>'$conf->agenda->enabled',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=8', $this->menu[$r]=array(
'fk_menu'=>'r=8',
'type'=>'left', 'type'=>'left',
'titre'=>'MenuToDoActions', 'titre'=>'MenuToDoActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -352,9 +373,11 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->allactions->read', 'perms'=>'$user->rights->agenda->allactions->read',
'enabled'=>'$user->rights->agenda->allactions->read', 'enabled'=>'$user->rights->agenda->allactions->read',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++; $r++;
$this->menu[$r]=array('fk_menu'=>'r=8', $this->menu[$r]=array(
'fk_menu'=>'r=8',
'type'=>'left', 'type'=>'left',
'titre'=>'MenuDoneActions', 'titre'=>'MenuDoneActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -364,10 +387,12 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->allactions->read', 'perms'=>'$user->rights->agenda->allactions->read',
'enabled'=>'$user->rights->agenda->allactions->read', 'enabled'=>'$user->rights->agenda->allactions->read',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++; $r++;
// Reports // Reports
$this->menu[$r]=array('fk_menu'=>'r=1', $this->menu[$r]=array(
'fk_menu'=>'r=1',
'type'=>'left', 'type'=>'left',
'titre'=>'Reportings', 'titre'=>'Reportings',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
@ -377,7 +402,23 @@ class modAgenda extends DolibarrModules
'perms'=>'$user->rights->agenda->allactions->read', 'perms'=>'$user->rights->agenda->allactions->read',
'enabled'=>'$conf->agenda->enabled', 'enabled'=>'$conf->agenda->enabled',
'target'=>'', 'target'=>'',
'user'=>2); 'user'=>2
);
$r++;
// Categories
$this->menu[$r]=array(
'fk_menu' => 'r=1',
'type' => 'left',
'titre' => 'Categories',
'mainmenu' => 'agenda',
'url'=>'/categories/index.php?mainmenu=agenda&amp;leftmenu=agenda&type=10',
'langs' => 'agenda',
'position' => 170,
'perms' => '$user->rights->agenda->allactions->read',
'enabled' => '$conf->categorie->enabled&&$conf->categorie->enabled',
'target' => '',
'user' => 2
);
$r++; $r++;

View File

@ -185,7 +185,7 @@ class modCategorie extends DolibarrModules
$this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories $this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories
// Add extra fields // Add extra fields
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe'"; $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example) if ($resql) // This can fail when class is used on old database (during migration for example)
{ {
@ -350,7 +350,7 @@ class modCategorie extends DolibarrModules
); // We define here only fields that use another picto ); // We define here only fields that use another picto
// Add extra fields // Add extra fields
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople'"; $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example) if ($resql) // This can fail when class is used on old database (during migration for example)
{ {

View File

@ -65,8 +65,8 @@ class modExpedition extends DolibarrModules
"/expedition/sending/temp", "/expedition/sending/temp",
"/expedition/receipt", "/expedition/receipt",
"/expedition/receipt/temp", "/expedition/receipt/temp",
"/doctemplates/shipment", "/doctemplates/shipments",
"/doctemplates/delivery" "/doctemplates/deliveries"
); );
// Config pages // Config pages
@ -98,7 +98,7 @@ class modExpedition extends DolibarrModules
$this->const[$r][0] = "EXPEDITION_ADDON_PDF_ODT_PATH"; $this->const[$r][0] = "EXPEDITION_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/shipment"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/shipments";
$this->const[$r][3] = ""; $this->const[$r][3] = "";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
@ -119,7 +119,7 @@ class modExpedition extends DolibarrModules
$this->const[$r][0] = "LIVRAISON_ADDON_PDF_ODT_PATH"; $this->const[$r][0] = "LIVRAISON_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/delivery"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/deliveries";
$this->const[$r][3] = ""; $this->const[$r][3] = "";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
@ -127,7 +127,7 @@ class modExpedition extends DolibarrModules
$this->const[$r][0] = "MAIN_SUBMODULE_EXPEDITION"; $this->const[$r][0] = "MAIN_SUBMODULE_EXPEDITION";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "1"; $this->const[$r][2] = "1";
$this->const[$r][3] = "Enable shipments"; $this->const[$r][3] = "Enable delivery receipts";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
@ -326,8 +326,8 @@ class modExpedition extends DolibarrModules
$this->remove($options); $this->remove($options);
//ODT template //ODT template
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/shipment/template_shipment.odt'; $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/shipments/template_shipment.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/shipment'; $dirodt = DOL_DATA_ROOT.'/doctemplates/shipments';
$dest = $dirodt.'/template_shipment.odt'; $dest = $dirodt.'/template_shipment.odt';
if (file_exists($src) && !file_exists($dest)) if (file_exists($src) && !file_exists($dest))

View File

@ -320,7 +320,7 @@ class modFournisseur extends DolibarrModules
); );
$this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
// Add extra fields object // Add extra fields object
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn'"; $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example) if ($resql) // This can fail when class is used on old database (during migration for example)
{ {
@ -357,7 +357,7 @@ class modFournisseur extends DolibarrModules
} }
// End add extra fields // End add extra fields
// Add extra fields line // Add extra fields line
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn_det'"; $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn_det' AND entity IN (0, ".$conf->entity.")";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example) if ($resql) // This can fail when class is used on old database (during migration for example)
{ {
@ -440,7 +440,7 @@ class modFournisseur extends DolibarrModules
'p.datep'=>'payment','p.num_paiement'=>'payment','project.rowid'=>'project','project.ref'=>'project','project.title'=>'project'); 'p.datep'=>'payment','p.num_paiement'=>'payment','project.rowid'=>'project','project.ref'=>'project','project.title'=>'project');
$this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
// Add extra fields object // Add extra fields object
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn'"; $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example) if ($resql) // This can fail when class is used on old database (during migration for example)
{ {
@ -527,7 +527,7 @@ class modFournisseur extends DolibarrModules
); );
$this->export_dependencies_array[$r]=array('order_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('order_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
// Add extra fields object // Add extra fields object
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseur'"; $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseur' AND entity IN (0, ".$conf->entity.")";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example) if ($resql) // This can fail when class is used on old database (during migration for example)
{ {
@ -565,7 +565,7 @@ class modFournisseur extends DolibarrModules
} }
// End add extra fields object // End add extra fields object
// Add extra fields line // Add extra fields line
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseurdet'"; $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseurdet' AND entity IN (0, ".$conf->entity.")";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example) if ($resql) // This can fail when class is used on old database (during migration for example)
{ {

View File

@ -449,7 +449,7 @@ class modSociete extends DolibarrModules
's.multicurrency_code' => 'MulticurrencyCurrency' 's.multicurrency_code' => 'MulticurrencyCurrency'
); );
// 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 IN (0, ".$conf->entity.")";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example) if ($resql) // This can fail when class is used on old database (during migration for example)
{ {
@ -597,7 +597,7 @@ class modSociete extends DolibarrModules
's.note_public' => "NotePublic" 's.note_public' => "NotePublic"
); );
// Add extra fields // Add extra fields
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople' AND entity = ".$conf->entity; $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) // This can fail when class is used on an old database (during a migration for example) if ($resql) // This can fail when class is used on an old database (during a migration for example)
{ {

View File

@ -93,7 +93,7 @@ class modSupplierProposal extends DolibarrModules
$this->const[$r][0] = "SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH"; $this->const[$r][0] = "SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_proposal"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_proposals";
$this->const[$r][3] = ""; $this->const[$r][3] = "";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
@ -215,8 +215,8 @@ class modSupplierProposal extends DolibarrModules
$this->remove($options); $this->remove($options);
//ODT template //ODT template
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_proposal/template_supplier_proposal.odt'; $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_proposals/template_supplier_proposal.odt';
$dirodt=DOL_DATA_ROOT.'/doctemplates/supplier_proposal'; $dirodt=DOL_DATA_ROOT.'/doctemplates/supplier_proposals';
$dest=$dirodt.'/template_supplier_proposal.odt'; $dest=$dirodt.'/template_supplier_proposal.odt';
if (file_exists($src) && ! file_exists($dest)) if (file_exists($src) && ! file_exists($dest))

View File

@ -233,7 +233,7 @@ class modUser extends DolibarrModules
'u.fk_socpeople'=>"IdContact",'u.fk_soc'=>"IdCompany",'u.fk_member'=>"MemberId" 'u.fk_socpeople'=>"IdContact",'u.fk_soc'=>"IdCompany",'u.fk_member'=>"MemberId"
); );
$this->export_TypeFields_array[$r]=array( $this->export_TypeFields_array[$r]=array(
'u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.employee'=>'Boolean','u.job'=>'Text', 'u.rowid'=>'Numeric', 'u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.employee'=>'Boolean','u.job'=>'Text',
'u.accountancy_code'=>'Text', 'u.accountancy_code'=>'Text',
'u.address'=>"Text",'u.zip'=>"Text",'u.town'=>"Text", 'u.address'=>"Text",'u.zip'=>"Text",'u.town'=>"Text",
'u.office_phone'=>'Text','u.user_mobile'=>'Text','u.office_fax'=>'Text', 'u.office_phone'=>'Text','u.user_mobile'=>'Text','u.office_fax'=>'Text',

View File

@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefo
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.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/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.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';

View File

@ -59,6 +59,10 @@ $search_state = trim(GETPOST("search_state"));
$search_country = GETPOST("search_country", 'int'); $search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$search_billed = GETPOST("search_billed", 'int'); $search_billed = GETPOST("search_billed", 'int');
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
$search_datereceipt_start = dol_mktime(0, 0, 0, GETPOST('search_datereceipt_startmonth', 'int'), GETPOST('search_datereceipt_startday', 'int'), GETPOST('search_datereceipt_startyear', 'int'));
$search_datereceipt_end = dol_mktime(23, 59, 59, GETPOST('search_datereceipt_endmonth', 'int'), GETPOST('search_datereceipt_endday', 'int'), GETPOST('search_datereceipt_endyear', 'int'));
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$optioncss = GETPOST('optioncss', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha');
@ -156,6 +160,10 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_country = ''; $search_country = '';
$search_type_thirdparty = ''; $search_type_thirdparty = '';
$search_billed = ''; $search_billed = '';
$search_datedelivery_start = '';
$search_datedelivery_end = '';
$search_datereceipt_start = '';
$search_datereceipt_end = '';
$viewstatut = ''; $viewstatut = '';
$toselect = ''; $toselect = '';
$search_array_options = array(); $search_array_options = array();
@ -234,6 +242,10 @@ if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdp
if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp); if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv); if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv);
if ($search_company) $sql .= natural_search('s.nom', $search_company); if ($search_company) $sql .= natural_search('s.nom', $search_company);
if ($search_datedelivery_start) $sql .= " AND e.date_delivery >= '" . $db->idate($search_datedelivery_start) . "'";
if ($search_datedelivery_end) $sql .= " AND e.date_delivery <= '" . $db->idate($search_datedelivery_end) . "'";
if ($search_datereceipt_start) $sql .= " AND l.date_delivery >= '" . $db->idate($search_datereceipt_start) . "'";
if ($search_datereceipt_end) $sql .= " AND l.date_delivery <= '" . $db->idate($search_datereceipt_end) . "'";
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
// Add where from extra fields // Add where from extra fields
@ -280,6 +292,10 @@ if ($resql)
if ($search_company) $param .= "&amp;search_company=".urlencode($search_company); if ($search_company) $param .= "&amp;search_company=".urlencode($search_company);
if ($search_town) $param .= '&search_town='.urlencode($search_town); if ($search_town) $param .= '&search_town='.urlencode($search_town);
if ($search_zip) $param .= '&search_zip='.urlencode($search_zip); if ($search_zip) $param .= '&search_zip='.urlencode($search_zip);
if ($search_datedelivery_start) $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start);
if ($search_datedelivery_end) $param .= '&search_datedelivery_end='.urlencode($search_datedelivery_end);
if ($search_datereceipt_start) $param .= '&search_datereceipt_start='.urlencode($search_datereceipt_start);
if ($search_datereceipt_end) $param .= '&search_datereceipt_end='.urlencode($search_datereceipt_end);
if ($viewstatut != '') $param .= '&viewstatut='.urlencode($viewstatut); if ($viewstatut != '') $param .= '&viewstatut='.urlencode($viewstatut);
if ($optioncss != '') $param .= '&amp;optioncss='.urlencode($optioncss); if ($optioncss != '') $param .= '&amp;optioncss='.urlencode($optioncss);
// Add $param from extra fields // Add $param from extra fields
@ -391,7 +407,16 @@ if ($resql)
// Date delivery planned // Date delivery planned
if (!empty($arrayfields['e.date_delivery']['checked'])) if (!empty($arrayfields['e.date_delivery']['checked']))
{ {
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->selectDate($search_delivery_start?$search_delivery_start:-1, 'search_delivery_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_delivery_end?$search_delivery_end:-1, 'search_delivery_end', 0, 0, 1);
print '</div>';
print '</td>';
} }
if (!empty($arrayfields['l.ref']['checked'])) if (!empty($arrayfields['l.ref']['checked']))
{ {
@ -403,7 +428,16 @@ if ($resql)
if (!empty($arrayfields['l.date_delivery']['checked'])) if (!empty($arrayfields['l.date_delivery']['checked']))
{ {
// Date received // Date received
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->selectDate($search_receipt_start?$search_receipt_start:-1, 'search_receipt_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_receipt_end?$search_receipt_end:-1, 'search_receipt_end', 0, 0, 1);
print '</div>';
print '</td>';
} }
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';

View File

@ -52,10 +52,10 @@ class Export
public $array_export_help=array(); // array with tooltip help for fields public $array_export_help=array(); // array with tooltip help for fields
// To store export modules // To store export modules
public $hexa; public $hexa; // List of fields in the export profile
public $hexafiltervalue; public $hexafiltervalue; // List of search criteria in the export profile
public $datatoexport; public $datatoexport;
public $model_name; public $model_name; // Name of export profile
public $sqlusedforexport; public $sqlusedforexport;

View File

@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (!empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if (!empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
// Load translation files required by page // Load translation files required by page
$langs->loadLangs(array( $langs->loadLangs(array(
@ -312,7 +313,7 @@ if ($object->id > 0)
$langs->load("categories"); $langs->load("categories");
print '<tr><td>'.$langs->trans("SuppliersCategoriesShort").'</td>'; print '<tr><td>'.$langs->trans("SuppliersCategoriesShort").'</td>';
print '<td>'; print '<td>';
print $form->showCategories($object->id, 'supplier', 1); print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER, 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -700,9 +700,10 @@ class CommandeFournisseur extends CommonOrder
* @param string $option On what the link points * @param string $option On what the link points
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $addlinktonotes Add link to show notes
* @return string Chain with URL * @return string Chain with URL
*/ */
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
{ {
global $langs, $conf; global $langs, $conf;
@ -751,6 +752,22 @@ class CommandeFournisseur extends CommonOrder
if ($withpicto != 2) $result .= $this->ref; if ($withpicto != 2) $result .= $this->ref;
$result .= $linkend; $result .= $linkend;
if ($addlinktonotes)
{
$txttoshow = ($user->socid > 0 ? $this->note_public : $this->note_private);
if ($txttoshow)
{
$notetoshow = $langs->trans("ViewPrivateNote").':<br>'.dol_string_nohtmltag($txttoshow, 1);
$result .= ' <span class="note inline-block">';
$result .= '<a href="'.DOL_URL_ROOT.'/fourn/commande/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">';
$result .= img_picto('', 'note');
$result .= '</a>';
//$result.=img_picto($langs->trans("ViewNote"),'object_generic');
//$result.='</a>';
$result .= '</span>';
}
}
return $result; return $result;
} }

View File

@ -2248,9 +2248,10 @@ class FactureFournisseur extends CommonInvoice
* @param string $moretitle Add more text to title tooltip * @param string $moretitle Add more text to title tooltip
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $addlinktonotes Add link to show notes
* @return string String with URL * @return string String with URL
*/ */
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
{ {
global $langs, $conf; global $langs, $conf;
@ -2318,6 +2319,22 @@ class FactureFournisseur extends CommonInvoice
if ($withpicto != 2) $result.= ($max?dol_trunc($ref, $max):$ref); if ($withpicto != 2) $result.= ($max?dol_trunc($ref, $max):$ref);
$result .= $linkend; $result .= $linkend;
if ($addlinktonotes)
{
$txttoshow = ($user->socid > 0 ? $this->note_public : $this->note_private);
if ($txttoshow)
{
$notetoshow = $langs->trans("ViewPrivateNote").':<br>'.dol_string_nohtmltag($txttoshow, 1);
$result .= ' <span class="note inline-block">';
$result .= '<a href="'.DOL_URL_ROOT.'/fourn/facture/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">';
$result .= img_picto('', 'note');
$result .= '</a>';
//$result.=img_picto($langs->trans("ViewNote"),'object_generic');
//$result.='</a>';
$result .= '</span>';
}
}
return $result; return $result;
} }

View File

@ -486,6 +486,7 @@ $sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= " cf.rowid, cf.ref, cf.ref_supplier, cf.fk_statut, cf.billed, cf.total_ht, cf.tva as total_tva, cf.total_ttc, cf.fk_user_author, cf.date_commande as date_commande, cf.date_livraison as date_delivery,"; $sql .= " cf.rowid, cf.ref, cf.ref_supplier, cf.fk_statut, cf.billed, cf.total_ht, cf.tva as total_tva, cf.total_ttc, cf.fk_user_author, cf.date_commande as date_commande, cf.date_livraison as date_delivery,";
$sql .= ' cf.date_creation as date_creation, cf.tms as date_update,'; $sql .= ' cf.date_creation as date_creation, cf.tms as date_update,';
$sql .= ' cf.note_public, cf.note_private,';
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_title,"; $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_title,";
$sql .= " u.firstname, u.lastname, u.photo, u.login, u.email as user_email"; $sql .= " u.firstname, u.lastname, u.photo, u.login, u.email as user_email";
// Add fields from extrafields // Add fields from extrafields
@ -936,6 +937,8 @@ if ($resql)
$objectstatic->total_tva = $obj->total_tva; $objectstatic->total_tva = $obj->total_tva;
$objectstatic->total_ttc = $obj->total_ttc; $objectstatic->total_ttc = $obj->total_ttc;
$objectstatic->date_delivery = $db->jdate($obj->date_delivery); $objectstatic->date_delivery = $db->jdate($obj->date_delivery);
$objectstatic->note_public = $obj->note_public;
$objectstatic->note_private = $obj->note_private;
$objectstatic->statut = $obj->fk_statut; $objectstatic->statut = $obj->fk_statut;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -946,7 +949,7 @@ if ($resql)
print '<td class="nowrap">'; print '<td class="nowrap">';
// Picto + Ref // Picto + Ref
print $objectstatic->getNomUrl(1); print $objectstatic->getNomUrl(1, '', 0, -1, 1);
// Other picto tool // Other picto tool
$filename = dol_sanitizeFileName($obj->ref); $filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->fournisseur->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref); $filedir = $conf->fournisseur->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);

View File

@ -269,6 +269,7 @@ if ($search_all || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql .= " f.rowid as facid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement as datelimite, f.fk_mode_reglement,"; $sql .= " f.rowid as facid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement as datelimite, f.fk_mode_reglement,";
$sql .= " f.total_ht, f.total_ttc, f.total_tva as total_vat, f.paye as paye, f.fk_statut as fk_statut, f.libelle as label, f.datec as date_creation, f.tms as date_update,"; $sql .= " f.total_ht, f.total_ttc, f.total_tva as total_vat, f.paye as paye, f.fk_statut as fk_statut, f.libelle as label, f.datec as date_creation, f.tms as date_update,";
$sql .= " f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,"; $sql .= " f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,";
$sql .= " f.note_public, f.note_private,";
$sql .= " s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,"; $sql .= " s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,";
$sql .= " typent.code as typent_code,"; $sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " state.code_departement as state_code, state.nom as state_name,";
@ -371,6 +372,7 @@ if (!$search_all)
$sql .= " GROUP BY f.rowid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement, f.fk_mode_reglement,"; $sql .= " GROUP BY f.rowid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement, f.fk_mode_reglement,";
$sql .= " f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut, f.libelle, f.datec, f.tms,"; $sql .= " f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut, f.libelle, f.datec, f.tms,";
$sql .= " f.localtax1, f.localtax2,"; $sql .= " f.localtax1, f.localtax2,";
$sql .= " f.note_public, f.note_private,";
$sql .= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; $sql .= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,';
$sql .= " typent.code,"; $sql .= " typent.code,";
$sql .= " state.code_departement, state.nom,"; $sql .= " state.code_departement, state.nom,";
@ -827,7 +829,8 @@ if ($resql)
$facturestatic->ref_supplier = $obj->ref_supplier; $facturestatic->ref_supplier = $obj->ref_supplier;
$facturestatic->date_echeance = $db->jdate($obj->datelimite); $facturestatic->date_echeance = $db->jdate($obj->datelimite);
$facturestatic->statut = $obj->fk_statut; $facturestatic->statut = $obj->fk_statut;
$facturestatic->note_public = $obj->note_public;
$facturestatic->note_private = $obj->note_private;
$thirdparty->id = $obj->socid; $thirdparty->id = $obj->socid;
$thirdparty->name = $obj->name; $thirdparty->name = $obj->name;
@ -861,13 +864,8 @@ if ($resql)
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref // Picto + Ref
print '<td class="nobordernopadding nowrap">'; print '<td class="nobordernopadding nowrap">';
print $facturestatic->getNomUrl(1); print $facturestatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
print '</td>';
// Warning
//print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
//print '</td>';
// Other picto tool
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
$filename = dol_sanitizeFileName($obj->ref); $filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref); $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref);
$subdir = get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref); $subdir = get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref);

View File

@ -138,7 +138,7 @@ if ($object->id > 0)
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'; print '<table class="border centpercent tableforfield">';
// Type // Type
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td>';

View File

@ -1278,9 +1278,17 @@ else
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
// Nb of days // Nb of days
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans('NbUseDaysCP').'</td>'; print '<td class="nowrap">';
$htmlhelp = $langs->trans('NbUseDaysCPHelp');
$includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1);
$includesunday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY : 1);
if ($includesaturday) $htmlhelp.='<br>'.$langs->trans("DayIsANonWorkingDay", $langs->trans("Saturday"));
if ($includesunday) $htmlhelp.='<br>'.$langs->trans("DayIsANonWorkingDay", $langs->trans("Sunday"));
print $form->textwithpicto($langs->trans('NbUseDaysCP'), $htmlhelp);
print '</td>';
print '<td>'.num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday).'</td>'; print '<td>'.num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday).'</td>';
print '</tr>'; print '</tr>';

View File

@ -186,6 +186,16 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
} }
} }
if (!class_exists('ZipArchive'))
{
$langs->load("errors");
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."<br>\n";
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
}
else
{
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupport", "ZIP")."<br>\n";
}
// Check memory // Check memory
$memrequiredorig = '64M'; $memrequiredorig = '64M';

View File

@ -45,25 +45,16 @@ insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1,
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 6,'97601',3,'Mayotte'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 6,'97601',3,'Mayotte');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 11,'75056',1,'Île-de-France'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 11,'75056',1,'Île-de-France');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 21,'51108',0,'Champagne-Ardenne'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 24,'45234',2,'Centre-Val de Loire');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 22,'80021',0,'Picardie'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 27,'21231',0,'Bourgogne-Franche-Comté');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 23,'76540',0,'Haute-Normandie'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 28,'76540',0,'Normandie');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 24,'45234',2,'Centre'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 32,'59350',4,'Hauts-de-France');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 25,'14118',0,'Basse-Normandie'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 44,'67482',2,'Grand Est');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 26,'21231',0,'Bourgogne');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 31,'59350',2,'Nord-Pas-de-Calais');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 41,'57463',0,'Lorraine');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 42,'67482',1,'Alsace');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 43,'25056',0,'Franche-Comté');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 52,'44109',4,'Pays de la Loire'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 52,'44109',4,'Pays de la Loire');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 53,'35238',0,'Bretagne'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 53,'35238',0,'Bretagne');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 54,'86194',2,'Poitou-Charentes'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 75,'33063',0,'Nouvelle-Aquitaine');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 72,'33063',1,'Aquitaine'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 76,'31355',1,'Occitanie');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 73,'31555',0,'Midi-Pyrénées'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 84,'69123',1,'Auvergne-Rhône-Alpes');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 74,'87085',2,'Limousin');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 82,'69123',2,'Rhône-Alpes');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 83,'63113',1,'Auvergne');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 91,'34172',2,'Languedoc-Roussillon');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 93,'13055',0,'Provence-Alpes-Côte d''Azur'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 93,'13055',0,'Provence-Alpes-Côte d''Azur');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 94,'2A004',0,'Corse'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 94,'2A004',0,'Corse');

View File

@ -42,97 +42,97 @@ insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,no
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 4,'974','97411',3,'REUNION','Réunion'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 4,'974','97411',3,'REUNION','Réunion');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 6,'976','97601',3,'MAYOTTE','Mayotte'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 6,'976','97601',3,'MAYOTTE','Mayotte');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (82,'01','01053',5,'AIN','Ain'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'01','01053',5,'AIN','Ain');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (22,'02','02408',5,'AISNE','Aisne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (32,'02','02408',5,'AISNE','Aisne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (83,'03','03190',5,'ALLIER','Allier'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'03','03190',5,'ALLIER','Allier');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'04','04070',4,'ALPES-DE-HAUTE-PROVENCE','Alpes-de-Haute-Provence'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'04','04070',4,'ALPES-DE-HAUTE-PROVENCE','Alpes-de-Haute-Provence');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'05','05061',4,'HAUTES-ALPES','Hautes-Alpes'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'05','05061',4,'HAUTES-ALPES','Hautes-Alpes');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'06','06088',4,'ALPES-MARITIMES','Alpes-Maritimes'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'06','06088',4,'ALPES-MARITIMES','Alpes-Maritimes');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (82,'07','07186',5,'ARDECHE','Ardèche'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'07','07186',5,'ARDECHE','Ardèche');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (21,'08','08105',4,'ARDENNES','Ardennes'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (44,'08','08105',4,'ARDENNES','Ardennes');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (73,'09','09122',5,'ARIEGE','Ariège'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'09','09122',5,'ARIEGE','Ariège');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (21,'10','10387',5,'AUBE','Aube'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (44,'10','10387',5,'AUBE','Aube');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (91,'11','11069',5,'AUDE','Aude'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'11','11069',5,'AUDE','Aude');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (73,'12','12202',5,'AVEYRON','Aveyron'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'12','12202',5,'AVEYRON','Aveyron');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'13','13055',4,'BOUCHES-DU-RHONE','Bouches-du-Rhône'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'13','13055',4,'BOUCHES-DU-RHONE','Bouches-du-Rhône');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (25,'14','14118',2,'CALVADOS','Calvados'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (28,'14','14118',2,'CALVADOS','Calvados');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (83,'15','15014',2,'CANTAL','Cantal'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'15','15014',2,'CANTAL','Cantal');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (54,'16','16015',3,'CHARENTE','Charente'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'16','16015',3,'CHARENTE','Charente');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (54,'17','17300',3,'CHARENTE-MARITIME','Charente-Maritime'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'17','17300',3,'CHARENTE-MARITIME','Charente-Maritime');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'18','18033',2,'CHER','Cher'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'18','18033',2,'CHER','Cher');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (74,'19','19272',3,'CORREZE','Corrèze'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'19','19272',3,'CORREZE','Corrèze');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (94,'2A','2A004',3,'CORSE-DU-SUD','Corse-du-Sud'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (94,'2A','2A004',3,'CORSE-DU-SUD','Corse-du-Sud');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (94,'2B','2B033',3,'HAUTE-CORSE','Haute-Corse'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (94,'2B','2B033',3,'HAUTE-CORSE','Haute-Corse');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (26,'21','21231',3,'COTE-D OR','Côte-d Or'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (27,'21','21231',3,'COTE-D OR','Côte-d Or');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (53,'22','22278',4,'COTES-D ARMOR','Côtes-d Armor'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (53,'22','22278',4,'COTES-D ARMOR','Côtes-d Armor');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (74,'23','23096',3,'CREUSE','Creuse'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'23','23096',3,'CREUSE','Creuse');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (72,'24','24322',3,'DORDOGNE','Dordogne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'24','24322',3,'DORDOGNE','Dordogne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (43,'25','25056',2,'DOUBS','Doubs'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (27,'25','25056',2,'DOUBS','Doubs');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (82,'26','26362',3,'DROME','Drôme'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'26','26362',3,'DROME','Drôme');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (23,'27','27229',5,'EURE','Eure'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (28,'27','27229',5,'EURE','Eure');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'28','28085',1,'EURE-ET-LOIR','Eure-et-Loir'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'28','28085',1,'EURE-ET-LOIR','Eure-et-Loir');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (53,'29','29232',2,'FINISTERE','Finistère'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (53,'29','29232',2,'FINISTERE','Finistère');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (91,'30','30189',2,'GARD','Gard'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'30','30189',2,'GARD','Gard');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (73,'31','31555',3,'HAUTE-GARONNE','Haute-Garonne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'31','31555',3,'HAUTE-GARONNE','Haute-Garonne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (73,'32','32013',2,'GERS','Gers'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'32','32013',2,'GERS','Gers');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (72,'33','33063',3,'GIRONDE','Gironde'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'33','33063',3,'GIRONDE','Gironde');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (91,'34','34172',5,'HERAULT','Hérault'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'34','34172',5,'HERAULT','Hérault');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (53,'35','35238',1,'ILLE-ET-VILAINE','Ille-et-Vilaine'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (53,'35','35238',1,'ILLE-ET-VILAINE','Ille-et-Vilaine');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'36','36044',5,'INDRE','Indre'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'36','36044',5,'INDRE','Indre');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'37','37261',1,'INDRE-ET-LOIRE','Indre-et-Loire'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'37','37261',1,'INDRE-ET-LOIRE','Indre-et-Loire');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (82,'38','38185',5,'ISERE','Isère'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'38','38185',5,'ISERE','Isère');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (43,'39','39300',2,'JURA','Jura'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (27,'39','39300',2,'JURA','Jura');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (72,'40','40192',4,'LANDES','Landes'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'40','40192',4,'LANDES','Landes');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'41','41018',0,'LOIR-ET-CHER','Loir-et-Cher'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'41','41018',0,'LOIR-ET-CHER','Loir-et-Cher');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (82,'42','42218',3,'LOIRE','Loire'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'42','42218',3,'LOIRE','Loire');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (83,'43','43157',3,'HAUTE-LOIRE','Haute-Loire'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'43','43157',3,'HAUTE-LOIRE','Haute-Loire');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (52,'44','44109',3,'LOIRE-ATLANTIQUE','Loire-Atlantique'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (52,'44','44109',3,'LOIRE-ATLANTIQUE','Loire-Atlantique');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'45','45234',2,'LOIRET','Loiret'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (24,'45','45234',2,'LOIRET','Loiret');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (73,'46','46042',2,'LOT','Lot'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'46','46042',2,'LOT','Lot');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (72,'47','47001',0,'LOT-ET-GARONNE','Lot-et-Garonne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'47','47001',0,'LOT-ET-GARONNE','Lot-et-Garonne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (91,'48','48095',3,'LOZERE','Lozère'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'48','48095',3,'LOZERE','Lozère');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (52,'49','49007',0,'MAINE-ET-LOIRE','Maine-et-Loire'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (52,'49','49007',0,'MAINE-ET-LOIRE','Maine-et-Loire');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (25,'50','50502',3,'MANCHE','Manche'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (28,'50','50502',3,'MANCHE','Manche');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (21,'51','51108',3,'MARNE','Marne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (44,'51','51108',3,'MARNE','Marne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (21,'52','52121',3,'HAUTE-MARNE','Haute-Marne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (44,'52','52121',3,'HAUTE-MARNE','Haute-Marne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (52,'53','53130',3,'MAYENNE','Mayenne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (52,'53','53130',3,'MAYENNE','Mayenne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (41,'54','54395',0,'MEURTHE-ET-MOSELLE','Meurthe-et-Moselle'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (44,'54','54395',0,'MEURTHE-ET-MOSELLE','Meurthe-et-Moselle');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (41,'55','55029',3,'MEUSE','Meuse'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (44,'55','55029',3,'MEUSE','Meuse');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (53,'56','56260',2,'MORBIHAN','Morbihan'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (53,'56','56260',2,'MORBIHAN','Morbihan');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (41,'57','57463',3,'MOSELLE','Moselle'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (44,'57','57463',3,'MOSELLE','Moselle');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (26,'58','58194',3,'NIEVRE','Nièvre'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (27,'58','58194',3,'NIEVRE','Nièvre');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (31,'59','59350',2,'NORD','Nord'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (32,'59','59350',2,'NORD','Nord');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (22,'60','60057',5,'OISE','Oise'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (32,'60','60057',5,'OISE','Oise');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (25,'61','61001',5,'ORNE','Orne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (28,'61','61001',5,'ORNE','Orne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (31,'62','62041',2,'PAS-DE-CALAIS','Pas-de-Calais'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (32,'62','62041',2,'PAS-DE-CALAIS','Pas-de-Calais');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (83,'63','63113',2,'PUY-DE-DOME','Puy-de-Dôme'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'63','63113',2,'PUY-DE-DOME','Puy-de-Dôme');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (72,'64','64445',4,'PYRENEES-ATLANTIQUES','Pyrénées-Atlantiques'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'64','64445',4,'PYRENEES-ATLANTIQUES','Pyrénées-Atlantiques');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (73,'65','65440',4,'HAUTES-PYRENEES','Hautes-Pyrénées'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'65','65440',4,'HAUTES-PYRENEES','Hautes-Pyrénées');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (91,'66','66136',4,'PYRENEES-ORIENTALES','Pyrénées-Orientales'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'66','66136',4,'PYRENEES-ORIENTALES','Pyrénées-Orientales');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (42,'67','67482',2,'BAS-RHIN','Bas-Rhin'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (44,'67','67482',2,'BAS-RHIN','Bas-Rhin');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (42,'68','68066',2,'HAUT-RHIN','Haut-Rhin'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (44,'68','68066',2,'HAUT-RHIN','Haut-Rhin');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (82,'69','69123',2,'RHONE','Rhône'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'69','69123',2,'RHONE','Rhône');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (43,'70','70550',3,'HAUTE-SAONE','Haute-Saône'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (27,'70','70550',3,'HAUTE-SAONE','Haute-Saône');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (26,'71','71270',0,'SAONE-ET-LOIRE','Saône-et-Loire'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (27,'71','71270',0,'SAONE-ET-LOIRE','Saône-et-Loire');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (52,'72','72181',3,'SARTHE','Sarthe'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (52,'72','72181',3,'SARTHE','Sarthe');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (82,'73','73065',3,'SAVOIE','Savoie'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'73','73065',3,'SAVOIE','Savoie');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (82,'74','74010',3,'HAUTE-SAVOIE','Haute-Savoie'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'74','74010',3,'HAUTE-SAVOIE','Haute-Savoie');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'75','75056',0,'PARIS','Paris'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'75','75056',0,'PARIS','Paris');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (23,'76','76540',3,'SEINE-MARITIME','Seine-Maritime'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (28,'76','76540',3,'SEINE-MARITIME','Seine-Maritime');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'77','77288',0,'SEINE-ET-MARNE','Seine-et-Marne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'77','77288',0,'SEINE-ET-MARNE','Seine-et-Marne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'78','78646',4,'YVELINES','Yvelines'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'78','78646',4,'YVELINES','Yvelines');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (54,'79','79191',4,'DEUX-SEVRES','Deux-Sèvres'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'79','79191',4,'DEUX-SEVRES','Deux-Sèvres');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (22,'80','80021',3,'SOMME','Somme'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (32,'80','80021',3,'SOMME','Somme');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (73,'81','81004',2,'TARN','Tarn'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'81','81004',2,'TARN','Tarn');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (73,'82','82121',0,'TARN-ET-GARONNE','Tarn-et-Garonne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (76,'82','82121',0,'TARN-ET-GARONNE','Tarn-et-Garonne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'83','83137',2,'VAR','Var'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'83','83137',2,'VAR','Var');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'84','84007',0,'VAUCLUSE','Vaucluse'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (93,'84','84007',0,'VAUCLUSE','Vaucluse');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (52,'85','85191',3,'VENDEE','Vendée'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (52,'85','85191',3,'VENDEE','Vendée');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (54,'86','86194',3,'VIENNE','Vienne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'86','86194',3,'VIENNE','Vienne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (74,'87','87085',3,'HAUTE-VIENNE','Haute-Vienne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (75,'87','87085',3,'HAUTE-VIENNE','Haute-Vienne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (41,'88','88160',4,'VOSGES','Vosges'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (44,'88','88160',4,'VOSGES','Vosges');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (26,'89','89024',5,'YONNE','Yonne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (27,'89','89024',5,'YONNE','Yonne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (43,'90','90010',0,'TERRITOIRE DE BELFORT','Territoire de Belfort'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (27,'90','90010',0,'TERRITOIRE DE BELFORT','Territoire de Belfort');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'91','91228',5,'ESSONNE','Essonne'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'91','91228',5,'ESSONNE','Essonne');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'92','92050',4,'HAUTS-DE-SEINE','Hauts-de-Seine'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'92','92050',4,'HAUTS-DE-SEINE','Hauts-de-Seine');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'93','93008',3,'SEINE-SAINT-DENIS','Seine-Saint-Denis'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'93','93008',3,'SEINE-SAINT-DENIS','Seine-Saint-Denis');

View File

@ -564,3 +564,16 @@ ALTER TABLE llx_mrp_production ADD INDEX idx_mrp_production_fk_mo (fk_mo);
ALTER TABLE llx_emailcollector_emailcollector ADD UNIQUE INDEX uk_emailcollector_emailcollector_ref(ref, entity); ALTER TABLE llx_emailcollector_emailcollector ADD UNIQUE INDEX uk_emailcollector_emailcollector_ref(ref, entity);
ALTER TABLE llx_website ADD COLUMN use_manifest integer; ALTER TABLE llx_website ADD COLUMN use_manifest integer;
ALTER TABLE llx_facture_rec MODIFY COLUMN fk_cond_reglement integer NOT NULL DEFAULT 1;
create table llx_commande_fournisseur_dispatch_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);

View File

@ -30,18 +30,70 @@
-- Missing in v11 -- Missing in v11
create table llx_commande_fournisseur_dispatch_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
-- For v12 -- For v12
ALTER TABLE llx_societe_rib ADD COLUMN stripe_account varchar(128); -- Migration to the new regions (France)
UPDATE llx_c_regions set nom = 'Centre-Val de Loire' WHERE fk_pays = 1 AND code_region = 24;
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 27, '21231', 0, 'Bourgogne-Franche-Comté');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 28, '76540', 0, 'Normandie');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 32, '59350', 4, 'Hauts-de-France');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 44, '67482', 2, 'Grand Est');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 75, '33063', 0, 'Nouvelle-Aquitaine');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 76, '31355', 1, 'Occitanie');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 84, '69123', 1, 'Auvergne-Rhône-Alpes');
UPDATE llx_c_departements set fk_region = 27 WHERE fk_region = 26 OR fk_region = 43;
UPDATE llx_c_departements set fk_region = 28 WHERE fk_region = 25 OR fk_region = 23;
UPDATE llx_c_departements set fk_region = 32 WHERE fk_region = 22 OR fk_region = 31;
UPDATE llx_c_departements set fk_region = 44 WHERE fk_region = 21 OR fk_region = 41 OR fk_region = 42;
UPDATE llx_c_departements set fk_region = 75 WHERE fk_region = 54 OR fk_region = 74 OR fk_region = 72;
UPDATE llx_c_departements set fk_region = 76 WHERE fk_region = 73 OR fk_region = 91;
UPDATE llx_c_departements set fk_region = 84 WHERE fk_region = 82 OR fk_region = 83;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 21;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 22;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 23;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 25;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 26;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 31;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 41;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 42;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 43;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 54;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 72;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 73;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 74;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 82;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 83;
DELETE FROM llx_c_regions WHERE fk_pays = 1 AND code_region = 91;
ALTER TABLE llx_bookmark DROP INDEX uk_bookmark_url;
ALTER TABLE llx_bookmark DROP INDEX uk_bookmark_title;
ALTER TABLE llx_bookmark MODIFY COLUMN url TEXT;
ALTER TABLE llx_bookmark ADD UNIQUE uk_bookmark_title (fk_user, entity, title);
ALTER TABLE llx_societe_rib ADD COLUMN stripe_account varchar(128);
create table llx_object_lang create table llx_object_lang
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_object integer DEFAULT 0 NOT NULL, fk_object integer DEFAULT 0 NOT NULL,
type_object varchar(32) NOT NULL, -- 'thirdparty', 'contact', '...' type_object varchar(32) NOT NULL,
property varchar(32) NOT NULL, property varchar(32) NOT NULL,
lang varchar(5) DEFAULT 0 NOT NULL, lang varchar(5) DEFAULT 0 NOT NULL,
value text, value text,
@ -51,9 +103,23 @@ create table llx_object_lang
ALTER TABLE llx_object_lang ADD UNIQUE INDEX uk_object_lang (fk_object, type_object, property, lang); ALTER TABLE llx_object_lang ADD UNIQUE INDEX uk_object_lang (fk_object, type_object, property, lang);
CREATE TABLE llx_categorie_actioncomm
(
fk_categorie integer NOT NULL,
fk_actioncomm integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
ALTER TABLE llx_categorie_actioncomm ADD PRIMARY KEY pk_categorie_actioncomm (fk_categorie, fk_actioncomm);
ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_actioncomm (fk_actioncomm);
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm (id);
ALTER TABLE llx_accounting_account ADD COLUMN labelshort varchar(255) DEFAULT NULL after label; ALTER TABLE llx_accounting_account ADD COLUMN labelshort varchar(255) DEFAULT NULL after label;
ALTER TABLE llx_subscription ADD COLUMN fk_user_creat integer DEFAULT NULL; ALTER TABLE llx_subscription ADD COLUMN fk_user_creat integer DEFAULT NULL;
ALTER TABLE llx_subscription ADD COLUMN fk_user_valid integer DEFAULT NULL; ALTER TABLE llx_subscription ADD COLUMN fk_user_valid integer DEFAULT NULL;

View File

@ -17,5 +17,4 @@
-- =================================================================== -- ===================================================================
ALTER TABLE llx_bookmark ADD UNIQUE uk_bookmark_url (fk_user, url); ALTER TABLE llx_bookmark ADD UNIQUE uk_bookmark_title (fk_user, entity, title);
ALTER TABLE llx_bookmark ADD UNIQUE uk_bookmark_title (fk_user, title);

View File

@ -21,7 +21,7 @@ create table llx_bookmark
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_user integer NOT NULL, fk_user integer NOT NULL,
dateb datetime, dateb datetime,
url varchar(255) NOT NULL, url TEXT,
target varchar(16), target varchar(16),
title varchar(64), title varchar(64),
favicon varchar(24), favicon varchar(24),

View File

@ -0,0 +1,25 @@
-- ============================================================================
-- Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
-- Copyright (C) 2016-2019 Frédéric France <frederic.france@netlogic.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 <https://www.gnu.org/licenses/>.
--
-- ============================================================================
ALTER TABLE llx_categorie_actioncomm ADD PRIMARY KEY pk_categorie_actioncomm (fk_categorie, fk_actioncomm);
ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_actioncomm (fk_actioncomm);
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm (id);

View File

@ -0,0 +1,26 @@
-- ============================================================================
-- Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
-- Copyright (C) 2016-2019 Frédéric France <frederic.france@netlogic.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 <https://www.gnu.org/licenses/>.
--
-- Table to link actioncomm tag/categories with actioncomms
-- ===========================================================================
CREATE TABLE llx_categorie_actioncomm
(
fk_categorie integer NOT NULL,
fk_actioncomm integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;

View File

@ -48,7 +48,7 @@ create table llx_facture_rec
fk_projet integer, -- projet auquel est associe la facture fk_projet integer, -- projet auquel est associe la facture
fk_cond_reglement integer DEFAULT 0, -- condition de reglement fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement
fk_mode_reglement integer DEFAULT 0, -- mode de reglement (Virement, Prelevement) fk_mode_reglement integer DEFAULT 0, -- mode de reglement (Virement, Prelevement)
date_lim_reglement date, -- date limite de reglement date_lim_reglement date, -- date limite de reglement
fk_account integer, -- bank account id fk_account integer, -- bank account id

View File

@ -90,4 +90,5 @@ ShowCategory=Show tag/category
ByDefaultInList=By default in list ByDefaultInList=By default in list
ChooseCategory=Choose category ChooseCategory=Choose category
StocksCategoriesArea=Warehouses Categories Area StocksCategoriesArea=Warehouses Categories Area
ActionCommCategoriesArea=Events Categories Area
UseOrOperatorForCategories=Use or operator for categories UseOrOperatorForCategories=Use or operator for categories

View File

@ -247,6 +247,12 @@ ProfId3US=-
ProfId4US=- ProfId4US=-
ProfId5US=- ProfId5US=-
ProfId6US=- ProfId6US=-
ProfId1RO=Prof Id 1 (CUI)
ProfId2RO=Prof Id 2 (Nr. Înmatriculare)
ProfId3RO=Prof Id 3 (CAEN)
ProfId4RO=-
ProfId5RO=Prof Id 5 (EUID)
ProfId6RO=-
ProfId1RU=Prof Id 1 (OGRN) ProfId1RU=Prof Id 1 (OGRN)
ProfId2RU=Prof Id 2 (INN) ProfId2RU=Prof Id 2 (INN)
ProfId3RU=Prof Id 3 (KPP) ProfId3RU=Prof Id 3 (KPP)

View File

@ -39,8 +39,10 @@ TypeOfLeaveId=Type of leave ID
TypeOfLeaveCode=Type of leave code TypeOfLeaveCode=Type of leave code
TypeOfLeaveLabel=Type of leave label TypeOfLeaveLabel=Type of leave label
NbUseDaysCP=Number of days of vacation consumed NbUseDaysCP=Number of days of vacation consumed
NbUseDaysCPHelp=The calculation takes into account the non working days and the holidays defined in the dictionary.
NbUseDaysCPShort=Days consumed NbUseDaysCPShort=Days consumed
NbUseDaysCPShortInMonth=Days consumed in month NbUseDaysCPShortInMonth=Days consumed in month
DayIsANonWorkingDay=%s is a non working day
DateStartInMonth=Start date in month DateStartInMonth=Start date in month
DateEndInMonth=End date in month DateEndInMonth=End date in month
EditCP=Edit EditCP=Edit

View File

@ -16,6 +16,7 @@ PHPSupportCurl=This PHP supports Curl.
PHPSupportCalendar=This PHP supports calendars extensions. PHPSupportCalendar=This PHP supports calendars extensions.
PHPSupportUTF8=This PHP supports UTF8 functions. PHPSupportUTF8=This PHP supports UTF8 functions.
PHPSupportIntl=This PHP supports Intl functions. PHPSupportIntl=This PHP supports Intl functions.
PHPSupport=This PHP supports %s functions.
PHPMemoryOK=Your PHP max session memory is set to <b>%s</b>. This should be enough. PHPMemoryOK=Your PHP max session memory is set to <b>%s</b>. This should be enough.
PHPMemoryTooLow=Your PHP max session memory is set to <b>%s</b> bytes. This is too low. Change your <b>php.ini</b> to set <b>memory_limit</b> parameter to at least <b>%s</b> bytes. PHPMemoryTooLow=Your PHP max session memory is set to <b>%s</b> bytes. This is too low. Change your <b>php.ini</b> to set <b>memory_limit</b> parameter to at least <b>%s</b> bytes.
Recheck=Click here for a more detailed test Recheck=Click here for a more detailed test
@ -25,6 +26,7 @@ ErrorPHPDoesNotSupportCurl=Your PHP installation does not support Curl.
ErrorPHPDoesNotSupportCalendar=Your PHP installation does not support php calendar extensions. ErrorPHPDoesNotSupportCalendar=Your PHP installation does not support php calendar extensions.
ErrorPHPDoesNotSupportUTF8=Your PHP installation does not support UTF8 functions. Dolibarr cannot work correctly. Resolve this before installing Dolibarr. ErrorPHPDoesNotSupportUTF8=Your PHP installation does not support UTF8 functions. Dolibarr cannot work correctly. Resolve this before installing Dolibarr.
ErrorPHPDoesNotSupportIntl=Your PHP installation does not support Intl functions. ErrorPHPDoesNotSupportIntl=Your PHP installation does not support Intl functions.
ErrorPHPDoesNotSupport=Your PHP installation does not support %s functions.
ErrorDirDoesNotExists=Directory %s does not exist. ErrorDirDoesNotExists=Directory %s does not exist.
ErrorGoBackAndCorrectParameters=Go back and check/correct the parameters. ErrorGoBackAndCorrectParameters=Go back and check/correct the parameters.
ErrorWrongValueForParameter=You may have typed a wrong value for parameter '%s'. ErrorWrongValueForParameter=You may have typed a wrong value for parameter '%s'.

View File

@ -135,3 +135,5 @@ CSSClass=CSS Class
NotEditable=Not editable NotEditable=Not editable
ForeignKey=Foreign key ForeignKey=Foreign key
TypeOfFieldsHelp=Type of fields:<br>varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1 AND fk_user = __USER_ID AND entity IN (__SHARED_ENTITIES__)' for example) TypeOfFieldsHelp=Type of fields:<br>varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1 AND fk_user = __USER_ID AND entity IN (__SHARED_ENTITIES__)' for example)
AsciiToHtmlConverter=Ascii to HTML converter
AsciiToPdfConverter=Ascii to PDF converter

View File

@ -249,9 +249,13 @@ TimeSpentForInvoice=Time spent
OneLinePerUser=One line per user OneLinePerUser=One line per user
ServiceToUseOnLines=Service to use on lines ServiceToUseOnLines=Service to use on lines
InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project
ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets). ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets). Note: To generate invoice, go on tab 'Time spent' of the project and select lines to include.
ProjectFollowOpportunity=Follow opportunity ProjectFollowOpportunity=Follow opportunity
ProjectFollowTasks=Follow tasks ProjectFollowTasks=Follow tasks
UsageOpportunity=Usage: Opportunity UsageOpportunity=Usage: Opportunity
UsageTasks=Usage: Tasks UsageTasks=Usage: Tasks
UsageBillTimeShort=Usage: Bill time UsageBillTimeShort=Usage: Bill time
InvoiceToUse=Draft invoice to use
NewInvoice=New invoice
OneLinePerTask=One line per task
OneLinePerPeriod=One line per period

View File

@ -716,9 +716,9 @@ if ($id > 0)
print '<td><a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.'</a></td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n"; print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
print "<td>".$objp->paiement_type.' '.$objp->num_payment."</td>\n"; print "<td>".$objp->paiement_type.' '.$objp->num_payment."</td>\n";
print '<td class="right">'.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n"; print '<td class="nowrap right">'.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n";
print '<td class="right">'.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n"; print '<td class="nowrap right">'.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n";
print '<td class="right">'.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n"; print '<td class="nowrap right">'.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n";
print "</tr>"; print "</tr>";
$total_capital += $objp->amount_capital; $total_capital += $objp->amount_capital;
$i++; $i++;
@ -728,14 +728,14 @@ if ($id > 0)
if ($object->paid == 0) if ($object->paid == 0)
{ {
print '<tr><td colspan="5" class="right">'.$langs->trans("AlreadyPaid").' :</td><td class="right">'.price($totalpaid, 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>'; print '<tr><td colspan="5" class="right">'.$langs->trans("AlreadyPaid").' :</td><td class="nowrap right">'.price($totalpaid, 0, $langs, 0, -1, -1, $conf->currency).'</td></tr>';
print '<tr><td colspan="5" class="right">'.$langs->trans("AmountExpected").' :</td><td class="right">'.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>'; print '<tr><td colspan="5" class="right">'.$langs->trans("AmountExpected").' :</td><td class="nowrap right">'.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
$staytopay = $object->capital - $totalpaid; $staytopay = $object->capital - $totalpaid;
print '<tr><td colspan="5" class="right">'.$langs->trans("RemainderToPay").' :</td>'; print '<tr><td colspan="5" class="right">'.$langs->trans("RemainderToPay").' :</td>';
print '<td class="right'.($staytopay ? ' amountremaintopay' : ' amountpaymentcomplete').'">'; print '<td class="nowrap right'.($staytopay ? ' amountremaintopay' : ' amountpaymentcomplete').'">';
print price($staytopay, 0, $langs, 0, 0, -1, $conf->currency); print price($staytopay, 0, $langs, 0, -1, -1, $conf->currency);
print '</td></tr>'; print '</td></tr>';
} }
print "</table>"; print "</table>";

View File

@ -185,10 +185,10 @@ if ($resql)
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="right liste_titre">'; print '<td class="right liste_titre">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<td class="liste_titre maxwidthsearch">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto;
print '</td>'; print '</td>';
print '</tr>';
// Fields title label // Fields title label
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@ -199,7 +199,9 @@ if ($resql)
print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre(''); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n";
print "</tr>\n"; print "</tr>\n";
// Loop on record // Loop on record

View File

@ -2571,6 +2571,10 @@ if (!function_exists("llxFooter"))
print "\n".'<!-- Includes JS for Ping of Dolibarr MAIN_FIRST_PING_OK_DATE = '.$conf->global->MAIN_FIRST_PING_OK_DATE.' MAIN_FIRST_PING_OK_ID = '.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'."\n"; print "\n".'<!-- Includes JS for Ping of Dolibarr MAIN_FIRST_PING_OK_DATE = '.$conf->global->MAIN_FIRST_PING_OK_DATE.' MAIN_FIRST_PING_OK_ID = '.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'."\n";
print "\n<!-- JS CODE TO ENABLE the anonymous Ping -->\n"; print "\n<!-- JS CODE TO ENABLE the anonymous Ping -->\n";
$url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING); $url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING);
// Try to guess the distrib used
$distrib = 'standard';
if ($_SERVER["SERVER_ADMIN"] == 'doliwamp@localhost') $distrib = 'doliwamp';
if (! empty($dolibarr_distrib)) $distrib = $dolibarr_distrib;
?> ?>
<script> <script>
jQuery(document).ready(function (tmp) { jQuery(document).ready(function (tmp) {
@ -2588,7 +2592,8 @@ if (!function_exists("llxFooter"))
dbtype: "<?php echo dol_escape_js($db->type); ?>", dbtype: "<?php echo dol_escape_js($db->type); ?>",
country_code: "<?php echo dol_escape_js($mysoc->country_code); ?>", country_code: "<?php echo dol_escape_js($mysoc->country_code); ?>",
php_version: "<?php echo phpversion(); ?>", php_version: "<?php echo phpversion(); ?>",
os_version: "<?php echo version_os('smr'); ?>" os_version: "<?php echo version_os('smr'); ?>",
distrib: "<?php echo $distrib ? $distrib : 'unknown'; ?>"
}, },
success: function (data, status, xhr) { // success callback function (data contains body of response) success: function (data, status, xhr) { // success callback function (data contains body of response)
console.log("Ping ok"); console.log("Ping ok");

View File

@ -1307,7 +1307,7 @@ if ($dirins && $action == 'generatepackage')
if ($dirofmodule) if ($dirofmodule)
{ {
if (!dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule); if (!dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule);
$result = dol_compress_dir($dir, $outputfilezip, 'zip'); $result = dol_compress_dir($dir, $outputfilezip, 'zip', '', $modulelowercase);
} }
else else
{ {

View File

@ -1992,7 +1992,7 @@ else
// Categories // Categories
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td colspan="3">'; print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td colspan="3">';
print $form->showCategories($object->id, 'product', 1); print $form->showCategories($object->id, Categorie::TYPE_PRODUCT, 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -173,9 +173,12 @@ $arrayfields = array(
'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))), 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))),
'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1')), 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1')),
'p.weight'=>array('label'=>$langs->trans("Weight"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled))), 'p.weight'=>array('label'=>$langs->trans("Weight"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled))),
'p.length'=>array('label'=>$langs->trans("Length"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->global->PRODUCT_DISABLE_SIZE))), 'p.length'=>array('label'=>$langs->trans("Length"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE))),
'p.surface'=>array('label'=>$langs->trans("Surface"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->global->PRODUCT_DISABLE_SURFACE))), 'p.width'=>array('label'=>$langs->trans('Width'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE))),
'p.volume'=>array('label'=>$langs->trans("Volume"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->global->PRODUCT_DISABLE_VOLUME))), 'p.height'=>array('label'=>$langs->trans('Height'), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SIZE))),
'p.surface'=>array('label'=>$langs->trans("Surface"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_SURFACE))),
'p.volume'=>array('label'=>$langs->trans("Volume"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && empty($conf->global->PRODUCT_DISABLE_VOLUME))),
'cu.label'=>array('label'=>$langs->trans("DefaultUnitToShow"), 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->global->PRODUCT_USE_UNITS))),
'p.sellprice'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)), 'p.sellprice'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)),
'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(!empty($user->rights->fournisseur->lire))), 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(!empty($user->rights->fournisseur->lire))),
'p.numbuyprice'=>array('label'=>$langs->trans("BuyingPriceNumShort"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire))), 'p.numbuyprice'=>array('label'=>$langs->trans("BuyingPriceNumShort"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire))),
@ -288,7 +291,8 @@ $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p
$sql .= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; $sql .= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
$sql .= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy,'; $sql .= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy,';
$sql .= ' p.datec as date_creation, p.tms as date_update, p.pmp, p.stock,'; $sql .= ' p.datec as date_creation, p.tms as date_update, p.pmp, p.stock,';
$sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.width, p.width_units, p.height, p.height_units,'; $sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units,';
if (!empty($conf->global->PRODUCT_USE_UNITS)) $sql .= ' p.fk_unit, cu.label as cu_label,';
$sql .= ' MIN(pfp.unitprice) as minsellprice'; $sql .= ' MIN(pfp.unitprice) as minsellprice';
if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
$sql .= ', pac.rowid prod_comb_id'; $sql .= ', pac.rowid prod_comb_id';
@ -311,6 +315,7 @@ if (!empty($conf->global->MAIN_MULTILANGS)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX
if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination pac ON pac.fk_product_child = p.rowid";
} }
if (!empty($conf->global->PRODUCT_USE_UNITS)) $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_units cu ON cu.rowid = p.fk_unit";
$sql .= ' WHERE p.entity IN ('.getEntity('product').')'; $sql .= ' WHERE p.entity IN ('.getEntity('product').')';
@ -375,7 +380,8 @@ $sql .= $hookmanager->resPrint;
$sql .= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type,"; $sql .= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type,";
$sql .= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; $sql .= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,";
$sql .= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.pmp, p.stock,'; $sql .= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.pmp, p.stock,';
$sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.width, p.width_units, p.height, p.height_units'; $sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units';
if (!empty($conf->global->PRODUCT_USE_UNITS)) $sql .= ', p.fk_unit, cu.label';
if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) {
$sql .= ', pac.rowid'; $sql .= ', pac.rowid';
@ -626,6 +632,18 @@ if ($resql)
} }
// Length // Length
if (!empty($arrayfields['p.length']['checked'])) if (!empty($arrayfields['p.length']['checked']))
{
print '<td class="liste_titre">';
print '</td>';
}
// Width
if (!empty($arrayfields['p.width']['checked']))
{
print '<td class="liste_titre">';
print '</td>';
}
// Height
if (!empty($arrayfields['p.height']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '</td>'; print '</td>';
@ -638,6 +656,13 @@ if ($resql)
} }
// Volume // Volume
if (!empty($arrayfields['p.volume']['checked'])) if (!empty($arrayfields['p.volume']['checked']))
{
print '<td class="liste_titre">';
print '</td>';
}
// Unit
if (!empty($arrayfields['cu.label']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '</td>'; print '</td>';
@ -761,8 +786,11 @@ if ($resql)
} }
if (!empty($arrayfields['p.weight']['checked'])) print_liste_field_titre($arrayfields['p.weight']['label'], $_SERVER["PHP_SELF"], "p.weight", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['p.weight']['checked'])) print_liste_field_titre($arrayfields['p.weight']['label'], $_SERVER["PHP_SELF"], "p.weight", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['p.length']['checked'])) print_liste_field_titre($arrayfields['p.length']['label'], $_SERVER["PHP_SELF"], "p.length", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['p.length']['checked'])) print_liste_field_titre($arrayfields['p.length']['label'], $_SERVER["PHP_SELF"], "p.length", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['p.width']['checked'])) print_liste_field_titre($arrayfields['p.width']['label'], $_SERVER['PHP_SELF'], 'p.width', '', $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['p.height']['checked'])) print_liste_field_titre($arrayfields['p.height']['label'], $_SERVER['PHP_SELF'], 'p.height', '', $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['p.surface']['checked'])) print_liste_field_titre($arrayfields['p.surface']['label'], $_SERVER["PHP_SELF"], "p.surface", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['p.surface']['checked'])) print_liste_field_titre($arrayfields['p.surface']['label'], $_SERVER["PHP_SELF"], "p.surface", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['p.volume']['checked'])) print_liste_field_titre($arrayfields['p.volume']['label'], $_SERVER["PHP_SELF"], "p.volume", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['p.volume']['checked'])) print_liste_field_titre($arrayfields['p.volume']['label'], $_SERVER["PHP_SELF"], "p.volume", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['cu.label']['checked'])) print_liste_field_titre($arrayfields['cu.label']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['p.sellprice']['checked'])) { if (!empty($arrayfields['p.sellprice']['checked'])) {
print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
} }
@ -880,6 +908,9 @@ if ($resql)
$product_static->volume_units = $obj->volume_units; $product_static->volume_units = $obj->volume_units;
$product_static->surface = $obj->surface; $product_static->surface = $obj->surface;
$product_static->surface_units = $obj->surface_units; $product_static->surface_units = $obj->surface_units;
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
$product_static->fk_unit = $obj->fk_unit;
}
// STOCK_DISABLE_OPTIM_LOAD can be set to force load_stock whatever is permissions on stock. // STOCK_DISABLE_OPTIM_LOAD can be set to force load_stock whatever is permissions on stock.
if ((!empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || !empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock if ((!empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || !empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock
@ -979,6 +1010,22 @@ if ($resql)
print '</td>'; print '</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }
// Width
if (!empty($arrayfields['p.width']['checked']))
{
print '<td align="center">';
print $obj->width;
print '</td>';
if (!$i) $totalarray['nbfield']++;
}
// Height
if (!empty($arrayfields['p.height']['checked']))
{
print '<td align="center">';
print $obj->height;
print '</td>';
if (!$i) $totalarray['nbfield']++;
}
// Surface // Surface
if (!empty($arrayfields['p.surface']['checked'])) if (!empty($arrayfields['p.surface']['checked']))
{ {
@ -995,6 +1042,16 @@ if ($resql)
print '</td>'; print '</td>';
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
} }
// Unit
if (!empty($arrayfields['cu.label']['checked']))
{
print '<td align="center">';
if (!empty($obj->cu_label)) {
print $langs->trans($obj->cu_label);
}
print '</td>';
if (!$i) $totalarray['nbfield']++;
}
// Sell price // Sell price
if (!empty($arrayfields['p.sellprice']['checked'])) if (!empty($arrayfields['p.sellprice']['checked']))

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -351,6 +352,7 @@ if ($result || empty($id))
$url = DOL_URL_ROOT.'/viewimage.php?modulepart='.$graphfiles[$key]['modulepart'].'&entity='.$object->entity.'&file='.urlencode($graphfiles[$key]['file']); $url = DOL_URL_ROOT.'/viewimage.php?modulepart='.$graphfiles[$key]['modulepart'].'&entity='.$object->entity.'&file='.urlencode($graphfiles[$key]['file']);
$px->draw($dir."/".$graphfiles[$key]['file'], $url); $px->draw($dir."/".$graphfiles[$key]['file'], $url);
$graphfiles[$key]['total'] = $px->total();
$graphfiles[$key]['output'] = $px->show(); $graphfiles[$key]['output'] = $px->show();
} }
else else
@ -405,7 +407,7 @@ if ($result || empty($id))
// Label // Label
print '<tr class="liste_titre"><td>'; print '<tr class="liste_titre"><td>';
print $graphfiles[$key]['label']; print $graphfiles[$key]['label'];
print '</td>'; print ' ('.$graphfiles[$key]['total'].')</td>';
print '<td align="right">'.$linktoregenerate.'</td>'; print '<td align="right">'.$linktoregenerate.'</td>';
print '</tr>'; print '</tr>';
// Image // Image

View File

@ -454,7 +454,7 @@ else
// Categories // Categories
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td colspan="3">'; print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td colspan="3">';
print $form->showCategories($object->id, 'warehouse', 1); print $form->showCategories($object->id, Categorie::TYPE_WAREHOUSE, 1);
print "</td></tr>"; print "</td></tr>";
} }
print "</table>"; print "</table>";

View File

@ -27,6 +27,7 @@ require '../main.inc.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.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.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.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php';
@ -657,7 +658,8 @@ if ($action == 'create' && $user->rights->projet->creer)
// Description // Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>'; print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
print '<td>'; print '<td>';
print '<textarea name="description" wrap="soft" class="centpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST("description", 'none'), 0, 1).'</textarea>'; $doleditor = new DolEditor('description', GETPOST("description", 'none'), '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%');
$doleditor->Create();
print '</td></tr>'; print '</td></tr>';
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
@ -927,7 +929,8 @@ elseif ($object->id > 0)
// Description // Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>'; print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
print '<td>'; print '<td>';
print '<textarea name="description" wrap="soft" class="centpercent" rows="'.ROWS_3.'">'.$object->description.'</textarea>'; $doleditor = new DolEditor('description', $object->description, '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%');
$doleditor->Create();
print '</td></tr>'; print '</td></tr>';
// Tags-Categories // Tags-Categories
@ -1083,7 +1086,7 @@ elseif ($object->id > 0)
// Categories // Categories
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, 'project', 1); print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -160,7 +160,7 @@ print '</td></tr>';
// Categories // Categories
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, 'project', 1); print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -268,18 +268,10 @@ if ($id > 0 || ! empty($ref))
print nl2br($object->description); print nl2br($object->description);
print '</td></tr>'; print '</td></tr>';
// Bill time
if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($object->usage_bill_time);
print '</td></tr>';
}
// Categories // Categories
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, 'project', 1); print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -244,18 +244,10 @@ print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
print nl2br($object->description); print nl2br($object->description);
print '</td></tr>'; print '</td></tr>';
// Bill time
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($object->usage_bill_time);
print '</td></tr>';
}
// Categories // Categories
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, 'project', 1); print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -201,18 +201,10 @@ if (($id > 0 && is_numeric($id)) || !empty($ref))
print nl2br($object->description); print nl2br($object->description);
print '</td></tr>'; print '</td></tr>';
// Bill time
if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($object->usage_bill_time);
print '</td></tr>';
}
// Categories // Categories
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, 'project', 1); print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -90,7 +90,7 @@ $hookmanager->initHooks(array('projecttaskscard', 'globalcard'));
$progress = GETPOST('progress', 'int'); $progress = GETPOST('progress', 'int');
$label = GETPOST('label', 'alpha'); $label = GETPOST('label', 'alpha');
$description = GETPOST('description'); $description = GETPOST('description', 'none');
$planned_workloadhour = (GETPOST('planned_workloadhour', 'int') ?GETPOST('planned_workloadhour', 'int') : 0); $planned_workloadhour = (GETPOST('planned_workloadhour', 'int') ?GETPOST('planned_workloadhour', 'int') : 0);
$planned_workloadmin = (GETPOST('planned_workloadmin', 'int') ?GETPOST('planned_workloadmin', 'int') : 0); $planned_workloadmin = (GETPOST('planned_workloadmin', 'int') ?GETPOST('planned_workloadmin', 'int') : 0);
$planned_workload = $planned_workloadhour * 3600 + $planned_workloadmin * 60; $planned_workload = $planned_workloadhour * 3600 + $planned_workloadmin * 60;
@ -445,9 +445,9 @@ if ($id > 0 || !empty($ref))
// Date start - end // Date start - end
print '<tr><td>'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>'; print '<tr><td>'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>';
$start = dol_print_date($object->date_start, 'dayhour'); $start = dol_print_date($object->date_start, 'day');
print ($start ? $start : '?'); print ($start ? $start : '?');
$end = dol_print_date($object->date_end, 'dayhour'); $end = dol_print_date($object->date_end, 'day');
print ' - '; print ' - ';
print ($end ? $end : '?'); print ($end ? $end : '?');
if ($object->hasDelay()) print img_warning("Late"); if ($object->hasDelay()) print img_warning("Late");
@ -476,18 +476,10 @@ if ($id > 0 || !empty($ref))
print nl2br($object->description); print nl2br($object->description);
print '</td></tr>'; print '</td></tr>';
// Bill time
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($object->usage_bill_time);
print '</td></tr>';
}
// Categories // Categories
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td>'; print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, 'project', 1); print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>"; print "</td></tr>";
} }

View File

@ -205,7 +205,7 @@ if ($object->id > 0)
print '<div class="ficheaddleft">'; print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border entpercent tableforfield">'; print '<table class="border centpercent tableforfield">';
// Description // Description
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>'; print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';

View File

@ -509,7 +509,7 @@ if ($id > 0 || !empty($ref))
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'; print '<table class="border centpercent tableforfield">';
// Task parent // Task parent
print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>'; print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
@ -550,7 +550,7 @@ if ($id > 0 || !empty($ref))
print '<div class="fichehalfright"><div class="ficheaddleft">'; print '<div class="fichehalfright"><div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'; print '<table class="border centpercent tableforfield">';
// Progress declared // Progress declared
print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td colspan="3">'; print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';

View File

@ -342,9 +342,26 @@ if ($action == 'confirm_generateinvoice')
$db->begin(); $db->begin();
$idprod = GETPOST('productid', 'int'); $idprod = GETPOST('productid', 'int');
$generateinvoicemode = GETPOST('generateinvoicemode', 'string');
$invoiceToUse = GETPOST('invoiceid', 'int');
$prodDurationHours = 1.0;
if ($idprod > 0) if ($idprod > 0)
{ {
$tmpproduct->fetch($idprod); $tmpproduct->fetch($idprod);
if ($tmpproduct->duration_unit=='i')
$prodDurationHours = 1./60;
if ($tmpproduct->duration_unit=='h')
$prodDurationHours = 1.;
if ($tmpproduct->duration_unit=='d')
$prodDurationHours = 24.;
if ($tmpproduct->duration_unit=='w')
$prodDurationHours = 24.*7;
if ($tmpproduct->duration_unit=='m')
$prodDurationHours = 24.*30;
if ($tmpproduct->duration_unit=='y')
$prodDurationHours = 24.*365;
$prodDurationHours *= $tmpproduct->duration_value;
$dataforprice = $tmpproduct->getSellPrice($mysoc, $projectstatic->thirdparty, 0); $dataforprice = $tmpproduct->getSellPrice($mysoc, $projectstatic->thirdparty, 0);
$pu_ht = empty($dataforprice['pu_ht']) ? 0 : $dataforprice['pu_ht']; $pu_ht = empty($dataforprice['pu_ht']) ? 0 : $dataforprice['pu_ht'];
@ -364,15 +381,21 @@ if ($action == 'confirm_generateinvoice')
$tmpinvoice->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $tmpinvoice->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$tmpinvoice->fk_project = $projectstatic->id; $tmpinvoice->fk_project = $projectstatic->id;
if ($invoiceToUse) {
$tmpinvoice->fetch($invoiceToUse);
}
else {
$result = $tmpinvoice->create($user); $result = $tmpinvoice->create($user);
if ($result <= 0) if ($result <= 0)
{ {
$error++; $error++;
setEventMessages($tmpinvoice->error, $tmpinvoice->errors, 'errors'); setEventMessages($tmpinvoice->error, $tmpinvoice->errors, 'errors');
} }
}
if (!$error) if (!$error)
{ {
if ($generateinvoicemode=='onelineperuser') {
$arrayoftasks = array(); $arrayoftasks = array();
foreach ($toselect as $key => $value) foreach ($toselect as $key => $value)
{ {
@ -389,7 +412,7 @@ if ($action == 'confirm_generateinvoice')
$username = $fuser->getFullName($langs); $username = $fuser->getFullName($langs);
// Define qty per hour // Define qty per hour
$qtyhour = round($value['timespent'] / 3600, 2); $qtyhour = $value['timespent'] / 3600;
$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
// If no unit price known // If no unit price known
@ -399,7 +422,7 @@ if ($action == 'confirm_generateinvoice')
} }
// Add lines // Add lines
$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_ht, $qtyhour, $txtva, $localtax1, $localtax2, ($idprod > 0 ? $idprod : 0)); $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_ht, round($qtyhour/$prodDurationHours, 2), $txtva, $localtax1, $localtax2, ($idprod > 0 ? $idprod : 0));
// Update lineid into line of timespent // Update lineid into line of timespent
$sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task_time SET invoice_line_id = '.$lineid.', invoice_id = '.$tmpinvoice->id; $sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task_time SET invoice_line_id = '.$lineid.', invoice_id = '.$tmpinvoice->id;
@ -413,6 +436,92 @@ if ($action == 'confirm_generateinvoice')
} }
} }
} }
elseif ($generateinvoicemode=='onelineperperiod') {
$arrayoftasks = array();
foreach ($toselect as $key => $value)
{
// Get userid, timepent
$object->fetchTimeSpent($value);
$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
$arrayoftasks[$object->timespent_id]['note'] = $object->timespent_note;
$arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user;
}
foreach ($arrayoftasks as $timespent_id => $value)
{
$userid = $value['user'];
$fuser->fetch($userid);
//$pu_ht = $value['timespent'] * $fuser->thm;
$username = $fuser->getFullName($langs);
// Define qty per hour
$qtyhour = $value['timespent'] / 3600;
$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
// If no unit price known
if (empty($pu_ht))
{
$pu_ht = price2num($value['totalvaluetodivideby3600'] / 3600, 'MU');
}
// Add lines
$lineid = $tmpinvoice->addline($value['note'], $pu_ht, round($qtyhour/$prodDurationHours, 2), $txtva, $localtax1, $localtax2, ($idprod > 0 ? $idprod : 0));
// Update lineid into line of timespent
$sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task_time SET invoice_line_id = '.$lineid.', invoice_id = '.$tmpinvoice->id;
$sql .= ' WHERE rowid in ('.join(',', $toselect).') AND fk_user = '.$userid;
$result = $db->query($sql);
if (!$result)
{
$error++;
setEventMessages($db->lasterror(), null, 'errors');
break;
}
}
}
elseif ($generateinvoicemode=='onelinepertask') {
$arrayoftasks = array();
foreach ($toselect as $key => $value)
{
// Get userid, timepent
$object->fetchTimeSpent($value);
// $object->id is the task id
$arrayoftasks[$object->id]['timespent'] += $object->timespent_duration;
$arrayoftasks[$object->id]['totalvaluetodivideby3600'] += $object->timespent_duration * $object->timespent_thm;
}
foreach ($arrayoftasks as $task_id => $value)
{
$ftask = new Task($db);
$ftask->fetch($task_id);
// Define qty per hour
$qtyhour = $value['timespent'] / 3600;
$qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
// If no unit price known
if (empty($pu_ht))
{
$pu_ht = price2num($value['totalvaluetodivideby3600'] / 3600, 'MU');
}
// Add lines
$lineName = $ftask->ref.' - '.$ftask->label;
$lineid = $tmpinvoice->addline($lineName, $pu_ht, round($qtyhour/$prodDurationHours, 2), $txtva, $localtax1, $localtax2, ($idprod > 0 ? $idprod : 0));
// Update lineid into line of timespent
$sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task_time SET invoice_line_id = '.$lineid.', invoice_id = '.$tmpinvoice->id;
$sql .= ' WHERE rowid in ('.join(',', $toselect).')';
$result = $db->query($sql);
if (!$result)
{
$error++;
setEventMessages($db->lasterror(), null, 'errors');
break;
}
}
}
}
if (!$error) if (!$error)
{ {
@ -576,14 +685,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print nl2br($projectstatic->description); print nl2br($projectstatic->description);
print '</td></tr>'; print '</td></tr>';
// Bill time
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($projectstatic->usage_bill_time);
print '</td></tr>';
}
// Categories // Categories
if ($conf->categorie->enabled) { if ($conf->categorie->enabled) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
@ -841,7 +942,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print '<td>'; print '<td>';
$tmparray = array( $tmparray = array(
'onelineperuser'=>'OneLinePerUser', 'onelineperuser'=>'OneLinePerUser',
//'onelinepertask'=>'OneLinePerTask', 'onelinepertask'=>'OneLinePerTask',
'onelineperperiod'=>'OneLinePerPeriod',
); );
print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
print '</td>'; print '</td>';
@ -857,6 +959,15 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
print '<tr>';
print '<td class="titlefield">';
print $langs->trans('InvoiceToUse');
print '</td>';
print '<td>';
$form->selectInvoice('invoice', '', 'invoiceid', 24, 0, $langs->trans('NewInvoice'),
1, 0, 0, 'maxwidth500', '', 'all');
print '</td>';
print '</tr>';
/*print '<tr>'; /*print '<tr>';
print '<td>'; print '<td>';
print $langs->trans('ValidateInvoices'); print $langs->trans('ValidateInvoices');

View File

@ -40,6 +40,8 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$search_ref = GETPOST('search_ref', 'int'); $search_ref = GETPOST('search_ref', 'int');
$search_user = GETPOST('search_user', 'alpha'); $search_user = GETPOST('search_user', 'alpha');
$search_label = GETPOST('search_label', 'alpha'); $search_label = GETPOST('search_label', 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_amount = GETPOST('search_amount', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'int'); $search_account = GETPOST('search_account', 'int');
@ -82,6 +84,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_ref=""; $search_ref="";
$search_user=""; $search_user="";
$search_label=""; $search_label="";
$search_date_start='';
$search_date_end='';
$search_amount=""; $search_amount="";
$search_account=''; $search_account='';
$typeid=""; $typeid="";
@ -115,6 +119,8 @@ $sql .= " AND s.entity = ".$conf->entity;
if ($search_ref) $sql .= " AND s.rowid=".$search_ref; if ($search_ref) $sql .= " AND s.rowid=".$search_ref;
if ($search_user) $sql .= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email'), $search_user); if ($search_user) $sql .= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email'), $search_user);
if ($search_label) $sql .= natural_search(array('s.label'), $search_label); if ($search_label) $sql .= natural_search(array('s.label'), $search_label);
if ($search_date_start) $sql .= " AND s.datep >= '" . $db->idate($search_date_start) . "'";
if ($search_date_end) $sql .= " AND s.datep <= '" . $db->idate($search_date_end) . "'";
if ($search_amount) $sql .= natural_search("s.amount", $search_amount, 1); if ($search_amount) $sql .= natural_search("s.amount", $search_amount, 1);
if ($search_account > 0) $sql .= " AND b.fk_account=".$search_account; if ($search_account > 0) $sql .= " AND b.fk_account=".$search_account;
if ($filtre) { if ($filtre) {
@ -170,7 +176,7 @@ if ($result)
print '<tr class="liste_titre_filter">'; print '<tr class="liste_titre_filter">';
// Ref // Ref
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre left">';
print '<input class="flat" type="text" size="3" name="search_ref" value="'.$db->escape($search_ref).'">'; print '<input class="flat" type="text" size="3" name="search_ref" value="'.$db->escape($search_ref).'">';
print '</td>'; print '</td>';
// Employee // Employee
@ -180,9 +186,18 @@ if ($result)
// Label // Label
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.$db->escape($search_label).'"></td>'; print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.$db->escape($search_label).'"></td>';
// Date // Date
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
print '</div>';
print '</td>';
// Type // Type
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre left">';
$form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16); $form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16);
print '</td>'; print '</td>';
// Account // Account

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