diff --git a/.github/workflows/exakat.yml b/.github/workflows/exakat.yml
index 3cfc4f8ba23..c2f8cc12765 100644
--- a/.github/workflows/exakat.yml
+++ b/.github/workflows/exakat.yml
@@ -13,5 +13,5 @@ jobs:
- name: Exakat
uses: docker://exakat/exakat-ga
with:
- ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/RepeatedPrint,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
+ ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
ignore_dirs: '/htdocs/includes,/build,/dev,/doc,/scripts,/test'
\ No newline at end of file
diff --git a/COPYRIGHT b/COPYRIGHT
index d43f4d506f1..adf7d38c04b 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -39,7 +39,7 @@ TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes
JS libraries:
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
-ChartJS 2.9.3 MIT License Yes JS library for graph
+ChartJS 2.9.4 MIT License Yes JS library for graph
jQuery 3.5.1 MIT License Yes JS library
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
diff --git a/ChangeLog b/ChangeLog
index 4745cea7736..782528daae8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@ NEW: Accountancy - change menu disposition
NEW: Accountancy - on transfers, select the periodicity by default
NEW: Accountancy - Add export for Gestinum (v3 & v5)
NEW: new currency rate editor
+NEW: add a widget to show the customers with outstanding limits reached
NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr
NEW: add a counter of number of words for pages in website module
NEW: add alert before changing thirdparty in TakePOS
@@ -30,7 +31,7 @@ NEW: add column payment term into list of supplier invoices
NEW: add column quantity in product margin page
NEW: add column vat rate in page to define accounting account on product/service
NEW: add costprice in fields of products list
-NEW: added an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
+NEW: add an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
NEW: add employee link in expense report binding page
NEW: add EORI No. as ProfID5
NEW: add export for various payments
@@ -167,7 +168,8 @@ NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding am
NEW: ticket classification on create from email collector
NEW: Ticket message notifications when edited from public interface
NEW: translate classification labels in ticket
-NEW: Add VAT and juridical status for Algeria
+NEW: VAT rate for Angola #15606
+NEW: VAT and juridical status for Algeria
NEW: VAT report - Invert constant to show by default zero VAT in reports
NEW: website page fields selection
NEW: Weighing Scale compatibility with TakePOS connector
@@ -178,13 +180,10 @@ NEW: #15065 Add option to put the product label in bold in the PDF templates if
For developers:
---------------
-NEW: Hook on propal card
NEW: add __MEMBER_TYPE__ substitution key
+NEW: add __TYPE__ substitution key
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
-NEW: add hooks on stats pages
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
-NEW: API get contacts list of a given order
-NEW: API endpoint getContacts and Clean results
NEW: Add some fields to link website page to an other object
NEW: fill ECM src object fields in dol_add_file_process
NEW: conf to allow to show the full tree in warehouse popup
@@ -194,10 +193,6 @@ NEW: can add event to log into blockedlog module with a constant
NEW: add property cssview when declaring fields of an object
NEW: Can use dynamic code into the 'enabled' property of DAO fields
NEW: allow to edit "demand reason" field though API
-NEW: API can update a payment
-NEW: API get member by thirdparty
-NEW: API get thirdparty by barcode
-NEW: API get users by email / login
NEW: fetch contact by email with REST API
NEW: field ref_ext in llx_commandedet
NEW: fields ref_ext for Attributes and Combinations
@@ -210,15 +205,27 @@ NEW: standardizes API thirdparties by email like other object
NEW: Thirdparty REST API: endpoint to set price level
NEW: use new category API for project list view
NEW: Triggers Attributes and Attributes values
-NEW: add hooks on newpayment page to allow external payment modules
NEW: added incoterms data into the substitution array
-NEW: add formConfirm hook on product page
NEW: add send context for ticket
NEW: add a message in error_log after detection of SQL or script injection
-NEW: add two hooks printFieldListFrom and printFieldSearchParam
-NEW: add __TYPE__ substitution key
NEW: add validation of MX domain for emails
NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
+NEW: Graphics can be horizontal bars
+
+APIs
+NEW: API get contacts list of a given order
+NEW: API endpoint getContacts and Clean results
+NEW: API can update a payment
+NEW: API get member by thirdparty
+NEW: API get thirdparty by barcode
+NEW: API get users by email / login
+
+HOOKs
+NEW: Hook on propal card
+NEW: add hooks on newpayment page to allow external payment modules
+NEW: add hooks on stats pages
+NEW: add formConfirm hook on product page
+NEW: add two hooks printFieldListFrom and printFieldSearchParam
WARNING:
@@ -238,6 +245,7 @@ Following changes may create regressions for some external modules, but were nec
* The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of simple amount.
* The method select_thirdparty(), deprecated since 3.8, into html.form.class.php has been removed.
* Depreciate all methods with name ->valide(). Use instead methods ->validate().
+* Function showStripePaymentUrl, getStripePaymentUrl, showPaypalPaymentUrl and getPaypalPaymentUrl has been removed. The generic one showOnlinePaymentUrl and getOnlinePaymentUrl are always used.
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
@@ -266,7 +274,7 @@ FIX: Look and feel v12: First tab must be name of object
FIX: missing entity check
FIX: missing param for hook
FIX: Missing transaction on PO actions
-FIX: MySql Strict mode
+FIX: MySQL Strict mode
FIX: param entity in html form file
FIX: Problems on FEC format
FIX: round stock value on product list
@@ -374,8 +382,8 @@ FIX: SQL Problem in customer invoice list
FIX: SQL Problem in social contribution list
FIX: SQL Problem in supplier invoice list
FIX: SQL syntax error when editing extrafields
-FIX: Sql type
-FIX: takepos 12 hook
+FIX: SQL type
+FIX: TakePOS 12 hook
FIX: Update form erased extrafields that were hidden
FIX: Update of extrafields date
FIX: Update of extrafiels on draft object
@@ -389,7 +397,7 @@ For users:
NEW: Module MO (Manufacturing Order) is available as stable module.
NEW: Receipt printer module moved from 'development' to 'experimental'
-NEW: Add option MAIN_VIEW_LINE_NUMBER_IN_LIST for some lists.
+NEW: add option MAIN_VIEW_LINE_NUMBER_IN_LIST for some lists
NEW: add numbering module for TakePOS module
NEW: 2 new options when creating an invoice from time spent on a project : by period or by task
NEW: Accountancy add column thirdparty on binding page
@@ -400,19 +408,19 @@ NEW: Accountancy - Add possibility to manage a short alternative label for accou
NEW: Accountancy - General ledger - Add an option to search not reconciled lines
NEW: Add accountancy code of thirdparty in contact and supplier export
NEW: support webp image format
-NEW: Add checkbox "overwrite if exists" into ECM/DMS module
+NEW: add checkbox "overwrite if exists" into ECM/DMS module
NEW: add a link to notes in members list
NEW: add a parameter to group same products in TakePOS
NEW: add a parameter to sort product by label in TakePOS
-NEW: Add a profil to import contact categories
-NEW: Add company extrafields into order export
+NEW: add a profil to import contact categories
+NEW: add company extrafields into order export
NEW: add const CASHDESK_FORCE_DECREASE_STOCK to force batch decrementation
NEW: add const TAKEPOS_NUMPAD_USE_PAYMENT_ICON to use icons on payment buttons
NEW: add csv separator setup in module admin
NEW: add dedicated substitutions keys for extrafields of type date and datetime
NEW: add default warehouse for dispatch
-NEW: Add due date in feature "Export accounting documents"
-NEW: Add duration information for fichinter
+NEW: add due date in feature "Export accounting documents"
+NEW: add duration information for fichinter
NEW: Start support of Dark theme into ELDY theme
NEW: Add field author public alias for blog post on website module
NEW: Add "finished" field on product list
diff --git a/README.md b/README.md
index 139bdc00b6a..29f7da1792b 100644
--- a/README.md
+++ b/README.md
@@ -140,15 +140,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### Other general features
- Localization in most major languages
+- Multi-Language Support
- Multi-Users and groups with finely grained rights
-- Multi-currency
-- Multi-company by adding of an external module
+- Multi-Currency
+- Multi-Company (by adding of an external module)
+
- Very user friendly and easy to use
- customizable Dashboard
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
-- APIs
+- APIs (REST, SOAP)
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
+
- Support a lot of country specific features:
- Spanish Tax RE and ISPF
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
diff --git a/SECURITY.md b/SECURITY.md
index 56e1da679ed..77307516f73 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -12,8 +12,7 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
## Reporting a Vulnerability
-To report a vulnerability, please send an email to security@dolibarr.org
-In most cases, after fixing the security, we make an answer by email to say the issue has been fixed.
+To report a vulnerability, please use GitHub security advisory (alternatively send an email to security@dolibarr.org)
## Hunting vulnerabilities on Dolibarr
diff --git a/build/README b/build/README
index f7e8ebfe60b..14f2b92ae39 100644
--- a/build/README
+++ b/build/README
@@ -1,48 +1,62 @@
README (English)
+
+Path: /dolibarr/build/README
+
##################################################
Building packages
##################################################
All sub-directories of "build" directory contains files (setup or binary tools) required to build automatically Dolibarr packages.
-There are several tools:
+There are several tools:
- To build full Dolibarr packages, launch the script
> Launch command perl makepack-dolibarr.pl
-Note: Prerequisites to build tgz, debian, rpm package
+--------------------------------------------------------------------------------------------------
+
+
+Prerequisites to build tgz, debian, rpm package:
+
> apt-get install tar dpkg dpatch p7zip-full rpm zip
-Note: Prerequisites to build autoexe DoliWamp package:
+
+--------------------------------------------------------------------------------------------------
+
+Prerequisites to build autoexe DoliWamp package:
> apt-get install wine q4wine
> Launch "wine cmd" to check a drive Z: pointing to / exists.
> Install InnoSetup
- For example by running isetup-5.3.9.exe (http://www.jrsoftware.org)
+ For example by running isetup-5.5.8.exe (https://www.jrsoftware.org) https://files.jrsoftware.org/is/5/
> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB
- For example by running wampserver3.2.0_x64.exe (http://www.wampserver.com). See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
+ For example by running wampserver3.2.0_x64.exe (https://www.wampserver.com).
+ See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
> Add path to ISCC into PATH windows var:
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded),
open file build/exe/doliwamp.iss and click on button "Compile".
The .exe file will be build into directory build.
-
+--------------------------------------------------------------------------------------------------
- To build a theme package, launch the script
> perl makepack-dolibarrtheme.pl
+--------------------------------------------------------------------------------------------------
- To build a package for a module, launch the script
> perl makepack-dolibarrmodule.pl
+--------------------------------------------------------------------------------------------------
- To build developper documentation, launch the script
> perl dolibarr-doxygen-build.pl
+--------------------------------------------------------------------------------------------------
Note:
The build directory and all its contents is absolutely not required to make Dolibarr working.
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 85212d9c5ba..17a935f6234 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -503,7 +503,10 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/sqlite3`;
+
+ $ret=`rm -fr $BUILDROOT/$PROJECT/node_modules`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/ansible`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
@@ -578,23 +581,36 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
+ $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
+
# Removed other test files
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
+
+ # Removed files installed by the awful composer
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
+ $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/bin`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball for official debian, not for the rest
-
+ $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/composer`;
+ $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/doctrine`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
+ $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
+ $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/docs`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/.github`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/docs`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/samples`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/scripts`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/src`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
@@ -609,21 +625,17 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
- $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
+ $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/examples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
-
+ $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
+ $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
+ $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;
-
- $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
}
# Build package for each target
diff --git a/composer.json b/composer.json
index 9fede994525..a943fbe0aa3 100644
--- a/composer.json
+++ b/composer.json
@@ -35,7 +35,7 @@
"nnnick/chartjs" : "^2.9",
"stripe/stripe-php" : "6.43.1",
"maximebf/debugbar" : "1.15.1",
- "symfony/var-dumper": "3"
+ "symfony/var-dumper" : "3"
},
"require-dev" : {
"php-parallel-lint/php-parallel-lint" : "^0",
diff --git a/composer.lock b/composer.lock
index 5afe0ca34f2..e0462435f5e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -6,6 +6,53 @@
],
"content-hash": "1dbd2d05cc0836acfca5988f29005cf2",
"packages": [
+ {
+ "name": "Psr/log",
+ "version": "1.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
+ "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2020-03-23T09:12:05+00:00"
+ },
{
"name": "ckeditor/ckeditor",
"version": "4.12.1",
@@ -217,16 +264,16 @@
},
{
"name": "nnnick/chartjs",
- "version": "v2.9.3",
+ "version": "v2.9.4",
"source": {
"type": "git",
"url": "https://github.com/chartjs/Chart.js.git",
- "reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2"
+ "reference": "9bd4cf82fda9f50a5fb50b72843e06ab88124278"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/chartjs/Chart.js/zipball/06f73dc3590084b2c464bf08189c7aee2b6b92d2",
- "reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2",
+ "url": "https://api.github.com/repos/chartjs/Chart.js/zipball/9bd4cf82fda9f50a5fb50b72843e06ab88124278",
+ "reference": "9bd4cf82fda9f50a5fb50b72843e06ab88124278",
"shasum": ""
},
"require": {
@@ -254,7 +301,11 @@
"JS",
"chart"
],
- "time": "2019-11-14T18:37:30+00:00"
+ "support": {
+ "issues": "https://github.com/chartjs/Chart.js/issues",
+ "source": "https://github.com/chartjs/Chart.js/tree/v2.9.4"
+ },
+ "time": "2020-10-19T12:22:11+00:00"
},
{
"name": "phpoffice/phpexcel",
@@ -314,53 +365,6 @@
"abandoned": "phpoffice/phpspreadsheet",
"time": "2015-05-01T07:00:55+00:00"
},
- {
- "name": "psr/log",
- "version": "1.1.3",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
- "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Log\\": "Psr/Log/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
- "keywords": [
- "log",
- "psr",
- "psr-3"
- ],
- "time": "2020-03-23T09:12:05+00:00"
- },
{
"name": "restler/framework",
"version": "3.0.0-RC6",
@@ -2037,159 +2041,6 @@
],
"time": "2019-08-06T08:03:45+00:00"
},
- {
- "name": "symfony/polyfill-php72",
- "version": "v1.18.1",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php72.git",
- "reference": "639447d008615574653fb3bc60d1986d7172eaae"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae",
- "reference": "639447d008615574653fb3bc60d1986d7172eaae",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.18-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Php72\\": ""
- },
- "files": [
- "bootstrap.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2020-07-14T12:35:20+00:00"
- },
- {
- "name": "symfony/polyfill-php80",
- "version": "v1.18.1",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981",
- "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981",
- "shasum": ""
- },
- "require": {
- "php": ">=7.0.8"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.18-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Php80\\": ""
- },
- "files": [
- "bootstrap.php"
- ],
- "classmap": [
- "Resources/stubs"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Ion Bazan",
- "email": "ion.bazan@gmail.com"
- },
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2020-07-14T12:35:20+00:00"
- },
{
"name": "symfony/yaml",
"version": "v3.4.32",
@@ -2312,5 +2163,5 @@
"ext-curl": "*"
},
"platform-dev": [],
- "plugin-api-version": "1.1.0"
+ "plugin-api-version": "2.0.0"
}
diff --git a/dev/examples/zapier/package.json b/dev/examples/zapier/package.json
index 5b5827b22b2..4266a6f00b1 100644
--- a/dev/examples/zapier/package.json
+++ b/dev/examples/zapier/package.json
@@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
- "zapier-platform-core": "10.1.1"
+ "zapier-platform-core": "10.1.2"
},
"devDependencies": {
"mocha": "^5.2.0",
diff --git a/dev/translation/erp_comparison_translation.txt b/dev/translation/erp_comparison_translation.txt
deleted file mode 100644
index 6cf7c4f7c60..00000000000
--- a/dev/translation/erp_comparison_translation.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-comparison of terms
-
-
-Dolibarr SAP ERP Odoo
--------------------------------------------------------------------------
-Thirdparty Contact partner Partner/Contact (company)
-Contact/address Contact person Partner/Contact (individual)
-
-Financial Finance (FI) Accounting
-Accounting
-
-
-Income / Expense ?? Profit / Loss
-Balance ?? Net profit
-Subledger account Subledger account ??
-
-CRM Sales & Distribution Sales
-Proposal ?? Quotation
-
-
-
-Proposal is ok but proposition looks better (proposal is for a detailed proposition).
-We can say also "business proposition or business proposal".
-In India they are using "Quotation".
-
diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php
index 2bd2a84841e..6d621a7e101 100644
--- a/htdocs/accountancy/admin/accountmodel.php
+++ b/htdocs/accountancy/admin/accountmodel.php
@@ -187,7 +187,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).' ';
}*/
}
- if (isset($_POST["country"]) && ($_POST["country"] == '0') && ($id != 2))
+ if (GETPOSTISSET("country") && (GETPOST("country") == '0') && ($id != 2))
{
$ok = 0;
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php
index cd17e5a1538..d1cee5ff59d 100644
--- a/htdocs/accountancy/admin/card.php
+++ b/htdocs/accountancy/admin/card.php
@@ -247,7 +247,7 @@ if ($action == 'create') {
// Chart of accounts type
print '
'.$langs->trans("Pcgtype").'
';
print '
';
- print '';
+ print '';
print '
';
print '';
@@ -309,7 +309,7 @@ if ($action == 'create') {
// Chart of accounts type
print '
'.$langs->trans("Pcgtype").'
';
print '
';
- print '';
+ print '';
print '
';
print '';
diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php
index 2e51d3d1b38..53dfb1cd5f9 100644
--- a/htdocs/accountancy/admin/categories_list.php
+++ b/htdocs/accountancy/admin/categories_list.php
@@ -168,7 +168,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
}
}
- if (isset($_POST["code"]))
+ if (GETPOSTISSET("code"))
{
if ($_POST["code"] == '0')
{
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index b250459bdce..d0f43cfe3dd 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -3,7 +3,7 @@
* Copyright (C) 2013-2017 Florian Henry
* Copyright (C) 2013-2018 Alexandre Spangaro
* Copyright (C) 2017 Laurent Destailleur
- * Copyright (C) 2018 Frédéric France
+ * Copyright (C) 2018-2020 Frédéric France
*
* 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
@@ -128,8 +128,7 @@ if ($action == "confirm_update") {
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
} else {
- if ($mode != '_tmp')
- {
+ if ($mode != '_tmp') {
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
}
@@ -165,14 +164,14 @@ if ($action == "confirm_update") {
$object->label_operation = $label_operation;
$object->debit = $debit;
$object->credit = $credit;
- $object->doc_date = GETPOST('doc_date', 'alpha');
- $object->doc_type = GETPOST('doc_type', 'alpha');
+ $object->doc_date = (string) GETPOST('doc_date', 'alpha');
+ $object->doc_type = (string) GETPOST('doc_type', 'alpha');
$object->piece_num = $piece_num;
- $object->doc_ref = GETPOST('doc_ref', 'alpha');
+ $object->doc_ref = (string) GETPOST('doc_ref', 'alpha');
$object->code_journal = $journal_code;
$object->journal_label = $journal_label;
- $object->fk_doc = (int) GETPOST('fk_doc', 'int');
- $object->fk_docdet = (int) GETPOST('fk_docdet', 'int');
+ $object->fk_doc = GETPOSTINT('fk_doc');
+ $object->fk_docdet = GETPOSTINT('fk_docdet');
if (floatval($debit) != 0.0) {
$object->montant = $debit; // deprecated
@@ -190,8 +189,7 @@ if ($action == "confirm_update") {
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
} else {
- if ($mode != '_tmp')
- {
+ if ($mode != '_tmp') {
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
}
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 097eb38b47f..92de49d66ed 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -108,7 +108,7 @@ $hookmanager->initHooks(array('bookkeepinglist'));
$formaccounting = new FormAccounting($db);
$form = new Form($db);
-if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
+if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
{
if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values'))
{
@@ -632,19 +632,19 @@ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $obj
if (empty($reshook)) {
// Button re-export
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
- $newcardbutton = '' . img_picto($langs->trans("Activated"), 'switch_on') . ' ';
+ $newcardbutton = ''.img_picto($langs->trans("Activated"), 'switch_on').' ';
} else {
- $newcardbutton = '' . img_picto($langs->trans("Disabled"), 'switch_off') . ' ';
+ $newcardbutton = ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
- $newcardbutton .= '' . $langs->trans("IncludeDocsAlreadyExported") . '';
+ $newcardbutton .= ''.$langs->trans("IncludeDocsAlreadyExported").'';
- $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList") . ' (' . $listofformat[$formatexportset] . ')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"] . '?action=export_file' . ($param ? '&' . $param : ''), $user->rights->accounting->mouvements->export);
+ $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
- $newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
- $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $param, '', 1, array('morecss' => 'marginleftonly'));
+ $newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
+ $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
$url = './card.php?action=create';
- if (!empty($socid)) $url .= '&socid=' . $socid;
+ if (!empty($socid)) $url .= '&socid='.$socid;
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer);
}
diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index 80d8b4961c8..18661f8a887 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -379,12 +379,12 @@ print '';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
- $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param);
- $newcardbutton .= dolGetButtonTitle($langs->trans('VueByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
+ $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
+ $newcardbutton .= dolGetButtonTitle($langs->trans('VueByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= ' ';
- $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?action=create');
+ $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
}
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php
index 0a70034aaa6..3bc0351b09b 100644
--- a/htdocs/accountancy/bookkeeping/listbysubaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php
@@ -380,8 +380,8 @@ print '';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
- $newcardbutton = dolGetButtonTitle($langs->trans('ViewAccountList'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
- $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?action=create');
+ $newcardbutton = dolGetButtonTitle($langs->trans('ViewAccountList'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
+ $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
}
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php
index 51e66f3360c..3423f096794 100644
--- a/htdocs/accountancy/class/accountancyexport.class.php
+++ b/htdocs/accountancy/class/accountancyexport.class.php
@@ -57,8 +57,8 @@ class AccountancyExport
public static $EXPORT_TYPE_OPENCONCERTO = 100;
public static $EXPORT_TYPE_LDCOMPTA = 110;
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
- public static $EXPORT_TYPE_GESTINUMV3 = 130;
- public static $EXPORT_TYPE_GESTINUMV5 = 135;
+ public static $EXPORT_TYPE_GESTINUMV3 = 130;
+ public static $EXPORT_TYPE_GESTINUMV5 = 135;
public static $EXPORT_TYPE_FEC = 1000;
@@ -115,11 +115,11 @@ class AccountancyExport
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans('Modelcsv_Sage50_Swiss'),
- self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
+ self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
- self::$EXPORT_TYPE_GESTINUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
- self::$EXPORT_TYPE_GESTINUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
+ self::$EXPORT_TYPE_GESTINUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
+ self::$EXPORT_TYPE_GESTINUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
);
@@ -148,12 +148,12 @@ class AccountancyExport
self::$EXPORT_TYPE_COGILOG => 'cogilog',
self::$EXPORT_TYPE_AGIRIS => 'agiris',
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
- self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
- self::$EXPORT_TYPE_CHARLEMAGNE => 'charlemagne',
- self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
- self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10',
- self::$EXPORT_TYPE_GESTINUMV3 => 'gestinumv3',
- self::$EXPORT_TYPE_GESTINUMV5 => 'gestinumv5',
+ self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
+ self::$EXPORT_TYPE_CHARLEMAGNE => 'charlemagne',
+ self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
+ self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10',
+ self::$EXPORT_TYPE_GESTINUMV3 => 'gestinumv3',
+ self::$EXPORT_TYPE_GESTINUMV5 => 'gestinumv5',
self::$EXPORT_TYPE_FEC => 'fec',
);
@@ -208,9 +208,9 @@ class AccountancyExport
self::$EXPORT_TYPE_AGIRIS => array(
'label' => $langs->trans('Modelcsv_agiris'),
),
- self::$EXPORT_TYPE_OPENCONCERTO => array(
- 'label' => $langs->trans('Modelcsv_openconcerto'),
- ),
+ self::$EXPORT_TYPE_OPENCONCERTO => array(
+ 'label' => $langs->trans('Modelcsv_openconcerto'),
+ ),
self::$EXPORT_TYPE_SAGE50_SWISS => array(
'label' => $langs->trans('Modelcsv_Sage50_Swiss'),
),
@@ -218,18 +218,18 @@ class AccountancyExport
'label' => $langs->trans('Modelcsv_charlemagne'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
- self::$EXPORT_TYPE_LDCOMPTA => array(
- 'label' => $langs->trans('Modelcsv_LDCompta'),
- ),
+ self::$EXPORT_TYPE_LDCOMPTA => array(
+ 'label' => $langs->trans('Modelcsv_LDCompta'),
+ ),
self::$EXPORT_TYPE_LDCOMPTA10 => array(
- 'label' => $langs->trans('Modelcsv_LDCompta10'),
- ),
- self::$EXPORT_TYPE_GESTINUMV3 => array(
- 'label' => $langs->trans('Modelcsv_Gestinumv3'),
- ),
- self::$EXPORT_TYPE_GESTINUMV5 => array(
- 'label' => $langs->trans('Modelcsv_Gestinumv5'),
- ),
+ 'label' => $langs->trans('Modelcsv_LDCompta10'),
+ ),
+ self::$EXPORT_TYPE_GESTINUMV3 => array(
+ 'label' => $langs->trans('Modelcsv_Gestinumv3'),
+ ),
+ self::$EXPORT_TYPE_GESTINUMV5 => array(
+ 'label' => $langs->trans('Modelcsv_Gestinumv5'),
+ ),
self::$EXPORT_TYPE_FEC => array(
'label' => $langs->trans('Modelcsv_FEC'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
@@ -307,21 +307,21 @@ class AccountancyExport
case self::$EXPORT_TYPE_CHARLEMAGNE :
$this->exportCharlemagne($TData);
break;
- case self::$EXPORT_TYPE_LDCOMPTA :
- $this->exportLDCompta($TData);
- break;
- case self::$EXPORT_TYPE_LDCOMPTA10 :
- $this->exportLDCompta10($TData);
- break;
- case self::$EXPORT_TYPE_GESTINUMV3 :
- $this->exportGestimumV3($TData);
- break;
- case self::$EXPORT_TYPE_GESTINUMV5 :
- $this->exportGestimumV5($TData);
- break;
- case self::$EXPORT_TYPE_FEC :
- $this->exportFEC($TData);
- break;
+ case self::$EXPORT_TYPE_LDCOMPTA :
+ $this->exportLDCompta($TData);
+ break;
+ case self::$EXPORT_TYPE_LDCOMPTA10 :
+ $this->exportLDCompta10($TData);
+ break;
+ case self::$EXPORT_TYPE_GESTINUMV3 :
+ $this->exportGestimumV3($TData);
+ break;
+ case self::$EXPORT_TYPE_GESTINUMV5 :
+ $this->exportGestimumV5($TData);
+ break;
+ case self::$EXPORT_TYPE_FEC :
+ $this->exportFEC($TData);
+ break;
default:
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
break;
@@ -1484,136 +1484,136 @@ class AccountancyExport
}
}
- /**
- * Export format : Gestimum V3
- *
- * @param array $objectLines data
- *
- * @return void
- */
- public function exportGestimumV3($objectLines)
+ /**
+ * Export format : Gestimum V3
+ *
+ * @param array $objectLines data
+ *
+ * @return void
+ */
+ public function exportGestimumV3($objectLines)
{
- global $langs;
+ global $langs;
- $this->separator = ',';
+ $this->separator = ',';
- $invoices_infos = array();
- $supplier_invoices_infos = array();
- foreach ($objectLines as $line) {
- $date = dol_print_date($line->doc_date, '%d/%m/%Y');
+ $invoices_infos = array();
+ $supplier_invoices_infos = array();
+ foreach ($objectLines as $line) {
+ $date = dol_print_date($line->doc_date, '%d/%m/%Y');
- $invoice_ref = $line->doc_ref;
- $company_name = "";
+ $invoice_ref = $line->doc_ref;
+ $company_name = "";
- if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) {
- if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) ||
- ($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) {
- if ($line->doc_type == 'customer_invoice') {
- // Get new customer invoice ref and company name
- $sql = 'SELECT f.facnumber, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f';
- $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid';
- $sql .= ' WHERE f.rowid = ' . $line->fk_doc;
- $resql = $this->db->query($sql);
- if ($resql) {
- if ($obj = $this->db->fetch_object($resql)) {
- // Save invoice infos
- $invoices_infos[$line->fk_doc] = array('ref' => $obj->facnumber, 'company_name' => $obj->nom);
- $invoice_ref = $obj->facnumber;
- $company_name = $obj->nom;
- }
- }
- } else {
- // Get new supplier invoice ref and company name
- $sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff';
- $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid';
- $sql .= ' WHERE ff.rowid = ' . $line->fk_doc;
- $resql = $this->db->query($sql);
- if ($resql) {
- if ($obj = $this->db->fetch_object($resql)) {
- // Save invoice infos
- $supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom);
- $invoice_ref = $obj->ref;
- $company_name = $obj->nom;
- }
- }
- }
- } elseif ($line->doc_type == 'customer_invoice') {
- // Retrieve invoice infos
- $invoice_ref = $invoices_infos[$line->fk_doc]['ref'];
- $company_name = $invoices_infos[$line->fk_doc]['company_name'];
- } else {
- // Retrieve invoice infos
- $invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref'];
- $company_name = $supplier_invoices_infos[$line->fk_doc]['company_name'];
- }
- }
+ if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) {
+ if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) ||
+ ($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) {
+ if ($line->doc_type == 'customer_invoice') {
+ // Get new customer invoice ref and company name
+ $sql = 'SELECT f.facnumber, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f';
+ $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid';
+ $sql .= ' WHERE f.rowid = ' . $line->fk_doc;
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ if ($obj = $this->db->fetch_object($resql)) {
+ // Save invoice infos
+ $invoices_infos[$line->fk_doc] = array('ref' => $obj->facnumber, 'company_name' => $obj->nom);
+ $invoice_ref = $obj->facnumber;
+ $company_name = $obj->nom;
+ }
+ }
+ } else {
+ // Get new supplier invoice ref and company name
+ $sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff';
+ $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid';
+ $sql .= ' WHERE ff.rowid = ' . $line->fk_doc;
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ if ($obj = $this->db->fetch_object($resql)) {
+ // Save invoice infos
+ $supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom);
+ $invoice_ref = $obj->ref;
+ $company_name = $obj->nom;
+ }
+ }
+ }
+ } elseif ($line->doc_type == 'customer_invoice') {
+ // Retrieve invoice infos
+ $invoice_ref = $invoices_infos[$line->fk_doc]['ref'];
+ $company_name = $invoices_infos[$line->fk_doc]['company_name'];
+ } else {
+ // Retrieve invoice infos
+ $invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref'];
+ $company_name = $supplier_invoices_infos[$line->fk_doc]['company_name'];
+ }
+ }
- print $line->id . $this->separator;
- print $date . $this->separator;
- print substr($line->code_journal, 0, 4) . $this->separator;
+ print $line->id . $this->separator;
+ print $date . $this->separator;
+ print substr($line->code_journal, 0, 4) . $this->separator;
- if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
- print length_accountg($line->subledger_account) . $this->separator;
- } else {
- print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
- }
- //Libellé Auto
- print $this->separator;
- //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
- //Libellé manuel
- print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator;
- //Numéro de pièce
- print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator;
- //Devise
- print 'EUR' . $this->separator;
- //Montant
- print price2num(abs($line->montant)) . $this->separator;
- //Sens
- print $line->sens . $this->separator;
- //Code lettrage
- print $this->separator;
- //Date Echéance
- print $date;
- print $this->end_line;
- }
- }
+ if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
+ print length_accountg($line->subledger_account) . $this->separator;
+ } else {
+ print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
+ }
+ //Libellé Auto
+ print $this->separator;
+ //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
+ //Libellé manuel
+ print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator;
+ //Numéro de pièce
+ print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator;
+ //Devise
+ print 'EUR' . $this->separator;
+ //Montant
+ print price2num(abs($line->montant)) . $this->separator;
+ //Sens
+ print $line->sens . $this->separator;
+ //Code lettrage
+ print $this->separator;
+ //Date Echéance
+ print $date;
+ print $this->end_line;
+ }
+ }
- /**
- * Export format : Gestimum V5
- *
- * @param array $objectLines data
- *
- * @return void
- */
- public function exportGestimumV5($objectLines)
+ /**
+ * Export format : Gestimum V5
+ *
+ * @param array $objectLines data
+ *
+ * @return void
+ */
+ public function exportGestimumV5($objectLines)
{
- $this->separator = ',';
+ $this->separator = ',';
- foreach ($objectLines as $line) {
- $date = dol_print_date($line->doc_date, '%d%m%Y');
+ foreach ($objectLines as $line) {
+ $date = dol_print_date($line->doc_date, '%d%m%Y');
- print $line->id . $this->separator;
- print $date . $this->separator;
- print substr($line->code_journal, 0, 4) . $this->separator;
- if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
- print length_accountg($line->subledger_account) . $this->separator;
- } else {
- print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
- }
- print $this->separator;
- //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
- print '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"' . $this->separator;
- print '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'.$this->separator;
- print price2num($line->montant).$this->separator;
- print $line->sens.$this->separator;
- print $date . $this->separator;
- print $this->separator;
- print $this->separator;
- print 'EUR';
- print $this->end_line;
- }
- }
+ print $line->id . $this->separator;
+ print $date . $this->separator;
+ print substr($line->code_journal, 0, 4) . $this->separator;
+ if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
+ print length_accountg($line->subledger_account) . $this->separator;
+ } else {
+ print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
+ }
+ print $this->separator;
+ //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
+ print '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"' . $this->separator;
+ print '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'.$this->separator;
+ print price2num($line->montant).$this->separator;
+ print $line->sens.$this->separator;
+ print $date . $this->separator;
+ print $this->separator;
+ print $this->separator;
+ print 'EUR';
+ print $this->end_line;
+ }
+ }
/**
* trunc
diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php
index c002abf2a89..a76be081471 100644
--- a/htdocs/accountancy/class/accountingjournal.class.php
+++ b/htdocs/accountancy/class/accountingjournal.class.php
@@ -37,7 +37,7 @@ class AccountingJournal extends CommonObject
public $table_element = 'accounting_journal';
/**
- * @var int Field with ID of parent key if this field has a parent
+ * @var string Fieldname with ID of parent key if this field has a parent
*/
public $fk_element = '';
diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php
index 20010cc8f5c..834af1ff06a 100644
--- a/htdocs/accountancy/index.php
+++ b/htdocs/accountancy/index.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2016-2020 Laurent Destailleur
* Copyright (C) 2016-2019 Alexandre Spangaro
* Copyright (C) 2019 Frédéric France
*
@@ -103,13 +103,19 @@ if ($conf->accounting->enabled)
// STEPS
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'');
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '{s}');
+ $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'', $s);
+ print $s;
print " \n";
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'');
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '{s}');
+ $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'', $s);
+ print $s;
print " \n";
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'');
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '{s}');
+ $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'', $s);
+ print $s;
print " \n";
print " \n";
@@ -118,60 +124,45 @@ if ($conf->accounting->enabled)
print " \n";
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '{s}');
+ $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'', $s);
+ print $s;
print " \n";
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'')."\n";
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '{s}')."\n";
+ $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'', $s);
+ print $s;
print " \n";
$step++;
$textlink = ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'';
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, '{s}');
+ $s = str_replace('{s}', $textlink, $s);
+ print $s;
print " \n";
if (!empty($conf->tax->enabled))
{
$textlink = ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'';
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, '{s}');
+ $s = str_replace('{s}', $textlink, $s);
+ print $s;
print " \n";
}
- /*if (! empty($conf->salaries->enabled))
- {
- $step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
- // htdocs/admin/salaries.php
- print " \n";
- print " \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++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'');
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '{s}');
+ $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'', $s);
+ print $s;
print " \n";
}
- /*
- if (! empty($conf->loan->enabled))
- {
- $step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, ''.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").' '.$langs->transnoentitiesnoconv("or").' '.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
- print " \n";
- }
- if (! empty($conf->don->enabled))
- {
- $step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
- print " \n";
- }
- if (! empty($conf->adherents->enabled))
- {
- $step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
- print " \n";
- }*/
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'');
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '{s}');
+ $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'', $s);
+ print $s;
print " \n";
@@ -188,26 +179,34 @@ if ($conf->accounting->enabled)
$langs->loadLangs(array('bills', 'trips'));
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'')."\n";
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), '{s}')."\n";
+ $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'', $s);
+ print $s;
print " \n";
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'')."\n";
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), '{s}')."\n";
+ $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'', $s);
+ print $s;
print " \n";
if (!empty($conf->expensereport->enabled) || !empty($conf->deplacement->enabled))
{
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."\n";
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '{s}')."\n";
+ $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'', $s);
+ print $s;
print " \n";
}
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64 + $step), $langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("RegistrationInAccounting"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64 + $step), $langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("RegistrationInAccounting"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
+ print $s;
print " \n";
$step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64 + $step))." \n";
+ $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64 + $step))." \n";
+ print $s;
print " \n";
print ' ';
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 4e1a64cd20c..d353041234f 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -7,7 +7,7 @@
* Copyright (C) 2013-2019 Alexandre Spangaro
* Copyright (C) 2013-2014 Florian Henry
* Copyright (C) 2013-2014 Olivier Geffroy
- * Copyright (C) 2017-2018 Frédéric France
+ * Copyright (C) 2017-2020 Frédéric France
* Copyright (C) 2018 Ferran Marcet
* Copyright (C) 2018 Eric Seigne
*
@@ -73,15 +73,18 @@ $date_endmonth = GETPOST('date_endmonth', 'int');
$date_endday = GETPOST('date_endday', 'int');
$date_endyear = GETPOST('date_endyear', 'int');
$in_bookkeeping = GETPOST('in_bookkeeping', 'aZ09');
-if ($in_bookkeeping == '') $in_bookkeeping = 'notyet';
+if ($in_bookkeeping == '') {
+ $in_bookkeeping = 'notyet';
+}
$now = dol_now();
$action = GETPOST('action', 'aZ09');
// Security check
-if ($user->socid > 0 && empty($id_journal))
+if ($user->socid > 0 && empty($id_journal)) {
accessforbidden();
+}
/*
@@ -93,8 +96,7 @@ $error = 0;
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
-if (empty($date_startmonth) || empty($date_endmonth))
-{
+if (empty($date_startmonth) || empty($date_endmonth)) {
// Period by default on transfer
$dates = getDefaultDatesForTransfer();
$date_start = $dates['date_start'];
@@ -103,8 +105,7 @@ if (empty($date_startmonth) || empty($date_endmonth))
$pastmonth = $dates['pastmonth'];
}
-if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) // We define date_start and date_end, only if we did not submit the form
-{
+if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form
$date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
}
@@ -124,19 +125,18 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc on bu1.url_id=soc.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid";
$sql .= " WHERE ba.fk_accountancy_journal=".$id_journal;
$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
-if ($date_start && $date_end)
+if ($date_start && $date_end) {
$sql .= " AND b.dateo >= '".$db->idate($date_start)."' AND b.dateo <= '".$db->idate($date_end)."'";
+}
// Define begin binding date
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
$sql .= " AND b.dateo >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
// Already in bookkeeping or not
-if ($in_bookkeeping == 'already')
-{
+if ($in_bookkeeping == 'already') {
$sql .= " AND (b.rowid IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
}
-if ($in_bookkeeping == 'notyet')
-{
+if ($in_bookkeeping == 'notyet') {
$sql .= " AND (b.rowid NOT IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
}
$sql .= " ORDER BY b.datev";
@@ -177,9 +177,9 @@ if ($result) {
//print $sql;
// Variables
- $account_supplier = (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
- $account_customer = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "") ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'); // NotDefined is a reserved word
- $account_employee = (!empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined'); // NotDefined is a reserved word
+ $account_supplier = (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
+ $account_customer = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "") ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'); // NotDefined is a reserved word
+ $account_employee = (!empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined'); // NotDefined is a reserved word
$account_pay_vat = (!empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : 'NotDefined'); // NotDefined is a reserved word
$account_pay_donation = (!empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word
$account_pay_subscription = (!empty($conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT) ? $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word
@@ -198,23 +198,28 @@ if ($result) {
// one line for bank record = tabbq
// one line for thirdparty record = tabtp
$i = 0;
- while ($i < $num)
- {
+ while ($i < $num) {
$obj = $db->fetch_object($result);
$lineisapurchase = -1;
$lineisasale = -1;
// Old method to detect if it's a sale or purchase
- if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') $lineisapurchase = 1;
- if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') $lineisasale = 1;
- // Try a more reliable method to detect if record is a supplier payment or a customer payment
- if ($lineisapurchase < 0)
- {
- if ($obj->typeop_payment_supplier == 'payment_supplier') $lineisapurchase = 1;
+ if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') {
+ $lineisapurchase = 1;
}
- if ($lineisasale < 0)
- {
- if ($obj->typeop_payment == 'payment') $lineisasale = 1;
+ if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') {
+ $lineisasale = 1;
+ }
+ // Try a more reliable method to detect if record is a supplier payment or a customer payment
+ if ($lineisapurchase < 0) {
+ if ($obj->typeop_payment_supplier == 'payment_supplier') {
+ $lineisapurchase = 1;
+ }
+ }
+ if ($lineisasale < 0) {
+ if ($obj->typeop_payment == 'payment') {
+ $lineisasale = 1;
+ }
}
//var_dump($obj->type_payment); var_dump($obj->type_payment_supplier);
//var_dump($lineisapurchase); //var_dump($lineisasale);
@@ -224,28 +229,30 @@ if ($result) {
// Set accountancy code for thirdparty (example: '411CU...' or '411' if no subledger account defined on customer)
$compta_soc = 'NotDefined';
- if ($lineisapurchase > 0)
+ if ($lineisapurchase > 0) {
$compta_soc = (($obj->code_compta_fournisseur != "") ? $obj->code_compta_fournisseur : $account_supplier);
- if ($lineisasale > 0)
+ }
+ if ($lineisasale > 0) {
$compta_soc = (!empty($obj->code_compta) ? $obj->code_compta : $account_customer);
+ }
$tabcompany[$obj->rowid] = array(
- 'id' => $obj->socid,
- 'name' => $obj->name,
- 'code_compta' => $compta_soc,
- 'email' => $obj->email
+ 'id' => $obj->socid,
+ 'name' => $obj->name,
+ 'code_compta' => $compta_soc,
+ 'email' => $obj->email
);
// Set accountancy code for user
$compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : '');
$tabuser[$obj->rowid] = array(
- 'id' => $obj->userid,
- 'name' => dolGetFirstLastname($obj->firstname, $obj->lastname),
- 'lastname' => $obj->lastname,
- 'firstname' => $obj->firstname,
- 'email' => $obj->useremail,
- 'accountancy_code' => $compta_user
+ 'id' => $obj->userid,
+ 'name' => dolGetFirstLastname($obj->firstname, $obj->lastname),
+ 'lastname' => $obj->lastname,
+ 'firstname' => $obj->firstname,
+ 'email' => $obj->useremail,
+ 'accountancy_code' => $compta_user
);
// Variable bookkeeping ($obj->rowid is Bank Id)
@@ -264,10 +271,6 @@ if ($result) {
// Load of url links to the line into llx_bank
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
- //var_dump($i);
- //var_dump($tabpay);
- //var_dump($tabcompany);
-
// By default
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or any old record with no links in bank_url.
$tabtype[$obj->rowid] = 'unknown';
@@ -277,17 +280,14 @@ if ($result) {
if (is_array($links) && count($links) > 0) {
// Now loop on each link of record in bank.
foreach ($links as $key => $val) {
- if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various')))
- {
+ if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
// So we excluded 'company' and 'user' here. We want only payment lines
// We save tabtype for a future use, to remember what kind of payment it is
$tabpay[$obj->rowid]['type'] = $links[$key]['type'];
$tabtype[$obj->rowid] = $links[$key]['type'];
- } elseif (in_array($links[$key]['type'], array('company', 'user')))
- {
- if ($tabpay[$obj->rowid]['type'] == 'unknown')
- {
+ } elseif (in_array($links[$key]['type'], array('company', 'user'))) {
+ if ($tabpay[$obj->rowid]['type'] == 'unknown') {
// We can guess here it is a bank record for a thirdparty company or a user.
// But we won't be able to record somewhere else than into a waiting account, because there is no other journal to record the contreparty.
}
@@ -312,16 +312,23 @@ if ($result) {
$societestatic->name = $links[$key]['label'];
$societestatic->email = $tabcompany[$obj->rowid]['email'];
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
- if ($compta_soc) $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
+ if ($compta_soc) {
+ $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
+ }
} elseif ($links[$key]['type'] == 'user') {
$userstatic->id = $links[$key]['url_id'];
$userstatic->name = $links[$key]['label'];
$userstatic->email = $tabuser[$obj->rowid]['email'];
$userstatic->firstname = $tabuser[$obj->rowid]['firstname'];
$userstatic->lastname = $tabuser[$obj->rowid]['lastname'];
- if ($userstatic->id > 0) $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
- else $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
- if ($compta_user) $tabtp[$obj->rowid][$compta_user] += $obj->amount;
+ if ($userstatic->id > 0) {
+ $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
+ } else {
+ $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
+ }
+ if ($compta_user) {
+ $tabtp[$obj->rowid][$compta_user] += $obj->amount;
+ }
} elseif ($links[$key]['type'] == 'sc') {
$chargestatic->id = $links[$key]['url_id'];
$chargestatic->ref = $links[$key]['url_id'];
@@ -329,8 +336,9 @@ if ($result) {
$tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2);
$reg = array();
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
- if ($reg[1] == 'socialcontribution')
+ if ($reg[1] == 'socialcontribution') {
$reg[1] = 'SocialContribution';
+ }
$chargestatic->label = $langs->trans($reg[1]);
} else {
$chargestatic->label = $links[$key]['label'];
@@ -430,20 +438,19 @@ if ($result) {
// If no links were found to know the amount on thirdparty, we try to guess it.
// This may happens on bank entries without the links lines to 'company'.
- if (empty($tabtp[$obj->rowid]) && !empty($tabmoreinfo[$obj->rowid]['withdraw'])) // If we dont find 'company' link because it is an old 'withdraw' record
- {
+ if (empty($tabtp[$obj->rowid]) && !empty($tabmoreinfo[$obj->rowid]['withdraw'])) { // If we dont find 'company' link because it is an old 'withdraw' record
foreach ($links as $key => $val) {
if ($links[$key]['type'] == 'payment') {
// Get thirdparty
$tmppayment->fetch($links[$key]['url_id']);
$arrayofamounts = $tmppayment->getAmountsArray();
- foreach ($arrayofamounts as $invoiceid => $amount)
- {
- $tmpinvoice->fetch($invoiceid);
- $tmpinvoice->fetch_thirdparty();
- if ($tmpinvoice->thirdparty->code_compta)
- {
- $tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount;
+ if (is_array($arrayofamounts)) {
+ foreach ($arrayofamounts as $invoiceid => $amount) {
+ $tmpinvoice->fetch($invoiceid);
+ $tmpinvoice->fetch_thirdparty();
+ if ($tmpinvoice->thirdparty->code_compta) {
+ $tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount;
+ }
}
}
}
@@ -451,7 +458,9 @@ if ($result) {
}
// If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'.
- if (empty($tabtp[$obj->rowid])) $tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
+ if (empty($tabtp[$obj->rowid])) {
+ $tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
+ }
// Check account number is ok
/*if ($action == 'writebookkeeping') // Make test now in such a case
@@ -492,8 +501,7 @@ if (!$error && $action == 'writebookkeeping') {
$now = dol_now();
$error = 0;
- foreach ($tabpay as $key => $val) // $key is rowid into llx_bank
- {
+ foreach ($tabpay as $key => $val) { // $key is rowid into llx_bank
$date = dol_print_date($db->jdate($val["date"]), 'day');
$ref = getSourceDocRef($val, $tabtype[$key]);
@@ -511,17 +519,18 @@ if (!$error && $action == 'writebookkeeping') {
var_dump($tabbq);exit;*/
// Bank
- if (!$errorforline && is_array($tabbq[$key]))
- {
+ if (!$errorforline && is_array($tabbq[$key])) {
// Line into bank account
- foreach ($tabbq[$key] as $k => $mt)
- {
- if ($mt)
- {
+ foreach ($tabbq[$key] as $k => $mt) {
+ if ($mt) {
$reflabel = '';
- if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
+ if (!empty($val['lib'])) {
+ $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
+ }
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
- if (!empty($val['soclib'])) $reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
+ if (!empty($val['soclib'])) {
+ $reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
+ }
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
@@ -554,8 +563,7 @@ if (!$error && $action == 'writebookkeeping') {
$result = $bookkeeping->create($user);
if ($result < 0) {
- if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
- {
+ if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
$error++;
$errorforline++;
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
@@ -570,18 +578,16 @@ if (!$error && $action == 'writebookkeeping') {
}
// Third party
- if (!$errorforline)
- {
- if (is_array($tabtp[$key]))
- {
+ if (!$errorforline) {
+ if (is_array($tabtp[$key])) {
// Line into thirdparty account
foreach ($tabtp[$key] as $k => $mt) {
- if ($mt)
- {
+ if ($mt) {
$reflabel = '';
- if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
- if ($tabtype[$key] == 'banktransfert')
- {
+ if (!empty($val['lib'])) {
+ $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
+ }
+ if ($tabtype[$key] == 'banktransfert') {
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
} else {
$reflabel .= dol_string_nohtmltag($val['soclib']);
@@ -681,8 +687,7 @@ if (!$error && $action == 'writebookkeeping') {
$accountingaccount->fetch(null, $k, true);
$bookkeeping->label_compte = $accountingaccount->label;
} else {
- if ($tabtype[$key] == 'unknown') // Unknown transaction, we will use a waiting account for thirdparty.
- {
+ if ($tabtype[$key] == 'unknown') { // Unknown transaction, we will use a waiting account for thirdparty.
// Temporary account
$bookkeeping->subledger_account = '';
$bookkeeping->subledger_label = '';
@@ -700,8 +705,7 @@ if (!$error && $action == 'writebookkeeping') {
$result = $bookkeeping->create($user);
if ($result < 0) {
- if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
- {
+ if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
$error++;
$errorforline++;
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
@@ -715,10 +719,11 @@ if (!$error && $action == 'writebookkeeping') {
}
} else { // If thirdparty unknown, output the waiting account
foreach ($tabbq[$key] as $k => $mt) {
- if ($mt)
- {
+ if ($mt) {
$reflabel = '';
- if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
+ if (!empty($val['lib'])) {
+ $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
+ }
$reflabel .= dol_string_nohtmltag('WaitingAccount');
$bookkeeping = new BookKeeping($db);
@@ -745,8 +750,7 @@ if (!$error && $action == 'writebookkeeping') {
$result = $bookkeeping->create($user);
if ($result < 0) {
- if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
- {
+ if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
$error++;
$errorforline++;
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
@@ -761,23 +765,20 @@ if (!$error && $action == 'writebookkeeping') {
}
}
- if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT'))
- {
+ if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT')) {
$error++;
$errorforline++;
setEventMessages('Try to insert a non balanced transaction in book for '.$ref.'. Canceled. Surely a bug.', null, 'errors');
}
- if (!$errorforline)
- {
+ if (!$errorforline) {
$db->commit();
} else {
//print 'KO for line '.$key.' '.$error.' ';
$db->rollback();
$MAXNBERRORS = 5;
- if ($error >= $MAXNBERRORS)
- {
+ if ($error >= $MAXNBERRORS) {
setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped").' (>'.$MAXNBERRORS.')', null, 'errors');
break; // Break in the foreach
}
@@ -786,8 +787,7 @@ if (!$error && $action == 'writebookkeeping') {
if (empty($error) && count($tabpay) > 0) {
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
- } elseif (count($tabpay) == $error)
- {
+ } elseif (count($tabpay) == $error) {
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
} else {
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
@@ -796,8 +796,7 @@ if (!$error && $action == 'writebookkeeping') {
$action = '';
// Must reload data, so we make a redirect
- if (count($tabpay) != $error)
- {
+ if (count($tabpay) != $error) {
$param = 'id_journal='.$id_journal;
$param .= '&date_startday='.$date_startday;
$param .= '&date_startmonth='.$date_startmonth;
@@ -835,20 +834,22 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$langs->transnoentitiesnoconv("Note").'"'.$sep;
print "\n";
- foreach ($tabpay as $key => $val)
- {
+ foreach ($tabpay as $key => $val) {
$date = dol_print_date($db->jdate($val["date"]), 'day');
$ref = getSourceDocRef($val, $tabtype[$key]);
// Bank
foreach ($tabbq[$key] as $k => $mt) {
- if ($mt)
- {
+ if ($mt) {
$reflabel = '';
- if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
+ if (!empty($val['lib'])) {
+ $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
+ }
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
- if (!empty($val['soclib'])) $reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
+ if (!empty($val['soclib'])) {
+ $reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
+ }
print '"'.$key.'"'.$sep;
print '"'.$date.'"'.$sep;
@@ -868,12 +869,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
// Third party
if (is_array($tabtp[$key])) {
foreach ($tabtp[$key] as $k => $mt) {
- if ($mt)
- {
+ if ($mt) {
$reflabel = '';
- if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
- if ($tabtype[$key] == 'banktransfert')
- {
+ if (!empty($val['lib'])) {
+ $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
+ }
+ if ($tabtype[$key] == 'banktransfert') {
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
} else {
$reflabel .= dol_string_nohtmltag($val['soclib']);
@@ -905,10 +906,11 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
}
} else { // If thirdparty unkown, output the waiting account
foreach ($tabbq[$key] as $k => $mt) {
- if ($mt)
- {
+ if ($mt) {
$reflabel = '';
- if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
+ if (!empty($val['lib'])) {
+ $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
+ }
$reflabel .= dol_string_nohtmltag('WaitingAccount');
print '"'.$key.'"'.$sep;
@@ -965,16 +967,18 @@ if (empty($action) || $action == 'view') {
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity = '.$conf->entity.' AND fk_accountancy_journal IS NULL AND clos=0';
$resql = $db->query($sql);
- if ($resql)
- {
+ if ($resql) {
$obj = $db->fetch_object($resql);
- if ($obj->nb > 0)
- {
+ if ($obj->nb > 0) {
print '
';
@@ -1151,14 +1149,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Country
//$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined
print '
';
}
}
diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index bfdff79cc1f..b5e4c0ddf45 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -229,7 +229,11 @@ foreach ($dirmodels as $reldir)
// Show example of numbering model
print '