Compare commits
214 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97aaff7395 | ||
|
|
a602309e04 | ||
|
|
f51935a258 | ||
|
|
7cf1a97673 | ||
|
|
cf57e7e88b | ||
|
|
a186e16568 | ||
|
|
6eddee9a78 | ||
|
|
52138372ce | ||
|
|
a27538f582 | ||
|
|
a621032643 | ||
|
|
32646cb7f4 | ||
|
|
74b67eb6c6 | ||
|
|
c1889afd7b | ||
|
|
644f365455 | ||
|
|
667890247c | ||
|
|
c727bbb530 | ||
|
|
adf9fcb290 | ||
|
|
46dc264654 | ||
|
|
23e39cb8b3 | ||
|
|
40329db2b2 | ||
|
|
887d0a5d01 | ||
|
|
e2b5315e23 | ||
|
|
51574768f4 | ||
|
|
2462daf1ed | ||
|
|
9c7381601f | ||
|
|
35a25599e5 | ||
|
|
9bfeb5e424 | ||
|
|
42590d8274 | ||
|
|
48a2fd3c61 | ||
|
|
5001cc6de5 | ||
|
|
bbca5118b7 | ||
|
|
383fc27618 | ||
|
|
fe7c71d1c2 | ||
|
|
973a2ede97 | ||
|
|
b0c2ccafcd | ||
|
|
d3fc152001 | ||
|
|
e8fd551043 | ||
|
|
34b3113bb7 | ||
|
|
90854dc2bf | ||
|
|
b44ddaa696 | ||
|
|
a5fe2ab0e5 | ||
|
|
dccaf116a2 | ||
|
|
c61e4b0e25 | ||
|
|
d432620708 | ||
|
|
316838afb3 | ||
|
|
3477930db2 | ||
|
|
bdd48c38b0 | ||
|
|
d10f277bba | ||
|
|
03a9daa3e6 | ||
|
|
e5193f16cc | ||
|
|
9abde6c057 | ||
|
|
5060d2c4f0 | ||
|
|
7475d4aaa2 | ||
|
|
8e2d2ac70f | ||
|
|
66f1696a9b | ||
|
|
6a878d9c13 | ||
|
|
5af17195b7 | ||
|
|
a52ae607ba | ||
|
|
6aa8ba8935 | ||
|
|
0a8ebb7dc4 | ||
|
|
0f9af62808 | ||
|
|
bf9a44ac6f | ||
|
|
6eda0f4c2e | ||
|
|
5217ae28f8 | ||
|
|
c3214ff3e0 | ||
|
|
cac9a00bac | ||
|
|
971b3f2bfc | ||
|
|
d3b1ee367a | ||
|
|
a06a5d0f65 | ||
|
|
a59bdfba0c | ||
|
|
5ad7894849 | ||
|
|
2c1571c514 | ||
|
|
f782ac6654 | ||
|
|
1e54e695b2 | ||
|
|
f2eb3c1a55 | ||
|
|
41a970c90f | ||
|
|
3d9b2a1676 | ||
|
|
7be0e0da1c | ||
|
|
f4b1d31013 | ||
|
|
bb01ad7d9a | ||
|
|
c81c91755d | ||
|
|
cd2b9538c1 | ||
|
|
d021c0b2a1 | ||
|
|
92ad656bf0 | ||
|
|
da3ae71a47 | ||
|
|
7df36e4a1f | ||
|
|
374e56d938 | ||
|
|
6b0de43f8f | ||
|
|
276168ef6f | ||
|
|
d0a2017639 | ||
|
|
3434460cc3 | ||
|
|
851416a61e | ||
|
|
fcbe09b790 | ||
|
|
c16cd502d0 | ||
|
|
226488b7ed | ||
|
|
1820276ac7 | ||
|
|
f10788e4c6 | ||
|
|
fb1a548a1e | ||
|
|
eeaa4f8205 | ||
|
|
380cae761a | ||
|
|
2d9a9ddd22 | ||
|
|
5decd00149 | ||
|
|
10aa1a66bc | ||
|
|
12f3c016d3 | ||
|
|
c300437e2a | ||
|
|
4696cd33d5 | ||
|
|
192510316b | ||
|
|
6f83c8c6f3 | ||
|
|
8213756c37 | ||
|
|
85e2fe40b1 | ||
|
|
c3fb7647c5 | ||
|
|
6aa4ce2acb | ||
|
|
e2c411b224 | ||
|
|
8231a9ea0f | ||
|
|
25196fa709 | ||
|
|
36fdee3337 | ||
|
|
a254412c61 | ||
|
|
cc1a3080d0 | ||
|
|
b5f887b3e4 | ||
|
|
7616a55de5 | ||
|
|
47661d8d38 | ||
|
|
900caf5a44 | ||
|
|
fb7f0545e4 | ||
|
|
6bbf4ccaaf | ||
|
|
fb0a38d248 | ||
|
|
694357d48e | ||
|
|
110fa251e8 | ||
|
|
4feb2c3b83 | ||
|
|
27ef6840d5 | ||
|
|
c4f80b4e71 | ||
|
|
e0f8f5d035 | ||
|
|
cb367f7787 | ||
|
|
155dfbda94 | ||
|
|
974fb46fda | ||
|
|
62b7496253 | ||
|
|
89b7c8298b | ||
|
|
7ccbd34c2d | ||
|
|
de737b6b23 | ||
|
|
ece9f3037a | ||
|
|
0c27578e69 | ||
|
|
7bf4fbec41 | ||
|
|
7d3dbf1876 | ||
|
|
097507a1ee | ||
|
|
d1c5c79d22 | ||
|
|
8dd44246b0 | ||
|
|
79865eaad8 | ||
|
|
8a7b97bed1 | ||
|
|
76470c9548 | ||
|
|
44ec8dd2b6 | ||
|
|
1c43617d93 | ||
|
|
6167d8a02c | ||
|
|
d92ed35447 | ||
|
|
c4e58ab4c0 | ||
|
|
c44cfb0885 | ||
|
|
100c48372b | ||
|
|
5914f2ac65 | ||
|
|
d4f55ae116 | ||
|
|
8ef55eae07 | ||
|
|
6617cbc531 | ||
|
|
c147acabe1 | ||
|
|
63b96e22b0 | ||
|
|
31167f5c0a | ||
|
|
3800f2c860 | ||
|
|
800c490c12 | ||
|
|
8a8462bf57 | ||
|
|
9514062868 | ||
|
|
f13e7bb03d | ||
|
|
d2d86ce53b | ||
|
|
0899caf74d | ||
|
|
023dfab171 | ||
|
|
92bfd6893d | ||
|
|
22706b70e9 | ||
|
|
1a20afe29b | ||
|
|
19be5f662d | ||
|
|
3eebbc0b14 | ||
|
|
45df52343b | ||
|
|
10bfb76ae9 | ||
|
|
d27c0b31fc | ||
|
|
a1534955a1 | ||
|
|
79371f66b0 | ||
|
|
4569cb82b2 | ||
|
|
04d33f4594 | ||
|
|
af6e95aa79 | ||
|
|
5d942c9d1a | ||
|
|
32a68995d6 | ||
|
|
cc57d3dbc1 | ||
|
|
f837845c12 | ||
|
|
e989371651 | ||
|
|
19ad231012 | ||
|
|
397776d4a4 | ||
|
|
87b187bded | ||
|
|
d13ae9f721 | ||
|
|
028fc4f004 | ||
|
|
df0b20aad3 | ||
|
|
e085c3989a | ||
|
|
e67c208b57 | ||
|
|
e13038dc30 | ||
|
|
744b84cb09 | ||
|
|
7239fa3605 | ||
|
|
5c3b0847c2 | ||
|
|
f1af7ca2f2 | ||
|
|
035bc32323 | ||
|
|
e3aae6d2e1 | ||
|
|
df9fa39d34 | ||
|
|
a70d45b3ab | ||
|
|
6dadfc9d0d | ||
|
|
0e0dd1ec6c | ||
|
|
1574254dcf | ||
|
|
400f6b244b | ||
|
|
bf3718a9bd | ||
|
|
ffa88b803f | ||
|
|
1129222064 | ||
|
|
c5f0faad43 | ||
|
|
7cb657c991 |
10
.travis.yml
@@ -48,7 +48,7 @@ jobs:
|
||||
php: '5.6'
|
||||
env: DB=postgresql
|
||||
- if: type = pull_request OR type = push
|
||||
php: '7.4'
|
||||
php: '7.4.22'
|
||||
env: DB=mysql
|
||||
- if: type = push AND branch = develop
|
||||
php: nightly
|
||||
@@ -102,7 +102,7 @@ install:
|
||||
php-parallel-lint/php-console-highlighter ^0 \
|
||||
squizlabs/php_codesniffer ^3
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ]; then
|
||||
composer -n require phpunit/phpunit ^7 \
|
||||
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||
php-parallel-lint/php-console-highlighter ^0 \
|
||||
@@ -237,7 +237,7 @@ before_script:
|
||||
# enable php-fpm
|
||||
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
|
||||
- |
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
# Copy the included pool
|
||||
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
|
||||
fi
|
||||
@@ -272,7 +272,7 @@ script:
|
||||
set -e
|
||||
#parallel-lint --exclude htdocs/includes --blame .
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
|
||||
if [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then
|
||||
parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||
@@ -287,7 +287,7 @@ script:
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then
|
||||
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;
|
||||
fi
|
||||
set +e
|
||||
|
||||
@@ -54,9 +54,12 @@ if (empty($argv[1])) {
|
||||
parse_str($argv[1]);
|
||||
|
||||
$i=0;
|
||||
$result = array();
|
||||
while ($i < $argc) {
|
||||
if (! empty($argv[$i])) parse_str($argv[$i]);
|
||||
if (preg_match('/includeconstant=/', $argv[$i])) {
|
||||
if (!empty($argv[$i])) {
|
||||
parse_str($argv[$i], $result); // set all params $release, $includecustom, $includeconstant, $buildzip ...
|
||||
}
|
||||
if (preg_match('/includeconstant=/', $argv[$i])) {
|
||||
$tmp=explode(':', $includeconstant, 3); // $includeconstant has been set with previous parse_str()
|
||||
if (count($tmp) != 3) {
|
||||
print "Error: Bad parameter includeconstant=".$includeconstant."\n";
|
||||
|
||||
@@ -102,7 +102,7 @@ with
|
||||
* Replace in tcpdf.php
|
||||
|
||||
if (!@TCPDF_STATIC::file_exists($file)) {
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
with
|
||||
@@ -110,9 +110,9 @@ with
|
||||
if (!@TCPDF_STATIC::file_exists($file)) {
|
||||
// DOL CHANGE If we keep this, the image is not visible on pages after the first one.
|
||||
//var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
|
||||
//return false;
|
||||
//return false;
|
||||
}
|
||||
|
||||
|
||||
* Replace in tcpdf.php
|
||||
|
||||
if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
|
||||
@@ -133,7 +133,7 @@ with
|
||||
}
|
||||
}
|
||||
elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
|
||||
|
||||
|
||||
|
||||
|
||||
* In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace
|
||||
@@ -152,16 +152,16 @@ with
|
||||
elseif (strpos($filename, '://') === false)
|
||||
|
||||
* To avoid to have QRcode changed because generated with a random mask, replace
|
||||
define('QR_FIND_FROM_RANDOM', 2);
|
||||
with
|
||||
define('QR_FIND_FROM_RANDOM', false);
|
||||
define('QR_FIND_FROM_RANDOM', 2);
|
||||
with:
|
||||
define('QR_FIND_FROM_RANDOM', false);
|
||||
|
||||
* Removed useless directories ("examples", "tools")
|
||||
|
||||
* Optionnaly, removed all fonts except
|
||||
dejavusans* (used by greek, arab, persan, romanian, turkish),
|
||||
freemono* (russian),
|
||||
cid*+msungstdlight+stsongstdlight+uni2cid* (chinese),
|
||||
* Optionnaly, removed all fonts except
|
||||
dejavusans* (used by greek, arab, persan, romanian, turkish),
|
||||
freemono* (russian),
|
||||
cid*+msungstdlight+stsongstdlight+uni2cid* (chinese),
|
||||
helvetica* (all other languages),
|
||||
zapfdingbats.php (for special chars like form checkboxes)
|
||||
|
||||
@@ -173,15 +173,15 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
|
||||
* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
|
||||
of the function, replace:
|
||||
|
||||
$roman = '';
|
||||
$roman = '';
|
||||
|
||||
with:
|
||||
with:
|
||||
|
||||
$roman = '';
|
||||
if ($number >= 4000) {
|
||||
// do not represent numbers above 4000 in Roman numerals
|
||||
return strval($number);
|
||||
}
|
||||
$roman = '';
|
||||
if ($number >= 4000) {
|
||||
// do not represent numbers above 4000 in Roman numerals
|
||||
return strval($number);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -192,14 +192,14 @@ Add fpdf_tpl.php 1.2
|
||||
Add tcpdi.php
|
||||
|
||||
Add tcpdi_parser.php and replace:
|
||||
require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
|
||||
with:
|
||||
require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
|
||||
require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
|
||||
with:
|
||||
require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
|
||||
|
||||
|
||||
* Fix by replacing
|
||||
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
|
||||
with
|
||||
with
|
||||
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
|
||||
|
||||
|
||||
@@ -215,11 +215,11 @@ window.location.href=pRef
|
||||
|
||||
* Replace
|
||||
vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
|
||||
with
|
||||
with
|
||||
var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
|
||||
vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
|
||||
vTmpNode.setAttribute('href',vTaskList[i].getLink());
|
||||
|
||||
|
||||
* Replace '% Comp.' to have a smaller text column header
|
||||
'comp':'% Comp.'
|
||||
with
|
||||
@@ -262,6 +262,23 @@ Change content of file htdocs/includes/restler/framework/Luracast/Restler/explor
|
||||
// @CHANGE LDR
|
||||
if (!is_string($haystack)) return false;
|
||||
|
||||
* Add a test into AutoLoader.php to complete function loadThisLoader and test if property exists before calling it. For this replace code
|
||||
|
||||
if (false !== $file = $b::$loader[1]($className) && $this->exists($className, $b::$loader[1])) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
with:
|
||||
|
||||
//avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader
|
||||
//in case of multiple autoloader systems
|
||||
if(property_exists($b, $loader[1])) {
|
||||
if (false !== $file = $b::$loader[1]($className)
|
||||
&& $this->exists($className, $b::$loader[1])) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PARSEDOWN
|
||||
---------
|
||||
@@ -269,16 +286,15 @@ PARSEDOWN
|
||||
* Add support of css by adding in Parsedown.php:
|
||||
|
||||
// @CHANGE LDR
|
||||
'class' => $Link['element']['attributes']['class']
|
||||
'class' => $Link['element']['attributes']['class']
|
||||
|
||||
...
|
||||
|
||||
|
||||
// @CHANGE LDR
|
||||
if (preg_match('/{([^}]+)}/', $remainder, $matches2))
|
||||
{
|
||||
$Element['attributes']['class'] = $matches2[1];
|
||||
$remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder);
|
||||
}
|
||||
if (preg_match('/{([^}]+)}/', $remainder, $matches2)) {
|
||||
$Element['attributes']['class'] = $matches2[1];
|
||||
$remainder = preg_replace('/{'.preg_quote($matches2[1],'/').'}/', '', $remainder);
|
||||
}
|
||||
|
||||
|
||||
// @CHANGE LDR
|
||||
@@ -311,7 +327,7 @@ Add into Class Google of file OAuth2/Service/Google:
|
||||
}
|
||||
$this->approvalPrompt = $prompt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
JEDITABLE.JS
|
||||
|
||||
@@ -882,13 +882,13 @@ class AccountancyExport
|
||||
print $date_document . $separator;
|
||||
|
||||
// FEC:CompteNum
|
||||
print $line->numero_compte . $separator;
|
||||
print length_accountg($line->numero_compte) . $separator;
|
||||
|
||||
// FEC:CompteLib
|
||||
print dol_string_unaccent($line->label_compte) . $separator;
|
||||
|
||||
// FEC:CompAuxNum
|
||||
print $line->subledger_account . $separator;
|
||||
print length_accounta($line->subledger_account) . $separator;
|
||||
|
||||
// FEC:CompAuxLib
|
||||
print dol_string_unaccent($line->subledger_label) . $separator;
|
||||
@@ -983,13 +983,13 @@ class AccountancyExport
|
||||
print $date_creation . $separator;
|
||||
|
||||
// FEC:CompteNum
|
||||
print $line->numero_compte . $separator;
|
||||
print length_accountg($line->numero_compte) . $separator;
|
||||
|
||||
// FEC:CompteLib
|
||||
print dol_string_unaccent($line->label_compte) . $separator;
|
||||
|
||||
// FEC:CompAuxNum
|
||||
print $line->subledger_account . $separator;
|
||||
print length_accounta($line->subledger_account) . $separator;
|
||||
|
||||
// FEC:CompAuxLib
|
||||
print dol_string_unaccent($line->subledger_label) . $separator;
|
||||
|
||||
@@ -121,9 +121,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
|
||||
|
||||
dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
||||
@@ -92,82 +92,84 @@ if ($conf->accounting->enabled)
|
||||
|
||||
print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'title_accountancy', 0, '', '', $showtutorial);
|
||||
|
||||
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||
print "<br>\n"; print "<br>\n";
|
||||
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||
if (!empty($user->rights->accounting->chartofaccount)){
|
||||
print "<br>\n"; print "<br>\n";
|
||||
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
|
||||
// STEPS
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '{s}')."\n";
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, '{s}');
|
||||
$s = str_replace('{s}', $textlink, $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
if (!empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
// STEPS
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, '{s}');
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '{s}')."\n";
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, '{s}');
|
||||
$s = str_replace('{s}', $textlink, $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
}
|
||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
if (!empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, '{s}');
|
||||
$s = str_replace('{s}', $textlink, $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>', $s);
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>', $s);
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Step A - E
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
@@ -123,9 +123,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
|
||||
|
||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
||||
@@ -789,8 +789,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$object->country = $tmparray['label'];
|
||||
}
|
||||
|
||||
$soc = new Societe($db);
|
||||
if (!empty($socid)) {
|
||||
$soc = new Societe($db);
|
||||
if ($socid > 0) $soc->fetch($socid);
|
||||
|
||||
if (!($soc->id > 0)) {
|
||||
|
||||
@@ -960,12 +960,12 @@ if ($rowid > 0) {
|
||||
|
||||
// Bank account
|
||||
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("FinancialAccount").'</td><td>';
|
||||
$form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 2);
|
||||
$form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 2, '', 0, 'minwidth200');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Payment mode
|
||||
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
|
||||
$form->select_types_paiements(GETPOST('operation'), 'operation', '', 2);
|
||||
$form->select_types_paiements(GETPOST('operation'), 'operation', '', 2, 1, 0, 0, 1, 'minwidth200');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Date of payment
|
||||
|
||||
@@ -842,7 +842,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
setEventMessages($db->error(), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ LOG INALTERABLE
|
||||
## Fonctionnalité
|
||||
|
||||
Ce module trace, en temps réel, certains évènements métiers dans une log inaltérable (que vous ne pouvez pas modifier une fois enregistrés) de type blockchain.
|
||||
Ce module est requis pour la compatibilité avec les exigences légales de certains pays (comme la France avec la loi Fincance 2016 - Norme NF535).
|
||||
Ce module est requis pour la compatibilité avec les exigences légales de certains pays (comme la France avec la loi Finance 2016 - Norme NF525).
|
||||
|
||||
|
||||
**Les évènements tracés de manière inaltérables sont:**
|
||||
|
||||
@@ -4,7 +4,7 @@ BLOCKED LOG
|
||||
## Feature
|
||||
|
||||
This module tracks, in real time, some events into a non reversible log (that you can't modify once recorded) into a block chain.
|
||||
This module provides compatibility with requirements of laws of some countries (like France with the law Fincance 2016 - Norme NF535).
|
||||
This module provides compatibility with requirements of laws of some countries (like France with the law Finance 2016 - Norme NF525).
|
||||
|
||||
|
||||
**The tracked events are:**
|
||||
|
||||
@@ -272,9 +272,9 @@ if ($action == 'validate') {
|
||||
$db->begin();
|
||||
$error = 0;
|
||||
foreach ($toselect as $checked) {
|
||||
if ($tmpproposal->fetch($checked)) {
|
||||
if ($tmpproposal->fetch($checked) > 0) {
|
||||
if ($tmpproposal->statut == $tmpproposal::STATUS_DRAFT) {
|
||||
if ($tmpproposal->valid($user)) {
|
||||
if ($tmpproposal->valid($user) > 0) {
|
||||
setEventMessage($tmpproposal->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs');
|
||||
} else {
|
||||
setEventMessage($langs->trans('CantBeValidated'), 'errors');
|
||||
@@ -285,7 +285,7 @@ if ($action == 'validate') {
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@@ -305,14 +305,14 @@ if ($action == "sign") {
|
||||
$db->begin();
|
||||
$error = 0;
|
||||
foreach ($toselect as $checked) {
|
||||
if ($tmpproposal->fetch($checked)) {
|
||||
if ($tmpproposal->fetch($checked) > 0) {
|
||||
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
|
||||
$tmpproposal->statut = $tmpproposal::STATUS_SIGNED;
|
||||
|
||||
if ($tmpproposal->update($user)) {
|
||||
if ($tmpproposal->update($user) > 0) {
|
||||
setEventMessage($tmpproposal->ref." ".$langs->trans('Signed'), 'mesgs');
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
@@ -320,7 +320,7 @@ if ($action == "sign") {
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,6 +478,12 @@ $sql .= " ".MAIN_DB_PREFIX."bank as b";
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND type = 'company'";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu.url_id = s.rowid";
|
||||
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListJoin', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " WHERE b.fk_account = ba.rowid";
|
||||
$sql .= " AND ba.entity IN (".getEntity('bank_account').")";
|
||||
if ($search_account > 0) $sql .= " AND b.fk_account = ".$search_account;
|
||||
@@ -1473,6 +1479,11 @@ if ($resql)
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Action edit/delete
|
||||
print '<td class="nowraponall" align="center">';
|
||||
// Transaction reconciliated or edit link
|
||||
|
||||
@@ -566,45 +566,6 @@ if (empty($reshook))
|
||||
|
||||
// Check parameters
|
||||
|
||||
// Check for mandatory fields in thirdparty (defined into setup)
|
||||
$array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL');
|
||||
foreach ($array_to_check as $key)
|
||||
{
|
||||
$keymin = strtolower($key);
|
||||
$i = (int) preg_replace('/[^0-9]/', '', $key);
|
||||
$vallabel = $object->thirdparty->$keymin;
|
||||
|
||||
if ($i > 0)
|
||||
{
|
||||
if ($object->thirdparty->isACompany())
|
||||
{
|
||||
// Check for mandatory prof id (but only if country is other than ours)
|
||||
if ($mysoc->country_id > 0 && $object->thirdparty->country_id == $mysoc->country_id)
|
||||
{
|
||||
$idprof_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY';
|
||||
if (!$vallabel && !empty($conf->global->$idprof_mandatory))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId'.$i, $object->thirdparty->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").')', null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//var_dump($conf->global->SOCIETE_EMAIL_MANDATORY);
|
||||
if ($key == 'EMAIL')
|
||||
{
|
||||
// Check for mandatory
|
||||
if (!empty($conf->global->SOCIETE_EMAIL_INVOICE_MANDATORY) && !isValidEMail($object->thirdparty->email))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorBadEMail", $object->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").')', null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for mandatory fields in invoice
|
||||
$array_to_check = array('REF_CUSTOMER'=>'RefCustomer');
|
||||
foreach ($array_to_check as $key => $val)
|
||||
|
||||
@@ -2470,7 +2470,7 @@ class Facture extends CommonInvoice
|
||||
*/
|
||||
public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0, $batch_rule = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $mysoc;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$productStatic = null;
|
||||
@@ -2512,6 +2512,60 @@ class Facture extends CommonInvoice
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Check for mandatory fields in thirdparty (defined into setup)
|
||||
$array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL');
|
||||
foreach ($array_to_check as $key)
|
||||
{
|
||||
$keymin = strtolower($key);
|
||||
$i = (int) preg_replace('/[^0-9]/', '', $key);
|
||||
if ($i == 1) {
|
||||
if (!is_object($this->thirdparty)) {
|
||||
$langs->load('errors');
|
||||
$this->error = $langs->trans('ErrorInvoiceLoadThirdParty', $this->ref);
|
||||
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (!property_exists($this->thirdparty, $keymin)) {
|
||||
$langs->load('errors');
|
||||
$this->error = $langs->trans('ErrorInvoiceLoadThirdPartyKey', $keymin, $this->ref);
|
||||
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
$vallabel = $this->thirdparty->$keymin;
|
||||
|
||||
if ($i > 0)
|
||||
{
|
||||
if ($this->thirdparty->isACompany())
|
||||
{
|
||||
// Check for mandatory prof id (but only if country is other than ours)
|
||||
if ($mysoc->country_id > 0 && $this->thirdparty->country_id == $mysoc->country_id)
|
||||
{
|
||||
$idprof_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY';
|
||||
if (!$vallabel && !empty($conf->global->$idprof_mandatory))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId'.$i, $this->thirdparty->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']';
|
||||
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($key == 'EMAIL')
|
||||
{
|
||||
// Check for mandatory
|
||||
if (!empty($conf->global->SOCIETE_EMAIL_INVOICE_MANDATORY) && !isValidEMail($this->thirdparty->email))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans("ErrorBadEMail", $this->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']';
|
||||
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Check parameters
|
||||
|
||||
@@ -1199,6 +1199,18 @@ if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
|
||||
$with_margin_info = false;
|
||||
if (!empty($conf->margin->enabled) && (
|
||||
!empty($arrayfields['total_pa']['checked'])
|
||||
|| !empty($arrayfields['total_margin']['checked'])
|
||||
|| !empty($arrayfields['total_margin_rate']['checked'])
|
||||
|| !empty($arrayfields['total_mark_rate']['checked'])
|
||||
)
|
||||
) {
|
||||
$with_margin_info = true;
|
||||
}
|
||||
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
@@ -1281,7 +1293,7 @@ if ($resql)
|
||||
$facturestatic->alreadypaid = $paiement;
|
||||
|
||||
$marginInfo = array();
|
||||
if (!empty($conf->margin->enabled)) {
|
||||
if ($with_margin_info === true) {
|
||||
$facturestatic->fetch_lines();
|
||||
$marginInfo = $formmargin->getMarginInfosArray($facturestatic);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ $object = new Paiement($db);
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||
|
||||
$result = restrictedArea($user, $object->element, $object->id, 'paiement', '');
|
||||
$result = restrictedArea($user, $object->element, $object->id, 'paiement');
|
||||
|
||||
// Security check
|
||||
if ($user->socid) $socid = $user->socid;
|
||||
|
||||
@@ -441,9 +441,15 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Bank transaction
|
||||
if (!empty($arrayfields['transaction']['checked'])) {
|
||||
$bankline->fetch($objp->fk_bank);
|
||||
print '<td>'.$bankline->getNomUrl(1, 0).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
print '<td>';
|
||||
if ($objp->fk_bank) {
|
||||
$bankline->fetch($objp->fk_bank);
|
||||
print $bankline->getNomUrl(1, 0);
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Bank account
|
||||
|
||||
@@ -522,11 +522,13 @@ class BonPrelevement extends CommonObject
|
||||
} else {
|
||||
if ($this->type == 'bank-transfer') {
|
||||
$modeforaddpayment = 'payment_supplier';
|
||||
$labelforaddpayment = '(BankTransferPayment)';
|
||||
} else {
|
||||
$modeforaddpayment = 'payment';
|
||||
$labelforaddpayment = '(WithdrawalPayment)';
|
||||
}
|
||||
|
||||
$result = $paiement->addPaymentToBank($user, $modeforaddpayment, '(WithdrawalPayment)', $bankaccount, '', '');
|
||||
$result = $paiement->addPaymentToBank($user, $modeforaddpayment, $labelforaddpayment, $bankaccount, '', '');
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
|
||||
@@ -414,7 +414,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
|
||||
// Quantity
|
||||
print '<td class="right">';
|
||||
print $qty[$key];
|
||||
print price($qty[$key], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
|
||||
// Percent;
|
||||
|
||||
@@ -479,6 +479,29 @@ if (empty($reshook))
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
// Update extrafields
|
||||
if ($action == 'update_extras' && ! empty($user->rights->societe->contact->creer)) {
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->insertExtraFields('CONTACT_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$action = 'edit_extras';
|
||||
}
|
||||
}
|
||||
|
||||
// Actions to send emails
|
||||
$triggersendname = 'CONTACT_SENTBYMAIL';
|
||||
$paramname = 'id';
|
||||
|
||||
@@ -339,7 +339,7 @@ if ($sql_select)
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$param = "&socid=".urlencode($socid)."&type_element=".urlencode($type_element);
|
||||
$param = "&socid=".urlencode($socid)."&type_element=".urlencode($type_element)."&id=".urlencode($id);
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||
if ($sprod_fulldescr) $param .= "&sprod_fulldescr=".urlencode($sprod_fulldescr);
|
||||
|
||||
@@ -605,6 +605,8 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
|
||||
|
||||
$db->begin();
|
||||
|
||||
$nbOrders = is_array($orders) ? count($orders) : 1;
|
||||
|
||||
foreach ($orders as $id_order)
|
||||
{
|
||||
$cmd = new Commande($db);
|
||||
@@ -726,7 +728,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
|
||||
$lines[$i]->fetch_optionals();
|
||||
$array_options = $lines[$i]->array_options;
|
||||
}
|
||||
|
||||
$rankedLine = ($nbOrders > 1) ? -1 : $lines[$i]->rang;
|
||||
$result = $objecttmp->addline(
|
||||
$desc,
|
||||
$lines[$i]->subprice,
|
||||
@@ -744,7 +746,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
|
||||
'HT',
|
||||
0,
|
||||
$product_type,
|
||||
$lines[$i]->rang,
|
||||
$rankedLine,
|
||||
$lines[$i]->special_code,
|
||||
$objecttmp->origin,
|
||||
$lines[$i]->rowid,
|
||||
|
||||
@@ -60,6 +60,7 @@ class CMailFile
|
||||
|
||||
public $atleastonefile;
|
||||
|
||||
public $msg;
|
||||
public $eol;
|
||||
public $eol2;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ trait CommonIncoterm
|
||||
$this->fk_incoterms = $id_incoterm;
|
||||
$this->location_incoterms = $location;
|
||||
|
||||
$sql = 'SELECT libelle as label_incotermsFROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms;
|
||||
$sql = 'SELECT libelle as label_incoterms FROM '.MAIN_DB_PREFIX.'c_incoterms WHERE rowid = '.(int) $this->fk_incoterms;
|
||||
$res = $this->db->query($sql);
|
||||
if ($res)
|
||||
{
|
||||
|
||||
@@ -1891,7 +1891,9 @@ abstract class CommonObject
|
||||
$sql = "SELECT MAX(te.".$fieldid.")";
|
||||
$sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te";
|
||||
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
if (empty($user->admin) || !empty($user->entity) || $conf->entity != 1) {
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON ug.fk_user=te.rowid";
|
||||
}
|
||||
}
|
||||
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
|
||||
$tmparray = explode('@', $this->ismultientitymanaged);
|
||||
@@ -1916,7 +1918,6 @@ abstract class CommonObject
|
||||
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
|
||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||
} else {
|
||||
$sql .= " AND ug.fk_user = te.rowid";
|
||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
||||
}
|
||||
} else {
|
||||
@@ -1944,7 +1945,9 @@ abstract class CommonObject
|
||||
$sql = "SELECT MIN(te.".$fieldid.")";
|
||||
$sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te";
|
||||
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
if (empty($user->admin) || !empty($user->entity) || $conf->entity != 1) {
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON ug.fk_user=te.rowid";
|
||||
}
|
||||
}
|
||||
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
|
||||
$tmparray = explode('@', $this->ismultientitymanaged);
|
||||
@@ -1969,7 +1972,6 @@ abstract class CommonObject
|
||||
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
|
||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||
} else {
|
||||
$sql .= " AND ug.fk_user = te.rowid";
|
||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
||||
}
|
||||
} else {
|
||||
@@ -3177,12 +3179,17 @@ abstract class CommonObject
|
||||
}
|
||||
$sqlfix = "UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".($obj->total_tva - $diff).", total_ttc = ".($obj->total_ttc - $diff)." WHERE rowid = ".$obj->rowid;
|
||||
dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix);
|
||||
$resqlfix = $this->db->query($sqlfix);
|
||||
if (!$resqlfix) dol_print_error($this->db, 'Failed to update line');
|
||||
$this->total_tva -= $diff;
|
||||
$this->total_ttc -= $diff;
|
||||
$total_tva_by_vats[$obj->vatrate] -= $diff;
|
||||
$total_ttc_by_vats[$obj->vatrate] -= $diff;
|
||||
|
||||
$resqlfix = $this->db->query($sqlfix);
|
||||
|
||||
if (!$resqlfix) {
|
||||
dol_print_error($this->db, 'Failed to update line');
|
||||
}
|
||||
|
||||
$this->total_tva = (float) price2num($this->total_tva - $diff, '', 1);
|
||||
$this->total_ttc = (float) price2num($this->total_ttc - $diff, '', 1);
|
||||
$total_tva_by_vats[$obj->vatrate] = (float) price2num($total_tva_by_vats[$obj->vatrate] - $diff, '', 1);
|
||||
$total_ttc_by_vats[$obj->vatrate] = (float) price2num($total_ttc_by_vats[$obj->vatrate] - $diff, '', 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3210,6 +3217,13 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Clean total
|
||||
$this->total_ht = (float) price2num($this->total_ht);
|
||||
$this->total_tva = (float) price2num($this->total_tva);
|
||||
$this->total_localtax1 = (float) price2num($this->total_localtax1);
|
||||
$this->total_localtax2 = (float) price2num($this->total_localtax2);
|
||||
$this->total_ttc = (float) price2num($this->total_ttc);
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
// Now update global field total_ht, total_ttc and tva
|
||||
@@ -5307,8 +5321,15 @@ abstract class CommonObject
|
||||
$attributeLabel = $extrafields->attributes[$this->table_element]['label'][$attributeKey];
|
||||
$attributeParam = $extrafields->attributes[$this->table_element]['param'][$attributeKey];
|
||||
$attributeRequired = $extrafields->attributes[$this->table_element]['required'][$attributeKey];
|
||||
$attributeUnique = $extrafields->attributes[$this->table_element]['unique'][$attributeKey];
|
||||
$attrfieldcomputed = $extrafields->attributes[$this->table_element]['computed'][$attributeKey];
|
||||
|
||||
// If we clone, we have to clean unique extrafields to prevent duplicates.
|
||||
// This behaviour can be prevented by external code by changing $this->context['createfromclone'] value in createFrom hook
|
||||
if (! empty($this->context['createfromclone']) && $this->context['createfromclone'] == 'createfromclone' && ! empty($attributeUnique)) {
|
||||
$new_array_options[$key] = null;
|
||||
}
|
||||
|
||||
// Similar code than into insertExtraFields
|
||||
if ($attributeRequired)
|
||||
{
|
||||
|
||||
@@ -1824,7 +1824,7 @@ class ExtraFields
|
||||
}
|
||||
}
|
||||
}
|
||||
$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
if (!empty($toprint)) $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
} else {
|
||||
dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
|
||||
}
|
||||
|
||||
@@ -468,8 +468,7 @@ class Translate
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found && !empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
|
||||
{
|
||||
if (!$found && !empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) {
|
||||
// Overwrite translation with database read
|
||||
$sql = "SELECT transkey, transvalue FROM ".MAIN_DB_PREFIX."overwrite_trans where lang='".$db->escape($this->defaultlang)."' OR lang IS NULL";
|
||||
$sql .= " AND entity IN (0, ".getEntity('overwrite_trans').")";
|
||||
|
||||
@@ -383,7 +383,7 @@ class Utils
|
||||
if ($compression == 'none') fclose($handle);
|
||||
if ($compression == 'gz') gzclose($handle);
|
||||
if ($compression == 'bz') bzclose($handle);
|
||||
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error
|
||||
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg) || preg_match('/^\/\*M?!999999/', $errormsg)) { // Start of file is ok, NOT an error
|
||||
$errormsg = '';
|
||||
} else {
|
||||
// Renommer fichier sortie en fichier erreur
|
||||
|
||||
@@ -1138,7 +1138,7 @@ $(document).ready(function() {
|
||||
|
||||
// Force to hide menus when page is inside an iFrame
|
||||
$(document).ready(function() {
|
||||
if (window.location !== window.parent.location ) {
|
||||
if (window.location && window.location.pathname.indexOf("externalsite/frametop.php") == -1 && window.location !== window.parent.location ) {
|
||||
console.log("Page is detected to be into an iframe, we hide by CSS the menus");
|
||||
// The page is in an iframe
|
||||
jQuery(".side-nav-vert, .side-nav, .websitebar").hide();
|
||||
|
||||
@@ -65,6 +65,17 @@ function getDolGlobalInt($key)
|
||||
return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is Dolibarr module enabled
|
||||
* @param string $module module name to check
|
||||
* @return int
|
||||
*/
|
||||
function isModEnabled($module)
|
||||
{
|
||||
global $conf;
|
||||
return !empty($conf->$module->enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a DoliDB instance (database handler).
|
||||
*
|
||||
|
||||
@@ -1271,7 +1271,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
||||
$textwasmodified = ($note == $prodser->note);
|
||||
if (!empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) $note = $prodser->multilangs[$outputlangs->defaultlang]["note"];
|
||||
}
|
||||
} elseif ($object->element == 'facture' || $object->element == 'facturefourn') {
|
||||
} elseif (($object->element == 'facture' || $object->element == 'facturefourn') && preg_match('/^\(DEPOSIT\).+/', $desc)) { // We must not replace '(DEPOSIT)' when it is alone, it will be translated and detailed later
|
||||
$desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc);
|
||||
}
|
||||
|
||||
|
||||
@@ -341,20 +341,18 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
||||
}
|
||||
|
||||
// If rounding is not using base 10 (rare)
|
||||
if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT))
|
||||
{
|
||||
if ($price_base_type == 'HT')
|
||||
{
|
||||
$result[0] = round($result[0] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
$result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
$result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
$result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT)) {
|
||||
if ($price_base_type == 'HT') {
|
||||
$result[0] = price2num(round($result[0] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT');
|
||||
$result[1] = price2num(round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT');
|
||||
$result[9] = price2num(round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT');
|
||||
$result[10] = price2num(round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT');
|
||||
$result[2] = price2num($result[0] + $result[1] + $result[9] + $result[10], 'MT');
|
||||
} else {
|
||||
$result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
$result[2] = round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
$result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
$result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT;
|
||||
$result[1] = price2num(round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT');
|
||||
$result[2] = price2num(round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT');
|
||||
$result[9] = price2num(round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT');
|
||||
$result[10] = price2num(round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT');
|
||||
$result[0] = price2num($result[2] - $result[1] - $result[9] - $result[10], 'MT');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_propale['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_propale['qty'];
|
||||
print price($product->stats_propale['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -389,7 +389,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_proposal_supplier['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_proposal_supplier['qty'];
|
||||
print price($product->stats_proposal_supplier['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -407,7 +407,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_commande['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_commande['qty'];
|
||||
print price($product->stats_commande['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -425,7 +425,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_commande_fournisseur['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_commande_fournisseur['qty'];
|
||||
print price($product->stats_commande_fournisseur['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -443,7 +443,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_facture['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_facture['qty'];
|
||||
print price($product->stats_facture['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -461,7 +461,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_facture_fournisseur['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_facture_fournisseur['qty'];
|
||||
print price($product->stats_facture_fournisseur['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -480,7 +480,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_contrat['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_contrat['qty'];
|
||||
print price($product->stats_contrat['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
||||
|
||||
//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
|
||||
//print "user_id=".$user->id.", features=".$features.", feature2=".$feature2.", objectid=".$objectid;
|
||||
//print ", dbtablename=".$dbtablename.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
|
||||
//print ", dbtablename=".$tableandshare.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
|
||||
//print ", perm: ".$features."->".$feature2."=".($user->rights->$features->$feature2->lire)."<br>";
|
||||
|
||||
$parentfortableentity = '';
|
||||
@@ -374,6 +374,8 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
||||
} elseif ($feature == 'salaries')
|
||||
{
|
||||
if (!$user->rights->salaries->delete) $deleteok = 0;
|
||||
} elseif ($feature == 'payment') {
|
||||
if (!$user->rights->facture->paiement) $deleteok = 0;
|
||||
} elseif ($feature == 'payment_supplier')
|
||||
{
|
||||
if (!$user->rights->fournisseur->facture->creer) { $deleteok = 0; }
|
||||
|
||||
@@ -1288,8 +1288,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
|
||||
@@ -1631,8 +1631,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
|
||||
@@ -94,7 +94,8 @@ class modIncoterm extends DolibarrModules
|
||||
'tabfieldvalue'=>array("code,libelle"), // List of fields (list of fields to edit a record)
|
||||
'tabfieldinsert'=>array("code,libelle"), // List of fields (list of fields for insert)
|
||||
'tabrowid'=>array("rowid"), // Name of columns with primary key (try to always name it 'rowid')
|
||||
'tabcond'=>array($conf->incoterm->enabled)
|
||||
'tabcond'=>array($conf->incoterm->enabled),
|
||||
'tabhelp' => array(array())
|
||||
);
|
||||
|
||||
$this->boxes = array(); // List of boxes
|
||||
|
||||
@@ -222,7 +222,7 @@ class modProjet extends DolibarrModules
|
||||
's.phone'=>'Text', 's.email'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text',
|
||||
'p.rowid'=>"List:projet:ref::project", 'p.ref'=>"Text", 'p.title'=>"Text",
|
||||
'p.usage_opportunity'=>'Boolean', 'p.usage_task'=>'Boolean', 'p.usage_bill_time'=>'Boolean',
|
||||
'p.datec'=>"Date", 'p.dateo'=>"Date", 'p.datee'=>"Date", 'p.fk_statut'=>'Status', 'cls.code'=>"Text", 'p.opp_percent'=>'Numeric', 'p.opp_amount'=>'Numeric', 'p.description'=>"Text", 'p.entity'=>'Numeric',
|
||||
'p.datec'=>"Date", 'p.dateo'=>"Date", 'p.datee'=>"Date", 'p.fk_statut'=>'Status', 'cls.code'=>"Text", 'p.opp_percent'=>'Numeric', 'p.opp_amount'=>'Numeric', 'p.description'=>"Text", 'p.entity'=>'Numeric', 'p.budget_amount'=>'Numeric',
|
||||
'pt.rowid'=>'Numeric', 'pt.ref'=>'Text', 'pt.label'=>'Text', 'pt.dateo'=>"Date", 'pt.datee'=>"Date", 'pt.duration_effective'=>"Duree", 'pt.planned_workload'=>"Numeric", 'pt.progress'=>"Numeric", 'pt.description'=>"Text",
|
||||
'ptt.rowid'=>'Numeric', 'ptt.task_date'=>'Date', 'ptt.task_duration'=>"Duree", 'ptt.fk_user'=>"List:user:CONCAT(lastname,' ',firstname)", 'ptt.note'=>"Text"
|
||||
);
|
||||
@@ -235,7 +235,7 @@ class modProjet extends DolibarrModules
|
||||
's.phone'=>'Phone', 's.email'=>'Email', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode',
|
||||
'p.rowid'=>"ProjectId", 'p.ref'=>"RefProject", 'p.title'=>'ProjectLabel',
|
||||
'p.usage_opportunity'=>'ProjectFollowOpportunity', 'p.usage_task'=>'ProjectFollowTasks', 'p.usage_bill_time'=>'BillTime',
|
||||
'p.datec'=>"DateCreation", 'p.dateo'=>"DateStart", 'p.datee'=>"DateEnd", 'p.fk_statut'=>'ProjectStatus', 'cls.code'=>'OpportunityStatus', 'p.opp_percent'=>'OpportunityProbability', 'p.opp_amount'=>'OpportunityAmount', 'p.description'=>"Description"
|
||||
'p.datec'=>"DateCreation", 'p.dateo'=>"DateStart", 'p.datee'=>"DateEnd", 'p.fk_statut'=>'ProjectStatus', 'cls.code'=>'OpportunityStatus', 'p.opp_percent'=>'OpportunityProbability', 'p.opp_amount'=>'OpportunityAmount', 'p.budget_amount'=>'Budget', 'p.description'=>"Description"
|
||||
);
|
||||
// Add multicompany field
|
||||
if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED))
|
||||
|
||||
@@ -238,18 +238,20 @@ class modResource extends DolibarrModules
|
||||
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
||||
$this->export_label[$r] = "ResourceSingular"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_permission[$r] = array(array("resource", "read"));
|
||||
$this->export_fields_array[$r] = array('r.rowid'=>'IdResource', 'r.ref'=>'ResourceFormLabel_ref', 'c.code'=>'ResourceTypeCode', 'c.label'=>'ResourceType', 'r.description'=>'ResourceFormLabel_description', 'r.note_private'=>"NotePrivate", 'r.note_public'=>"NotePublic", 'r.asset_number'=>'AssetNumber', 'r.datec'=>"DateCreation", 'r.tms'=>"DateLastModification");
|
||||
$this->export_TypeFields_array[$r] = array('r.rowid'=>'List:resource:ref', 'r.ref'=>'Text', 'r.asset_number'=>'Text', 'r.description'=>'Text', 'c.code'=>'Text', 'c.label'=>'List:c_type_resource:label', 'r.datec'=>'Date', 'r.tms'=>'Date', 'r.note_private'=>'Text', 'r.note_public'=>'Text');
|
||||
$this->export_entities_array[$r] = array('r.rowid'=>'resource', 'r.ref'=>'resource', 'c.code'=>'resource', 'c.label'=>'resource', 'r.description'=>'resource', 'r.note_private'=>"resource", 'r.resource'=>"resource", 'r.asset_number'=>'resource', 'r.datec'=>"resource", 'r.tms'=>"resource");
|
||||
$this->export_fields_array[$r] = array('r.rowid'=>'IdResource', 'r.ref'=>'ResourceFormLabel_ref', 'c.code'=>'ResourceTypeCode', 'c.rowid'=>'ResourceType', 'c.label'=>'ResourceTypeLabel', 'r.description'=>'ResourceFormLabel_description', 'r.note_private'=>"NotePrivate", 'r.note_public'=>"NotePublic", 'r.asset_number'=>'AssetNumber', 'r.datec'=>"DateCreation", 'r.tms'=>"DateLastModification");
|
||||
$this->export_TypeFields_array[$r] = array('r.rowid'=>'List:resource:ref', 'r.ref'=>'Text','r.asset_number'=>'Text', 'r.description'=>'Text', 'c.code'=>'Text', 'c.rowid'=>'List:c_type_resource:label', 'r.datec'=>'Date', 'r.tms'=>'Date', 'r.note_private'=>'Text', 'r.note_public'=>'Text');
|
||||
$this->export_entities_array[$r] = array('r.rowid'=>'resource', 'r.ref'=>'resource', 'c.code'=>'resource', 'c.rowid'=>'resource', 'r.description'=>'resource', 'r.note_private'=>"resource", 'r.resource'=>"resource", 'r.asset_number'=>'resource', 'r.datec'=>"resource", 'r.tms'=>"resource");
|
||||
|
||||
$keyforselect = 'resource'; $keyforelement = 'resource'; $keyforaliasextra = 'extra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
|
||||
$this->export_dependencies_array[$r] = array('resource'=>array('r.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them.
|
||||
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'resource as r';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_resource as c ON c.rowid=r.fk_code_type_resource';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_resource as c ON c.code = r.fk_code_type_resource';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'resource_extrafields as extra ON extra.fk_object = r.rowid';
|
||||
$this->export_sql_end[$r] .= ' AND r.entity IN ('.getEntity('resource').')';
|
||||
$this->export_sql_end[$r] .= ' WHERE r.entity IN ('.getEntity('resource').')';
|
||||
|
||||
|
||||
|
||||
// Imports
|
||||
|
||||
@@ -1455,8 +1455,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
|
||||
@@ -1554,8 +1554,7 @@ class pdf_cyan extends ModelePDFPropales
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
|
||||
@@ -150,6 +150,9 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
||||
if ($object->element == 'productlot') $permok = $user->rights->stock->creer;
|
||||
if ($object->element == 'facturerec') $permok = $user->rights->facture->creer;
|
||||
if ($object->element == 'mo') $permok = $user->rights->mrp->write;
|
||||
if ($object->element == 'contact') {
|
||||
$permok = $user->rights->societe->contact->creer;
|
||||
}
|
||||
|
||||
$isdraft = ((isset($object->statut) && $object->statut == 0) || (isset($object->status) && $object->status == 0));
|
||||
if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra]))
|
||||
|
||||
@@ -72,7 +72,7 @@ class DolLogsCollector extends MessagesCollector
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$uselogfile = $conf->global->DEBUGBAR_USE_LOGFILE;
|
||||
$uselogfile = $conf->global->DEBUGBAR_USE_LOG_FILE;
|
||||
|
||||
if ($uselogfile)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010 Pierre Morin <pierre.morin@auguria.net>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2022 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
|
||||
@@ -140,6 +141,11 @@ if (!empty($hashp))
|
||||
$modulepart = $moduleparttocheck;
|
||||
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
|
||||
}
|
||||
$entity = $ecmfile->entity;
|
||||
if ($entity != $conf->entity) {
|
||||
$conf->entity = $entity;
|
||||
$conf->setValues($db);
|
||||
}
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
accessforbidden($langs->trans("ErrorFileNotFoundWithSharedLink"), 0, 0, 1);
|
||||
|
||||
@@ -2648,7 +2648,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
}
|
||||
|
||||
// If bank module is not used
|
||||
if (($user->rights->expensereport->to_paid || empty($conf->banque->enabled)) && $object->status == ExpenseReport::STATUS_APPROVED)
|
||||
if (($user->rights->expensereport->to_paid && empty($conf->banque->enabled)) && $object->status == ExpenseReport::STATUS_APPROVED)
|
||||
{
|
||||
//if ((round($remaintopay) == 0 || empty($conf->banque->enabled)) && $object->paid == 0)
|
||||
if ($object->paid == 0)
|
||||
|
||||
@@ -449,10 +449,9 @@ if (empty($reshook))
|
||||
$subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysToValidate");
|
||||
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
$message = "<p>".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",</p>\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysToValidateBody")."\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysToValidateBody")."</p>\n";
|
||||
|
||||
$delayForRequest = $object->getConfCP('delayForRequest');
|
||||
//$delayForRequest = $delayForRequest * (60*60*24);
|
||||
@@ -464,8 +463,7 @@ if (empty($reshook))
|
||||
{
|
||||
if ($object->date_debut < $nextMonth)
|
||||
{
|
||||
$message .= "\n";
|
||||
$message .= $langs->transnoentities("HolidaysToValidateDelay", $object->getConfCP('delayForRequest'))."\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysToValidateDelay", $object->getConfCP('delayForRequest'))."</p>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,20 +473,21 @@ if (empty($reshook))
|
||||
$nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
|
||||
if ($nbopenedday > $object->getCPforUser($object->fk_user, $object->fk_type))
|
||||
{
|
||||
$message .= "\n";
|
||||
$message .= $langs->transnoentities("HolidaysToValidateAlertSolde")."\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysToValidateAlertSolde")."</p>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$message .= "\n";
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n";
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')."\n";
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n";
|
||||
$message .= "\n";
|
||||
$link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id;
|
||||
|
||||
$message .= "<ul>";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href="'.$link.'" target="_blank">'.$link."</a></li>\n";
|
||||
$message .= "</ul>\n";
|
||||
|
||||
$trackid = 'leav'.$object->id;
|
||||
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
|
||||
|
||||
// Envoi du mail
|
||||
$result = $mail->sendfile();
|
||||
@@ -603,19 +602,20 @@ if (empty($reshook))
|
||||
$subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysValidated");
|
||||
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
$message = "<p>".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",</p>\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysValidatedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysValidatedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."</p>\n";
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("ValidatedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n";
|
||||
$link = dol_buildpath('/holiday/card.php', 3).'?id='.$object->id;
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n";
|
||||
$message .= "\n";
|
||||
$message .= "<ul>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("ValidatedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href="'.$link.'" target="_blank">'.$link."</a></li>\n";
|
||||
$message .= "</ul>\n";
|
||||
|
||||
$trackid = 'leav'.$object->id;
|
||||
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
|
||||
|
||||
// Envoi du mail
|
||||
$result = $mail->sendfile();
|
||||
@@ -689,20 +689,21 @@ if (empty($reshook))
|
||||
$subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysRefused");
|
||||
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
$message = "<p>".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",</p>\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysRefusedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n";
|
||||
$message .= GETPOST('detail_refuse', 'alpha')."\n\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysRefusedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."<p>\n";
|
||||
$message .= "<p>".GETPOST('detail_refuse', 'alpha')."</p>";
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n";
|
||||
$link = dol_buildpath('/holiday/card.php', 3).'?id='.$object->id;
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n";
|
||||
$message .= "\n";
|
||||
$message .= "<ul>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href="'.$link.'" target="_blank">'.$link."</a></li>\n";
|
||||
$message .= "</ul>";
|
||||
|
||||
$trackid = 'leav'.$object->id;
|
||||
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
|
||||
|
||||
// Envoi du mail
|
||||
$result = $mail->sendfile();
|
||||
@@ -838,18 +839,20 @@ if (empty($reshook))
|
||||
$subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysCanceled");
|
||||
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
$message = "<p>".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",</p>\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysCanceledBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n";
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysCanceledBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."</p>\n";
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n";
|
||||
$message .= "\n";
|
||||
$link = dol_buildpath('/holiday/card.php', 3).'?id='.$object->id;
|
||||
|
||||
$message .= "<ul>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href="'.$link.'" target="_blank">'.$link."</a></li>\n";
|
||||
$message .= "</ul>\n";
|
||||
|
||||
$trackid = 'leav'.$object->id;
|
||||
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
|
||||
|
||||
// Envoi du mail
|
||||
$result = $mail->sendfile();
|
||||
|
||||
@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("holiday"));
|
||||
$langs->loadLangs(array('holiday', 'hrm'));
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
@@ -106,7 +106,7 @@ if (empty($reshook))
|
||||
$arrayfields = array(
|
||||
'cp.ref'=>array('label'=>$langs->trans('Ref'), 'checked'=>1),
|
||||
'cp.fk_user'=>array('label'=>$langs->trans('Employee'), 'checked'=>1),
|
||||
'ct.label'=>array('label'=>$langs->trans('Type'), 'checked'=>1),
|
||||
'cp.fk_type'=>array('label'=>$langs->trans('Type'), 'checked'=>1),
|
||||
'cp.date_debut'=>array('label'=>$langs->trans('DateDebCP'), 'checked'=>1),
|
||||
'cp.date_fin'=>array('label'=>$langs->trans('DateFinCP'), 'checked'=>1),
|
||||
'used_days'=>array('label'=>$langs->trans('NbUseDaysCPShort'), 'checked'=>1),
|
||||
@@ -133,10 +133,9 @@ $search_month = GETPOST("remonth", 'int') ?GETPOST("remonth", 'int') : date("m",
|
||||
$search_year = GETPOST("reyear", 'int') ?GETPOST("reyear", 'int') : date("Y", time());
|
||||
$year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
|
||||
|
||||
$sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, ct.label, cp.description, cp.halfday";
|
||||
$sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid";
|
||||
$sql .= " WHERE cp.rowid > 0";
|
||||
$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
|
||||
$sql .= " AND (";
|
||||
@@ -223,7 +222,7 @@ if (!empty($arrayfields['cp.fk_user']['checked'])) {
|
||||
}
|
||||
|
||||
// Filter: Type
|
||||
if (!empty($arrayfields['ct.label']['checked'])) {
|
||||
if (!empty($arrayfields['cp.fk_type']['checked'])) {
|
||||
$typeleaves = $holidaystatic->getTypes(1, -1);
|
||||
$arraytypeleaves = array();
|
||||
foreach ($typeleaves as $key => $val)
|
||||
@@ -261,7 +260,7 @@ print '</tr>';
|
||||
print '<tr class="liste_titre">';
|
||||
if (!empty($arrayfields['cp.ref']['checked'])) print_liste_field_titre($arrayfields['cp.ref']['label'], $_SERVER["PHP_SELF"], 'cp.ref', '', '', '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['cp.fk_user']['checked'])) print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'cp.fk_user', '', '', '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['ct.label']['checked'])) print_liste_field_titre($arrayfields['ct.label']['label'], $_SERVER["PHP_SELF"], 'ct.label', '', '', '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['cp.fk_type']['checked'])) print_liste_field_titre($arrayfields['cp.fk_type']['label'], $_SERVER["PHP_SELF"], 'cp.fk_type', '', '', '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['cp.date_debut']['checked'])) print_liste_field_titre($arrayfields['cp.date_debut']['label'], $_SERVER["PHP_SELF"], 'cp.date_debut', '', '', '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['cp.date_fin']['checked'])) print_liste_field_titre($arrayfields['cp.date_fin']['label'], $_SERVER["PHP_SELF"], 'cp.date_fin', '', '', '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['used_days']['checked'])) print_liste_field_titre($arrayfields['used_days']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder);
|
||||
@@ -323,7 +322,10 @@ else {
|
||||
|
||||
if (!empty($arrayfields['cp.ref']['checked'])) print '<td>'.$holidaystatic->getNomUrl(1, 1).'</td>';
|
||||
if (!empty($arrayfields['cp.fk_user']['checked'])) print '<td>'.$user->getFullName($langs).'</td>';
|
||||
if (!empty($arrayfields['ct.label']['checked'])) print '<td>'.$obj->label.'</td>';
|
||||
|
||||
if (!empty($arrayfields['cp.fk_type']['checked'])) {
|
||||
print '<td>'.$arraytypeleaves[$obj->fk_type].'</td>';
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['cp.date_debut']['checked']))
|
||||
{
|
||||
@@ -356,7 +358,10 @@ else {
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['used_days_month']['checked'])) print '<td class="right">'.num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth).'</td>';
|
||||
if (!empty($arrayfields['cp.description']['checked'])) print '<td class="maxwidth300">'.dol_escape_htmltag(dolGetFirstLineOfText($obj->description)).'</td>';
|
||||
|
||||
if (!empty($arrayfields['cp.description']['checked'])) {
|
||||
print '<td class="maxwidth300">'.dolGetFirstLineOfText($obj->description).'</td>';
|
||||
}
|
||||
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -290,10 +290,14 @@ class AutoLoader
|
||||
if (is_array($loader)
|
||||
&& is_callable($loader)) {
|
||||
$b = new $loader[0];
|
||||
if (false !== $file = $b::$loader[1]($className)
|
||||
&& $this->exists($className, $b::$loader[1])) {
|
||||
return $file;
|
||||
}
|
||||
//avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader
|
||||
//in case of multiple autoloader systems
|
||||
if(property_exists($b, $loader[1])) {
|
||||
if (false !== $file = $b::$loader[1]($className)
|
||||
&& $this->exists($className, $b::$loader[1])) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
} elseif (is_callable($loader)
|
||||
&& false !== $file = $loader($className)
|
||||
&& $this->exists($className, $loader)) {
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
@@ -43,6 +43,8 @@ create table llx_commande_fournisseur_dispatch_extrafields
|
||||
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
|
||||
|
||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1;
|
||||
|
||||
UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA';
|
||||
|
||||
create table llx_c_shipment_package_type
|
||||
|
||||
@@ -70,6 +70,7 @@ ALTER TABLE llx_bom_bom ADD COLUMN bomtype integer DEFAULT 0;
|
||||
|
||||
UPDATE llx_emailcollector_emailcollector SET ref = 'Collect_Ticket_Requests' WHERE ref = 'Collect_Ticket_Requets';
|
||||
UPDATE llx_emailcollector_emailcollector SET ref = 'Collect_Responses_In' WHERE ref = 'Collect_Responses';
|
||||
-- VMYSQL4.3 ALTER TABLE llx_emailcollector_emailcollector MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
||||
|
||||
UPDATE llx_document_model set nom = 'standard' where nom = 'Standard' and type ='stock';
|
||||
@@ -332,6 +333,8 @@ ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float;
|
||||
|
||||
ALTER TABLE llx_product ADD COLUMN fk_state integer DEFAULT NULL AFTER fk_country;
|
||||
|
||||
ALTER TABLE llx_product CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
||||
ALTER TABLE llx_projet ADD COLUMN email_msgid varchar(255);
|
||||
ALTER TABLE llx_ticket ADD COLUMN email_msgid varchar(255);
|
||||
ALTER TABLE llx_actioncomm ADD COLUMN reply_to varchar(255);
|
||||
@@ -562,7 +565,8 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES
|
||||
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_customers_outstanding_bill_reached.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_customers_outstanding_bill_reached.php' AND entity = 1);
|
||||
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_scheduled_jobs.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_scheduled_jobs.php' AND entity = 1);
|
||||
|
||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64);
|
||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64) DEFAULT NULL;
|
||||
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging varchar(64) DEFAULT NULL;
|
||||
|
||||
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
||||
|
||||
@@ -591,3 +595,172 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position)
|
||||
|
||||
ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64);
|
||||
|
||||
|
||||
-- ALL tms thanks to regis (commit 111f73bd863c7120a9c13a8fc9ae227a02079cb0)
|
||||
|
||||
ALTER TABLE llx_accounting_account CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_accounting_bookkeeping CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_accounting_bookkeeping_tmp CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_accounting_fiscalyear CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_actioncomm_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_actioncomm CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_adherent_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_adherent CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_adherent_type_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_adherent_type CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_advtargetemailing CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_asset_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_asset CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_asset_type_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_asset_type CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bank_account_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bank_account CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bank CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_blockedlog_authority CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_blockedlog CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bom_bom_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bom_bomline_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bom_bom CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_bordereau_cheque CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_boxes_def CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_budget_lines CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_budget CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_categories_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_categorie CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_c_email_senderprofile CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_c_email_templates CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_c_field_list CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_chargesociales CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commandedet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseurdet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseur_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseur_log CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande_fournisseur CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_commande CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_comment CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_const CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_contratdet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_contratdet_log CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_contratdet CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_contrat_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_contrat CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_cronjob CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_c_shipment_mode CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_deplacement CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_don_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_don CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_element_resources CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_emailcollector_emailcollectoraction CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_emailcollector_emailcollectorfilter CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_entrepot_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_entrepot CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_establishment CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_events CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expeditiondet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expedition_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expedition CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expensereport_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expensereport_ik CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expensereport_rules CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_expensereport CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facturedet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facturedet_rec_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_fourn_det_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_fourn_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_fourn CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_rec_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture_rec CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_facture CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_fichinterdet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_fichinter_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_fichinter CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_holiday_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_holiday CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_inventorydet CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_inventorydet CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_inventory CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_inventory CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_loan_schedule CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_loan CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_localtax CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mailing_cibles CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mailing CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mailing_unsubscribe CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_menu CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mrp_mo_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mrp_mo CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_mrp_production CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_notify_def CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_notify CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_online_signatures CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_opensurvey_comments CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_opensurvey_user_studs CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_paiementcharge CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_paiementfourn CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_paiement CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_donation CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_expensereport CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_loan CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_salary_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_salary CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_payment_various CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_pos_cash_fence CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_printing CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_batch CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_customer_price CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_fournisseur_price_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_fournisseur_price CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_lot_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_lot CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_price_by_qty CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_price CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_stock_entrepot CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_stock CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_projet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_projet CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_projet_task_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_projet_task CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_propaldet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_propal_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_propal_merge_pdf_product CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_propal CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_reception_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_reception CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_resource_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_resource CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_account CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_address CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_contacts CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_prices CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_remise CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_remise_supplier CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe_rib CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_societe CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_socpeople_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_socpeople CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_stock_mouvement CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_subscription CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_supplier_proposaldet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_supplier_proposal_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_supplier_proposal CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_ticket_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_ticket CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_tva CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_user_employment CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_user_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_usergroup_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_usergroup CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_user_rib CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_user CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_website_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_website_page CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_website CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_zapier_hook CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
CREATE TABLE llx_establishment (
|
||||
rowid integer NOT NULL auto_increment PRIMARY KEY,
|
||||
entity integer NOT NULL DEFAULT 1,
|
||||
label varchar(255),
|
||||
ref varchar(30),
|
||||
name varchar(128),
|
||||
address varchar(255),
|
||||
|
||||
@@ -50,8 +50,7 @@ create table llx_product_fournisseur_price
|
||||
import_key varchar(14), -- Import key
|
||||
delivery_time_days integer,
|
||||
supplier_reputation varchar(10),
|
||||
packaging varchar(64),
|
||||
|
||||
packaging varchar(64) DEFAULT NULL,
|
||||
fk_multicurrency integer,
|
||||
multicurrency_code varchar(255),
|
||||
multicurrency_tx double(24,8) DEFAULT 1,
|
||||
|
||||
@@ -257,6 +257,8 @@ ErrorLanguageRequiredIfPageIsTranslationOfAnother=The language of new page must
|
||||
ErrorLanguageMustNotBeSourceLanguageIfPageIsTranslationOfAnother=The language of new page must not be the source language if it is set as a translation of another page
|
||||
ErrorAParameterIsRequiredForThisOperation=A parameter is mandatory for this operation
|
||||
ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of account
|
||||
ErrorInvoiceLoadThirdParty=Can't load third-party object for invoice "%s"
|
||||
ErrorInvoiceLoadThirdPartyKey=Third-party key "%s" no set for invoice "%s"
|
||||
|
||||
# Warnings
|
||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||
@@ -289,4 +291,4 @@ WarningFailedToAddFileIntoDatabaseIndex=Warning, failed to add file entry into E
|
||||
WarningTheHiddenOptionIsOn=Warning, the hidden option <b>%s</b> is on.
|
||||
WarningCreateSubAccounts=Warning, you can't create directly a sub account, you must create a third party or an user and assign them an accounting code to find them in this list
|
||||
WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection.
|
||||
WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here.
|
||||
WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here.
|
||||
|
||||
@@ -267,4 +267,5 @@ NewInvoice=New invoice
|
||||
OneLinePerTask=One line per task
|
||||
OneLinePerPeriod=One line per period
|
||||
RefTaskParent=Ref. Parent Task
|
||||
ProfitIsCalculatedWith=Profit is calculated using
|
||||
ProfitIsCalculatedWith=Profit is calculated using
|
||||
ErrorPROJECTLEADERRoleMissingRestoreIt=The "PROJECTLEADER" role is missing or has been de-activited, please restore in the dictionary of contact types
|
||||
|
||||
@@ -84,6 +84,17 @@ ProposalCustomerSignature=Written acceptance, company stamp, date and signature
|
||||
ProposalsStatisticsSuppliers=Vendor proposals statistics
|
||||
CaseFollowedBy=Case followed by
|
||||
SignedOnly=Signed only
|
||||
IsNotADraft=is not a draft
|
||||
PassedInOpenStatus=has been validated
|
||||
CantBeSign=cannot be signed
|
||||
Sign=Sign
|
||||
Signed=signed
|
||||
CantBeSign=cannot be signed
|
||||
CantBeValidated=cannot be validated
|
||||
ConfirmMassValidation=Bulk Validate confirmation
|
||||
ConfirmMassSignature=Bulk Signature confirmation
|
||||
ConfirmMassValidationQuestion=Are you sure you want to validate the selected records ?
|
||||
ConfirmMassSignatureQuestion=Are you sure you want to sign the selected records ?
|
||||
IdProposal=Proposal ID
|
||||
IdProduct=Product ID
|
||||
PrParentLine=Proposal Parent Line
|
||||
|
||||
@@ -3008,7 +3008,7 @@ if ($module == 'initmodule')
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $perm[1];
|
||||
print $langs->trans($perm[1]);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
|
||||
@@ -937,8 +937,8 @@ class MyObject extends CommonObject
|
||||
|
||||
if (is_numeric($result))
|
||||
{
|
||||
$this->error = $this->error;
|
||||
$this->errors = $this->errors;
|
||||
$this->error = $objectline->error;
|
||||
$this->errors = $objectline->errors;
|
||||
return $result;
|
||||
} else {
|
||||
$this->lines = $result;
|
||||
|
||||
@@ -221,7 +221,10 @@ class modMyModule extends DolibarrModules
|
||||
// Name of columns with primary key (try to always name it 'rowid')
|
||||
'tabrowid'=>array("rowid", "rowid", "rowid"),
|
||||
// Condition to show each dictionary
|
||||
'tabcond'=>array($conf->mymodule->enabled, $conf->mymodule->enabled, $conf->mymodule->enabled)
|
||||
'tabcond'=>array($conf->mymodule->enabled, $conf->mymodule->enabled, $conf->mymodule->enabled),
|
||||
// Tooltip for every fields of dictionaries: DO NOT PUT AN EMPTY ARRAY
|
||||
'tabhelp'=>array(array('field1' => 'field1tooltip', 'field2' => 'field2tooltip'), array('field1' => 'field1tooltip', 'field2' => 'field2tooltip'), ...),
|
||||
|
||||
);
|
||||
*/
|
||||
|
||||
|
||||
@@ -145,27 +145,8 @@ if ($action == 'other')
|
||||
$value = GETPOST('activate_useProdFournDesc', 'alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUIT_FOURN_TEXTS", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if ($value) {
|
||||
$sql_test = "SELECT count(desc_fourn) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1";
|
||||
$resql = $db->query($sql_test);
|
||||
if (!$resql && $db->lasterrno == 'DB_ERROR_NOSUCHFIELD') // if the field does not exist, we create it
|
||||
{
|
||||
$sql_new = "ALTER TABLE ".MAIN_DB_PREFIX."product_fournisseur_price ADD COLUMN desc_fourn text";
|
||||
$resql_new = $db->query($sql_new);
|
||||
}
|
||||
}
|
||||
|
||||
$value = GETPOST('activate_useProdSupplierPackaging', 'alpha');
|
||||
$res = dolibarr_set_const($db, "PRODUCT_USE_SUPPLIER_PACKAGING", $value, 'chaine', 0, '', $conf->entity);
|
||||
if ($value) {
|
||||
$sql_test = "SELECT count(packaging) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1";
|
||||
$resql = $db->query($sql_test);
|
||||
if (!$resql && $db->lasterrno == 'DB_ERROR_NOSUCHFIELD') // if the field does not exist, we create it
|
||||
{
|
||||
$sql_new = "ALTER TABLE ".MAIN_DB_PREFIX."product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1";
|
||||
$resql_new = $db->query($sql_new);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'specimen') // For products
|
||||
|
||||
@@ -1797,6 +1797,7 @@ class Product extends CommonObject
|
||||
$this->fourn_multicurrency_id = $obj->fk_multicurrency;
|
||||
$this->fourn_multicurrency_code = $obj->multicurrency_code;
|
||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $this->packaging = $obj->packaging;
|
||||
|
||||
$result = $obj->fk_product;
|
||||
return $result;
|
||||
} else { // If not found
|
||||
@@ -1807,7 +1808,10 @@ class Product extends CommonObject
|
||||
$sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code,";
|
||||
$sql .= " pfp.packaging";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
||||
$sql .= " WHERE pfp.fk_product = ".$product_id;
|
||||
$sql .= " WHERE 1 = 1";
|
||||
if ($product_id > 0) {
|
||||
$sql .= " AND pfp.fk_product = ".((int) $product_id);
|
||||
}
|
||||
if ($fourn_ref != 'none') { $sql .= " AND pfp.ref_fourn = '".$this->db->escape($fourn_ref)."'";
|
||||
}
|
||||
if ($fk_soc > 0) { $sql .= " AND pfp.fk_soc = ".$fk_soc;
|
||||
@@ -2045,7 +2049,8 @@ class Product extends CommonObject
|
||||
$this->db->commit();
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
dol_print_error($this->db);
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -516,11 +516,11 @@ class Productbatch extends CommonObject
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_lot as pl";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pl.fk_product";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_batch AS pb ON pl.batch = pb.batch";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock AS ps ON ps.rowid = pb.fk_product_stock";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock AS ps ON ps.rowid = pb.fk_product_stock AND ps.fk_product = ".((int) $fk_product);
|
||||
$sql .= " WHERE p.entity IN (".getEntity('product').")";
|
||||
$sql .= " AND pl.fk_product = ".$fk_product;
|
||||
$sql .= " AND pl.fk_product = ".((int) $fk_product);
|
||||
if ($fk_warehouse > 0) {
|
||||
$sql .= " AND ps.fk_entrepot = ".$fk_warehouse;
|
||||
$sql .= " AND ps.fk_entrepot = ".((int) $fk_warehouse);
|
||||
}
|
||||
if ($qty_min !== null) {
|
||||
$sql .= " AND pb.qty > ".$qty_min;
|
||||
|
||||
@@ -43,6 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
if (!empty($conf->categorie->enabled))
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('products', 'stocks', 'suppliers', 'companies', 'margins'));
|
||||
@@ -346,10 +347,14 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sqlfields = $sql; // $sql fields to remove for count total
|
||||
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)";
|
||||
if (!empty($searchCategoryProductList) || !empty($catid)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||
$linktopfp = " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||
$sql .= $linktopfp;
|
||||
// multilang
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$db->escape($langs->getDefaultLang())."'";
|
||||
|
||||
@@ -410,12 +415,12 @@ if ($fourn_id > 0) $sql .= " AND pfp.fk_soc = ".((int) $fourn_id);
|
||||
if ($search_country) $sql .= " AND p.fk_country = ".$search_country;
|
||||
if ($search_state) $sql .= " AND p.fk_state = ".$search_state;
|
||||
if ($search_finished >= 0 && $search_finished !== '') $sql .= " AND p.finished = ".$search_finished;
|
||||
if ($search_accountancy_code_sell) $sql .= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell);
|
||||
if ($search_accountancy_code_sell_intra) $sql .= natural_search('p.accountancy_code_sell_intra', $search_accountancy_code_sell_intra);
|
||||
if ($search_accountancy_code_sell_export) $sql .= natural_search('p.accountancy_code_sell_export', $search_accountancy_code_sell_export);
|
||||
if ($search_accountancy_code_buy) $sql .= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy);
|
||||
if ($search_accountancy_code_buy_intra) $sql .= natural_search('p.accountancy_code_buy_intra', $search_accountancy_code_buy_intra);
|
||||
if ($search_accountancy_code_buy_export) $sql .= natural_search('p.accountancy_code_buy_export', $search_accountancy_code_buy_export);
|
||||
if ($search_accountancy_code_sell) $sql .= natural_search('p.accountancy_code_sell', clean_account($search_accountancy_code_sell));
|
||||
if ($search_accountancy_code_sell_intra) $sql .= natural_search('p.accountancy_code_sell_intra', clean_account($search_accountancy_code_sell_intra));
|
||||
if ($search_accountancy_code_sell_export) $sql .= natural_search('p.accountancy_code_sell_export', clean_account($search_accountancy_code_sell_export));
|
||||
if ($search_accountancy_code_buy) $sql .= natural_search('p.accountancy_code_buy', clean_account($search_accountancy_code_buy));
|
||||
if ($search_accountancy_code_buy_intra) $sql .= natural_search('p.accountancy_code_buy_intra', clean_account($search_accountancy_code_buy_intra));
|
||||
if ($search_accountancy_code_buy_export) $sql .= natural_search('p.accountancy_code_buy_export', clean_account($search_accountancy_code_buy_export));
|
||||
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
@@ -447,8 +452,24 @@ $sql .= $db->order($sortfield, $sortorder);
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/'.preg_quote($linktopfp, '/').'/', '', $sqlforcount);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
||||
$resql = $db->query($sqlforcount);
|
||||
if ($resql) {
|
||||
$objforcount = $db->fetch_object($resql);
|
||||
$nbtotalofrecords = $objforcount->nbtotalofrecords;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
/*
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
*/
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
{
|
||||
$page = 0;
|
||||
@@ -1481,33 +1502,33 @@ if ($resql)
|
||||
// Accountancy code sell
|
||||
if (!empty($arrayfields['p.accountancy_code_sell']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->accountancy_code_sell.'</td>';
|
||||
print '<td>'.length_accountg($obj->accountancy_code_sell).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['p.accountancy_code_sell_intra']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->accountancy_code_sell_intra.'</td>';
|
||||
print '<td>'.length_accountg($obj->accountancy_code_sell_intra).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['p.accountancy_code_sell_export']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->accountancy_code_sell_export.'</td>';
|
||||
print '<td>'.length_accountg($obj->accountancy_code_sell_export).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Accountancy code buy
|
||||
if (!empty($arrayfields['p.accountancy_code_buy']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->accountancy_code_buy.'</td>';
|
||||
print '<td>'.length_accountg($obj->accountancy_code_buy).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['p.accountancy_code_buy_intra']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->accountancy_code_buy_intra.'</td>';
|
||||
print '<td>'.length_accountg($obj->accountancy_code_buy_intra).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['p.accountancy_code_buy_export']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->accountancy_code_buy_export.'</td>';
|
||||
print '<td>'.length_accountg($obj->accountancy_code_buy_export).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Extra fields
|
||||
|
||||
@@ -163,11 +163,15 @@ if (empty($reshook))
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
if ($error)
|
||||
{
|
||||
if (!$error) {
|
||||
//$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2);
|
||||
$localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them.
|
||||
$object->updatePrice(0, $object->price_base_type, $user, $tva_tx, '', 0, $npr, 0, 0, $localtaxarray, $vatratecode);
|
||||
$ret = $object->updatePrice(0, $object->price_base_type, $user, $tva_tx, '', 0, $npr, 0, 0, $localtaxarray, $vatratecode);
|
||||
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
@@ -400,14 +404,22 @@ if (empty($reshook))
|
||||
{
|
||||
// Activating product price by quantity add a new price line with price_by_qty set to 1
|
||||
$level = GETPOST('level', 'int');
|
||||
$object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 1);
|
||||
$ret = $object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 1);
|
||||
|
||||
if ($ret < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
// Unset Price by quantity
|
||||
if ($action == 'disable_price_by_qty')
|
||||
{
|
||||
// Disabling product price by quantity add a new price line with price_by_qty set to 0
|
||||
$level = GETPOST('level', 'int');
|
||||
$object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 0);
|
||||
$ret = $object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 0);
|
||||
|
||||
if ($ret < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'edit_price_by_qty')
|
||||
@@ -1444,17 +1456,21 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
|
||||
{
|
||||
$db->free($result);
|
||||
|
||||
// Il doit au moins y avoir la ligne de prix initial.
|
||||
// On l'ajoute donc pour remettre a niveau (pb vieilles versions)
|
||||
// We emulate the change of the price from interface with the same value than the one into table llx_product
|
||||
// Il doit au moins y avoir la ligne de prix initial.
|
||||
// On l'ajoute donc pour remettre a niveau (pb vieilles versions)
|
||||
// We emulate the change of the price from interface with the same value than the one into table llx_product
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
$object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1);
|
||||
$ret = $object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1);
|
||||
} else {
|
||||
$object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min));
|
||||
$ret = $object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min));
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
$num = $db->num_rows($result);
|
||||
if ($ret < 0) {
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
$result = $db->query($sql);
|
||||
$num = $db->num_rows($result);
|
||||
}
|
||||
}
|
||||
|
||||
if ($num > 0) {
|
||||
|
||||
@@ -87,6 +87,10 @@ $daytoparse = $now;
|
||||
if ($yearofday && $monthofday && $dayofday) $daytoparse = dol_mktime(0, 0, 0, $monthofday, $dayofday, $yearofday); // xxxofday is value of day after submit action 'addtime'
|
||||
elseif ($year && $month && $day) $daytoparse = dol_mktime(0, 0, 0, $month, $day, $year); // this are value submited after submit of action 'submitdateselect'
|
||||
|
||||
$daytoparsegmt = dol_now('gmt');
|
||||
if ($yearofday && $monthofday && $dayofday) $daytoparsegmt = dol_mktime(0, 0, 0, $monthofday, $dayofday, $yearofday, 'gmt'); // xxxofday is value of day after submit action 'addtime'
|
||||
elseif ($year && $month && $day) $daytoparsegmt = dol_mktime(0, 0, 0, $month, $day, $year, 'gmt'); // this are value submited after submit of action 'submitdateselect'
|
||||
|
||||
|
||||
if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id)
|
||||
{
|
||||
@@ -602,6 +606,11 @@ $restrictviewformytask = ((!isset($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSI
|
||||
|
||||
// Get if user is available or not for each day
|
||||
$isavailable = array();
|
||||
|
||||
// Assume from Monday to Friday if conf empty or badly formed
|
||||
$numstartworkingday = 1;
|
||||
$numendworkingday = 5;
|
||||
|
||||
if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
||||
{
|
||||
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
|
||||
@@ -616,7 +625,7 @@ $statusofholidaytocheck = Holiday::STATUS_APPROVED;
|
||||
$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse, $statusofholidaytocheck); // $daytoparse is a date with hours = 0
|
||||
$isavailable[$daytoparse] = $isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day
|
||||
|
||||
$test = num_public_holiday($daytoparse, $daytoparse + 86400, $mysoc->country_code);
|
||||
$test = num_public_holiday($daytoparsegmt, $daytoparsegmt + 86400, $mysoc->country_code);
|
||||
if ($test) $isavailable[$daytoparse] = array('morning'=>false, 'afternoon'=>false, 'morning_reason'=>'public_holiday', 'afternoon_reason'=>'public_holiday');
|
||||
|
||||
$tmparray = dol_getdate($daytoparse, true); // detail of current day
|
||||
|
||||
@@ -97,7 +97,7 @@ $next_day = $next['day'];
|
||||
|
||||
// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
|
||||
$firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year);
|
||||
$lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd');
|
||||
$firstdaytoshowgmt = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'gmt');
|
||||
|
||||
if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id)
|
||||
{
|
||||
@@ -507,6 +507,11 @@ $startday = dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['
|
||||
|
||||
// Get if user is available or not for each day
|
||||
$isavailable = array();
|
||||
|
||||
// Assume from Monday to Friday if conf empty or badly formed
|
||||
$numstartworkingday = 1;
|
||||
$numendworkingday = 5;
|
||||
|
||||
if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
||||
{
|
||||
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
|
||||
@@ -516,27 +521,19 @@ if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
||||
$numendworkingday = $tmparray[1];
|
||||
}
|
||||
}
|
||||
|
||||
for ($idw = 0; $idw < 7; $idw++)
|
||||
{
|
||||
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0
|
||||
|
||||
// Useless because $dayinloopwithouthours should be same than $dayinloopfromfirstdaytoshow
|
||||
//$tmparray = dol_getdate($dayinloop);
|
||||
//$dayinloopwithouthours=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']);
|
||||
//print dol_print_date($dayinloop, 'dayhour').' ';
|
||||
//print dol_print_date($dayinloopwithouthours, 'dayhour').' ';
|
||||
//print dol_print_date($dayinloopfromfirstdaytoshow, 'dayhour').'<br>';
|
||||
$dayinloopfromfirstdaytoshowgmt = dol_time_plus_duree($firstdaytoshowgmt, $idw, 'd'); // $firstdaytoshow is a date with hours = 0
|
||||
|
||||
$statusofholidaytocheck = Holiday::STATUS_APPROVED;
|
||||
|
||||
$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow, $statusofholidaytocheck);
|
||||
$isavailable[$dayinloopfromfirstdaytoshow] = $isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day
|
||||
|
||||
$test = num_public_holiday($dayinloopfromfirstdaytoshow, $dayinloopfromfirstdaytoshow + 86400, $mysoc->country_code);
|
||||
$test = num_public_holiday($dayinloopfromfirstdaytoshowgmt, $dayinloopfromfirstdaytoshowgmt + 86400, $mysoc->country_code);
|
||||
if ($test) $isavailable[$dayinloopfromfirstdaytoshow] = array('morning'=>false, 'afternoon'=>false, 'morning_reason'=>'public_holiday', 'afternoon_reason'=>'public_holiday');
|
||||
}
|
||||
//var_dump($isavailable);
|
||||
|
||||
|
||||
|
||||
@@ -656,7 +653,6 @@ print '<th class="maxwidth75 right">'.$langs->trans("TimeSpent").($usertoprocess
|
||||
for ($idw = 0; $idw < 7; $idw++)
|
||||
{
|
||||
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0
|
||||
$dayinloop = dol_time_plus_duree($startday, $idw, 'd');
|
||||
|
||||
$cssweekend = '';
|
||||
if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css.
|
||||
|
||||
@@ -174,10 +174,14 @@ if (empty($reshook))
|
||||
if (!$error && $result > 0)
|
||||
{
|
||||
// Add myself as project leader
|
||||
$typeofcontact = 'PROJECTLEADER'; // TODO If use rename this code in dictionary, the add_contact will generate an error.
|
||||
$typeofcontact = 'PROJECTLEADER';
|
||||
$result = $object->add_contact($user->id, $typeofcontact, 'internal');
|
||||
if ($result < 0)
|
||||
{
|
||||
|
||||
// -3 means type not found (PROJECTLEADER renamed, de-activated or deleted), so don't prevent creation if it has been the case
|
||||
if ($result == -3) {
|
||||
setEventMessage('ErrorPROJECTLEADERRoleMissingRestoreIt', 'errors');
|
||||
$error++;
|
||||
} elseif ($result < 0) {
|
||||
$langs->load("errors");
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
||||
@@ -266,156 +266,161 @@ if (empty($reshook) && $action == 'add') {
|
||||
// Fill array 'array_options' with data from add form
|
||||
$extrafields->fetch_name_optionals_label($adh->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $adh);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
$result = $adh->create($user);
|
||||
if ($result > 0) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$object = $adh;
|
||||
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($object->typeid);
|
||||
|
||||
if ($object->email) {
|
||||
$subject = '';
|
||||
$msg = '';
|
||||
|
||||
// Send subscription email
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER;
|
||||
|
||||
if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
|
||||
|
||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||
$subject = $arraydefaultmessage->topic;
|
||||
$msg = $arraydefaultmessage->content;
|
||||
}
|
||||
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
|
||||
|
||||
if ($subjecttosend && $texttosend) {
|
||||
$moreinheader = 'X-Dolibarr-Info: send_an_email by public/members/new.php'."\r\n";
|
||||
|
||||
$result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
||||
}
|
||||
/*if ($result < 0) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}*/
|
||||
}
|
||||
|
||||
// Send email to the foundation to say a new member subscribed with autosubscribe form
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && !empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT) &&
|
||||
!empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL)) {
|
||||
// Define link to login card
|
||||
$appli = constant('DOL_APPLICATION_TITLE');
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||
$appli = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
if (preg_match('/\d\.\d/', $appli)) {
|
||||
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
|
||||
} else $appli .= " ".DOL_VERSION;
|
||||
} else {
|
||||
$appli .= " ".DOL_VERSION;
|
||||
}
|
||||
|
||||
$to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL);
|
||||
$from = $conf->global->ADHERENT_MAIL_FROM;
|
||||
$mailfile = new CMailFile(
|
||||
'['.$appli.'] '.$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT,
|
||||
$to,
|
||||
$from,
|
||||
$adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
|
||||
array(),
|
||||
array(),
|
||||
array(),
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
-1
|
||||
);
|
||||
|
||||
if (!$mailfile->sendfile()) {
|
||||
dol_syslog($langs->trans("ErrorFailedToSendMail", $from, $to), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($backtopage)) {
|
||||
$urlback = $backtopage;
|
||||
} elseif (!empty($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION)) {
|
||||
$urlback = $conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION;
|
||||
// TODO Make replacement of __AMOUNT__, etc...
|
||||
} else {
|
||||
$urlback = $_SERVER["PHP_SELF"]."?action=added";
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE != '-1') {
|
||||
if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'all') {
|
||||
$urlback = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
|
||||
if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
|
||||
if (GETPOST('email')) $urlback .= '&email='.urlencode(GETPOST('email'));
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
} else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
} elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox') {
|
||||
$urlback = DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
|
||||
if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
|
||||
if (GETPOST('email')) $urlback .= '&email='.urlencode(GETPOST('email'));
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
} else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
} elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal') {
|
||||
$urlback = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
|
||||
if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
|
||||
if (GETPOST('email')) $urlback .= '&email='.urlencode(GETPOST('email'));
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
} else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
} elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'stripe') {
|
||||
$urlback = DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref;
|
||||
if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
|
||||
if (GETPOST('email')) $urlback .= '&email='.urlencode(GETPOST('email'));
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
} else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($entity)) $urlback .= '&entity='.$entity;
|
||||
dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback);
|
||||
} else {
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
$errmsg .= join('<br>', $adh->errors);
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $adh->create($user);
|
||||
|
||||
if ($result > 0) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$object = $adh;
|
||||
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($object->typeid);
|
||||
|
||||
if ($object->email) {
|
||||
$subject = '';
|
||||
$msg = '';
|
||||
|
||||
// Send subscription email
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER;
|
||||
|
||||
if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
|
||||
|
||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||
$subject = $arraydefaultmessage->topic;
|
||||
$msg = $arraydefaultmessage->content;
|
||||
}
|
||||
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
|
||||
|
||||
if ($subjecttosend && $texttosend) {
|
||||
$moreinheader = 'X-Dolibarr-Info: send_an_email by public/members/new.php'."\r\n";
|
||||
|
||||
$result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
||||
}
|
||||
/*if ($result < 0) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}*/
|
||||
}
|
||||
|
||||
// Send email to the foundation to say a new member subscribed with autosubscribe form
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && !empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT) &&
|
||||
!empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL)) {
|
||||
// Define link to login card
|
||||
$appli = constant('DOL_APPLICATION_TITLE');
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||
$appli = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
if (preg_match('/\d\.\d/', $appli)) {
|
||||
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
|
||||
} else $appli .= " ".DOL_VERSION;
|
||||
} else {
|
||||
$appli .= " ".DOL_VERSION;
|
||||
}
|
||||
|
||||
$to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL);
|
||||
$from = $conf->global->ADHERENT_MAIL_FROM;
|
||||
$mailfile = new CMailFile(
|
||||
'['.$appli.'] '.$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT,
|
||||
$to,
|
||||
$from,
|
||||
$adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
|
||||
array(),
|
||||
array(),
|
||||
array(),
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
-1
|
||||
);
|
||||
|
||||
if (!$mailfile->sendfile()) {
|
||||
dol_syslog($langs->trans("ErrorFailedToSendMail", $from, $to), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($backtopage)) {
|
||||
$urlback = $backtopage;
|
||||
} elseif (!empty($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION)) {
|
||||
$urlback = $conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION;
|
||||
// TODO Make replacement of __AMOUNT__, etc...
|
||||
} else {
|
||||
$urlback = $_SERVER["PHP_SELF"]."?action=added";
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE != '-1') {
|
||||
if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'all') {
|
||||
$urlback = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
|
||||
if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
|
||||
if (GETPOST('email')) $urlback .= '&email='.urlencode(GETPOST('email'));
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
} else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
} elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox') {
|
||||
$urlback = DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
|
||||
if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
|
||||
if (GETPOST('email')) $urlback .= '&email='.urlencode(GETPOST('email'));
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
} else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
} elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal') {
|
||||
$urlback = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
|
||||
if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
|
||||
if (GETPOST('email')) $urlback .= '&email='.urlencode(GETPOST('email'));
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
} else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
} elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'stripe') {
|
||||
$urlback = DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref;
|
||||
if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha'));
|
||||
if (GETPOST('email')) $urlback .= '&email='.urlencode(GETPOST('email'));
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2));
|
||||
} else {
|
||||
$urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($entity)) $urlback .= '&entity='.$entity;
|
||||
dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback);
|
||||
} else {
|
||||
$error++;
|
||||
$errmsg .= join('<br>', $adh->errors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
|
||||
@@ -212,6 +212,11 @@ $parameters = [
|
||||
'validpaymentmethod' => &$validpaymentmethod
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('doValidatePayment', $parameters, $object, $action);
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
} elseif ($reshook > 0) {
|
||||
print $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
// Check security token
|
||||
$valid = true;
|
||||
@@ -1674,6 +1679,12 @@ if ($action != 'dopayment')
|
||||
'object' => $object
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('doCheckStatus', $parameters, $object, $action);
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
} elseif ($reshook > 0) {
|
||||
print $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
if ($source == 'order' && $object->billed)
|
||||
{
|
||||
print '<br><br><span class="amountpaymentcomplete size15x">'.$langs->trans("OrderBilled").'</span>';
|
||||
@@ -1699,6 +1710,12 @@ if ($action != 'dopayment')
|
||||
'paymentmethod' => $paymentmethod
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('doAddButton', $parameters, $object, $action);
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
} elseif ($reshook > 0) {
|
||||
print $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
if ((empty($paymentmethod) || $paymentmethod == 'paybox') && !empty($conf->paybox->enabled))
|
||||
{
|
||||
print '<div class="button buttonpayment" id="div_dopayment_paybox"><span class="fa fa-credit-card"></span> <input class="" type="submit" id="dopayment_paybox" name="dopayment_paybox" value="'.$langs->trans("PayBoxDoPayment").'">';
|
||||
@@ -2299,9 +2316,13 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
|
||||
'dopayment' => GETPOST('dopayment', 'alpha')
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('doPayment', $parameters, $object, $action);
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
} elseif ($reshook > 0) {
|
||||
print $hookmanager->resPrint;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object);
|
||||
|
||||
llxFooter('', 'public');
|
||||
|
||||
@@ -554,7 +554,7 @@ class Reception extends CommonObject
|
||||
|
||||
// Loop on each product line to add a stock movement
|
||||
// TODO in future, reception lines may not be linked to order line
|
||||
$sql = "SELECT cd.fk_product, cd.subprice,";
|
||||
$sql = "SELECT cd.fk_product, cd.subprice, cd.remise_percent,";
|
||||
$sql .= " ed.rowid, ed.qty, ed.fk_entrepot,";
|
||||
$sql .= " ed.eatby, ed.sellby, ed.batch";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd,";
|
||||
@@ -580,12 +580,18 @@ class Reception extends CommonObject
|
||||
$mouvS = new MouvementStock($this->db);
|
||||
$mouvS->origin = &$this;
|
||||
|
||||
// get unit price with discount
|
||||
$up_ht_disc = $obj->subprice;
|
||||
if (!empty($obj->remise_percent) && empty($conf->global->STOCK_EXCLUDE_DISCOUNT_FOR_PMP)) {
|
||||
$up_ht_disc = price2num($up_ht_disc * (100 - $obj->remise_percent) / 100, 'MU');
|
||||
}
|
||||
|
||||
if (empty($obj->batch))
|
||||
{
|
||||
// line without batch detail
|
||||
|
||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record.
|
||||
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref));
|
||||
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $up_ht_disc, $langs->trans("ReceptionValidatedInDolibarr", $numref));
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->errors[] = $mouvS->error;
|
||||
@@ -597,7 +603,7 @@ class Reception extends CommonObject
|
||||
|
||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record.
|
||||
// Note: ->fk_origin_stock = id into table llx_product_batch (may be rename into llx_product_stock_batch in another version)
|
||||
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch);
|
||||
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $up_ht_disc, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->errors[] = $mouvS->error;
|
||||
|
||||
@@ -1119,7 +1119,7 @@ class Thirdparties extends DolibarrApi
|
||||
*/
|
||||
public function getCompanyBankAccount($id)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->facture->lire) {
|
||||
if (!DolibarrApiAccess::$user->rights->societe->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
if (empty($id)) {
|
||||
|
||||
@@ -58,7 +58,8 @@ if ($action == 'addcontact' && $permissiontoedit)
|
||||
if ($result > 0 && $id > 0)
|
||||
{
|
||||
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
|
||||
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
|
||||
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||
$result = $object->add_contact($contactid, $typeid, GETPOST("source"));
|
||||
}
|
||||
|
||||
if ($result >= 0)
|
||||
|
||||
@@ -422,9 +422,12 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
|
||||
$holiday->id = $objp->rowid;
|
||||
$holiday->ref = $objp->rowid;
|
||||
|
||||
$holiday->fk_type = $objp->fk_type;
|
||||
$holiday->statut = $objp->status;
|
||||
$nbopenedday = num_open_day($db->jdate($objp->date_debut), $db->jdate($objp->date_fin), 0, 1, $objp->halfday);
|
||||
$holiday->status = $objp->status;
|
||||
|
||||
$nbopenedday = num_open_day($db->jdate($objp->date_debut, 'gmt'), $db->jdate($objp->date_fin, 'gmt'), 0, 1, $objp->halfday);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
|
||||
@@ -1846,7 +1846,7 @@ if ($action == 'create' || $action == 'adduserldap')
|
||||
}
|
||||
}
|
||||
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DisabledInMonoUserMode")).'">'.$langs->trans("Modify").'</a></div>';
|
||||
@@ -1854,8 +1854,7 @@ if ($action == 'create' || $action == 'adduserldap')
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
} elseif ($caneditpassword && !$object->ldap_sid &&
|
||||
(empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
{
|
||||
(empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans("EditPassword").'</a></div>';
|
||||
}
|
||||
|
||||
@@ -1866,8 +1865,7 @@ if ($action == 'create' || $action == 'adduserldap')
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("ReinitPassword").'</a></div>';
|
||||
} elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
{
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=password">'.$langs->trans("ReinitPassword").'</a></div>';
|
||||
}
|
||||
|
||||
@@ -1875,8 +1873,7 @@ if ($action == 'create' || $action == 'adduserldap')
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||
} elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
{
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) {
|
||||
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=passwordsend">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||
}
|
||||
@@ -1884,13 +1881,13 @@ if ($action == 'create' || $action == 'adduserldap')
|
||||
|
||||
// Enable user
|
||||
if ($user->id <> $id && $candisableuser && $object->statut == 0 &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable">'.$langs->trans("Reactivate").'</a></div>';
|
||||
}
|
||||
// Disable user
|
||||
if ($user->id <> $id && $candisableuser && $object->statut == 1 &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'">'.$langs->trans("DisableUser").'</a></div>';
|
||||
} else {
|
||||
@@ -1901,7 +1898,7 @@ if ($action == 'create' || $action == 'adduserldap')
|
||||
}
|
||||
// Delete
|
||||
if ($user->id <> $id && $candisableuser &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
if ($user->admin || !$object->admin) // If user edited is admin, delete is possible on for an admin
|
||||
{
|
||||
@@ -1943,7 +1940,7 @@ if ($action == 'create' || $action == 'adduserldap')
|
||||
$exclude = array();
|
||||
|
||||
$usergroup = new UserGroup($db);
|
||||
$groupslist = $usergroup->listGroupsForUser($object->id);
|
||||
$groupslist = $usergroup->listGroupsForUser($object->id, false);
|
||||
|
||||
if (!empty($groupslist))
|
||||
{
|
||||
|
||||
@@ -534,7 +534,14 @@ class ProductCombination
|
||||
$new_price += $variation_price;
|
||||
}
|
||||
|
||||
$child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, $i, $new_npr, $new_psq, 0, array(), $parent->default_vat_code);
|
||||
$ret = $child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, $i, $new_npr, $new_psq, 0, array(), $parent->default_vat_code);
|
||||
|
||||
if ($ret < 0) {
|
||||
$this->db->rollback();
|
||||
$this->error = $child->error;
|
||||
$this->errors = $child->errors;
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -556,7 +563,14 @@ class ProductCombination
|
||||
$new_price += $this->variation_price;
|
||||
}
|
||||
|
||||
$child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, 1, $new_npr, $new_psq);
|
||||
$ret = $child->updatePrice($new_price, $new_type, $user, $new_vat, $new_min_price, 1, $new_npr, $new_psq);
|
||||
|
||||
if ($ret < 0) {
|
||||
$this->db->rollback();
|
||||
$this->error = $child->error;
|
||||
$this->errors = $child->errors;
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
@@ -565,6 +579,8 @@ class ProductCombination
|
||||
}
|
||||
|
||||
$this->db->rollback();
|
||||
$this->error = $child->error;
|
||||
$this->errors = $child->errors;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -186,7 +186,14 @@ $refname = basename(dirname($original_file)."/");
|
||||
// Security check
|
||||
if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart', 0, 0, 1);
|
||||
|
||||
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $refname);
|
||||
// When logged in a different entity, medias cannot be accessed because $conf->$module->multidir_output
|
||||
// is not set on the requested entity, but they are public documents, so reset entity
|
||||
if ($modulepart === 'medias' && $entity != $conf->entity) {
|
||||
$conf->entity = $entity;
|
||||
$conf->setValues($db);
|
||||
}
|
||||
|
||||
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $user, $refname);
|
||||
$accessallowed = $check_access['accessallowed'];
|
||||
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
|
||||
$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name
|
||||
|
||||
@@ -66,6 +66,8 @@ if (empty($conf->global->MAILING_LIMIT_SENDBYCLI))
|
||||
$conf->global->MAILING_LIMIT_SENDBYCLI = 0;
|
||||
}
|
||||
|
||||
$langs->loadLangs(array("main", "mails"));
|
||||
|
||||
|
||||
/*
|
||||
* Main
|
||||
|
||||