Merge remote-tracking branch 'origin/develop' into expenses

This commit is contained in:
Your Name 2016-05-18 18:46:05 +02:00
commit 23311cdba1
283 changed files with 10460 additions and 2118 deletions

1
.gitignore vendored
View File

@ -19,7 +19,6 @@ Thumbs.db
# Vagrant generated files # Vagrant generated files
.vagrant .vagrant
# Composer installed repositories # Composer installed repositories
composer.lock
/htdocs/includes/**/.git /htdocs/includes/**/.git
# Composer autoloader and unwanted files # Composer autoloader and unwanted files
htdocs/includes/autoload.php htdocs/includes/autoload.php

View File

@ -79,7 +79,11 @@ before_install:
install: install:
- | - |
echo "Updating Composer" echo "Updating Composer"
rm $TRAVIS_BUILD_DIR/composer.json
rm $TRAVIS_BUILD_DIR/composer.lock
composer self-update composer self-update
composer -n init
composer -n config vendor-dir htdocs/includes
echo echo
- | - |
@ -100,13 +104,14 @@ install:
- | - |
echo "Installing PHP CodeSniffer" echo "Installing PHP CodeSniffer"
composer require squizlabs/php_codesniffer ^2 composer -n require squizlabs/php_codesniffer ^2
echo echo
- | - |
echo "Adding Composer binaries to the path" echo "Adding path of binaries tools installed by composer to the PATH"
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH" export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
echo echo
before_script: before_script:
- | - |
@ -269,29 +274,31 @@ script:
set +e set +e
cd htdocs/install cd htdocs/install
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
php upgrade2.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-2.log php upgrade2.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-2.log
php step5.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-3.log php step5.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-3.log
php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log
php upgrade2.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-2.log php upgrade2.php 3.6.0 3.7.0 > $TRAVIS_BUILD_DIR/upgrade360370-2.log
php step5.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-3.log php step5.php 3.6.0 3.7.0 > $TRAVIS_BUILD_DIR/upgrade360370-3.log
php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log
php upgrade2.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-2.log php upgrade2.php 3.7.0 3.8.0 > $TRAVIS_BUILD_DIR/upgrade370380-2.log
php step5.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-3.log php step5.php 3.7.0 3.8.0 > $TRAVIS_BUILD_DIR/upgrade370380-3.log
php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log
php upgrade2.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390-2.log php upgrade2.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-2.log
php step5.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390-3.log php step5.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-3.log
php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log
php upgrade2.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400-2.log php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API > $TRAVIS_BUILD_DIR/upgrade390400-2.log
php step5.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400-3.log php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log
cd - cd -
set +e set +e
echo echo
#cat $TRAVIS_BUILD_DIR/upgrade390400-2.log
#cat /tmp/dolibarr_install.log
- | - |
echo "Unit testing" echo "Unit testing"
# Ensure we catch errors. Set this to +e if you want to go to the end to see log file. # Ensure we catch errors. Set this to +e if you want to go to the end to see log file.
set -e set -e
#phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
set +e set +e
- | - |

10
build/composer/README Normal file
View File

@ -0,0 +1,10 @@
To test upgrade of a lib with composer:
composer update --no-dev --no-autoloader --dry-run ccampbell/chromephp
To upgrade a lib with composer:
composer update --no-dev --no-autoloader ccampbell/chromephp

View File

@ -12,12 +12,15 @@
"irc": "irc://chat.freenode.net/dolibarr", "irc": "irc://chat.freenode.net/dolibarr",
"source": "https://github.com/Dolibarr/dolibarr" "source": "https://github.com/Dolibarr/dolibarr"
}, },
"config": {
"vendor-dir": "htdocs/includes"
},
"require": { "require": {
"php": ">=5.3.0", "php": ">=5.3.0",
"ext-curl": "*", "ext-curl": "*",
"ccampbell/chromephp": "^4.1", "ccampbell/chromephp": "4.1.0",
"ckeditor/ckeditor": "dev-full/stable", "ckeditor/ckeditor": "dev-full/stable",
"mike42/escpos-php": "dev-master", "mike42/escpos-php": "1.2.1",
"mobiledetect/mobiledetectlib": "2.8.17", "mobiledetect/mobiledetectlib": "2.8.17",
"phpoffice/phpexcel": "1.8.1", "phpoffice/phpexcel": "1.8.1",
"restler/framework": "3.0.0-RC6", "restler/framework": "3.0.0-RC6",
@ -45,8 +48,5 @@
"ext-xml": "Excel support", "ext-xml": "Excel support",
"firephp/firephp-core": "Logging to Firebug console support", "firephp/firephp-core": "Logging to Firebug console support",
"raven/raven": "Sentry logging server support" "raven/raven": "Sentry logging server support"
},
"config": {
"vendor-dir": "htdocs/includes"
} }
} }

408
composer.lock generated Normal file
View File

@ -0,0 +1,408 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "f666a32d1a59518b8ecc55899e829e79",
"content-hash": "8d110e7d8fca6eca1aa814ee35d0032b",
"packages": [
{
"name": "ccampbell/chromephp",
"version": "4.1.0",
"source": {
"type": "git",
"url": "https://github.com/ccampbell/chromephp.git",
"reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ccampbell/chromephp/zipball/c3c297615d48ae5b2a86a82311152d1ed095fcef",
"reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef",
"shasum": ""
},
"require": {
"php": ">=5.0.0"
},
"type": "library",
"autoload": {
"psr-0": {
"ChromePhp": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Craig Campbell",
"email": "iamcraigcampbell@gmail.com",
"homepage": "http://craig.is",
"role": "Developer"
}
],
"description": "Log variables to the Chrome console (via Chrome Logger Google Chrome extension).",
"homepage": "http://github.com/ccampbell/chromephp",
"keywords": [
"log",
"logging"
],
"time": "2013-06-26 03:44:33"
},
{
"name": "ckeditor/ckeditor",
"version": "dev-full/stable",
"source": {
"type": "git",
"url": "https://github.com/ckeditor/ckeditor-releases.git",
"reference": "4a7a6d717f9a408fa8f9ea53ef2dba4d64b83e91"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/4a7a6d717f9a408fa8f9ea53ef2dba4d64b83e91",
"reference": "4a7a6d717f9a408fa8f9ea53ef2dba4d64b83e91",
"shasum": ""
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0+",
"LGPL-2.1+",
"MPL-1.1+"
],
"authors": [
{
"name": "CKSource",
"homepage": "http://cksource.com"
}
],
"description": "JavaScript WYSIWYG web text editor.",
"homepage": "http://ckeditor.com",
"keywords": [
"CKEditor",
"editor",
"fckeditor",
"html",
"javascript",
"richtext",
"text",
"wysiwyg"
],
"time": "2016-05-12 15:36:04"
},
{
"name": "mike42/escpos-php",
"version": "v1.2.1",
"source": {
"type": "git",
"url": "https://github.com/mike42/escpos-php.git",
"reference": "cfea4c4fc95516ac953e1e5b623f854632afa2ee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mike42/escpos-php/zipball/cfea4c4fc95516ac953e1e5b623f854632afa2ee",
"reference": "cfea4c4fc95516ac953e1e5b623f854632afa2ee",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "4.5.*",
"squizlabs/php_codesniffer": "2.*"
},
"type": "library",
"autoload": {
"psr-4": {
"Mike42\\": "src/Mike42"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roni Saha",
"email": "roni.cse@gmail.com"
},
{
"name": "Michael Billington",
"email": "michael.billington@gmail.com"
},
{
"name": "Gergely Radics",
"email": "gerifield@ustream.tv"
},
{
"name": "Warren Doyle",
"email": "w.doyle@fuelled.co"
},
{
"name": "vharo",
"email": "vharo@geepok.com"
}
],
"description": "Thermal receipt printer library, for use with ESC/POS compatible printers",
"homepage": "https://github.com/mike42/escpos-php",
"keywords": [
"ESC-POS",
"driver",
"escpos",
"print",
"receipt"
],
"time": "2016-04-25 01:14:07"
},
{
"name": "mobiledetect/mobiledetectlib",
"version": "2.8.17",
"source": {
"type": "git",
"url": "https://github.com/serbanghita/Mobile-Detect.git",
"reference": "b87da5f63a76e9615a0c74fcf168657b1ea7e41d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/b87da5f63a76e9615a0c74fcf168657b1ea7e41d",
"reference": "b87da5f63a76e9615a0c74fcf168657b1ea7e41d",
"shasum": ""
},
"require": {
"php": ">=5.0.0"
},
"require-dev": {
"codeclimate/php-test-reporter": "dev-master",
"johnkary/phpunit-speedtrap": "~1.0@dev",
"phpunit/phpunit": "*"
},
"type": "library",
"autoload": {
"classmap": [
"Mobile_Detect.php"
],
"psr-0": {
"Detection": "namespaced/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Serban Ghita",
"email": "serbanghita@gmail.com",
"homepage": "http://mobiledetect.net",
"role": "Developer"
}
],
"description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.",
"homepage": "https://github.com/serbanghita/Mobile-Detect",
"keywords": [
"detect mobile devices",
"mobile",
"mobile detect",
"mobile detector",
"php mobile detect"
],
"time": "2015-09-17 14:45:21"
},
{
"name": "phpoffice/phpexcel",
"version": "1.8.1",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PHPExcel.git",
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"shasum": ""
},
"require": {
"ext-xml": "*",
"ext-xmlwriter": "*",
"php": ">=5.2.0"
},
"type": "library",
"autoload": {
"psr-0": {
"PHPExcel": "Classes/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
],
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "http://blog.maartenballiauw.be"
},
{
"name": "Mark Baker"
},
{
"name": "Franck Lefevre",
"homepage": "http://blog.rootslabs.net"
},
{
"name": "Erik Tilt"
}
],
"description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "http://phpexcel.codeplex.com",
"keywords": [
"OpenXML",
"excel",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"time": "2015-05-01 07:00:55"
},
{
"name": "restler/framework",
"version": "3.0.0-RC6",
"target-dir": "Luracast/Restler",
"source": {
"type": "git",
"url": "https://github.com/Luracast/Restler-Framework.git",
"reference": "bfe1139b233852b745c6a0ec14d7244ceb3b3fc6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Luracast/Restler-Framework/zipball/bfe1139b233852b745c6a0ec14d7244ceb3b3fc6",
"reference": "bfe1139b233852b745c6a0ec14d7244ceb3b3fc6",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"replace": {
"luracast/restler": "3.*"
},
"suggest": {
"bshaffer/oauth2-server-php": "If you want to use OAuth2 for authentication",
"illuminate/view": "If you want to use laravel blade templates with Html format",
"mustache/mustache": "If you want to use mustache/handlebar templates with Html format",
"rodneyrehm/plist": "If you need Apple plist binary/xml format",
"symfony/yaml": "If you need YAML format",
"twig/twig": "If you want to use twig templates with Html format",
"zendframework/zendamf": "If you need AMF format"
},
"type": "library",
"extra": {
"branch-alias": {
"master": "v3.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Luracast\\Restler": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1"
],
"authors": [
{
"name": "Luracast",
"email": "arul@luracast.com"
}
],
"description": "Just the Restler Framework without the tests and examples",
"homepage": "http://luracast.com/products/restler/",
"keywords": [
"api",
"framework",
"rest",
"server"
],
"time": "2016-02-28 15:57:37"
},
{
"name": "tecnickcom/tcpdf",
"version": "6.2.12",
"source": {
"type": "git",
"url": "https://github.com/tecnickcom/TCPDF.git",
"reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/2f732eaa91b5665274689b1d40b285a7bacdc37f",
"reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"classmap": [
"fonts",
"config",
"include",
"tcpdf.php",
"tcpdf_parser.php",
"tcpdf_import.php",
"tcpdf_barcodes_1d.php",
"tcpdf_barcodes_2d.php",
"include/tcpdf_colors.php",
"include/tcpdf_filters.php",
"include/tcpdf_font_data.php",
"include/tcpdf_fonts.php",
"include/tcpdf_images.php",
"include/tcpdf_static.php",
"include/barcodes/datamatrix.php",
"include/barcodes/pdf417.php",
"include/barcodes/qrcode.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPLv3"
],
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"homepage": "http://nicolaasuni.tecnick.com"
}
],
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"homepage": "http://www.tcpdf.org/",
"keywords": [
"PDFD32000-2008",
"TCPDF",
"barcodes",
"datamatrix",
"pdf",
"pdf417",
"qrcode"
],
"time": "2015-09-12 10:08:34"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"ckeditor/ckeditor": 20,
"restler/framework": 5
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"platform-dev": []
}

View File

@ -116,8 +116,15 @@ JQUERYFILETREE:
RESTLER: RESTLER:
-------- --------
if ($className == 'Luracast\Restler\string') return; * Add 2 lines into function
if ($className == 'Luracast\Restler\mixed') return; private function alias($className, $currentClass)
{
...
to get
private function alias($className, $currentClass)
{
if ($className == 'Luracast\Restler\string') return;
if ($className == 'Luracast\Restler\mixed') return;
...

View File

@ -180,7 +180,7 @@ if (! $sourcecontent)
} }
// Define output variables // Define output variables
$outfile='out.'.$classmin.'.class.php'; $outfile=$classmin.'.class.php';
$targetcontent=$sourcecontent; $targetcontent=$sourcecontent;
// Substitute module name // Substitute module name
@ -259,7 +259,7 @@ foreach($property as $key => $prop)
if ($addfield) if ($addfield)
{ {
$varprop.="\t\t\$sql.= '".$prop['field']; $varprop.="\t\t\$sql.= '".$prop['field'];
if ($i <= count($property)-$no_output_field) $varprop.=","; if ($i < (count($property)-$no_output_field)) $varprop.=",";
$varprop.="';"; $varprop.="';";
$varprop.="\n"; $varprop.="\n";
} }
@ -455,9 +455,9 @@ else $error++;
//-------------------------------------------------------------------- //--------------------------------------------------------------------
$skeletonfiles=array( $skeletonfiles=array(
$path.'skeleton_script.php' => 'out.'.$classmin.'_script.php', $path.'skeleton_script.php' => $classmin.'_script.php',
$path.'skeleton_list.php' => 'out.'.$classmin.'_list.php', $path.'skeleton_list.php' => $classmin.'_list.php',
$path.'skeleton_card.php' => 'out.'.$classmin.'_card.php' $path.'skeleton_card.php' => $classmin.'_card.php'
); );
foreach ($skeletonfiles as $skeletonfile => $outfile) foreach ($skeletonfiles as $skeletonfile => $outfile)
@ -670,5 +670,5 @@ foreach ($skeletonfiles as $skeletonfile => $outfile)
// -------------------- END OF BUILD_CLASS_FROM_TABLE SCRIPT -------------------- // -------------------- END OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
print "You can now rename generated files by removing the 'out.' prefix in their name and store them into directory /yourmodule/class (for .class.php file) or /yourmodule.\n"; print "You can now move generated files to store them into directory /yourmodule/class (for .class.php file) or /yourmodule.\n";
return $error; return $error;

View File

@ -266,7 +266,8 @@ if ($resql)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$params=''; $params='';
if ($search_field1 != '') $params.= '&amp;search_field1='.urlencode($search_field1); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_field1 != '') $params.= '&amp;search_field1='.urlencode($search_field1);
if ($search_field2 != '') $params.= '&amp;search_field2='.urlencode($search_field2); if ($search_field2 != '') $params.= '&amp;search_field2='.urlencode($search_field2);
if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields // Add $param from extra fields

2
htdocs/.gitignore vendored
View File

@ -20,5 +20,5 @@
/allscreens* /allscreens*
/ecommerce/ /ecommerce/
/cabinetmed* /cabinetmed*
/conf/conf.php
/webmail* /webmail*
/conf/conf.php

View File

@ -1376,17 +1376,12 @@ else
print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1); print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1);
} }
/* // Confirm add in spip
* Confirm add in spip
*/
if ($action == 'add_spip') if ($action == 'add_spip')
{ {
print $form->formconfirm("card.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip'); print $form->formconfirm("card.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip');
} }
// Confirm removed from spip
/*
* Confirm removed from spip
*/
if ($action == 'del_spip') if ($action == 'del_spip')
{ {
print $form->formconfirm("card.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip'); print $form->formconfirm("card.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip');
@ -1551,8 +1546,16 @@ else
} }
else else
{ {
print $langs->trans("SubscriptionNotReceived"); if (! $adht->cotisation)
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie {
print $langs->trans("SubscriptionNotRecorded");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie
}
else
{
print $langs->trans("SubscriptionNotReceived");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie
}
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -722,8 +722,16 @@ if ($rowid > 0)
} }
else else
{ {
print $langs->trans("SubscriptionNotReceived"); if (! $adht->cotisation)
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie {
print $langs->trans("SubscriptionNotRecorded");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie
}
else
{
print $langs->trans("SubscriptionNotReceived");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie
}
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -1553,7 +1553,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
$formadmin = new FormAdmin($db); $formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db); if (! empty($conf->accounting->enabled)) $formaccountancy = new FormVentilation($db);
foreach ($fieldlist as $field => $value) foreach ($fieldlist as $field => $value)
{ {

View File

@ -233,11 +233,6 @@ if ($id > 0)
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Alias name (commercial, trademark or alias name)
print '<tr><td class="titelfield">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
// Prospect/Customer // Prospect/Customer
print '<tr><td width="30%">'.$langs->trans('ProspectCustomer').'</td><td width="70%" colspan="3">'; print '<tr><td width="30%">'.$langs->trans('ProspectCustomer').'</td><td width="70%" colspan="3">';
print $object->getLibCustProspStatut(); print $object->getLibCustProspStatut();
@ -461,8 +456,8 @@ if ($id > 0)
} }
// Categories // Categories
if (!empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire )) { if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>'; print '<tr><td>' . $langs->trans("CustomersCategoriesShort") . '</td>';
print '<td colspan="3">'; print '<td colspan="3">';
print $form->showCategories( $object->id, 'customer', 1 ); print $form->showCategories( $object->id, 'customer', 1 );
print "</td></tr>"; print "</td></tr>";

View File

@ -123,7 +123,7 @@ if ($resql)
foreach ($listofstatus as $status) foreach ($listofstatus as $status)
{ {
$dataseries[]=array('label'=>$commandestatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0)); $dataseries[]=array('label'=>$commandestatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
if ($status==3 && $bool==false) $bool=true; if ($status==3 && ! $bool) $bool=true;
else $bool=false; else $bool=false;
} }
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
@ -147,7 +147,7 @@ if ($resql)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
if ($status==3 && $bool==false) $bool=true; if ($status==3 && ! $bool) $bool=true;
else $bool=false; else $bool=false;
} }
} }

View File

@ -760,8 +760,120 @@ class FactureRec extends CommonInvoice
$arraynow=dol_getdate($now); $arraynow=dol_getdate($now);
$nownotime=dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']); $nownotime=dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']);
parent::initAsSpecimen($option); $prodids = array();
$sql = "SELECT rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."product";
$sql.= " WHERE entity IN (".getEntity('product', 1).")";
$resql = $this->db->query($sql);
if ($resql)
{
$num_prods = $this->db->num_rows($resql);
$i = 0;
while ($i < $num_prods)
{
$i++;
$row = $this->db->fetch_row($resql);
$prodids[$i] = $row[0];
}
}
// Initialize parameters
$this->id=0;
$this->ref = 'SPECIMEN';
$this->specimen=1;
$this->socid = 1;
$this->date = $nownotime;
$this->date_lim_reglement = $nownotime + 3600 * 24 *30;
$this->cond_reglement_id = 1;
$this->cond_reglement_code = 'RECEP';
$this->date_lim_reglement=$this->calculate_date_lim_reglement();
$this->mode_reglement_id = 0; // Not forced to show payment mode CHQ + VIR
$this->mode_reglement_code = ''; // Not forced to show payment mode CHQ + VIR
$this->note_public='This is a comment (public)';
$this->note_private='This is a comment (private)';
$this->note='This is a comment (private)';
$this->fk_incoterms=0;
$this->location_incoterms='';
if (empty($option) || $option != 'nolines')
{
// Lines
$nbp = 5;
$xnbp = 0;
while ($xnbp < $nbp)
{
$line=new FactureLigne($this->db);
$line->desc=$langs->trans("Description")." ".$xnbp;
$line->qty=1;
$line->subprice=100;
$line->tva_tx=19.6;
$line->localtax1_tx=0;
$line->localtax2_tx=0;
$line->remise_percent=0;
if ($xnbp == 1) // Qty is negative (product line)
{
$prodid = mt_rand(1, $num_prods);
$line->fk_product=$prodids[$prodid];
$line->qty=-1;
$line->total_ht=-100;
$line->total_ttc=-119.6;
$line->total_tva=-19.6;
}
else if ($xnbp == 2) // UP is negative (free line)
{
$line->subprice=-100;
$line->total_ht=-100;
$line->total_ttc=-119.6;
$line->total_tva=-19.6;
$line->remise_percent=0;
}
else if ($xnbp == 3) // Discount is 50% (product line)
{
$prodid = mt_rand(1, $num_prods);
$line->fk_product=$prodids[$prodid];
$line->total_ht=50;
$line->total_ttc=59.8;
$line->total_tva=9.8;
$line->remise_percent=50;
}
else // (product line)
{
$prodid = mt_rand(1, $num_prods);
$line->fk_product=$prodids[$prodid];
$line->total_ht=100;
$line->total_ttc=119.6;
$line->total_tva=19.6;
$line->remise_percent=00;
}
$this->lines[$xnbp]=$line;
$xnbp++;
$this->total_ht += $line->total_ht;
$this->total_tva += $line->total_tva;
$this->total_ttc += $line->total_ttc;
}
$this->revenuestamp = 0;
// Add a line "offered"
$line=new FactureLigne($this->db);
$line->desc=$langs->trans("Description")." (offered line)";
$line->qty=1;
$line->subprice=100;
$line->tva_tx=19.6;
$line->localtax1_tx=0;
$line->localtax2_tx=0;
$line->remise_percent=100;
$line->total_ht=0;
$line->total_ttc=0; // 90 * 1.196
$line->total_tva=0;
$prodid = mt_rand(1, $num_prods);
$line->fk_product=$prodids[$prodid];
$this->lines[$xnbp]=$line;
$xnbp++;
}
$this->usenewprice = 1; $this->usenewprice = 1;
} }

View File

@ -202,13 +202,14 @@ if ($resql)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
$paramlist=''; $param='';
$paramlist.=(GETPOST("orphelins")?"&orphelins=1":""); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
$paramlist.=($search_ref?"&search_ref=".urlencode($search_ref):""); $param.=(GETPOST("orphelins")?"&orphelins=1":"");
$paramlist.=($search_company?"&search_company=".urlencode($search_company):""); $param.=($search_ref?"&search_ref=".urlencode($search_ref):"");
$paramlist.=($search_amount?"&search_amount=".urlencode($search_amount):""); $param.=($search_company?"&search_company=".urlencode($search_company):"");
$paramlist.=($search_payment_num?"&search_payment_num=".urlencode($search_payment_num):""); $param.=($search_amount?"&search_amount=".urlencode($search_amount):"");
if ($optioncss != '') $paramlist.='&optioncss='.urlencode($optioncss); $param.=($search_payment_num?"&search_payment_num=".urlencode($search_payment_num):"");
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
@ -218,24 +219,24 @@ if ($resql)
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">'; print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"],$paramlist,$sortfield,$sortorder,'',$num, $nbtotalofrecords,'title_accountancy.png', 0, '', '', $limit); print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $nbtotalofrecords,'title_accountancy.png', 0, '', '', $limit);
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"p.rowid","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"p.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","",$paramlist,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$paramlist,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$param,'align="right"',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("Invoices"),"","","",$paramlist,'align="left"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("Invoices"),"","","",$param,'align="left"',$sortfield,$sortorder);
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$paramlist,'align="right"',$sortfield,$sortorder); if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";

View File

@ -328,8 +328,7 @@ if (empty($reshook))
$label = $lines[$i]->product_label; $label = $lines[$i]->product_label;
} }
if ($conf->global->PRODUIT_DESC_IN_FORM) $desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):'';
$desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):'';
} }
else { else {
$desc = dol_htmlentitiesbr($lines[$i]->desc); $desc = dol_htmlentitiesbr($lines[$i]->desc);
@ -360,7 +359,6 @@ if (empty($reshook))
$error++; $error++;
break; break;
} }
} }
} }
} }

View File

@ -190,7 +190,7 @@ foreach($listofstatus as $status)
print '<td align="right"><a href="services.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'</a></td>'; print '<td align="right"><a href="services.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'</a></td>';
print "</tr>\n"; print "</tr>\n";
} }
if ($status==4 && $bool==false) $bool=true; if ($status==4 && ! $bool) $bool=true;
else $bool=false; else $bool=false;
} }
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax))
@ -210,7 +210,7 @@ foreach($listofstatus as $status)
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$staticcontratligne->LibStatut($status,0,($bool?1:0)).'</td>'; print '<td>'.$staticcontratligne->LibStatut($status,0,($bool?1:0)).'</td>';
print '<td align="right"><a href="services.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'</a></td>'; print '<td align="right"><a href="services.php?mode='.$status.($bool?'&filter=expired':'').'">'.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).'</a></td>';
if ($status==4 && $bool==false) $bool=true; if ($status==4 && ! $bool) $bool=true;
else $bool=false; else $bool=false;
print "</tr>\n"; print "</tr>\n";
} }

View File

@ -4297,7 +4297,7 @@ class Form
} }
$return.= '>'.vatrate($rate['libtva']); $return.= '>'.vatrate($rate['libtva']);
//$return.=($rate['code']?' '.$rate['code']:''); //$return.=($rate['code']?' '.$rate['code']:'');
$return.= (empty($defaultcode) && $rate['nprtva']) ? ' *': ''; // We show the * (old behaviour only if new vat code is not used) $return.= (empty($rate['code']) && $rate['nprtva']) ? ' *': ''; // We show the * (old behaviour only if new vat code is not used)
$return.= '</option>'; $return.= '</option>';
} }

View File

@ -192,8 +192,12 @@ class DoliDBMssql extends DoliDB
function getVersion() function getVersion()
{ {
$resql=$this->query("SELECT @@VERSION"); $resql=$this->query("SELECT @@VERSION");
$version=$this->fetch_array($resql); if ($resql)
return $version['computed']; {
$version=$this->fetch_array($resql);
return $version['computed'];
}
else return '';
} }
/** /**
@ -203,10 +207,7 @@ class DoliDBMssql extends DoliDB
*/ */
function getDriverInfo() function getDriverInfo()
{ {
// FIXME: Dummy method return 'php mssql driver';
// TODO: Implement
return '';
} }
/** /**
@ -359,7 +360,7 @@ class DoliDBMssql extends DoliDB
$query_comp[]=$fld->COLUMN_NAME." IS NOT NULL"; $query_comp[]=$fld->COLUMN_NAME." IS NOT NULL";
} }
} }
if ($query_comp) if (! empty($query_comp))
$query.=" WHERE ".implode(" AND ",$query_comp); $query.=" WHERE ".implode(" AND ",$query_comp);
} }
} }
@ -648,7 +649,7 @@ class DoliDBMssql extends DoliDB
function last_insert_id($tab,$fieldid='rowid') function last_insert_id($tab,$fieldid='rowid')
{ {
$res = $this->query("SELECT @@IDENTITY as id"); $res = $this->query("SELECT @@IDENTITY as id");
if ($data = $this->fetch_array($res)) if ($res && $data = $this->fetch_array($res))
{ {
return $data["id"]; return $data["id"];
} }
@ -709,8 +710,12 @@ class DoliDBMssql extends DoliDB
function DDLGetConnectId() function DDLGetConnectId()
{ {
$resql=$this->query('SELECT CONNECTION_ID()'); $resql=$this->query('SELECT CONNECTION_ID()');
$row=$this->fetch_row($resql); if ($resql)
return $row[0]; {
$row=$this->fetch_row($resql);
return $row[0];
}
else return '?';
} }
/** /**

View File

@ -549,8 +549,12 @@ class DoliDBMysql extends DoliDB
function DDLGetConnectId() function DDLGetConnectId()
{ {
$resql=$this->query('SELECT CONNECTION_ID()'); $resql=$this->query('SELECT CONNECTION_ID()');
$row=$this->fetch_row($resql); if ($resql)
return $row[0]; {
$row=$this->fetch_row($resql);
return $row[0];
}
else return '?';
} }

View File

@ -532,8 +532,12 @@ class DoliDBMysqli extends DoliDB
function DDLGetConnectId() function DDLGetConnectId()
{ {
$resql=$this->query('SELECT CONNECTION_ID()'); $resql=$this->query('SELECT CONNECTION_ID()');
$row=$this->fetch_row($resql); if ($resql)
return $row[0]; {
$row=$this->fetch_row($resql);
return $row[0];
}
else return '?';
} }
/** /**

View File

@ -874,31 +874,34 @@ class DoliDBPgsql extends DoliDB
*/ */
function DDLInfoTable($table) function DDLInfoTable($table)
{ {
$infotables=array(); $infotables=array();
$sql="SELECT "; $sql="SELECT ";
$sql.=" infcol.column_name as \"Column\","; $sql.=" infcol.column_name as \"Column\",";
$sql.=" CASE WHEN infcol.character_maximum_length IS NOT NULL THEN infcol.udt_name || '('||infcol.character_maximum_length||')'"; $sql.=" CASE WHEN infcol.character_maximum_length IS NOT NULL THEN infcol.udt_name || '('||infcol.character_maximum_length||')'";
$sql.=" ELSE infcol.udt_name"; $sql.=" ELSE infcol.udt_name";
$sql.=" END as \"Type\","; $sql.=" END as \"Type\",";
$sql.=" infcol.collation_name as \"Collation\","; $sql.=" infcol.collation_name as \"Collation\",";
$sql.=" infcol.is_nullable as \"Null\","; $sql.=" infcol.is_nullable as \"Null\",";
$sql.=" '' as \"Key\","; $sql.=" '' as \"Key\",";
$sql.=" infcol.column_default as \"Default\","; $sql.=" infcol.column_default as \"Default\",";
$sql.=" '' as \"Extra\","; $sql.=" '' as \"Extra\",";
$sql.=" '' as \"Privileges\""; $sql.=" '' as \"Privileges\"";
$sql.=" FROM information_schema.columns infcol"; $sql.=" FROM information_schema.columns infcol";
$sql.=" WHERE table_schema='public' "; $sql.=" WHERE table_schema='public' ";
$sql.=" AND table_name='".$table."'"; $sql.=" AND table_name='".$table."'";
$sql.=" ORDER BY ordinal_position;"; $sql.=" ORDER BY ordinal_position;";
dol_syslog($sql,LOG_DEBUG); dol_syslog($sql,LOG_DEBUG);
$result = $this->query($sql); $result = $this->query($sql);
while($row = $this->fetch_row($result)) if ($result)
{ {
$infotables[] = $row; while($row = $this->fetch_row($result))
} {
return $infotables; $infotables[] = $row;
}
}
return $infotables;
} }
@ -1111,8 +1114,12 @@ class DoliDBPgsql extends DoliDB
function getDefaultCharacterSetDatabase() function getDefaultCharacterSetDatabase()
{ {
$resql=$this->query('SHOW SERVER_ENCODING'); $resql=$this->query('SHOW SERVER_ENCODING');
$liste=$this->fetch_array($resql); if ($resql)
return $liste['server_encoding']; {
$liste=$this->fetch_array($resql);
return $liste['server_encoding'];
}
else return '';
} }
/** /**
@ -1127,7 +1134,7 @@ class DoliDBPgsql extends DoliDB
if ($resql) if ($resql)
{ {
$i = 0; $i = 0;
while ($obj = $this->fetch_object($resql) ) while ($obj = $this->fetch_object($resql))
{ {
$liste[$i]['charset'] = $obj->server_encoding; $liste[$i]['charset'] = $obj->server_encoding;
$liste[$i]['description'] = 'Default database charset'; $liste[$i]['description'] = 'Default database charset';
@ -1148,8 +1155,12 @@ class DoliDBPgsql extends DoliDB
function getDefaultCollationDatabase() function getDefaultCollationDatabase()
{ {
$resql=$this->query('SHOW LC_COLLATE'); $resql=$this->query('SHOW LC_COLLATE');
$liste=$this->fetch_array($resql); if ($resql)
return $liste['lc_collate']; {
$liste=$this->fetch_array($resql);
return $liste['lc_collate'];
}
else return '';
} }
/** /**

View File

@ -186,9 +186,9 @@ function societe_prepare_head(Societe $object)
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{ {
$head[$h][1] = $langs->trans("Events"); $head[$h][1] = $langs->trans("Events");
$head[$h][1].= ' / '; $head[$h][1].= '/';
} }
$head[$h][1].= $langs->trans("Info"); $head[$h][1].= $langs->trans("Agenda");
$head[$h][2] = 'agenda'; $head[$h][2] = 'agenda';
$h++; $h++;

View File

@ -209,7 +209,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__);
-- Accounting Expert -- Accounting Expert
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accounting', 6__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=accounting', 'MenuAccountancy', 0, 'accountancy', '(! empty($conf->accounting->enabled) || $user->rights->accounting->ventilation->read || $user->rights->accounting->ventilation->dispatch || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accounting', 6__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=accounting', 'MenuAccountancy', 0, 'accountancy', '! empty($conf->accounting->enabled) || $user->rights->accounting->ventilation->read || $user->rights->accounting->ventilation->dispatch || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__);
-- Dispatch -- Dispatch
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->ventilation->dispatch', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->ventilation->dispatch', '', 0, 2, __ENTITY__);

View File

@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $atarget Target * @param string $atarget Target
* @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param int $type_user 0=Menu for backoffice, 1=Menu for front office
* @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @param array $menu Object Menu to return back list of menu entries * @param Menu $menu Object Menu to return back list of menu entries
* @param int $noout Disable output (Initialise &$menu only). * @param int $noout Disable output (Initialise &$menu only).
* @return int 0 * @return int 0
*/ */

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
* @param string $atarget Target (Example: '' or '_top') * @param string $atarget Target (Example: '' or '_top')
* @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param int $type_user 0=Menu for backoffice, 1=Menu for front office
* @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @param array $menu Object Menu to return back list of menu entries * @param Menu $menu Object Menu to return back list of menu entries
* @param int $noout 1=Disable output (Initialise &$menu only). * @param int $noout 1=Disable output (Initialise &$menu only).
* @return int 0 * @return int 0
*/ */

View File

@ -49,7 +49,7 @@ class pdf_proforma extends pdf_einstein
function __construct($db) function __construct($db)
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
parent::__construct($db); parent::__construct($db);
$this->name = "proforma"; $this->name = "proforma";
@ -64,13 +64,14 @@ class pdf_proforma extends pdf_einstein
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param string $titlekey Translation key to show as title of document
* @return void * @return void
*/ */
function _pagehead(&$pdf, $object, $showaddress, $outputlangs) function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="InvoiceProForma")
{ {
global $conf,$langs,$hookmanager; global $conf,$langs,$hookmanager;
parent::_pagehead($pdf, $object, $showaddress, $outputlangs, "InvoiceProForma"); parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey);
} }
} }

View File

View File

@ -165,11 +165,11 @@ class modBanque extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Bordereaux remise Chq/Fact'; $this->export_label[$r]='Bordereaux remise Chq/Fact';
$this->export_permission[$r]=array(array("banque","export")); $this->export_permission[$r]=array(array("banque","export"));
$this->export_fields_array[$r]=array("bch.rowid"=>"DepositId","bch.number"=>"Numero","bch.ref_ext"=>"RefExt",'ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.num_chq'=>'ChequeOrTransferNumber','b.amount'=>'Credit','b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation", $this->export_fields_array[$r]=array("bch.rowid"=>"DepositId","bch.ref"=>"Numero","bch.ref_ext"=>"RefExt",'ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.num_chq'=>'ChequeOrTransferNumber','b.amount'=>'Credit','b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation",
"bch.date_bordereau"=>"Date","bch.amount"=>"Total","bch.nbcheque"=>"NbCheque","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty","f.facnumber"=>"InvoiceRef" "bch.date_bordereau"=>"Date","bch.amount"=>"Total","bch.nbcheque"=>"NbCheque","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty","f.facnumber"=>"InvoiceRef"
); );
$this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.num_chq'=>'Text','b.amount'=>'Numeric','b.num_releve'=>'Text','b.datec'=>"Date", $this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.num_chq'=>'Text','b.amount'=>'Numeric','b.num_releve'=>'Text','b.datec'=>"Date",
"bch.date_bordereau"=>"Date","bch.rowid"=>"Numeric","bch.number"=>"Numeric","bch.ref_ext"=>"Text","bch.amount"=>"Numeric","bch.nbcheque"=>"Numeric","bu.url_id"=>"Text","s.nom"=>"Text","f.facnumber"=>"Text" "bch.date_bordereau"=>"Date","bch.rowid"=>"Numeric","bch.ref"=>"Numeric","bch.ref_ext"=>"Text","bch.amount"=>"Numeric","bch.nbcheque"=>"Numeric","bu.url_id"=>"Text","s.nom"=>"Text","f.facnumber"=>"Text"
); );
$this->export_entities_array[$r]=array('ba.ref'=>'account','ba.label'=>'account','b.datev'=>'account','b.num_chq'=>'account','b.amount'=>'account','b.num_releve'=>'account','b.datec'=>"account", $this->export_entities_array[$r]=array('ba.ref'=>'account','ba.label'=>'account','b.datev'=>'account','b.num_chq'=>'account','b.amount'=>'account','b.num_releve'=>'account','b.datec'=>"account",
"bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company","f.facnumber"=>"invoice"); "bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company","f.facnumber"=>"invoice");

View File

@ -83,7 +83,7 @@ class modExpedition extends DolibarrModules
// Constants // Constants
$this->const = array(); $this->const = array();
$r=0; $r=0;
$this->const[$r][0] = "EXPEDITION_ADDON_PDF"; $this->const[$r][0] = "EXPEDITION_ADDON_PDF";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "rouget"; $this->const[$r][2] = "rouget";
@ -125,14 +125,14 @@ class modExpedition extends DolibarrModules
$this->const[$r][3] = ""; $this->const[$r][3] = "";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
$this->const[$r][0] = "MAIN_SUBMODULE_EXPEDITION"; $this->const[$r][0] = "MAIN_SUBMODULE_EXPEDITION";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "1"; $this->const[$r][2] = "1";
$this->const[$r][3] = "Enable shipments"; $this->const[$r][3] = "Enable shipments";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
// Boxes // Boxes
$this->boxes = array(); $this->boxes = array();
@ -224,8 +224,14 @@ class modExpedition extends DolibarrModules
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$shipment=new Commande($this->db); $shipment=new Commande($this->db);
$idcontacts=join(',',array_keys($shipment->liste_type_contact('external','',0,0,''))); $contact_arrays=$shipment->liste_type_contact('external','',0,0,'');
if (is_array($contact_arrays) && count($contact_arrays)>0){
$idcontacts=join(',',array_keys($shipment->liste_type_contact('external','',0,0,'')));
} else {
$idcontacts=0;
}
$r++; $r++;
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Shipments'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='Shipments'; // Translation key (used only if key ExportDataset_xxx_z not found)
@ -237,7 +243,7 @@ class modExpedition extends DolibarrModules
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','d.nom'=>'company','co.label'=>'company','co.code'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"shipment",'c.ref'=>"shipment",'c.ref_customer'=>"shipment",'c.fk_soc'=>"shipment",'c.date_creation'=>"shipment",'c.date_delivery'=>"shipment",'c.tracking_number'=>'shipment','c.height'=>"shipment",'c.width'=>"shipment",'c.size'=>'shipment','c.size_units'=>'shipment','c.weight'=>"shipment",'c.weight_units'=>'shipment','c.fk_statut'=>"shipment",'c.note_public'=>"shipment",'ed.rowid'=>'shipment_line','cd.description'=>'shipment_line','ed.qty'=>"shipment_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product','p.weight'=>'product','p.weight_units'=>'product','p.volume'=>'product','p.volume_units'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','d.nom'=>'company','co.label'=>'company','co.code'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"shipment",'c.ref'=>"shipment",'c.ref_customer'=>"shipment",'c.fk_soc'=>"shipment",'c.date_creation'=>"shipment",'c.date_delivery'=>"shipment",'c.tracking_number'=>'shipment','c.height'=>"shipment",'c.width'=>"shipment",'c.size'=>'shipment','c.size_units'=>'shipment','c.weight'=>"shipment",'c.weight_units'=>'shipment','c.fk_statut'=>"shipment",'c.note_public'=>"shipment",'ed.rowid'=>'shipment_line','cd.description'=>'shipment_line','ed.qty'=>"shipment_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product','p.weight'=>'product','p.weight_units'=>'product','p.volume'=>'product','p.volume_units'=>'product');
if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) $this->export_entities_array[$r]+=array('sp.rowid'=>'contact','sp.lastname'=>'contact','sp.firstname'=>'contact','sp.note_public'=>'contact'); if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) $this->export_entities_array[$r]+=array('sp.rowid'=>'contact','sp.lastname'=>'contact','sp.firstname'=>'contact','sp.note_public'=>'contact');
$this->export_dependencies_array[$r]=array('shipment_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('shipment_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT))
{ {
$keyforselect='socpeople'; $keyforelement='contact'; $keyforaliasextra='extra3'; $keyforselect='socpeople'; $keyforelement='contact'; $keyforaliasextra='extra3';
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';

View File

@ -117,7 +117,7 @@ $coldisplay=-1; // We remove first td
} }
$coldisplay++; $coldisplay++;
print '<td align="right"><input type="text" class="flat" size="8" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht,0,'',0):price($line->subprice,0,'',0)) . '"'; print '<td align="right"><input type="text" class="flat" size="5" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht,0,'',0):price($line->subprice,0,'',0)) . '"';
if ($this->situation_counter > 1) print ' readonly'; if ($this->situation_counter > 1) print ' readonly';
print '></td>'; print '></td>';

View File

@ -705,7 +705,9 @@ class Expedition 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 // 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->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref)); $result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref));
if ($result < 0) { if ($result < 0) {
$error++; break; $error++;
$this->errors[]=$mouvS->error;
break;
} }
} }
else else
@ -713,17 +715,12 @@ class Expedition extends CommonObject
// line with batch detail // line with 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 // 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->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch); // ->fk_origin_stock = id into table llx_product_batch (may be rename into llx_product_stock_batch in another version)
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch, $obj->fk_origin_stock);
if ($result < 0) { if ($result < 0) {
$error++; break; $error++;
} $this->errors[]=$mouvS->error;
break;
// We update content of table llx_product_batch (will be rename into llx_product_stock_batch inantoher version)
// We can set livraison_batch to deprecated and adapt livraison to handle batch too (mouvS->_create also calls mouvS->_create_batch)
if (! empty($conf->productbatch->enabled))
{
$result=$mouvS->livraison_batch($obj->fk_origin_stock, $qty); // ->fk_origin_stock = id into table llx_product_batch (will be rename into llx_product_stock_batch in another version)
if ($result < 0) { $error++; $this->errors[]=$mouvS->error; break; }
} }
} }
} }

View File

@ -333,7 +333,7 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id
if ($result > 0) if ($result > 0)
{ {
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition
{ {
// Send mail // Send mail
@ -390,6 +390,7 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id
else else
{ {
$mesg=$mailfile->error; $mesg=$mailfile->error;
setEventMessages($mesg, null, 'errors');
} }
// END - Send mail // END - Send mail
} }
@ -438,7 +439,7 @@ if ($action == "confirm_approve" && GETPOST("confirm") == "yes" && $id > 0 && $u
if ($result > 0) if ($result > 0)
{ {
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition
{ {
// Send mail // Send mail
@ -542,7 +543,7 @@ if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user
if ($result > 0) if ($result > 0)
{ {
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition
{ {
// Send mail // Send mail
@ -583,7 +584,6 @@ if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user
else else
{ {
setEventMessages($langs->trans("ErrorFailedToSendMail",$emailFrom,$emailTo), null, 'errors'); setEventMessages($langs->trans("ErrorFailedToSendMail",$emailFrom,$emailTo), null, 'errors');
$mesg="Impossible d'envoyer l'email.";
} }
// END - Send mail // END - Send mail
} }
@ -627,7 +627,7 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_
if ($result > 0) if ($result > 0)
{ {
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition
{ {
// Send mail // Send mail
@ -667,6 +667,7 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_
else else
{ {
$mesg="Impossible d'envoyer l'email."; $mesg="Impossible d'envoyer l'email.";
setEventMessages($mesg, null, 'errors');
} }
// END - Send mail // END - Send mail
} }
@ -756,7 +757,7 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
if ($result > 0) if ($result > 0)
{ {
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition
{ {
// Send mail // Send mail
@ -806,9 +807,8 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
endif; endif;
else: else:
$mesg="Impossible d'envoyer l'email.";
$mesg="Impossible d'envoyer l'email."; setEventMessages($mesg, null, 'errors');
endif; endif;
// END - Send mail // END - Send mail
} }
@ -921,7 +921,7 @@ if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes")
$total_ht = $object_ligne->total_ht; $total_ht = $object_ligne->total_ht;
$total_tva = $object_ligne->total_tva; $total_tva = $object_ligne->total_tva;
$result=$object->deleteline(GETPOST("rowid")); $result=$object->deleteline(GETPOST("rowid"), $user);
if ($result >= 0) if ($result >= 0)
{ {
if ($result > 0) if ($result > 0)
@ -961,7 +961,6 @@ if ($action == "updateligne" )
$rowid = $_POST['rowid']; $rowid = $_POST['rowid'];
$type_fees_id = GETPOST('fk_c_type_fees'); $type_fees_id = GETPOST('fk_c_type_fees');
$object_ligne->vatrate = price2num(GETPOST('vatrate'));
$projet_id = $fk_projet; $projet_id = $fk_projet;
$comments = GETPOST('comments'); $comments = GETPOST('comments');
$qty = GETPOST('qty'); $qty = GETPOST('qty');
@ -983,6 +982,7 @@ if ($action == "updateligne" )
if (! $error) if (! $error)
{ {
// TODO Use update method of ExpenseReportLine
$result = $object->updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, $qty, $value_unit, $date, $id); $result = $object->updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, $qty, $value_unit, $date, $id);
if ($result >= 0) if ($result >= 0)
{ {
@ -1078,29 +1078,6 @@ $formfile = new FormFile($db);
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
$projecttmp = new Project($db); $projecttmp = new Project($db);
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN))
{
if(!empty($_GET['mesg']))
{
$text_mesg = explode(",",$_GET['mesg']);
foreach($text_mesg as $text)
{
$mesg.= "- ".$langs->trans($text)."<br />";
}
print "<div class=\"error\" style=\"font-size:15px;background-color:#FFB3B3;\">";
print $langs->trans("LINE_NOT_ADDED")."<br />";
print $mesg;
print "</div>";
}
else
{
if ($mesg) print "<div class=\"error\" style=\"font-size:16px;background-color:red;\">".$mesg."</div>";
}
}
// Create // Create
if ($action == 'create') if ($action == 'create')
{ {

View File

@ -120,7 +120,7 @@ if ($resql)
foreach ($listofstatus as $status) foreach ($listofstatus as $status)
{ {
$dataseries[]=array('label'=>$fichinterstatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0)); $dataseries[]=array('label'=>$fichinterstatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
if ($status==3 && $bool==false) $bool=true; if ($status==3 && ! $bool) $bool=true;
else $bool=false; else $bool=false;
} }
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
@ -144,7 +144,7 @@ if ($resql)
print '</a>'; print '</a>';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
if ($status==3 && $bool==false) $bool=true; if ($status==3 && ! $bool) $bool=true;
else $bool=false; else $bool=false;
} }
} }

View File

@ -231,7 +231,7 @@ if ($object->id > 0)
// Categories // Categories
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
print '<tr><td>' . $langs->trans("Categories") . '</td>'; print '<tr><td>' . $langs->trans("SuppliersCategoriesShort") . '</td>';
print '<td colspan="3">'; print '<td colspan="3">';
print $form->showCategories($object->id, 'supplier', 1); print $form->showCategories($object->id, 'supplier', 1);
print "</td></tr>"; print "</td></tr>";

View File

@ -1126,7 +1126,7 @@ class CommandeFournisseur extends CommonOrder
// insert products details into database // insert products details into database
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {
$result = $this->addline( $result = $this->addline( // This include test on qty if option SUPPLIERORDER_WITH_NOPRICEDEFINED is not set
$this->lines[$i]->desc, $this->lines[$i]->desc,
$this->lines[$i]->subprice, $this->lines[$i]->subprice,
$this->lines[$i]->qty, $this->lines[$i]->qty,
@ -1306,11 +1306,11 @@ class CommandeFournisseur extends CommonOrder
*/ */
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null) function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null)
{ {
global $langs,$mysoc, $conf; global $langs,$mysoc,$conf;
$error = 0; $error = 0;
dol_syslog(get_class($this)."::addline $desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2. $fk_product, $fk_prod_fourn_price, $fourn_ref, $remise_percent, $price_base_type, $pu_ttc, $type, $fk_unit"); dol_syslog(get_class($this)."::addline $desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $fk_prod_fourn_price, $fourn_ref, $remise_percent, $price_base_type, $pu_ttc, $type, $fk_unit");
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters // Clean parameters
@ -1350,40 +1350,45 @@ class CommandeFournisseur extends CommonOrder
{ {
$this->db->begin(); $this->db->begin();
if ($fk_prod_fourn_price > 0) if ($fk_product > 0)
{ {
$prod = new Product($this->db, $fk_product); if (empty($conf->global->SUPPLIERORDER_WITH_NOPRICEDEFINED))
if ($prod->fetch($fk_product) > 0)
{ {
$result=$prod->get_buyprice($fk_prod_fourn_price,$qty,$fk_product,$fourn_ref); // Check quantity is enough
if ($result > 0) dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref);
$prod = new Product($this->db, $fk_product);
if ($prod->fetch($fk_product) > 0)
{ {
$label = $prod->libelle; $result=$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, $fourn_ref); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$fourn_ref
$pu = $prod->fourn_pu; if ($result > 0)
$ref = $prod->ref_fourn; {
$product_type = $prod->type; $label = $prod->libelle;
$pu = $prod->fourn_pu;
$ref = $prod->ref_fourn;
$product_type = $prod->type;
}
if ($result == 0 || $result == -1)
{
$langs->load("errors");
$this->error = "Ref " . $prod->ref . " " . $langs->trans("ErrorQtyTooLowForThisSupplier");
$this->db->rollback();
dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG);
return -1;
}
if ($result < -1)
{
$this->error=$prod->error;
$this->db->rollback();
dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_ERR);
return -1;
}
} }
if ($result == 0 || $result == -1) else
{ {
$langs->load("errors");
$this->error = "Ref " . $prod->ref . " " . $langs->trans("ErrorQtyTooLowForThisSupplier");
$this->db->rollback();
dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG);
return -1;
}
if ($result < -1)
{
$this->error=$prod->error; $this->error=$prod->error;
$this->db->rollback();
dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_ERR);
return -1; return -1;
} }
} }
else
{
$this->error=$prod->error;
return -1;
}
} }
else else
{ {
@ -1449,7 +1454,6 @@ class CommandeFournisseur extends CommonOrder
$sql.= ", ".$multicurrency_total_ttc; $sql.= ", ".$multicurrency_total_ttc;
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::addline", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
//print $sql; //print $sql;
if ($resql) if ($resql)

View File

@ -216,7 +216,7 @@ class ProductFournisseur extends Product
$this->db->begin(); $this->db->begin();
if ($this->product_fourn_price_id) if ($this->product_fourn_price_id > 0)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql.= " SET fk_user = " . $user->id." ,"; $sql.= " SET fk_user = " . $user->id." ,";
@ -237,7 +237,7 @@ class ProductFournisseur extends Product
$sql.= " WHERE rowid = ".$this->product_fourn_price_id; $sql.= " WHERE rowid = ".$this->product_fourn_price_id;
// TODO Add price_base_type and price_ttc // TODO Add price_base_type and price_ttc
dol_syslog(get_class($this).'::update_buyprice', LOG_DEBUG); dol_syslog(get_class($this).'::update_buyprice update knowing id of line = product_fourn_price_id = '.$this->product_fourn_price_id, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -249,7 +249,7 @@ class ProductFournisseur extends Product
if (empty($error)) if (empty($error))
{ {
$this->db->commit(); $this->db->commit();
return 0; return $this->product_fourn_price_id;
} }
else else
{ {
@ -267,94 +267,88 @@ class ProductFournisseur extends Product
else else
{ {
// Delete price for this quantity dol_syslog(get_class($this) . '::update_buyprice without knowing id of line, so we delete from company, quantity and supplier_ref and insert again', LOG_DEBUG);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql.= " WHERE fk_soc = ".$fourn->id." AND ref_fourn = '".$this->db->escape($ref_fourn)."' AND quantity = ".$qty." AND entity = ".$conf->entity; // Delete price for this quantity
dol_syslog(get_class($this).'::update_buyprice', LOG_DEBUG); $sql = "DELETE FROM " . MAIN_DB_PREFIX . "product_fournisseur_price";
$resql=$this->db->query($sql); $sql .= " WHERE fk_soc = " . $fourn->id . " AND ref_fourn = '" . $this->db->escape($ref_fourn) . "' AND quantity = " . $qty . " AND entity = " . $conf->entity;
if ($resql) $resql = $this->db->query($sql);
{ if ($resql) {
// Add price for this quantity to supplier // Add price for this quantity to supplier
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price("; $sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price(";
$sql.= "datec, fk_product, fk_soc, ref_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, charges, unitcharges, fk_availability, info_bits, entity, delivery_time_days,supplier_reputation)"; $sql .= "datec, fk_product, fk_soc, ref_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, charges, unitcharges, fk_availability, info_bits, entity, delivery_time_days,supplier_reputation)";
$sql.= " values('".$this->db->idate($now)."',"; $sql .= " values('" . $this->db->idate($now) . "',";
$sql.= " ".$this->id.","; $sql .= " " . $this->id . ",";
$sql.= " ".$fourn->id.","; $sql .= " " . $fourn->id . ",";
$sql.= " '".$this->db->escape($ref_fourn)."',"; $sql .= " '" . $this->db->escape($ref_fourn) . "',";
$sql.= " ".$user->id.","; $sql .= " " . $user->id . ",";
$sql.= " ".$buyprice.","; $sql .= " " . $buyprice . ",";
$sql.= " ".$qty.","; $sql .= " " . $qty . ",";
$sql.= " ".$remise_percent.","; $sql .= " " . $remise_percent . ",";
$sql.= " ".$remise.","; $sql .= " " . $remise . ",";
$sql.= " ".$unitBuyPrice.","; $sql .= " " . $unitBuyPrice . ",";
$sql.= " ".$tva_tx.","; $sql .= " " . $tva_tx . ",";
$sql.= " ".$charges.","; $sql .= " " . $charges . ",";
$sql.= " ".$unitCharges.","; $sql .= " " . $unitCharges . ",";
$sql.= " ".$availability.","; $sql .= " " . $availability . ",";
$sql.= " ".$newnpr.","; $sql .= " " . $newnpr . ",";
$sql.= $conf->entity.","; $sql .= $conf->entity . ",";
$sql.= $delivery_time_days.","; $sql .= $delivery_time_days . ",";
$sql.= (empty($supplier_reputation) ? 'NULL' : "'".$this->db->escape($supplier_reputation)."'"); $sql .= (empty($supplier_reputation) ? 'NULL' : "'" . $this->db->escape($supplier_reputation) . "'");
$sql.=")"; $sql .= ")";
dol_syslog(get_class($this)."::update_buyprice", LOG_DEBUG); $idinserted = 0;
if (! $this->db->query($sql))
{ $resql = $this->db->query($sql);
$error++; if ($resql) {
} $idinserted = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price");
}
if (! $error && !empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) else {
{ $error++;
// Add record into log table }
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price_log(";
$sql.= "datec, fk_product_fournisseur,fk_user,price,quantity)"; if (! $error && ! empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) {
$sql.= "values('".$this->db->idate($now)."',"; // Add record into log table
$sql.= " ".$this->product_fourn_id.","; $sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price_log(";
$sql.= " ".$user->id.","; $sql .= "datec, fk_product_fournisseur,fk_user,price,quantity)";
$sql.= " ".price2num($buyprice).","; $sql .= "values('" . $this->db->idate($now) . "',";
$sql.= " ".$qty; $sql .= " " . $this->product_fourn_id . ",";
$sql.=")"; $sql .= " " . $user->id . ",";
$sql .= " " . price2num($buyprice) . ",";
$resql=$this->db->query($sql); $sql .= " " . $qty;
if (! $resql) $sql .= ")";
{
$error++; $resql = $this->db->query($sql);
} if (! $resql) {
} $error++;
}
}
if (! $error)
{ if (! $error) {
// Call trigger // Call trigger
$result=$this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_CREATE',$user); $result = $this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_CREATE', $user);
if ($result < 0) $error++; if ($result < 0)
$error++;
// End call triggers // End call triggers
if (empty($error)) if (empty($error)) {
{ $this->db->commit();
$this->db->commit(); return $idinserted;
return 0; } else {
} $this->db->rollback();
else return -1;
{ }
$this->db->rollback(); } else {
return -1; $this->error = $this->db->lasterror() . " sql=" . $sql;
} $this->db->rollback();
} return -2;
else }
{ } else {
$this->error=$this->db->error()." sql=".$sql; $this->error = $this->db->lasterror() . " sql=" . $sql;
$this->db->rollback(); $this->db->rollback();
return -2; return - 1;
} }
} }
else
{
$this->error=$this->db->error()." sql=".$sql;
$this->db->rollback();
return -1;
}
}
} }
/** /**

View File

@ -1,6 +1,21 @@
CKEditor 4 Changelog CKEditor 4 Changelog
==================== ====================
## CKEditor 4.5.9
Fixed Issues:
* [#10685](http://dev.ckeditor.com/ticket/10685): Fixed: Unreadable toolbar icons after updating to the new editor version. Fixed with [6876179](https://github.com/ckeditor/ckeditor-dev/commit/6876179db4ee97e786b07b8fd72e6b4120732185) in [ckeditor-dev](https://github.com/ckeditor/ckeditor-dev) and [6c9189f4](https://github.com/ckeditor/ckeditor-presets/commit/6c9189f46392d2c126854fe8889b820b8c76d291) in [ckeditor-presets](https://github.com/ckeditor/ckeditor-presets).
* [#14573](https://dev.ckeditor.com/ticket/14573): Fixed: Missing [Widget](http://ckeditor.com/addon/widget) drag handler CSS when there are multiple editor instances.
* [#14620](https://dev.ckeditor.com/ticket/14620): Fixed: Setting both the `min-height` style for the `<body>` element and the `height` style for the `<html>` element breaks the [Auto Grow](http://ckeditor.com/addon/autogrow) plugin.
* [#14538](http://dev.ckeditor.com/ticket/14538): Fixed: Keyboard focus goes into an embedded `<iframe>` element.
* [#14602](http://dev.ckeditor.com/ticket/14602): Fixed: The [`dom.element.removeAttribute()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-removeAttribute) method does not remove all attributes if no parameter is given.
* [#8679](http://dev.ckeditor.com/ticket/8679): Fixed: Better focus indication and ability to style the selected color in the [color picker dialog](http://ckeditor.com/addon/colordialog).
* [#11697](http://dev.ckeditor.com/ticket/11697): Fixed: Content is replaced ignoring the letter case setting in the [Find and Replace](http://ckeditor.com/addon/find) dialog window.
* [#13886](http://dev.ckeditor.com/ticket/13886): Fixed: Invalid handling of the [`CKEDITOR.style`](http://docs.ckeditor.com/#!/api/CKEDITOR.style) instance with the `styles` property by [`CKEDITOR.filter`](http://docs.ckeditor.com/#!/api/CKEDITOR.filter).
* [#14535](http://dev.ckeditor.com/ticket/14535): Fixed: CSS syntax corrections. Thanks to [mdjdenormandie](https://github.com/mdjdenormandie)!
* [#14312](http://dev.ckeditor.com/ticket/14312): [IE] Fixed: Artifact is visible after pasting any text.
## CKEditor 4.5.8 ## CKEditor 4.5.8
New Features: New Features:

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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