mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 09:08:09 +01:00
Compare commits
69 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
474260e526 | ||
|
|
eead9a93d3 | ||
|
|
ef00cb0736 | ||
|
|
d7f7f5bf3d | ||
|
|
7c0a6946a7 | ||
|
|
1ecc1afa9e | ||
|
|
ceb1e699b7 | ||
|
|
c028819cab | ||
|
|
d59b1bb0c6 | ||
|
|
9d582a53ca | ||
|
|
24c499aa44 | ||
|
|
8eac45a762 | ||
|
|
3d85407619 | ||
|
|
ca1e3b4d55 | ||
|
|
94bb1ac511 | ||
|
|
8893d8d59f | ||
|
|
b9c95a5a5c | ||
|
|
5bab9d59b2 | ||
|
|
37fb70d983 | ||
|
|
02bedc49d3 | ||
|
|
e41b55af13 | ||
|
|
a69c3caf2c | ||
|
|
b96082a577 | ||
|
|
b1a3238c94 | ||
|
|
e03d7eba8c | ||
|
|
2aa0956f15 | ||
|
|
bb09bcece4 | ||
|
|
97b1589fb5 | ||
|
|
2ba7c07574 | ||
|
|
8785d69548 | ||
|
|
2e2cc55350 | ||
|
|
f2cfb928e8 | ||
|
|
dd259043cd | ||
|
|
dc7a1610e7 | ||
|
|
842c6168a2 | ||
|
|
82708705c7 | ||
|
|
d975dd507b | ||
|
|
b1f1ddc6d0 | ||
|
|
e18190565c | ||
|
|
c044d9ab58 | ||
|
|
1870598734 | ||
|
|
9a210c1a91 | ||
|
|
6b3c17680f | ||
|
|
bfed1b9db1 | ||
|
|
ecdb56606d | ||
|
|
4fae1e3236 | ||
|
|
7d5c3a5c4f | ||
|
|
2094c48b7f | ||
|
|
cad7bdc74b | ||
|
|
34145ed443 | ||
|
|
faef7a2e0c | ||
|
|
fd36ade61a | ||
|
|
1d571c4159 | ||
|
|
9eeb80151e | ||
|
|
4caefbe926 | ||
|
|
94de6efa4b | ||
|
|
dd208348c4 | ||
|
|
aab0a33f40 | ||
|
|
4d05bff780 | ||
|
|
9690e68bfb | ||
|
|
a698ba0b56 | ||
|
|
671b4a399d | ||
|
|
2e1727e323 | ||
|
|
5535daf84a | ||
|
|
7c583227fb | ||
|
|
7ce7c0d5e5 | ||
|
|
7f1adc6a6a | ||
|
|
e61bcd03ed | ||
|
|
3295498e9e |
0
.gitignore
vendored
Executable file → Normal file
0
.gitignore
vendored
Executable file → Normal file
@@ -133,10 +133,10 @@ before_script:
|
||||
echo "Set timezone"
|
||||
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
|
||||
echo
|
||||
echo "Enabling APC for PHP <= 5.4"
|
||||
#echo
|
||||
#echo "Enabling APC for PHP <= 5.4"
|
||||
# Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6!
|
||||
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
#echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
echo
|
||||
echo "Enabling Memcached for PHP <= 5.4"
|
||||
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1 and nightly!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# DOLIBARR ERP & CRM
|
||||
|
||||
 
|
||||
 
|
||||
|
||||
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -17,11 +17,13 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file build/generate_filecheck_xml.php
|
||||
* \file build/generate_filelist_xml.php
|
||||
* \ingroup dev
|
||||
* \brief This script create a xml checksum file
|
||||
*/
|
||||
|
||||
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
|
||||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=dirname(__FILE__).'/';
|
||||
@@ -40,55 +42,128 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
* Main
|
||||
*/
|
||||
|
||||
$includecustom=0;
|
||||
$includeconstants=array();
|
||||
|
||||
if (empty($argv[1]))
|
||||
{
|
||||
print "Usage: ".$script_file." release=x.y.z\n";
|
||||
print "Usage: ".$script_file." release=auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||
exit -1;
|
||||
}
|
||||
parse_str($argv[1]);
|
||||
|
||||
if ($release != DOL_VERSION)
|
||||
$i=0;
|
||||
while ($i < $argc)
|
||||
{
|
||||
print 'Error: release is not version declared into filefunc.in.php.'."\n";
|
||||
exit -1;
|
||||
if (! empty($argv[$i])) parse_str($argv[$i]);
|
||||
if (preg_match('/includeconstant=/',$argv[$i]))
|
||||
{
|
||||
$tmp=explode(':', $includeconstant, 3);
|
||||
if (count($tmp) != 3)
|
||||
{
|
||||
print "Error: Bad parameter includeconstant ".$includeconstant."\n";
|
||||
exit -1;
|
||||
}
|
||||
$includeconstants[$tmp[0]][$tmp[1]] = $tmp[2];
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
// If release is auto, we take current version
|
||||
$tmpver=explode('-', $release, 2);
|
||||
if ($tmpver[0] == 'auto')
|
||||
{
|
||||
$release=DOL_VERSION;
|
||||
if ($tmpver[1]) $release.='-'.$tmpver[1];
|
||||
}
|
||||
|
||||
if (empty($includecustom))
|
||||
{
|
||||
$tmpver=explode('-', $release, 2);
|
||||
if (DOL_VERSION != $tmpver[0])
|
||||
{
|
||||
print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpver[0].')'."\n";
|
||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
|
||||
exit -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release))
|
||||
{
|
||||
print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parmater (ex: '.DOL_VERSION.'-mydistrib).'."\n";
|
||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
|
||||
exit -1;
|
||||
}
|
||||
}
|
||||
|
||||
print "Release : ".$release."\n";
|
||||
print "Include custom in signature : ".$includecustom."\n";
|
||||
print "Include constants in signature : ";
|
||||
foreach ($includeconstants as $countrycode => $tmp)
|
||||
{
|
||||
foreach($tmp as $constname => $constvalue)
|
||||
{
|
||||
print $constname.'='.$constvalue." ";
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
|
||||
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
||||
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
|
||||
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
||||
dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
|
||||
|
||||
$checksumconcat=array();
|
||||
|
||||
$outputfile=$outputdir.'/filelist-'.$release.'.xml';
|
||||
$fp = fopen($outputfile,'w');
|
||||
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
|
||||
fputs($fp, '<checksum_list version="'.$release.'">'."\n");
|
||||
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");
|
||||
|
||||
fputs($fp, '<dolibarr_htdocs_dir>'."\n");
|
||||
foreach ($includeconstants as $countrycode => $tmp)
|
||||
{
|
||||
fputs($fp, '<dolibarr_constants country="'.$countrycode.'">'."\n");
|
||||
foreach($tmp as $constname => $constvalue)
|
||||
{
|
||||
$valueforchecksum=(empty($constvalue)?'0':$constvalue);
|
||||
$checksumconcat[]=$valueforchecksum;
|
||||
fputs($fp, ' <constant name="'.$constname.'">'.$valueforchecksum.'</constant>'."\n");
|
||||
}
|
||||
fputs($fp, '</dolibarr_constants>'."\n");
|
||||
}
|
||||
|
||||
$checksumconcat=array();
|
||||
fputs($fp, '<dolibarr_htdocs_dir includecustom="'.$includecustom.'">'."\n");
|
||||
|
||||
$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
||||
/*$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
||||
$iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
||||
// need to ignore document custom etc
|
||||
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||
// Need to ignore document custom etc. Note: this also ignore natively symbolic links.
|
||||
$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|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
||||
$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
|
||||
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||
$dir='';
|
||||
$needtoclose=0;
|
||||
foreach ($files as $file) {
|
||||
$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
|
||||
if ($newdir!=$dir) {
|
||||
foreach ($files as $filetmp) {
|
||||
$file = $filetmp['fullname'];
|
||||
//$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
if ($newdir!=$dir) {
|
||||
if ($needtoclose)
|
||||
fputs($fp, '</dir>'."\n");
|
||||
fputs($fp, '<dir name="'.$newdir.'" >'."\n");
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
fputs($fp, ' <dir name="'.$newdir.'" >'."\n");
|
||||
$dir = $newdir;
|
||||
$needtoclose=1;
|
||||
}
|
||||
if (filetype($file)=="file") {
|
||||
$md5=md5_file($file);
|
||||
$checksumconcat[]=$md5;
|
||||
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||
fputs($fp, ' <md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
}
|
||||
fputs($fp, '</dir>'."\n");
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
fputs($fp, '</dolibarr_htdocs_dir>'."\n");
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
@@ -102,28 +177,36 @@ $checksumconcat=array();
|
||||
|
||||
fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n");
|
||||
|
||||
$dir_iterator2 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../scripts/');
|
||||
// TODO Replace RecursiveDirectoryIterator with dol_dir_list
|
||||
/*$dir_iterator2 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../scripts/');
|
||||
$iterator2 = new RecursiveIteratorIterator($dir_iterator2);
|
||||
// need to ignore document custom etc
|
||||
$files = new RegexIterator($iterator2, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||
// Need to ignore document custom etc. Note: this also ignore natively symbolic links.
|
||||
$files = new RegexIterator($iterator2, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||
*/
|
||||
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
||||
$regextoexclude='(custom|documents|conf|install)$'; // Exclude dirs
|
||||
$files = dol_dir_list(dirname(__FILE__).'/../scripts/', 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||
$dir='';
|
||||
$needtoclose=0;
|
||||
foreach ($files as $file) {
|
||||
$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file));
|
||||
foreach ($files as $filetmp) {
|
||||
$file = $filetmp['fullname'];
|
||||
//$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file));
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file));
|
||||
if ($newdir!=$dir) {
|
||||
if ($needtoclose)
|
||||
fputs($fp, '</dir>'."\n");
|
||||
fputs($fp, '<dir name="'.$newdir.'" >'."\n");
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
fputs($fp, ' <dir name="'.$newdir.'" >'."\n");
|
||||
$dir = $newdir;
|
||||
$needtoclose=1;
|
||||
}
|
||||
if (filetype($file)=="file") {
|
||||
$md5=md5_file($file);
|
||||
$checksumconcat[]=$md5;
|
||||
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||
fputs($fp, ' <md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
}
|
||||
fputs($fp, '</dir>'."\n");
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
fputs($fp, '</dolibarr_script_dir>'."\n");
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@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
|
||||
@@ -143,7 +144,7 @@ if ($action == 'initbarcodeproducts')
|
||||
$nextvalue=$modBarCodeProduct->getNextValue($productstatic,'');
|
||||
|
||||
//print 'Set value '.$nextvalue.' to product '.$productstatic->id." ".$productstatic->ref." ".$productstatic->type."<br>\n";
|
||||
$result=$productstatic->setValueFrom('barcode', $nextvalue, '', '', 'date', '', $user, 'PRODUCT_MODIFY');
|
||||
$result=$productstatic->setValueFrom('barcode', $nextvalue, '', '', 'text', '', $user, 'PRODUCT_MODIFY');
|
||||
|
||||
$nbtry++;
|
||||
if ($result > 0) $nbok++;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2018 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
|
||||
@@ -145,7 +146,8 @@ switch (GETPOST('action','alpha'))
|
||||
$obj_facturation->id($ret['rowid']);
|
||||
$obj_facturation->ref($ret['ref']);
|
||||
$obj_facturation->stock($ret['reel']);
|
||||
$obj_facturation->prix($ret['price']);
|
||||
//$obj_facturation->prix($ret['price']);
|
||||
$obj_facturation->prix($pu_ht);
|
||||
|
||||
|
||||
$vatrate = $tva_tx;
|
||||
|
||||
@@ -74,6 +74,7 @@ $originid = GETPOST('originid', 'int');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
$contactid = GETPOST('contactid','int');
|
||||
$projectid = GETPOST('projectid','int');
|
||||
|
||||
// PDF
|
||||
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
|
||||
@@ -1310,7 +1311,7 @@ if ($action == 'create')
|
||||
}
|
||||
$objectsrc->fetch_thirdparty();
|
||||
|
||||
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
||||
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : 0);
|
||||
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
|
||||
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
|
||||
|
||||
@@ -1478,9 +1479,6 @@ if ($action == 'create')
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled) && $socid > 0)
|
||||
{
|
||||
$projectid = GETPOST('projectid')?GETPOST('projectid'):0;
|
||||
if ($origin == 'project') $projectid = ($originid ? $originid : 0);
|
||||
|
||||
$langs->load("projects");
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("Project") . '</td><td colspan="2">';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
||||
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2018 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -285,6 +285,13 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
{
|
||||
$fk_parent_line = 0;
|
||||
}
|
||||
|
||||
// Extrafields
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
||||
$array_options = $lines[$i]->array_options;
|
||||
}
|
||||
|
||||
$result = $object->addline(
|
||||
$desc,
|
||||
$lines[$i]->subprice,
|
||||
@@ -309,7 +316,8 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
$fk_parent_line,
|
||||
$lines[$i]->fk_fournprice,
|
||||
$lines[$i]->pa_ht,
|
||||
$lines[$i]->label
|
||||
$lines[$i]->label,
|
||||
$array_options
|
||||
);
|
||||
if ($result > 0)
|
||||
{
|
||||
|
||||
@@ -2245,9 +2245,12 @@ class Facture extends CommonInvoice
|
||||
$final = ($this->lines[$i]->situation_percent == 100);
|
||||
$i++;
|
||||
}
|
||||
if ($final) {
|
||||
$this->setFinal($user);
|
||||
}
|
||||
|
||||
if (empty($final)) $this->situation_final = 0;
|
||||
else $this->situation_final = 1;
|
||||
|
||||
$this->setFinal($user);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4090,7 +4093,6 @@ class Facture extends CommonInvoice
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$this->situation_final = 1;
|
||||
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture SET situation_final = ' . $this->situation_final . ' where rowid = ' . $this->id;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
@@ -872,12 +872,27 @@ if (empty($reshook))
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
$old_ref = $object->ref;
|
||||
$result = $object->setValueFrom('ref', GETPOST('ref','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'editref';
|
||||
} else {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$old_filedir = $conf->contrat->dir_output . '/' . dol_sanitizeFileName($old_ref);
|
||||
$new_filedir = $conf->contrat->dir_output . '/' . dol_sanitizeFileName($object->ref);
|
||||
|
||||
$files = dol_dir_list($old_filedir);
|
||||
if (!empty($files))
|
||||
{
|
||||
if (!is_dir($new_filedir)) dol_mkdir($new_filedir);
|
||||
foreach ($files as $file)
|
||||
{
|
||||
dol_move($file['fullname'], $new_filedir.'/'.$file['name']);
|
||||
}
|
||||
}
|
||||
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -1560,7 +1560,7 @@ abstract class CommonObject
|
||||
$this->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, false, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
|
||||
break;
|
||||
case 'invoice_supplier':
|
||||
$this->updateline($line->id, $line->desc, $line->subprice, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->qty, 0, 'HT', $line->info_bits, $line->product_type, $line->remise_percent, false, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
|
||||
$this->updateline($line->id, $line->desc, $line->subprice, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->qty, $line->fk_product, 'HT', $line->info_bits, $line->product_type, $line->remise_percent, false, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
|
||||
break;
|
||||
default:
|
||||
dol_syslog(get_class($this).'::setMulticurrencyRate no updateline defined', LOG_DEBUG);
|
||||
|
||||
@@ -498,7 +498,7 @@ class FormFile
|
||||
$modellist=ModelePDFCards::liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'agenda')
|
||||
elseif ($modulepart == 'agenda' || $modulepart == 'actions')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
@@ -3768,10 +3768,14 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
||||
}
|
||||
else // i am the seller
|
||||
{
|
||||
if (!isOnlyOneLocalTax($local)) // This is for spain only, we don't return value found into datbase even if there is only one locatax vat.
|
||||
{
|
||||
return $conf->global->MAIN_INFO_VALUE_LOCALTAX2;
|
||||
}
|
||||
if (in_array($mysoc->country_code, array('ES')))
|
||||
{
|
||||
return $thirdparty_buyer->localtax2_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $conf->global->MAIN_INFO_VALUE_LOCALTAX2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3926,50 +3930,16 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($local == 1)
|
||||
{
|
||||
if (! isOnlyOneLocalTax(1))
|
||||
{
|
||||
return array($obj->localtax1_type, get_localtax($vatrate, $local, $buyer, $seller), $obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||
}
|
||||
else
|
||||
{
|
||||
return array($obj->localtax1_type, $obj->localtax1,$obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||
}
|
||||
return array($obj->localtax1_type, get_localtax($vatrate, $local, $buyer, $seller), $obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||
}
|
||||
elseif ($local == 2)
|
||||
{
|
||||
if (! isOnlyOneLocalTax(2))
|
||||
{
|
||||
return array($obj->localtax2_type, get_localtax($vatrate, $local, $buyer, $seller),$obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||
}
|
||||
else
|
||||
{
|
||||
return array($obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||
}
|
||||
return array($obj->localtax2_type, get_localtax($vatrate, $local, $buyer, $seller),$obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(! isOnlyOneLocalTax(1))
|
||||
{
|
||||
if(! isOnlyOneLocalTax(2))
|
||||
{
|
||||
return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, get_localtax($vatrate, 2, $buyer, $seller), $obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
||||
}
|
||||
else
|
||||
{
|
||||
return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, $obj->localtax2, $obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(! isOnlyOneLocalTax(2))
|
||||
{
|
||||
return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, get_localtax($vatrate, 2, $buyer, $seller), $obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||
}
|
||||
else
|
||||
{
|
||||
return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, $obj->localtax2, $obj->accountancy_code_sell, $obj->accountancy_code_buy);
|
||||
}
|
||||
}
|
||||
return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, get_localtax($vatrate, 2, $buyer, $seller), $obj->accountancy_code_sell,$obj->accountancy_code_buy);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -378,7 +378,7 @@ class modAgenda extends DolibarrModules
|
||||
$this->export_TypeFields_array[$r]=array('ac.ref_ext'=>"Text",'ac.datec'=>"Date",'ac.datep'=>"Date",
|
||||
'ac.datep2'=>"Date",'ac.label'=>"Text",'ac.note'=>"Text",'ac.percent'=>"Numeric",
|
||||
'ac.durationp'=>"Duree",
|
||||
'cac.libelle'=>"List:c_actioncomm:libelle:id",
|
||||
'cac.libelle'=>"List:c_actioncomm:libelle:libelle",
|
||||
's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text',
|
||||
'co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.idprof5'=>'Text','s.idprof6'=>'Text',
|
||||
's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text');
|
||||
@@ -400,7 +400,7 @@ class modAgenda extends DolibarrModules
|
||||
$this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda',1).')';
|
||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)';
|
||||
if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id);
|
||||
$this->export_sql_end[$r] .=' ORDER BY ac.datep';
|
||||
$this->export_sql_order[$r]=' ORDER BY ac.datep';
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class modCommande extends DolibarrModules
|
||||
$this->depends = array("modSociete");
|
||||
$this->requiredby = array("modExpedition");
|
||||
$this->conflictwith = array();
|
||||
$this->langfiles = array('orders', 'bills', 'companies','products', 'deliveries');
|
||||
$this->langfiles = array('orders', 'bills', 'companies','products', 'deliveries', 'sendings');
|
||||
|
||||
// Constants
|
||||
$this->const = array();
|
||||
@@ -184,9 +184,9 @@ class modCommande extends DolibarrModules
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_permission[$r]=array(array("commande","commande","export"));
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','d.nom'=>'State','co.label'=>'Country','co.code'=>"CountryCode",'s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"OrderDate",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"Billed",'c.fk_statut'=>'Status','c.note_public'=>"Note",'c.date_livraison'=>'DeliveryDate','c.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','c.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','pj.ref'=>'ProjectRef','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','d.nom'=>'State','co.label'=>'Country','co.code'=>"CountryCode",'s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"OrderDate",'c.date_livraison'=>"DateDeliveryPlanned",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"Billed",'c.fk_statut'=>'Status','c.note_public'=>"Note",'c.date_livraison'=>'DeliveryDate','c.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','c.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','pj.ref'=>'ProjectRef','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
|
||||
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Numeric",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:product:ref','p.ref'=>'Text','p.label'=>'Text');
|
||||
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Numeric",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','pj.ref'=>'Text','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:product:ref','p.ref'=>'Text','p.label'=>'Text','d.nom'=>'Text');
|
||||
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.date_livraison'=>"Date",'c.amount_ht'=>"Numeric",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','pj.ref'=>'Text','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:product:ref','p.ref'=>'Text','p.label'=>'Text','d.nom'=>'Text');
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','d.nom'=>'company','co.label'=>'company','co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'pj.ref'=>'project','cd.rowid'=>'order_line','cd.label'=>"order_line",'cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
|
||||
$this->export_dependencies_array[$r]=array('order_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
|
||||
$keyforselect='commande'; $keyforelement='order'; $keyforaliasextra='extra';
|
||||
|
||||
@@ -73,7 +73,7 @@ class modFournisseur extends DolibarrModules
|
||||
// Dependencies
|
||||
$this->depends = array("modSociete");
|
||||
$this->requiredby = array();
|
||||
$this->langfiles = array('bills', 'companies', 'suppliers', 'orders');
|
||||
$this->langfiles = array('bills', 'companies', 'suppliers', 'orders', 'sendings');
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array("supplier_order.php");
|
||||
@@ -452,14 +452,14 @@ class modFournisseur extends DolibarrModules
|
||||
$this->export_label[$r]='Commandes fournisseurs et lignes de commandes';
|
||||
$this->export_icon[$r]='order';
|
||||
$this->export_permission[$r]=array(array("fournisseur","commande","export"));
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"OrderId",'f.ref'=>"Ref",'f.ref_supplier'=>"RefSupplier",'f.date_creation'=>"DateCreation",'f.date_commande'=>"OrderDate",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.fk_statut'=>'Status','f.date_approve'=>'DateApprove','f.date_approve2'=>'DateApprove2','f.note_public'=>"NotePublic",'f.note_private'=>"NotePrivate",'ua1.login'=>'ApprovedBy','ua2.login'=>'ApprovedBy2','fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId',
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"OrderId",'f.ref'=>"Ref",'f.ref_supplier'=>"RefSupplier",'f.date_creation'=>"DateCreation",'f.date_commande'=>"OrderDate",'f.date_livraison'=>"DateDeliveryPlanned",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.fk_statut'=>'Status','f.date_approve'=>'DateApprove','f.date_approve2'=>'DateApprove2','f.note_public'=>"NotePublic",'f.note_private'=>"NotePrivate",'ua1.login'=>'ApprovedBy','ua2.login'=>'ApprovedBy2','fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId',
|
||||
'p.ref'=>'ProductRef','p.label'=>'ProductLabel','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel');
|
||||
if (empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED))
|
||||
{
|
||||
unset($this->export_fields_array['f.date_approve2']);
|
||||
unset($this->export_fields_array['ua2.login']);
|
||||
}
|
||||
$this->export_TypeFields_array[$r]=array('s.rowid'=>"company",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.idprof5'=>'Text','s.idprof6'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.date_creation'=>"Date",'f.date_commande'=>"Date",'f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.fk_statut'=>'Status','f.date_approve'=>'Date','f.date_approve2'=>'Date','f.note_public'=>"Text",'f.note_private'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.remise_percent'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.product_type'=>'Numeric','fd.fk_product'=>'List:product:label',
|
||||
$this->export_TypeFields_array[$r]=array('s.rowid'=>"company",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.idprof5'=>'Text','s.idprof6'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.date_creation'=>"Date",'f.date_commande'=>"Date",'f.date_livraison'=>"Date",'f.total_ht'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.fk_statut'=>'Status','f.date_approve'=>'Date','f.date_approve2'=>'Date','f.note_public'=>"Text",'f.note_private'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.remise_percent'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.product_type'=>'Numeric','fd.fk_product'=>'List:product:label',
|
||||
'p.ref'=>'Text','p.label'=>'Text','project.ref'=>'Text','project.title'=>'Text');
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','ua1.login'=>'user','ua2.login'=>'user','fd.rowid'=>'order_line','fd.description'=>"order_line",'fd.tva_tx'=>"order_line",'fd.qty'=>"order_line",'fd.remise_percent'=>"order_line",'fd.total_ht'=>"order_line",'fd.total_ttc'=>"order_line",'fd.total_tva'=>"order_line",'fd.product_type'=>'order_line','fd.fk_product'=>'product',
|
||||
'p.ref'=>'product','p.label'=>'product','project.rowid'=>'project','project.ref'=>'project','project.title'=>'project');
|
||||
|
||||
@@ -983,6 +983,8 @@ if (empty($reshook))
|
||||
$type = $productsupplier->type;
|
||||
$price_base_type = 'HT';
|
||||
|
||||
$rang = $object->line_max() +1;
|
||||
|
||||
// TODO Save the product supplier ref into database (like done for supplier propal and order) into field ref_supplier (must rename field ref into ref_supplier first)
|
||||
$result=$object->addline(
|
||||
$desc,
|
||||
@@ -999,7 +1001,7 @@ if (empty($reshook))
|
||||
$tva_npr,
|
||||
$price_base_type,
|
||||
$type,
|
||||
-1,
|
||||
$rang,
|
||||
0,
|
||||
$array_options,
|
||||
$productsupplier->fk_unit
|
||||
|
||||
@@ -121,7 +121,7 @@ create table llx_expensereport_extrafields
|
||||
ALTER TABLE llx_expensereport_extrafields ADD INDEX idx_expensereport_extrafields (fk_object);
|
||||
|
||||
ALTER TABLE llx_cotisation RENAME TO llx_subscription;
|
||||
-- VPGSQL8.2 ALTER SEQUENCE IF EXISTS llx_cotisation_rowid_seq RENAME TO llx_subscription_rowid_seq;
|
||||
-- VPGSQL8.2 ALTER SEQUENCE llx_cotisation_rowid_seq RENAME TO llx_subscription_rowid_seq;
|
||||
|
||||
ALTER TABLE llx_subscription ADD UNIQUE INDEX uk_subscription (fk_adherent,dateadh);
|
||||
ALTER TABLE llx_subscription CHANGE COLUMN cotisation subscription real;
|
||||
|
||||
@@ -1625,7 +1625,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra
|
||||
if (! empty($conf->user->enabled) && $user->rights->user->user->lire)
|
||||
{
|
||||
$langs->load("users");
|
||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'maxwidth100', 'sall', 'M', 'searchleftuser', img_object('','user'));
|
||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/user/index.php', DOL_URL_ROOT.'/user/index.php', $langs->trans("Users"), 'maxwidth100', 'sall', 'M', 'searchleftuser', img_object('','user'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -763,7 +763,7 @@ class Product extends CommonObject
|
||||
$sql.= ", duration = '" . $this->db->escape($this->duration_value . $this->duration_unit) ."'";
|
||||
$sql.= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy)."'";
|
||||
$sql.= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell)."'";
|
||||
$sql.= ", desiredstock = " . ((isset($this->desiredstock) && $this->desiredstock != '') ? $this->desiredstock : "null");
|
||||
$sql.= ", desiredstock = " . ((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? $this->desiredstock : "null");
|
||||
$sql.= ", cost_price = " . ($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null');
|
||||
$sql.= ", fk_unit= " . (!$this->fk_unit ? 'NULL' : $this->fk_unit);
|
||||
$sql.= ", price_autogen = " . (!$this->price_autogen ? 0 : 1);
|
||||
|
||||
@@ -154,6 +154,8 @@ if ($action == 'order' && isset($_POST['valid']))
|
||||
$line->total_ttc = $line->total_ht + $line->total_tva;
|
||||
$line->remise_percent = $obj->remise_percent;
|
||||
$line->ref_fourn = $obj->ref_fourn;
|
||||
$line->type = $product->type;
|
||||
$line->fk_unit = $product->fk_unit;
|
||||
$suppliers[$obj->fk_soc]['lines'][] = $line;
|
||||
}
|
||||
}
|
||||
@@ -198,7 +200,13 @@ if ($action == 'order' && isset($_POST['valid']))
|
||||
$line->remise_percent,
|
||||
'HT',
|
||||
0,
|
||||
$line->info_bits
|
||||
$line->type,
|
||||
0,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
0,
|
||||
$line->fk_unit
|
||||
);
|
||||
}
|
||||
if ($result < 0) {
|
||||
|
||||
@@ -61,7 +61,9 @@ class AdherentTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
@@ -79,7 +81,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||
|
||||
if (! empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) {
|
||||
if (! empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) {
|
||||
print "\n".__METHOD__." Company must be setup to have name-firstname in order 'Firstname Lastname'\n";
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -59,7 +59,9 @@ class AdminLibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
@@ -142,21 +144,21 @@ class AdminLibTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testEnableModule
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testEnableModule()
|
||||
{
|
||||
global $conf, $db, $langs, $user;
|
||||
|
||||
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/modules/modExpenseReport.class.php';
|
||||
print "Enable module modExpenseReport";
|
||||
$moduledescriptor=new modExpenseReport($db);
|
||||
$moduledescriptor->init();
|
||||
$conf->setValues($db);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,9 @@ class BankAccountTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -62,6 +62,8 @@ class BonPrelevementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -89,7 +89,9 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -59,7 +59,9 @@ class CMailFileTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
@@ -103,7 +105,7 @@ class CMailFileTest extends PHPUnit_Framework_TestCase
|
||||
$db=$this->savdb;
|
||||
|
||||
$conf->global->MAIN_DISABLE_ALL_MAILS=1; // If I comment/remove this lien, unit test still works alone but failed when ran from AllTest. Don't know why.
|
||||
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -60,7 +60,9 @@ class CategorieTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -60,6 +60,8 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
@@ -117,7 +119,7 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testChargeSocialesCreate
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testChargeSocialesCreate()
|
||||
@@ -139,10 +141,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testChargeSocialesFetch
|
||||
*
|
||||
*
|
||||
* @param int $id Id of social contribution
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
* @depends testChargeSocialesCreate
|
||||
* The depends says test is run only if previous is ok
|
||||
*/
|
||||
@@ -164,10 +166,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testChargeSocialesValid
|
||||
*
|
||||
*
|
||||
* @param Object $localobject Social contribution
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
* @depends testChargeSocialesFetch
|
||||
* The depends says test is run only if previous is ok
|
||||
*/
|
||||
@@ -188,10 +190,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testChargeSocialesOther
|
||||
*
|
||||
*
|
||||
* @param Object $localobject Social contribution
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
* @depends testChargeSocialesValid
|
||||
* The depends says test is run only if previous is ok
|
||||
*/
|
||||
@@ -216,10 +218,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testChargeSocialesDelete
|
||||
*
|
||||
*
|
||||
* @param int $id Social contribution
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
* @depends testChargeSocialesOther
|
||||
* The depends says test is run only if previous is ok
|
||||
*/
|
||||
|
||||
@@ -61,7 +61,9 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -59,7 +59,9 @@ class CommandeTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -60,7 +60,9 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -60,6 +60,8 @@ class CompanyBankAccountTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -68,6 +68,8 @@ class ContactTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
@@ -207,7 +209,7 @@ class ContactTest extends PHPUnit_Framework_TestCase
|
||||
$localobject->email='newemail@newemail.com';
|
||||
$localobject->jabberid='New im id';
|
||||
$localobject->default_lang='es_ES';
|
||||
|
||||
|
||||
$result=$localobject->update($localobject->id,$user);
|
||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0, 'Contact::update error');
|
||||
|
||||
@@ -60,6 +60,8 @@ class ContratTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -62,7 +62,9 @@ class CoreTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
@@ -290,22 +292,22 @@ class CoreTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
// Run tests
|
||||
|
||||
|
||||
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices';
|
||||
$result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2);
|
||||
$expectedresult=0;
|
||||
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1a');
|
||||
|
||||
|
||||
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices;badaction';
|
||||
$result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2);
|
||||
$expectedresult=1;
|
||||
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1b');
|
||||
|
||||
|
||||
$_GET['aaa']="<img src='1.jpg' onerror =javascript:alert('XSS')>";
|
||||
$result=test_sql_and_script_inject($_GET['aaa'], 0);
|
||||
$expectedresult=1;
|
||||
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 2');
|
||||
|
||||
|
||||
$_POST['bbb']="<img src='1.jpg' onerror =javascript:alert('XSS')>";
|
||||
$result=test_sql_and_script_inject($_POST['bbb'], 2);
|
||||
$expectedresult=1;
|
||||
|
||||
@@ -60,6 +60,8 @@ class DateLibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -60,6 +60,8 @@ class DateLibTzFranceTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -60,6 +60,8 @@ class DiscountTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -60,6 +60,8 @@ class EntrepotTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -64,6 +64,8 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -60,6 +60,8 @@ class FactureFournisseurTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -61,6 +61,8 @@ class FactureRecTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -59,7 +59,9 @@ class FactureTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -60,6 +60,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -60,6 +60,8 @@ class FichinterTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -61,6 +61,8 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
@@ -399,7 +401,7 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
||||
print __METHOD__." result=".join(',',$result)."\n";
|
||||
$this->assertEquals(0,count($result));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testDolDirList
|
||||
*
|
||||
@@ -411,7 +413,7 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
||||
public function testDolDirList()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
|
||||
|
||||
// Scan dir to guaruante we on't have library jquery twice (we accept exception of duplicte into ckeditor because all dir is removed for debian package, so there is no duplicate).
|
||||
$founddirs=dol_dir_list(DOL_DOCUMENT_ROOT.'/includes/', 'files', 1, '^jquery\.js', array('ckeditor'));
|
||||
print __METHOD__." count(founddirs)=".count($founddirs)."\n";
|
||||
|
||||
@@ -60,6 +60,8 @@ class FormAdminTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -63,7 +63,9 @@ class Functions2LibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -63,7 +63,9 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -62,6 +62,8 @@ class HolidayTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
@@ -201,11 +203,11 @@ class HolidayTest extends PHPUnit_Framework_TestCase
|
||||
$localobject->email='newemail@newemail.com';
|
||||
$localobject->jabberid='New im id';
|
||||
$localobject->default_lang='es_ES';
|
||||
|
||||
|
||||
$result=$localobject->update($localobject->id,$user);
|
||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0, 'Holiday::update error');
|
||||
|
||||
|
||||
$result=$localobject->update_note($localobject->note_private,'_private');
|
||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0, 'Holiday::update_note (private) error');
|
||||
@@ -213,7 +215,7 @@ class HolidayTest extends PHPUnit_Framework_TestCase
|
||||
$result=$localobject->update_note($localobject->note_public, '_public');
|
||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0, 'Holiday::update_note (public) error');
|
||||
|
||||
|
||||
|
||||
$newobject=new Holiday($this->savdb);
|
||||
$result=$newobject->fetch($localobject->id);
|
||||
|
||||
@@ -61,6 +61,8 @@ class ImagesLibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -62,6 +62,8 @@ class ImportTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -62,7 +62,9 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
@@ -134,7 +136,7 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
|
||||
// Do a test with an array starting with 0
|
||||
$arraytotest=array(0=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "'));
|
||||
$arrayencodedexpected='[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]';
|
||||
|
||||
|
||||
$encoded=json_encode($arraytotest);
|
||||
$this->assertEquals($arrayencodedexpected,$encoded);
|
||||
$decoded=json_decode($encoded,true);
|
||||
@@ -148,7 +150,7 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
|
||||
// Same test but array start with 2 instead of 0
|
||||
$arraytotest=array(2=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "'));
|
||||
$arrayencodedexpected='{"2":{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}}';
|
||||
|
||||
|
||||
$encoded=json_encode($arraytotest);
|
||||
$this->assertEquals($arrayencodedexpected,$encoded);
|
||||
$decoded=json_decode($encoded,true);
|
||||
@@ -158,7 +160,7 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($arrayencodedexpected,$encoded);
|
||||
$decoded=dol_json_decode($encoded,true);
|
||||
$this->assertEquals($arraytotest,$decoded,'test for dol_json_xxx');
|
||||
|
||||
|
||||
// Test with object
|
||||
$now=gmmktime(12,0,0,1,1,1970);
|
||||
$objecttotest=new stdClass();
|
||||
|
||||
@@ -72,6 +72,8 @@ class LangTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -60,6 +60,8 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
@@ -136,7 +138,7 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(25,$result[1]);
|
||||
print __METHOD__." result[2]=".$result[2]."\n";
|
||||
$this->assertEquals(20,$result[2]);
|
||||
|
||||
|
||||
$result=getMarginInfos(10, 10, 19.6, 0, 0, 0, 8);
|
||||
print __METHOD__." result[0]=".$result[0]."\n";
|
||||
$this->assertEquals(8,$result[0]);
|
||||
@@ -144,7 +146,7 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(12.5,$result[1]);
|
||||
print __METHOD__." result[2]=".$result[2]."\n";
|
||||
$this->assertEquals(1/9*100,$result[2]);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ class ModulesTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -62,6 +62,8 @@ class MouvementStockTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -59,6 +59,8 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
@@ -75,7 +77,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
|
||||
|
||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||
|
||||
print __METHOD__."\n";
|
||||
@@ -138,7 +140,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
|
||||
$conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}-{0000}';
|
||||
$conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}-{0000}';
|
||||
$conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED=0;
|
||||
|
||||
|
||||
$localobject=new Facture($this->savdb);
|
||||
$localobject->initAsSpecimen();
|
||||
$localobject->date=dol_mktime(12, 0, 0, 1, 1, 1915); // we use year 1915 to be sure to not have existing invoice for this year
|
||||
|
||||
@@ -61,6 +61,8 @@ class PaypalTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
@@ -135,9 +137,9 @@ class PaypalTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
$urltotest=getPaypalPaymentUrl(1,'free');
|
||||
print "urltotest=".$urltotest."\n";
|
||||
|
||||
|
||||
$result=getURLContent($urltotest, 'GET');
|
||||
|
||||
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThanOrEqual($result, 0);
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@ class PdfDocTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -62,6 +62,8 @@ class PgsqlTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
@@ -167,13 +169,13 @@ class PgsqlTest extends PHPUnit_Framework_TestCase
|
||||
$result=DoliDBPgsql::convertSQLFromMysql($sql);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, "SELECT a.b, STRING_AGG(a.c, ',') FROM table GROUP BY a.b", 'Test GROUP_CONCAT (without SEPARATOR)');
|
||||
|
||||
|
||||
// Test GROUP_CONCAT (with SEPARATOR)
|
||||
$sql="SELECT a.b, GROUP_CONCAT(a.c SEPARATOR ',') FROM table GROUP BY a.b";
|
||||
$result=DoliDBPgsql::convertSQLFromMysql($sql);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, "SELECT a.b, STRING_AGG(a.c, ',') FROM table GROUP BY a.b", 'Test GROUP_CONCAT (with SEPARATOR)');
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,9 @@ class PricesTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -60,7 +60,9 @@ class ProductTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -61,6 +61,8 @@ class ProjectTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -60,6 +60,8 @@ class PropalTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -64,7 +64,9 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
@@ -106,7 +108,7 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
|
||||
$this->api_url=DOL_MAIN_URL_ROOT.'/api/index.php';
|
||||
|
||||
$login='admin';
|
||||
@@ -158,7 +160,7 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
||||
$object=json_decode($result['content'], true);
|
||||
$this->assertNotNull($object, "Parsing of json result must no be null");
|
||||
$this->assertEquals(404, $object['error']['code']);
|
||||
|
||||
|
||||
$url = $this->api_url.'/users/1?api_key='.$this->api_key;
|
||||
|
||||
print __METHOD__." Request GET url=".$url."\n";
|
||||
@@ -172,11 +174,11 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
public function testRestCreateUser() {
|
||||
|
||||
|
||||
// attemp to create without mandatory fields :
|
||||
$url = $this->api_url.'/users?api_key='.$this->api_key;
|
||||
$addheaders=array('Content-Type: application/json');
|
||||
|
||||
|
||||
$bodyobj = array(
|
||||
"lastname"=>"testRestUser",
|
||||
"password"=>"testRestPassword",
|
||||
@@ -210,14 +212,14 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase
|
||||
$resid=json_decode($result['content'], true);
|
||||
$this->assertNotNull($resid, "Parsing of json result must no be null");
|
||||
$this->assertGreaterThan(0, $resid, $object['error']['code'].' '.$object['error']['message']);
|
||||
|
||||
|
||||
// attempt to create duplicated user
|
||||
print __METHOD__." Request POST url=".$url."\n";
|
||||
$result=getURLContent($url, 'POST', $body, 1, $addheaders);
|
||||
//print __METHOD__." Result for creating duplicate user".var_export($result, true)."\n";
|
||||
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
||||
$this->assertEquals($result['curl_error_no'],'');
|
||||
$object=json_decode($result['content'], true);
|
||||
$object=json_decode($result['content'], true);
|
||||
$this->assertNotNull($object, "Parsing of json result must no be null");
|
||||
$this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
|
||||
}
|
||||
|
||||
@@ -72,6 +72,8 @@ class ScriptsTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -72,6 +72,8 @@ class SecurityTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
|
||||
@@ -60,7 +60,9 @@ class SocieteTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -72,7 +72,9 @@ class SqlTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
@@ -143,16 +145,16 @@ class SqlTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
$listofsqldir = array(DOL_DOCUMENT_ROOT.'/install/mysql/tables', DOL_DOCUMENT_ROOT.'/install/mysql/migration');
|
||||
|
||||
foreach ($listofsqldir as $dir)
|
||||
foreach ($listofsqldir as $dir)
|
||||
{
|
||||
print 'Process dir '.$dir."\n";
|
||||
$filesarray = scandir($dir);
|
||||
|
||||
foreach($filesarray as $key => $file)
|
||||
|
||||
foreach($filesarray as $key => $file)
|
||||
{
|
||||
if (! preg_match('/\.sql$/',$file))
|
||||
continue;
|
||||
|
||||
|
||||
print 'Check sql file '.$file."\n";
|
||||
$filecontent=file_get_contents($dir.'/'.$file);
|
||||
|
||||
@@ -167,7 +169,7 @@ class SqlTest extends PHPUnit_Framework_TestCase
|
||||
$result=strpos($filecontent,'ON DELETE CASCADE');
|
||||
print __METHOD__." Result for checking we don't have 'ON DELETE CASCADE' = ".$result."\n";
|
||||
$this->assertTrue($result===false, 'Found ON DELETE CASCADE into '.$file.'. Bad.');
|
||||
|
||||
|
||||
if ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/migration')
|
||||
{
|
||||
// Test for migration files only
|
||||
@@ -176,9 +178,9 @@ class SqlTest extends PHPUnit_Framework_TestCase
|
||||
else
|
||||
{
|
||||
if (preg_match('/\.key\.sql$/',$file))
|
||||
{
|
||||
{
|
||||
// Test for files key files only
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -59,7 +59,9 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
@@ -117,7 +119,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testUserGroupCreate
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testUserGroupCreate()
|
||||
@@ -139,7 +141,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testUserGroupFetch
|
||||
*
|
||||
*
|
||||
* @param int $id Id of group
|
||||
* @return void
|
||||
* @depends testUserGroupCreate
|
||||
@@ -163,7 +165,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testUserGroupUpdate
|
||||
*
|
||||
*
|
||||
* @param Object $localobject Group
|
||||
* @return void
|
||||
* @depends testUserGroupFetch
|
||||
@@ -187,7 +189,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testUserGroupAddRight
|
||||
*
|
||||
*
|
||||
* @param Object $localobject Object to show
|
||||
* @return void
|
||||
* @depends testUserGroupUpdate
|
||||
@@ -210,7 +212,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testUserGroupDelRight
|
||||
*
|
||||
*
|
||||
* @param Object $localobject Object
|
||||
* @return void
|
||||
* @depends testUserGroupAddRight
|
||||
@@ -233,7 +235,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testUserGroupOther
|
||||
*
|
||||
*
|
||||
* @param Object $localobject Object
|
||||
* @return void
|
||||
* @depends testUserGroupDelRight
|
||||
@@ -261,7 +263,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* testUserGroupDelete
|
||||
*
|
||||
*
|
||||
* @param int $id Id of object
|
||||
* @return void
|
||||
* @depends testUserGroupOther
|
||||
|
||||
@@ -59,7 +59,9 @@ class UserTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -54,11 +54,11 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
||||
protected $savlangs;
|
||||
protected $savdb;
|
||||
protected $soapclient;
|
||||
|
||||
|
||||
private static $socid;
|
||||
|
||||
|
||||
protected $ns = 'http://www.dolibarr.org/ns/';
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* We save global variables into local variables
|
||||
@@ -67,13 +67,15 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
$this->savlangs=$langs;
|
||||
$this->savdb=$db;
|
||||
|
||||
|
||||
// Set the WebService URL
|
||||
$WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php';
|
||||
print __METHOD__." create nusoap_client for URL=".$WS_DOL_URL."\n";
|
||||
@@ -83,7 +85,7 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
||||
$this->soapclient->soap_defencoding='UTF-8';
|
||||
$this->soapclient->decodeUTF8(false);
|
||||
}
|
||||
|
||||
|
||||
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
|
||||
//print " - db ".$db->db;
|
||||
print "\n";
|
||||
@@ -116,7 +118,7 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
||||
$societe->date_creation=$now;
|
||||
$societe->tva_assuj=0;
|
||||
$societe->particulier=0;
|
||||
|
||||
|
||||
$societe->create($user);
|
||||
|
||||
self::$socid = $societe->id;
|
||||
@@ -257,13 +259,13 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testWSInvoicesGetInvoiceByRefExt
|
||||
*
|
||||
*
|
||||
* Retrieve an invoice using ref_ext
|
||||
* @depends testWSInvoicesCreateInvoice
|
||||
*
|
||||
*
|
||||
* @param array $result Invoice created by create method
|
||||
* @return array Invoice
|
||||
*/
|
||||
@@ -313,13 +315,13 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testWSInvoicesUpdateInvoiceByRefExt
|
||||
*
|
||||
*
|
||||
* Update an invoice using ref_ext
|
||||
* @depends testWSInvoicesCreateInvoice
|
||||
*
|
||||
*
|
||||
* @param array $result invoice created by create method
|
||||
* @return array Invoice
|
||||
*/
|
||||
|
||||
@@ -61,7 +61,9 @@ class WebservicesOrdersTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -61,7 +61,9 @@ class WebservicesOtherTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -68,7 +68,9 @@ class WebservicesProductsTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -53,12 +53,12 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
protected $savlangs;
|
||||
protected $savdb;
|
||||
protected $soapclient;
|
||||
|
||||
|
||||
private $_WS_DOL_URL;
|
||||
private $_ns='http://www.dolibarr.org/ns/';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -68,15 +68,17 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
$this->savlangs=$langs;
|
||||
$this->savdb=$db;
|
||||
|
||||
|
||||
$this->_WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php';
|
||||
|
||||
|
||||
// Set the WebService URL
|
||||
print __METHOD__." create nusoap_client for URL=".$this->_WS_DOL_URL."\n";
|
||||
$this->soapclient = new nusoap_client($this->_WS_DOL_URL);
|
||||
@@ -146,10 +148,10 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
|
||||
$WS_METHOD = 'createThirdParty';
|
||||
|
||||
|
||||
|
||||
|
||||
// Call the WebService method and store its result in $result.
|
||||
$authentication=array(
|
||||
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
||||
@@ -157,7 +159,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
'login'=>'admin',
|
||||
'password'=>'admin',
|
||||
'entity'=>'');
|
||||
|
||||
|
||||
$body = array (
|
||||
"id" => NULL,
|
||||
"ref" => "name",
|
||||
@@ -195,7 +197,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
"vat_used" => "",
|
||||
"vat_number" => ""
|
||||
);
|
||||
|
||||
|
||||
// Test URL
|
||||
$result='';
|
||||
$parameters = array('authentication'=>$authentication, 'thirdparty'=>$body);
|
||||
@@ -215,20 +217,20 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
print $this->soapclient->response;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
|
||||
print __METHOD__." result=".$result['result']['result_code']."\n";
|
||||
$this->assertEquals('OK',$result['result']['result_code']);
|
||||
$this->assertEquals('name',$result['ref']);
|
||||
|
||||
$this->assertEquals('name',$result['ref']);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* testWSThirdpartygetThirdPartyById
|
||||
*
|
||||
*
|
||||
* Use id to retrieve thirdparty
|
||||
* @depends testWSThirdpartycreateThirdParty
|
||||
*
|
||||
*
|
||||
* @param array $result thirdparty created by create method
|
||||
* @return array thirpdarty updated
|
||||
*/
|
||||
@@ -278,18 +280,18 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('0', $result['thirdparty']['status']);
|
||||
$this->assertEquals('1', $result['thirdparty']['client']);
|
||||
$this->assertEquals('0', $result['thirdparty']['supplier']);
|
||||
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testWSThirdpartygetThirdPartyByRefExt
|
||||
*
|
||||
* Use ref_ext to retrieve thirdparty
|
||||
*
|
||||
* @depends testWSThirdpartycreateThirdParty
|
||||
*
|
||||
*
|
||||
* @param array $result thirdparty created by create method
|
||||
* @return array thirdparty
|
||||
*/
|
||||
@@ -301,9 +303,9 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
$id = $result['id'];
|
||||
|
||||
|
||||
$WS_METHOD = 'getThirdParty';
|
||||
|
||||
|
||||
// Call the WebService method and store its result in $result.
|
||||
$authentication=array(
|
||||
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
||||
@@ -311,7 +313,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
'login'=>'admin',
|
||||
'password'=>'admin',
|
||||
'entity'=>'');
|
||||
|
||||
|
||||
// Test URL
|
||||
$result='';
|
||||
$parameters = array('authentication'=>$authentication, 'id'=>'', 'ref'=>'', 'ref_ext'=>'12');
|
||||
@@ -332,7 +334,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
print $this->soapclient->response;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
|
||||
print __METHOD__." result=".$result['result']['result_code']."\n";
|
||||
$this->assertEquals('OK',$result['result']['result_code']);
|
||||
$this->assertEquals($id, $result['thirdparty']['id']);
|
||||
@@ -341,11 +343,11 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('0', $result['thirdparty']['status']);
|
||||
$this->assertEquals('1', $result['thirdparty']['client']);
|
||||
$this->assertEquals('0', $result['thirdparty']['supplier']);
|
||||
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testWSThirdpartydeleteThirdParty
|
||||
*
|
||||
@@ -362,9 +364,9 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
$id = $result['id'];
|
||||
|
||||
|
||||
$WS_METHOD = 'deleteThirdParty';
|
||||
|
||||
|
||||
// Call the WebService method and store its result in $result.
|
||||
$authentication=array(
|
||||
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
|
||||
@@ -372,7 +374,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
'login'=>'admin',
|
||||
'password'=>'admin',
|
||||
'entity'=>'');
|
||||
|
||||
|
||||
$result='';
|
||||
$parameters = array('authentication'=>$authentication, 'id'=>$id, 'ref'=>'', 'ref_ext'=>'');
|
||||
print __METHOD__." call method ".$WS_METHOD."\n";
|
||||
@@ -393,7 +395,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
print __METHOD__." result=".$result['result']['result_code']."\n";
|
||||
$this->assertEquals('OK',$result['result']['result_code']);
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,9 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
@@ -59,7 +59,9 @@ class XCalLibTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
|
||||
Reference in New Issue
Block a user