mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Merge branch 'develop' into patch-112
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -12,6 +12,7 @@ dolibarr_install.log
|
||||
upgrade.log
|
||||
doxygen_warnings.log
|
||||
/.project
|
||||
/.vscode
|
||||
.DS_Store
|
||||
.idea
|
||||
*.iml
|
||||
@@ -24,3 +25,4 @@ Thumbs.db
|
||||
htdocs/includes/autoload.php
|
||||
htdocs/includes/bin/
|
||||
htdocs/includes/composer/
|
||||
/.pydevproject
|
||||
|
||||
81
.travis.yml
81
.travis.yml
@@ -2,7 +2,7 @@
|
||||
# from Dolibarr GitHub repository.
|
||||
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
|
||||
|
||||
# We use dist: precise to have php 5.3 available
|
||||
# We use dist: trusty to have php 5.4+ available
|
||||
dist: trusty
|
||||
sudo: required
|
||||
|
||||
@@ -20,7 +20,7 @@ addons:
|
||||
# To use the last version of pgloader, we add repo of postgresql
|
||||
- postgresql
|
||||
- sourceline: 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main'
|
||||
- key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
|
||||
- key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
|
||||
packages:
|
||||
# We need a webserver to test the webservices
|
||||
# Let's install Apache with.
|
||||
@@ -37,7 +37,6 @@ php:
|
||||
- '7.0'
|
||||
- '7.1'
|
||||
- '7.2'
|
||||
#- hhvm only with dist: trusty
|
||||
- nightly
|
||||
|
||||
env:
|
||||
@@ -59,10 +58,17 @@ env:
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: hhvm
|
||||
- php: nightly
|
||||
# We exclude some combinations not usefull to save Travis CPU
|
||||
exclude:
|
||||
- php: '5.5'
|
||||
env: DB=mariadb
|
||||
- php: '5.6'
|
||||
env: DB=mariadb
|
||||
- php: '7.0'
|
||||
env: DB=mariadb
|
||||
- php: '7.1'
|
||||
env: DB=mariadb
|
||||
- php: '5.5'
|
||||
env: DB=postgresql
|
||||
- php: '5.6'
|
||||
@@ -71,8 +77,6 @@ matrix:
|
||||
env: DB=postgresql
|
||||
- php: '7.1'
|
||||
env: DB=postgresql
|
||||
- php: hhvm
|
||||
env: DB=postgresql
|
||||
- php: nightly
|
||||
env: DB=postgresql
|
||||
|
||||
@@ -101,7 +105,7 @@ before_install:
|
||||
pgloader --version
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
install:
|
||||
- |
|
||||
echo "Updating Composer"
|
||||
@@ -133,7 +137,7 @@ install:
|
||||
|
||||
- |
|
||||
echo "Installing PHP CodeSniffer"
|
||||
composer -n require squizlabs/php_codesniffer ^2
|
||||
composer -n require squizlabs/php_codesniffer ^3
|
||||
echo
|
||||
|
||||
- |
|
||||
@@ -195,7 +199,7 @@ before_script:
|
||||
mysql --version | head -
|
||||
mysql -e "SELECT VERSION();" | head -
|
||||
echo
|
||||
|
||||
|
||||
- |
|
||||
echo "Setting up database"
|
||||
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
|
||||
@@ -203,12 +207,11 @@ before_script:
|
||||
mysql -e 'DROP DATABASE IF EXISTS travis;'
|
||||
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
|
||||
mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
|
||||
mysql -e 'FLUSH PRIVILEGES;'
|
||||
mysql -e 'FLUSH PRIVILEGES;'
|
||||
mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||
fi
|
||||
if [ "$DB" = 'postgresql' ]; then
|
||||
#pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||
#pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr
|
||||
#pgloader mysql://root:pass@127.0.0.1/dolibarr_35 postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dev
|
||||
pgloader mysql://root@127.0.0.1/travis postgresql:///travis
|
||||
fi
|
||||
# TODO: SQLite
|
||||
@@ -217,7 +220,7 @@ before_script:
|
||||
- |
|
||||
export CONF_FILE=htdocs/conf/conf.php
|
||||
echo "Setting up Dolibarr $CONF_FILE"
|
||||
echo '<?php ' > $CONF_FILE
|
||||
echo '<?php' > $CONF_FILE
|
||||
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE
|
||||
@@ -238,8 +241,9 @@ before_script:
|
||||
- |
|
||||
echo "Create documents directory and set permissions"
|
||||
# and admin/temp subdirectory needed for unit tests
|
||||
mkdir -p documents/admin/temp
|
||||
echo "first line" > documents/dolibarr.log
|
||||
mkdir -p $TRAVIS_BUILD_DIR/documents/admin/temp
|
||||
sudo chmod -R a+rwx $TRAVIS_BUILD_DIR/documents
|
||||
echo "***** First line of dolibarr.log" > $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||
echo
|
||||
|
||||
|
||||
@@ -293,7 +297,8 @@ script:
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
|
||||
#phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
|
||||
phpcs -s -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
|
||||
set +e
|
||||
echo
|
||||
|
||||
@@ -333,32 +338,28 @@ script:
|
||||
php upgrade.php 7.0.0 8.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade700800.log
|
||||
php upgrade2.php 7.0.0 8.0.0 MAIN_MODULE_TICKETSUP > $TRAVIS_BUILD_DIR/upgrade700800-2.log
|
||||
php step5.php 7.0.0 8.0.0 > $TRAVIS_BUILD_DIR/upgrade700800-3.log
|
||||
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log
|
||||
php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log
|
||||
php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log
|
||||
cd -
|
||||
set +e
|
||||
echo
|
||||
#cat $TRAVIS_BUILD_DIR/upgrade400500-2.log
|
||||
#cat $TRAVIS_BUILD_DIR/upgrade500600.log
|
||||
#cat $TRAVIS_BUILD_DIR/upgrade500600-2.log
|
||||
#cat $TRAVIS_BUILD_DIR/upgrade500600-3.log
|
||||
#cat /tmp/dolibarr_install.log
|
||||
|
||||
|
||||
- |
|
||||
echo "Unit testing"
|
||||
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file.
|
||||
set -e
|
||||
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
|
||||
phpunitresult=$?
|
||||
echo "Phpunit return code = $phpunitresult"
|
||||
set +e
|
||||
|
||||
- |
|
||||
#echo "Output dolibarr.log"
|
||||
#cat documents/dolibarr.log
|
||||
|
||||
after_script:
|
||||
- |
|
||||
# Dolibarr log file
|
||||
#echo "After script"
|
||||
#cat documents/dolibarr.log
|
||||
|
||||
echo "After script - Output 50 latest lines of dolibarr.log"
|
||||
ls $TRAVIS_BUILD_DIR/documents
|
||||
tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||
|
||||
after_success:
|
||||
- |
|
||||
@@ -366,20 +367,24 @@ after_success:
|
||||
|
||||
after_failure:
|
||||
- |
|
||||
echo Failure
|
||||
# This part of code seems to be never executed, error or not ???
|
||||
echo "Debugging informations"
|
||||
echo Failure detected, so we show samples of log to help diagnose
|
||||
# This part of code is executed only if previous commande that fails are enclosed with set +e
|
||||
# Upgrade log files
|
||||
cat *.log
|
||||
echo "Debugging informations"
|
||||
for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
|
||||
do
|
||||
echo "Debugging informations for file $ficlog"
|
||||
#cat $ficlog
|
||||
done
|
||||
# Apache log file
|
||||
echo "Debugging informations for file apache error.log"
|
||||
sudo cat /var/log/apache2/error.log
|
||||
# Dolibarr log file
|
||||
cat documents/dolibarr.log
|
||||
if [ "$DEBUG" = true ]; then
|
||||
# Dolibarr log file
|
||||
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
|
||||
tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||
# MariaDB log file
|
||||
sudo cat /var/log/mysql/error.log
|
||||
echo "Debugging informations for file mysql error.log"
|
||||
sudo tail -n 50 /var/log/mysql/error.log
|
||||
# TODO: PostgreSQL log file
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
18
.tx/config
18
.tx/config
@@ -20,6 +20,12 @@ source_file = htdocs/langs/en_US/agenda.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.assets]
|
||||
file_filter = htdocs/langs/<lang>/assets.lang
|
||||
source_file = htdocs/langs/en_US/assets.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.banks]
|
||||
file_filter = htdocs/langs/<lang>/banks.lang
|
||||
source_file = htdocs/langs/en_US/banks.lang
|
||||
@@ -32,6 +38,12 @@ source_file = htdocs/langs/en_US/bills.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.blockedlog]
|
||||
file_filter = htdocs/langs/<lang>/blockedlog.lang
|
||||
source_file = htdocs/langs/en_US/blockedlog.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.bookmarks]
|
||||
file_filter = htdocs/langs/<lang>/bookmarks.lang
|
||||
source_file = htdocs/langs/en_US/bookmarks.lang
|
||||
@@ -350,9 +362,9 @@ source_file = htdocs/langs/en_US/supplier_proposal.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.ticketsup]
|
||||
file_filter = htdocs/langs/<lang>/ticketsup.lang
|
||||
source_file = htdocs/langs/en_US/ticketsup.lang
|
||||
[dolibarr.ticket]
|
||||
file_filter = htdocs/langs/<lang>/ticket.lang
|
||||
source_file = htdocs/langs/en_US/ticket.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
|
||||
@@ -53,6 +53,10 @@ JsTimezoneDetect 1.0.6 MIT License Yes
|
||||
SwaggerUI 2.0.24 GPL-2+ Yes JS library to offer the REST API explorer
|
||||
Ace 1.2.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
||||
|
||||
Image libraries
|
||||
Octicons 8.1 MIT Yes
|
||||
|
||||
|
||||
For licenses compatibility informations:
|
||||
http://www.gnu.org/licenses/licenses.en.html
|
||||
|
||||
|
||||
408
ChangeLog
408
ChangeLog
@@ -3,7 +3,263 @@ English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 9.0.0 compared to 8.0.0 *****
|
||||
For Users:
|
||||
NEW: Stable module: Website
|
||||
NEW: Stable module: WebDAV
|
||||
NEW: Stable module: Module Builder
|
||||
NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more tools.
|
||||
NEW: Experimental module "TakePos"
|
||||
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
|
||||
Android application like DoliDroid able to provide native features for multicompany module.
|
||||
NEW: Compatibility with PHP 7.3
|
||||
|
||||
|
||||
For developers:
|
||||
* Code changes to be more compatible with PSR2
|
||||
* Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that)
|
||||
|
||||
WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must
|
||||
replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for
|
||||
modulepart=mycompany that now works like others).
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 8.0.2 compared to 8.0.1 *****
|
||||
FIX: #8452
|
||||
FIX: #9043
|
||||
FIX: #9316 Error when listing invoices
|
||||
FIX: #9317
|
||||
FIX: #9353 Bug: html error - div inside span on graphs
|
||||
FIX: #9355
|
||||
FIX: #9393 inconsistency behaviour. option FACTURE_ENABLE_NEGATIVE_LINES
|
||||
FIX: #9394
|
||||
FIX: #9396
|
||||
FIX: #9403
|
||||
FIX: #9412
|
||||
FIX: #9497
|
||||
FIX: Add paypal error message in alert email when online payment fails.
|
||||
FIX: better compatibility with multicompany
|
||||
FIX: capital must be empty and not 0 if undefined
|
||||
FIX: character making error on bill list
|
||||
FIX: Entering negative price on order.
|
||||
FIX: Expedition not showing extrafields on creation.
|
||||
FIX: Homepage links were using wrong topmenus
|
||||
FIX: inconsistency behaviour on option FACTURE_ENABLE_NEGATIVE_LINES
|
||||
FIX: invert mime type and name.
|
||||
FIX: invoice popup hide localtax2 and 3 if not defined.
|
||||
FIX: Lose filter on payment type or category after a sort on invoice list.
|
||||
FIX: Maxi debug to allow to load chart of account with multicompany.
|
||||
FIX: Missing translation in predefined email to membership renewal.
|
||||
FIX: Mixing tickets of different thirdparties.
|
||||
FIX: "Other ..." link so the "Back to" link works.
|
||||
FIX: PDF address: handle when contact thirdparty is different from thirdparty of document
|
||||
FIX: Problems with permissions of module to record payment of salaries
|
||||
FIX: remove debug
|
||||
FIX: Several fixes on the management of minimal amount for orders
|
||||
FIX: wrong var name
|
||||
|
||||
***** ChangeLog for 8.0.1 compared to 8.0.0 *****
|
||||
FIX: #9258
|
||||
FIX: #9328
|
||||
FIX: #9337
|
||||
FIX: adding GROUP BY for PostgreSQL
|
||||
FIX: API template for list pages in module builder
|
||||
FIX: API template for record page to delete a record
|
||||
FIX: a removed option was still in setup
|
||||
FIX: badge on time spent on project and tasks
|
||||
FIX: Delete file on smartphone
|
||||
FIX: Fetch function will fetch comments
|
||||
FIX: Fetch task will now fetch comments
|
||||
FIX: $fk_account is always empty, must be $soc->fk_account
|
||||
FIX: Force stripe api version to avoid trouble if we update stripe api
|
||||
FIX: get_product_vat_for_country functions.lib.php
|
||||
FIX: Get templates in a forced language
|
||||
FIX: hook on dispatch order fourn
|
||||
FIX: Language selection lost if error during creation of email template
|
||||
FIX: Look and feel v8
|
||||
FIX: propal.class.php
|
||||
FIX: Add calls to fetchComments function
|
||||
FIX: Remove fetchComments from project and task fetch function
|
||||
FIX: remove internal property isextrafieldmanaged from API returns
|
||||
FIX: sql error
|
||||
FIX: table llx_chargessociales doesn't exists
|
||||
FIX: trans on null object
|
||||
FIX: vat rate code not returned by get_product_vat_for_country
|
||||
FIX: warning for late template invoices to remove when suspended
|
||||
FIX: Add hidden option MAIN_xxx_IN_SOURCE_ADDRESS to solve legal issues on PDF
|
||||
FIX: Table llx_facture_rec_extrafields missing after migration
|
||||
|
||||
|
||||
***** ChangeLog for 8.0.0 compared to 7.0.0 *****
|
||||
For Users:
|
||||
NEW: Experimental module: Ticket
|
||||
NEW: Experimental module: WebDAV
|
||||
NEW: Accept anonymous events (no user assigned)
|
||||
NEW: Accountancy - Add import on general ledger
|
||||
NEW: Accountancy - Show journal name on journal page and hide button draft export (Add an option in admin)
|
||||
NEW: Can create event from record card of a company and/or member
|
||||
NEW: Add a button to create Stripe customer from the customer Payment mode tab
|
||||
NEW: Add accounting account number on product tooltip
|
||||
NEW: Add any predefined mail content
|
||||
NEW: Add arrows to navigate into containers in experimental website module
|
||||
NEW: Add a tab to specify accountant/auditor of the company
|
||||
NEW: Add Date delivery and Availability on Propals List
|
||||
NEW: Add date in goods reception supplier order table
|
||||
NEW: Add delivery_time_days of suppliers in export profile
|
||||
NEW: Add Documents'tab to expedition module
|
||||
NEW: Use dol_print_phone in thirdparty list page to format phone
|
||||
NEW: Add entry for the GDPR contact
|
||||
NEW: Add extrafield type "html"
|
||||
NEW: Add file number in accountant card and update export filename
|
||||
NEW: Add files management on products lot
|
||||
NEW: add filter on project task list
|
||||
NEW: Add hidden option COMPANY_AQUARIUM_CLEAN_REGEX to clean generated
|
||||
NEW: add internal stripe payment page for invoice
|
||||
NEW: Add key __USER_REMOTE_IP__ into available substitution variables
|
||||
NEW: Add link between credit note invoice and origin
|
||||
NEW: Add linked file tab to vat
|
||||
NEW: add link to stripe's info in bank menu
|
||||
NEW: Add margin filters
|
||||
NEW: Add mass action enable/disable on cron job list
|
||||
NEW: Add mass action on project's list to close projects
|
||||
NEW: Add method to register distributed payments on invoices
|
||||
NEW: Add multicurrency support for product buy price for supplier propales, orders and invoices
|
||||
NEW: Add name of day in the timesheet input page per day.
|
||||
NEW: add new parameters for tcpf encryption
|
||||
NEW: add optional esign field in pdf propal
|
||||
NEW: Add option BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD
|
||||
NEW: Add option CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES
|
||||
NEW: Add param $dolibarr_main_restrict_ip in config file to limit ips
|
||||
NEW: add pdf function to check if pdf file is protected/encrypted
|
||||
NEW: Add pdf template for stock/warehouse module
|
||||
NEW: Add phone format for a lot of countries
|
||||
NEW: Add product and product categories filters on customer margins
|
||||
NEW: Add product categories filter on product margin
|
||||
NEW: Add romanian chart of accounts
|
||||
NEW: Add stats in salaries module
|
||||
NEW: add stripe transaction
|
||||
NEW: Add tab contact on supplier proposals
|
||||
NEW: Add total of time spent in timespent page at top of page too.
|
||||
NEW: Add trigger CONTRACT_MODIFY
|
||||
NEW: Add triggers on ECM object and add fill src_object_type/id fields
|
||||
NEW: Add type of website container/page into dictionary
|
||||
NEW: advance target filtering can be used everywhere with tpl and fk_element
|
||||
NEW: Allow negative quantity for dispatch (supplier order)
|
||||
NEW: bank reconcile: checkbox to select all bank operations
|
||||
NEW: Better performance with openldap
|
||||
NEW: Can add filter actiontype and notactiontype on event ical export
|
||||
NEW: Can add product in supplier order/invoice even w/o predefined price
|
||||
NEW: cancel orders on massaction
|
||||
NEW: Can crop image files attached in "document" tabs of a member
|
||||
NEW: Can delete dir content in media and ECM module recursively
|
||||
NEW: Can dispatch if more than ordered (if hidden option set)
|
||||
NEW: Can edit the text color for title line of tables
|
||||
NEW: Can enter time spent from the list of time spent of project
|
||||
NEW: Can export leave requests
|
||||
NEW: Can filter on account range in general ledger grouped by account
|
||||
NEW: Can filter on country and taxid into the binding page
|
||||
NEW: Can filter on progression in timesheet
|
||||
NEW: Can fix the bank account of a payment if payment not conciliated
|
||||
NEW: Can force usage of shared link for photo of products
|
||||
NEW: Can get template of email from its label
|
||||
NEW: Can see Unit Purchase Value of product in stock movement
|
||||
NEW: Can select from the user list into send form email (For field to and CC)
|
||||
NEW: Can select sample to use when creating a new page
|
||||
NEW: can send mail from project card
|
||||
NEW: Can set position of images in module tickets
|
||||
NEW: Can set the reply-to into email sent
|
||||
NEW: Can set the start/end date of service line in invoice templates
|
||||
NEW: Can share any file from the "Document" tab.
|
||||
NEW: Can sort on priority in task scheduler list
|
||||
NEW: Can sort order of files in attach tab for leave and expensereport
|
||||
NEW: Can use setValueFrom without user modification field
|
||||
NEW: Cat set the encryption algorithm for extrafields of type password
|
||||
NEW: check idprof1 for country pt
|
||||
NEW: default add action: new param $backurlforcard to redirect to card
|
||||
NEW: default warehouse field for products + prefill warehouses when dispatching supplier orders
|
||||
NEW: Display price HT on all commercial area boards
|
||||
NEW: display total on contract service list
|
||||
NEW: display weight volume in proposal
|
||||
NEW: Edit of extrafields position page on the edit form
|
||||
NEW: Experimental DAV module provides a public and private directory
|
||||
NEW: export filter models can be share or not by user
|
||||
NEW: Externalsite module can accept iframe content.
|
||||
NEW: Filter export model is now by user
|
||||
NEW: Finish implementation of option PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES
|
||||
NEW: generalize use of button to create new element from list
|
||||
NEW: hidden conf AGENDA_NB_WEEKS_IN_VIEW_PER_USER to set nb weeks to show into per user view
|
||||
NEW: hidden conf to assign category to thirparty that are neither customer nor prospect or supplier
|
||||
NEW: hidden conf to set nb weeks to show into user view
|
||||
NEW: hidden option MAIN_DISABLE_FREE_LINES
|
||||
NEW: improve way of adding users/sales representative to thirdparty
|
||||
NEW: Introduce option THIRDPARTY_QUICKSEARCH_ON_FIELDS to personalize fields use to search on quick search.
|
||||
NEW: Introduce permission "approve" for "leave request" like for "expense report"
|
||||
NEW: Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
|
||||
NEW: Look and feel v8 - Show Picto "+" on all links "Add record"
|
||||
NEW: Look and feel v8: Use a different picto for delete and unlink
|
||||
NEW: mail templates for projects
|
||||
NEW: Module variant supported on services
|
||||
NEW: monthly VAT report show "Claimed for the period" + "Paid during this
|
||||
NEW: Mutualize code for action="update_extras"
|
||||
NEW: On invoice card, show accounting account linked
|
||||
NEW: Online payment of invoice and subscription record the payment
|
||||
NEW: OnSearchAndListGoOnCustomerOrSupplierCard conf
|
||||
NEW: Optimize load of hooks classes (save 1-5Kb of memory)
|
||||
NEW: Option MAIN_SHOW_REGION_IN_STATE renamed into MAIN_SHOW_REGION_IN_STATE_SELECT are more complete
|
||||
NEW: Option to force all emails recipient
|
||||
NEW: Hidden option to send to salaries into emails forms
|
||||
NEW: order minimum amount
|
||||
NEW: add price in burger menu on mouvement list
|
||||
NEW: Report a list of leave requests for a month
|
||||
NEW: Section of files generated by mass action not visible if empty
|
||||
NEW: send mails from project card
|
||||
NEW: Show also size in bytes in tooltip if visible unit is not bytes
|
||||
NEW: Show keyboard shortcut of nav arrow into tooltip
|
||||
NEW: Show last result code of cron jobs in error in red
|
||||
NEW: Show region in company info & Global option to show state code MAIN_SHOW_STATE_CODE
|
||||
NEW: Show total number of records by category
|
||||
NEW: Show total of time consumed in week in time spent entry page
|
||||
NEW: Stripe online payments reuse the same stripe customer account
|
||||
NEW: Suggest link to pay online for customer orders
|
||||
NEW: supplier credit notes is now supported like for customer credit notes
|
||||
NEW: supplier order/order lines export: add supplier product ref
|
||||
NEW: supplier relative discounts
|
||||
NEW: Support alternative aliases of page name in website
|
||||
NEW: syslog file autoclean
|
||||
NEW: thirdparty categ filter on lists
|
||||
NEW: Use a css style for weekend in time spent
|
||||
NEW: Use common substitution rule for language to get translation in ODT
|
||||
NEW: Variable __ONLINE_PAYMENT_URL__ available in email templates
|
||||
|
||||
For developers:
|
||||
NEW: class reposition can also work on POST (not only GET)
|
||||
NEW: add a hook in dol_print_phone
|
||||
NEW: The field "visible" on extrafield can accept expression as condition
|
||||
NEW: Upgrade of Stripe lib to 6.4.1
|
||||
NEW: work on CommonObject 'array' field typeNew common object array
|
||||
NEW: method Form::selectArrayFilter() + use in left menu search
|
||||
NEW: [REST API] Add the possibility to remove a category from a thirdparty
|
||||
NEW: doActions on categorycard
|
||||
NEW: add "moreHtmlRef" hook
|
||||
NEW: add hook for more permissions control
|
||||
NEW: add hook moreHtmlStatus to complete to status on banners
|
||||
NEW: Add hook printEmail
|
||||
NEW: Add hook setContentSecurityPolicy
|
||||
NEW: Add password_hash as a hash algorithm
|
||||
NEW: Add dol_is_link function
|
||||
NEW: Adds a contact to an invoice with REST API
|
||||
NEW: Adds a payment for the list of invoices given as parameter
|
||||
NEW: adds billing contacts ids to REST API returns
|
||||
NEW: Add showempty parameter in country selection
|
||||
NEW: add printUserListWhere hook
|
||||
NEW: add "printUserPasswordField" hooks
|
||||
NEW: Call to trigger on payment social contribution creation
|
||||
NEW: Call to trigger on social contribution creation
|
||||
NEW: hook getnomurltooltip is replaced with hook getNomUrl more powerfull
|
||||
|
||||
WARNING:
|
||||
|
||||
@@ -21,8 +277,141 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Removed method fetch_prods() and get_each_prod() not used, keep only get_arbo_each_prod() that is better.
|
||||
* The hook contaxt commcard has been renamed thirdpartycomm
|
||||
* The hook contaxt thirdpartycard has been renamed thirdpartycontact
|
||||
* Remove method Categorie:get_nb_categories() that was not used.
|
||||
* Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip
|
||||
are now replaced with hook getNomUrl.
|
||||
* The substitution key __CONTACTCIVNAME__ is no longer present, it has been replaced by __CONTACT_NAME_{TYPE}__
|
||||
where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary).
|
||||
|
||||
|
||||
***** ChangeLog for 7.0.3 compared to 7.0.2 *****
|
||||
FIX: 7.0 task contact card without withproject parameters
|
||||
FIX: #8722
|
||||
FIX: #8762
|
||||
FIX: #8813
|
||||
FIX: #8858 #8860 Backport better compatibility fix
|
||||
FIX: #8893 to get formatted price as substitution vars
|
||||
FIX: Avoid converting into reduction twice and draft invoice
|
||||
FIX: bad result on fetch ProductStockEntrepot
|
||||
FIX: Bad substitution key used for default send proposal email
|
||||
FIX: button to pay still visible when amount null used
|
||||
FIX: clause must not be there
|
||||
FIX: Contact tab not visible when using canvas
|
||||
FIX: dol_delete_file must work in a context without db handler loaded
|
||||
FIX: entity test must be on product_fourn_price table and not product table
|
||||
FIX: Fetch shipping will now fetch project id
|
||||
FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def.
|
||||
FIX: intervention: extrafield error when calling insertExtrafields
|
||||
FIX: It's not possible to remove a contact which is assigned to an event #8852
|
||||
FIX: javascript showempty error
|
||||
FIX: Keep supplier proposal price for supplier order
|
||||
FIX: link for projets not linked to a thirdparties
|
||||
FIX: Missing extrafields in export of stock or products
|
||||
FIX: missing filters during ordering
|
||||
FIX: missing filters during reordering
|
||||
FIX: missing parenthesis
|
||||
FIX: need to filter on aa.entity for same accounting accounts available in several entities
|
||||
FIX: picto for type in product link in accountany list is wrong
|
||||
FIX: Problems in accountancy module when using multicompany module.
|
||||
FIX: proposal: missing contact type translation key
|
||||
FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
|
||||
FIX: Select user on add time spent form
|
||||
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
|
||||
FIX: sometimes amounts are identical but php find them different.
|
||||
FIX: supplier order: product supplier ref not saved on addline
|
||||
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
|
||||
FIX: wrong var name $search_month_lim
|
||||
|
||||
***** ChangeLog for 7.0.2 compared to 7.0.1 *****
|
||||
FIX: #8023
|
||||
FIX: #8259 can't update contact birthday with REST API
|
||||
FIX: #8359
|
||||
FIX: #8389
|
||||
FIX: #8478 !empty instead of count to avoid warning
|
||||
FIX: #8488
|
||||
FIX: #8559 Bug to generate cheque receipt
|
||||
FIX: #8571
|
||||
FIX: #8574
|
||||
FIX: #8580
|
||||
FIX: #8650
|
||||
FIX: actioncomm export: type filtering not working
|
||||
FIX: Add a test to avoid to reset binding by error.
|
||||
FIX: addline on invoice supplier manage rank on its own if not provided
|
||||
FIX: Add warning when expense report line not into range
|
||||
FIX: avoid Error: Call to undefined method mysqli::get_charset()
|
||||
FIX: avoid focus problem when select2 is in a modal dialog window
|
||||
FIX: Binding pages must start on fiscal month not calendar month
|
||||
FIX: button "Classify bill" on supplier order was not visible
|
||||
FIX: Button receive products not visible
|
||||
FIX: can bypass the CSRF protection with url with domain inside
|
||||
FIX: Can't edit option PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY
|
||||
FIX: commonobject: don't require notnull field if default set
|
||||
FIX: CommonObject: don't require 'notnull' field if 'default' set
|
||||
FIX: cron script disabled if module disabled
|
||||
FIX: CVE-2018-10092
|
||||
FIX: CVE-2018-10094
|
||||
FIX: CVE-2018-10095
|
||||
FIX: CVE-2018-9019
|
||||
FIX: CWE-89
|
||||
FIX: Data on income/expense report was always 0
|
||||
FIX: default addupdatedelete actions: uniformize add/update value checks
|
||||
FIX: default currency not set on supplier order creation from commercial menu #8459
|
||||
FIX: delete all product variants of a parent product
|
||||
FIX: Detail per account not visible when total < 0
|
||||
FIX: DOL_AUTOSET_COOKIE was not correctly setting value of cookie
|
||||
FIX: don't print empty date in CommonObject::showOutputField
|
||||
FIX: dont print empty date in CommonObject::showOutputField
|
||||
FIX: Draft invoice must be excluded from report
|
||||
FIX: environment shown on cron card
|
||||
FIX: Error in ContractLigne not return to Contract
|
||||
FIX: extrafields price and double were lost during a failed post.
|
||||
FIX: File name not visible in email preview
|
||||
FIX: filter/sorting on extrafield on contact list from contact tab
|
||||
FIX: Initial month on report income/expense per predefined group
|
||||
FIX: issue #8037
|
||||
FIX: Issue #8455
|
||||
FIX: issue #8470
|
||||
FIX: label in getnomurl projectlist
|
||||
FIX: limit access of email template page to internal users
|
||||
FIX: look and feel v7 "back to" for bookkeeping record
|
||||
FIX: Max nb of generation of recurring invoice should not show warning
|
||||
FIX: missing english name for object
|
||||
FIX: Missing include
|
||||
FIX: missing User object with API REST
|
||||
FIX: modulebuilder: could not create html fields
|
||||
FIX: modulebuilder: handle 'price' fieldtype
|
||||
FIX: multiple creation of same event
|
||||
FIX: Name of user not visible on journalizing expense report payments
|
||||
FIX: Not approved holidays must not be visible into timesheet
|
||||
FIX: Only approved expense report must be journalized
|
||||
FIX: payment term doc-specific label was not used
|
||||
FIX: payment term doc-specific label was not used (issue #8414)
|
||||
FIX: project category is type 6 not 5
|
||||
FIX: Projet is not prefilled when created from overwiew page
|
||||
FIX: Related contact printed in societe agenda
|
||||
FIX: Removed error when no error on accounting setup page
|
||||
FIX: remove var_dump
|
||||
FIX: sanitize setup params
|
||||
FIX: selectForFormsList: entity checked even is object not multi-entity managed
|
||||
FIX: service creation, right is tested regarding the product type
|
||||
FIX: some localtaxes errors
|
||||
FIX: Some report have data when several chart of accounts exists
|
||||
FIX: sql error using no category
|
||||
FIX: SQL Injection CWE-89
|
||||
FIX: Support or multicompany for sheduled jobs
|
||||
FIX: Test on mandatory status when closing proposal failed
|
||||
FIX: to allow IRPF not null even if main VAT is null.
|
||||
FIX: update wrong datetime extrafield
|
||||
FIX: Use priority to define order of sheduled jobs
|
||||
FIX: various modulebuilder-related issues
|
||||
FIX: view of balance before field
|
||||
FIX: weird password autocompletion in Goocle Chrome (issue #8479)
|
||||
FIX: weird password autocompletion in Google Chrome (issue #8479)
|
||||
FIX: When clearing filter, we must not save tmp criterias in session
|
||||
FIX: With x extrafields, request for multicompany label was done x times
|
||||
FIX: several XSS
|
||||
FIX: zip not filtered
|
||||
|
||||
***** ChangeLog for 7.0.1 compared to 7.0.0 *****
|
||||
FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php
|
||||
FIX: #8200
|
||||
@@ -90,7 +479,7 @@ FIX: Use of undefined constant _ROWS_2
|
||||
FIX: warning when adding ECM files using old photo path
|
||||
|
||||
|
||||
***** ChangeLog for 7.0.0 compared to 6.0.5 *****
|
||||
***** ChangeLog for 7.0.0 compared to 6.0.7 *****
|
||||
For users:
|
||||
NEW: Add a preview icon after files that can be previewed (pdf + images)
|
||||
NEW: When payment is registered, PDF of invoices are also regenerated so payments
|
||||
@@ -378,7 +767,22 @@ Following changes may create regressions for some external modules, but were nec
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 6.0.6 compared to 6.0.6 *****
|
||||
***** ChangeLog for 6.0.7 compared to 6.0.6 *****
|
||||
FIX: #8023
|
||||
FIX: #8259 can't update contact birthday with REST API
|
||||
FIX: #8478 !empty instead of count to avoid warning
|
||||
FIX: #8488
|
||||
FIX: actioncomm export: type filtering not working
|
||||
FIX: addline on invoice supplier manage rank on its own if not provided
|
||||
FIX: issue #8037
|
||||
FIX: label in getnomurl projectlist
|
||||
FIX: payment term doc-specific label was not used
|
||||
FIX: payment term doc-specific label was not used (issue #8414)
|
||||
FIX: project category is type 6 not 5 !!
|
||||
FIX: some localtaxes errors
|
||||
FIX: weird password autocompletion in Google Chrome (issue #8479)
|
||||
|
||||
***** ChangeLog for 6.0.6 compared to 6.0.5 *****
|
||||
FIX: #7974 Contract - Invalid reference on the document
|
||||
FIX: #8139
|
||||
FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php
|
||||
|
||||
16
README-FR.md
16
README-FR.md
@@ -94,14 +94,15 @@ Voir fichier ChangeLog.
|
||||
|
||||
- Gestion de marque-pages
|
||||
- Gestion des promesses de dons
|
||||
- Gestion de la TVA NPR (non perçue récupérable - pour les utilisateurs français des DOM-TOM)
|
||||
- Rapports
|
||||
- Imports/Exports des données
|
||||
- Support des codes barres
|
||||
- Calcul des marges
|
||||
- Connectivité LDAP
|
||||
- Intégratn de ClickToDial
|
||||
- Intégration RSS
|
||||
- Intégation Skype
|
||||
- Intégration de système de paiements (Paypal, Strip, Paybox...)
|
||||
- Intégration de système de paiements (Paypal, Stripe, Paybox...)
|
||||
- …
|
||||
|
||||
### Divers:
|
||||
@@ -114,9 +115,18 @@ Voir fichier ChangeLog.
|
||||
- Application simple à utiliser.
|
||||
- Requiert PHP et MariaDb, Mysql ou Postgresql (Voir versions exactes sur https://wiki.dolibarr.org/index.php/Prérequis).
|
||||
- Compatible avec toutes les offres Cloud du marché respectant les prérequis de base de données et PHP.
|
||||
- Code simple et facilement personnalisable (pas de framework lourd; mécanisme de hook et triggers).
|
||||
- APIs.
|
||||
- Génération PDF et ODT des éléments (factures, propositions commerciales, commandes, bons expéditions, etc...)
|
||||
- Code simple et facilement personnalisable (pas de framework lourd; mécanisme de hook et triggers).
|
||||
- Support natif de nombreuses fonctions spécifiques aux pays comme:
|
||||
- La tax espagnole TE et ISPF
|
||||
- Gestion de la TVA NPR (non perçue récupérable - pour les utilisateurs français des DOM-TOM)
|
||||
- La loi française Finance 2016 et logiciels de caisse
|
||||
- La double taxe canadienne
|
||||
- Le timbre fiscal tunisien
|
||||
- Numérotation de facture de l'argentines (avec type A,B,C...)
|
||||
- Compatible avec vos processus RGPD
|
||||
- ...
|
||||
- …
|
||||
|
||||
### Extension
|
||||
|
||||
11
README.md
11
README.md
@@ -1,6 +1,10 @@
|
||||
# DOLIBARR ERP & CRM
|
||||
|
||||
 
|
||||

|
||||
|
||||
|6|7|8|develop|
|
||||
|----------|----------|----------|----------|
|
||||
|||||
|
||||
|
||||
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
|
||||
|
||||
@@ -125,7 +129,6 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Donations management
|
||||
- Reporting
|
||||
- Data export/import
|
||||
- Thirdparties and/or products categories
|
||||
- Barcodes support
|
||||
- Margin calculations
|
||||
- LDAP connectivity
|
||||
@@ -147,13 +150,15 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites.
|
||||
- APIs.
|
||||
- An easy to understand, maintain and develop code (PHP with no heavy framework; trigger and hook architecture)
|
||||
- Support for country specific features:
|
||||
- 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)
|
||||
- Canadian double taxes (federal/province) and other countries using cumulative VAT
|
||||
- Tunisian tax stamp
|
||||
- Argentina invoice numbering using A,B,C...
|
||||
- Compatible with [European directives](http://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE)
|
||||
- Compatible with European GDPR rules
|
||||
- ...
|
||||
- PDF or ODT generation for invoice, proposals, orders...
|
||||
- …
|
||||
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
<!-- Application namespaces and APS version (step 9) -->
|
||||
<application xmlns="http://apstandard.com/ns/1" version="1.1">
|
||||
<!-- Application common properties (step 9) -->
|
||||
<name>Dolibarr ERP-CRM</name>
|
||||
<version>__VERSION__</version>
|
||||
<release>__RELEASE__</release>
|
||||
<homepage>http://www.dolibarr.org/</homepage>
|
||||
<vendor>
|
||||
<name>Dolibarr</name>
|
||||
<homepage>http://www.dolibarr.org/</homepage>
|
||||
<icon path="images/appicon_64.png" />
|
||||
</vendor>
|
||||
<packager>
|
||||
<name>Laurent Destailleur</name>
|
||||
<homepage>http://www.nltechno.com</homepage>
|
||||
<uri>uuid:e743ee30-9fe8-11e0-a32e-0025115d642c</uri>
|
||||
</packager>
|
||||
<presentation>
|
||||
<summary>Dolibarr ERP-CRM, the easy to use software to manage small or medium companies, freelancers or foundations</summary>
|
||||
<description>
|
||||
Dolibarr is a free modular software (you see only
|
||||
features you need) to manage small and medium companies, freelancers
|
||||
or foundations.
|
||||
This OpenSource software is designed to provide all features you need to
|
||||
manage information on many aspects of your business
|
||||
into an intuitive and user-friendly graphical interface
|
||||
It's an OpenSource software you can install on a web server or as a
|
||||
standalone software. Dolibarr is designed to provide simplicity to end-user.
|
||||
</description>
|
||||
<icon path="images/appicon_64.png" />
|
||||
<screenshot path="images/dolibarr_screenshot1_640x480.png">
|
||||
<description>Screenshot 1</description>
|
||||
</screenshot>
|
||||
<changelog>
|
||||
<version version="3.1.0" release="0">
|
||||
<entry>See http://www.dolibarr.org/files/ChangeLog</entry>
|
||||
</version>
|
||||
</changelog>
|
||||
<categories>
|
||||
<category>Back office/Billing</category>
|
||||
<category>Back office/Accounting and Financial</category>
|
||||
<category>Back office/Customer Relationship Management</category>
|
||||
<category>Back office/Enterprise Resource Planning</category>
|
||||
</categories>
|
||||
<languages>
|
||||
<language>en</language>
|
||||
<language>fr</language>
|
||||
<language>es</language>
|
||||
<language>de</language>
|
||||
<language>pt</language>
|
||||
</languages>
|
||||
</presentation>
|
||||
<upgrade match="/application/version = '3.0'" />
|
||||
<!-- Application service (step 4) -->
|
||||
<service id="dolibarr">
|
||||
<!-- Service presentation properties (step 7) -->
|
||||
<license must-accept="false">
|
||||
<text>
|
||||
<name>GPL-3.0+</name>
|
||||
<file>COPYING</file>
|
||||
</text>
|
||||
</license>
|
||||
<presentation>
|
||||
<name>Dolibarr instance</name>
|
||||
<summary>Dolibarr services</summary>
|
||||
<entry-points>
|
||||
<entry class="frontpage" dst="/">
|
||||
<label>Application entry point</label>
|
||||
</entry>
|
||||
</entry-points>
|
||||
</presentation>
|
||||
<!-- Service settings (step 7) -->
|
||||
<settings>
|
||||
<!--
|
||||
<group>
|
||||
<name>Administrator's preferences</name>
|
||||
<setting id="admin_name" type="string" default-value="admin"
|
||||
min-length="1" max-length="32" regex="^[a-zA-Z][0-9a-zA-Z_\-]*">
|
||||
<name>Administrator's login</name>
|
||||
<error-message>
|
||||
Please make sure the text you entered starts with a letter and continues with either numbers, letters, underscores or hyphens.
|
||||
</error-message>
|
||||
</setting>
|
||||
<setting id="admin_password" type="password" min-length="1">
|
||||
<name>Password</name>
|
||||
</setting>
|
||||
</group>
|
||||
-->
|
||||
</settings>
|
||||
<!-- Service used technologies (step 6) -->
|
||||
<requirements xmlns:php="http://apstandard.com/ns/1/php"
|
||||
xmlns:db="http://apstandard.com/ns/1/db">
|
||||
<php:version min="4.2.0" />
|
||||
<php:extension>mysql</php:extension>
|
||||
<php:extension>mbstring</php:extension>
|
||||
<php:safe-mode>false</php:safe-mode>
|
||||
<db:db>
|
||||
<db:id>main</db:id>
|
||||
<db:default-name>dolibarr</db:default-name>
|
||||
<db:can-use-tables-prefix>false</db:can-use-tables-prefix>
|
||||
<db:server-type>mysql</db:server-type>
|
||||
<db:server-min-version>4.3.1</db:server-min-version>
|
||||
</db:db>
|
||||
</requirements>
|
||||
<!-- Content delivery settings (step 8) -->
|
||||
<provision>
|
||||
<url-mapping>
|
||||
<default-prefix>dolibarr</default-prefix>
|
||||
<installed-size>35000000</installed-size>
|
||||
<mapping url="/" path="htdocs" xmlns:php="http://apstandard.com/ns/1/php">
|
||||
<php:handler>
|
||||
<php:extension>php</php:extension>
|
||||
</php:handler>
|
||||
</mapping>
|
||||
</url-mapping>
|
||||
<!-- Service configuration script declaration (step 10) -->
|
||||
<configuration-script name="configure.php">
|
||||
<configuration-script-language>php</configuration-script-language>
|
||||
<status-control/>
|
||||
</configuration-script>
|
||||
</provision>
|
||||
</service>
|
||||
</application>
|
||||
@@ -1,121 +0,0 @@
|
||||
<!-- Application namespaces and APS version (step 9) -->
|
||||
<application xmlns="http://apstandard.com/ns/1" version="1.2">
|
||||
<!-- Application common properties (step 9) -->
|
||||
<id>dolibarr</id>
|
||||
<name>Dolibarr</name>
|
||||
<version>__VERSION__</version>
|
||||
<release>__RELEASE__</release>
|
||||
<homepage>http://www.dolibarr.org/</homepage>
|
||||
<vendor>
|
||||
<name>Dolibarr</name>
|
||||
<homepage>http://www.dolibarr.org/</homepage>
|
||||
<icon path="images/appicon_64.png" />
|
||||
</vendor>
|
||||
<packager>
|
||||
<name>Laurent Destailleur</name>
|
||||
<homepage>http://www.nltechno.com</homepage>
|
||||
<uri>uuid:e743ee30-9fe8-11e0-a32e-0025115d642c</uri>
|
||||
</packager>
|
||||
<presentation>
|
||||
<summary>Dolibarr ERP - CRM, the easy to use software to manage small or medium companies, freelancers or foundations</summary>
|
||||
<description>
|
||||
Dolibarr is a free modular software (you see only
|
||||
features you need) to manage small and medium companies, freelancers
|
||||
or foundations.
|
||||
This OpenSource software is designed to provide all features you need to
|
||||
manage information on many aspects of your business
|
||||
into an intuitive and user-friendly graphical interface
|
||||
It's an OpenSource software you can install on a web server or as a
|
||||
standalone software. Dolibarr is designed to provide simplicity to end-user.
|
||||
</description>
|
||||
<icon path="images/appicon_64.png" />
|
||||
<screenshot path="images/dolibarr_screenshot1_640x480.png">
|
||||
<description>Screenshot 1</description>
|
||||
</screenshot>
|
||||
<changelog>
|
||||
<version version="3.1.0" release="0">
|
||||
<entry>See http://www.dolibarr.org/files/ChangeLog</entry>
|
||||
</version>
|
||||
</changelog>
|
||||
<categories>
|
||||
<category>Back office/Billing</category>
|
||||
<category>Back office/Accounting and Financial</category>
|
||||
<category>Back office/Customer Relationship Management</category>
|
||||
<category>Back office/Enterprise Resource Planning</category>
|
||||
</categories>
|
||||
<languages>
|
||||
<language>en</language>
|
||||
<language>fr</language>
|
||||
<language>es</language>
|
||||
<language>de</language>
|
||||
<language>pt</language>
|
||||
</languages>
|
||||
</presentation>
|
||||
<upgrade match="/application/version = '3.0'" />
|
||||
<!-- Application service (step 4) -->
|
||||
<service id="dolibarr">
|
||||
<!-- Service presentation properties (step 7) -->
|
||||
<license must-accept="false">
|
||||
<text xml:lang="">
|
||||
<name>GPL-3.0+</name>
|
||||
<file>COPYING</file>
|
||||
</text>
|
||||
</license>
|
||||
<presentation>
|
||||
<name>Dolibarr instance</name>
|
||||
<entry-points>
|
||||
<entry class="frontpage" dst="/">
|
||||
<label>Application entry point</label>
|
||||
</entry>
|
||||
</entry-points>
|
||||
</presentation>
|
||||
<!-- Service settings (step 7) -->
|
||||
<settings>
|
||||
<group>
|
||||
<name>Administrator's preferences</name>
|
||||
<setting id="admin_name" type="string" default-value="admin"
|
||||
min-length="1" max-length="32" regex="^[a-zA-Z][0-9a-zA-Z_\-]*">
|
||||
<name>Administrator's login</name>
|
||||
<error-message>
|
||||
Please make sure the text you entered starts with a letter and continues with either numbers, letters, underscores or hyphens.
|
||||
</error-message>
|
||||
</setting>
|
||||
<setting id="admin_password" type="password" min-length="1">
|
||||
<name>Password</name>
|
||||
</setting>
|
||||
</group>
|
||||
</settings>
|
||||
<!-- Service used technologies (step 6) -->
|
||||
<requirements xmlns:php="http://apstandard.com/ns/1/php"
|
||||
xmlns:db="http://apstandard.com/ns/1/db">
|
||||
<php:version min="4.2.0" />
|
||||
<php:extension>mysql</php:extension>
|
||||
<php:extension>mbstring</php:extension>
|
||||
<php:safe-mode>false</php:safe-mode>
|
||||
<db:db>
|
||||
<db:id>main</db:id>
|
||||
<db:default-name>dolibarr</db:default-name>
|
||||
<db:can-use-tables-prefix>false</db:can-use-tables-prefix>
|
||||
<db:server-type>mysql</db:server-type>
|
||||
<db:server-min-version>4.3.1</db:server-min-version>
|
||||
</db:db>
|
||||
</requirements>
|
||||
<!-- Content delivery settings (step 8) -->
|
||||
<provision>
|
||||
<url-mapping>
|
||||
<default-prefix>dolibarr</default-prefix>
|
||||
<installed-size>35000000</installed-size>
|
||||
<mapping url="/" path="htdocs" xmlns:php="http://apstandard.com/ns/1/php">
|
||||
<php:handler>
|
||||
<php:extension>php</php:extension>
|
||||
</php:handler>
|
||||
</mapping>
|
||||
</url-mapping>
|
||||
<!-- Service configuration script declaration (step 10) -->
|
||||
<configuration-script name="configure.php">
|
||||
<script-language>php</script-language>
|
||||
<status-control/>
|
||||
</configuration-script>
|
||||
</provision>
|
||||
</service>
|
||||
</application>
|
||||
@@ -1,89 +0,0 @@
|
||||
<html><head>
|
||||
<title> Limitations of APS Support in the Panel </title>
|
||||
<meta name="Keywords" content="">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="Limitations%20of%20APS%20Support%20in%20the%20Panel_fichiers/stylesheet.css">
|
||||
<link href="Limitations%20of%20APS%20Support%20in%20the%20Panel_fichiers/prettify.css" type="text/css" rel="stylesheet">
|
||||
<script type="text/javascript" src="Limitations%20of%20APS%20Support%20in%20the%20Panel_fichiers/prettify.js"></script>
|
||||
<script src="Limitations%20of%20APS%20Support%20in%20the%20Panel_fichiers/highlight.js"></script></head>
|
||||
|
||||
<body onload="prettyPrint()" link="#0000A0" text="#000000" vlink="#FF0000" alink="#008000" bgcolor="#FFFFFF">
|
||||
<h1 class="heading1">Limitations of APS Support in the Panel</h1>
|
||||
<h2 class="heading2">About This Document</h2>
|
||||
<p class="bodytext">This document is addressed to independent software
|
||||
vendors who plan to distribute web applications among the Panel users.
|
||||
The aim of the document is to help vendors find out whether they can
|
||||
package their applications to APS to make them available through the
|
||||
Panel.</p>
|
||||
<p class="bodytext">The document does not contain information about
|
||||
Application Packaging Standard itself or give application packaging
|
||||
instructions. It focuses on how the Panel implements APS and what APS
|
||||
packages are not supported by this implementation.</p>
|
||||
<p class="bodytext"></p>
|
||||
<h2 class="heading2">APS Support in the Panel</h2>
|
||||
<p class="bodytext"><em class="emphasis"><em class="emphasis">Application Packaging Standard</em></em> (<em class="emphasis">APS</em>)
|
||||
is a set of rules that defines a web application packaging format. This
|
||||
standard is designed to ease the integration of applications in a
|
||||
service provider's infrastructure. It covers provisioning, management,
|
||||
and integration of cloud-based services and applications.</p>
|
||||
<p class="bodytext">The Panel uses APS to offer third-party applications to hosting customers. These applications are presented in <em class="emphasis">APS catalog</em>, where the customers can buy or download them.</p>
|
||||
<p class="bodytext">Currently, the Panel does not support all aspects of
|
||||
APS. Therefore, customers may have problems trying to install certain
|
||||
applications. To find out whether your application is compatible with
|
||||
the Panel, see section <strong class="specialbold"><strong class="specialbold">Plesk Panel Restrictions.</strong></strong></p>
|
||||
<p class="bodytext">You can find more information about APS at http://www.apsstandard.org/.</p>
|
||||
<p class="bodytext">APS specification and supporting documents are available at http://www.apsstandard.org/isv/documentation/.</p>
|
||||
<p class="bodytext"></p>
|
||||
<h2 class="heading2">Restrictions on Packages Processing</h2>
|
||||
<p class="bodytext">The current Panel version has restrictions on APS
|
||||
applications processing. If an application requires performing
|
||||
restricted actions, the Panel will not install it. Particularly, these
|
||||
actions are the following:</p>
|
||||
<ul class="listbullet"><li class="listbullet">Sending e-mails or processing incoming mail.<p class="listcontinue">See <strong class="specialbold">Mail aspect</strong> of APS in <strong class="specialbold">APS Format Specification v1.2</strong>, section <strong class="specialbold">8.8. Mail </strong>at http://www.apsstandard.org/r/doc/package-format-specification-1.2/index.html#s.aspects.mail</p>
|
||||
</li><li class="listbullet">Changing the DNS resource records of an environment where the application works.<p class="listcontinue">See <strong class="specialbold">DNS aspect</strong> in <strong class="specialbold">APS Format Specification v1.2</strong>, section <strong class="specialbold">8.10. DNS Zone </strong>at http://www.apsstandard.org/r/doc/package-format-specification-1.2/index.html#s.aspects.dns</p>
|
||||
</li><li class="listbullet">Installing third-party dynamic libraries (*.dll, *.so).<p class="listcontinue">See<strong class="specialbold"> DLL aspect</strong> in <strong class="specialbold">APS Format Specification v1.2</strong>, section <strong class="specialbold">8.11. DLL Content Processing Method </strong>at http://www.apsstandard.org/r/doc/package-format-specification-1.2/index.html#s.aspects.dll</p>
|
||||
</li><li class="listbullet">Updating older version of application with
|
||||
complex changes in application settings or deployment logic. According
|
||||
to APS, such updates are called <em class="emphasis">upgrades. </em>For more information on the application updates, see the <strong class="specialbold">APS Format Specification v1.2</strong>, section <strong class="specialbold">5.1.15 Updates </strong>at http://www.apsstandard.org/r/doc/package-format-specification-1.2/index.html#s.metadata.common.update</li></ul><p class="bodytext">If
|
||||
you need you application to perform these actions, consider other ways
|
||||
of integration with the Panel: API RPC, modules or Panel Notifications.</p>
|
||||
<p class="bodytext">Also, the Panel does not support the following actions defined in the application package: </p>
|
||||
<ul class="listbullet"><li class="listbullet">Checking application settings for consistency via <strong class="specialbold">verification script. </strong>For more information on verification scripts, see the <strong class="specialbold">APS Format Specification v1.2</strong>, section <strong class="specialbold">5.3.3 Verification Script </strong>at http://www.apsstandard.org/r/doc/package-format-specification-1.2/index.html#s.metadata.provision.verification-script</li><li class="listbullet">Processing application resource usage reports defined by <strong class="specialbold">resource counters</strong> and passed by <strong class="specialbold">resource script</strong> . For more information on resource counters and resource scripts, see the <strong class="specialbold">APS Format Specification v1.2</strong>, section <strong class="specialbold">5.2.6. Resources</strong> at http://www.apsstandard.org/r/doc/package-format-specification-1.2/index.html#s.metadata.service.resources and <strong class="specialbold">5.3.3 Resources Script </strong>at http://www.apsstandard.org/r/doc/package-format-specification-1.2/index.html#s.metadata.provision.resource-script</li>
|
||||
|
||||
<h1 class="heading1">Copyright Notice</h1>
|
||||
<p class="copyright">Parallels Holdings, Ltd.</p>
|
||||
<p class="copyright">c/o Parallels International GmbH</p>
|
||||
<p class="copyright">Vordergasse 59</p>
|
||||
<p class="copyright">CH-Schaffhausen</p>
|
||||
<p class="copyright">Switzerland</p>
|
||||
<p class="copyright">Phone: +41-526320-411</p>
|
||||
<p class="copyright">Fax: +41-52672-2010</p>
|
||||
<p class="copyright"> </p>
|
||||
<p class="copyright">Copyright © 1999-2011 Parallels Holdings, Ltd. and its affiliates. All rights reserved. </p>
|
||||
<p class="copyright"> </p>
|
||||
<p class="copyright">This product is protected by United States and
|
||||
international copyright laws. The product's underlying technology,
|
||||
patents, and trademarks are listed at
|
||||
http://www.parallels.com/trademarks. </p>
|
||||
<p class="copyright"> </p>
|
||||
<p class="copyright">Microsoft, Windows, Windows Server, Windows NT, Windows Vista, and MS-DOS are registered trademarks of Microsoft Corporation.</p>
|
||||
<p class="copyright">Linux is a registered trademark of Linus Torvalds.</p>
|
||||
<p class="copyright">Mac is a registered trademark of Apple, Inc.</p>
|
||||
<p class="copyright">All other marks and names mentioned herein may be trademarks of their respective owners.</p>
|
||||
|
||||
|
||||
|
||||
<p class="bodytext">
|
||||
<a target="_blank" title="Send feedback through a web form" href="http://www.parallels.com/en/support/usersdoc/?problemSubject=Feedback+on+Help+Page+" onclick="var u = parent.BODY.location.href;
|
||||
u = u.replace(/.+\/([^/]+).htm$/,'$1');
|
||||
u+= '+of+the+'+parent.document.title.replace(/ /g,'+');
|
||||
|
||||
this.href+=u;
|
||||
|
||||
window.location.reload(false);">Please send us your feedback on this help page.</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul></body></html>
|
||||
<!-- Edited by post-publisher -->
|
||||
@@ -1,64 +0,0 @@
|
||||
function last(href)
|
||||
{
|
||||
var ret = href.split("/");
|
||||
return ret[ret.length-1];
|
||||
}
|
||||
|
||||
function StopProcess()
|
||||
{
|
||||
LeftFrame = parent.TOC.document.location.href;
|
||||
LeftFrame = last(LeftFrame);
|
||||
if (LeftFrame == "dhtml_search.htm") return 1
|
||||
else return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function highlightTOC(str) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (StopProcess()) return;
|
||||
try {
|
||||
|
||||
str = str || parent.BODY.document.location.href;
|
||||
uri = last(str);
|
||||
list = parent.TOC.document.getElementsByTagName("a");
|
||||
for(i=0; i<list.length; i++)
|
||||
{
|
||||
if (last(list[i].href) == uri)
|
||||
{
|
||||
list[i].style.backgroundColor = "#6697cc";
|
||||
list[i].style.padding = "2px";
|
||||
list[i].style.color = "#ffffff";
|
||||
|
||||
} else {
|
||||
list[i].style.backgroundColor = "#ffffff";
|
||||
list[i].style.color = "#003380";
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function FindCorrectTOCPage()
|
||||
{
|
||||
if (StopProcess()) return;
|
||||
//Updated on 30.04.2008
|
||||
list = parent.BODY.document.getElementsByTagName("a") || document.getElementsByTagName("a");
|
||||
for(i=0; i<list.length; i++)
|
||||
{
|
||||
if (list[i].target == "TOC")
|
||||
{
|
||||
|
||||
if (last(list[i].href) != last(parent.TOC.document.location.href))
|
||||
{
|
||||
parent.TOC.document.location.href = list[i].href;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
/* Pretty printing styles. Used with prettify.js. */
|
||||
|
||||
.str { color: #FF0000; }
|
||||
.vr { color: #0000FF; }
|
||||
.kwd { color: #000080; font-weight: bold}
|
||||
.com { color: #EA8110; }
|
||||
.typ { color: #606; }
|
||||
.lit { color: #066; }
|
||||
.pun { color: #660; }
|
||||
.pln { color: #000; }
|
||||
.tag { color: #008; }
|
||||
.atn { color: #606; }
|
||||
.atv { color: #080; }
|
||||
.dec { color: #606; }
|
||||
pre.preformatted {
|
||||
|
||||
display: block;
|
||||
font-family: "Courier New", verdana, arial, helvetica, sans-serif;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
font-weight: normal;
|
||||
font-size: 10pt;
|
||||
color: #000000;
|
||||
background-color: #f4f4f4;
|
||||
word-spacing: normal;
|
||||
letter-spacing: normal;
|
||||
vertical-align: baseline;
|
||||
text-decoration: none;
|
||||
text-transform: none;
|
||||
line-height: normal;
|
||||
margin-top: 0pt;
|
||||
margin-bottom: 0pt;
|
||||
margin-left: 0pt;
|
||||
margin-right: 6pt;
|
||||
padding-top: 1pt;
|
||||
padding-bottom: 1pt;
|
||||
padding-left: 5pt;
|
||||
padding-right: 5pt;
|
||||
float: none;
|
||||
clear: none;
|
||||
text-align: left;
|
||||
text-indent: 0cm;
|
||||
width: auto;
|
||||
height: auto;
|
||||
|
||||
}
|
||||
|
||||
@media print {
|
||||
.vr { color: #f0f; }
|
||||
.str { color: #060; }
|
||||
.kwd { color: #006; font-weight: bold; }
|
||||
.com { color: #600; font-style: italic; }
|
||||
.typ { color: #404; font-weight: bold; }
|
||||
.lit { color: #044; }
|
||||
.pun { color: #440; }
|
||||
.pln { color: #000; }
|
||||
.tag { color: #006; font-weight: bold; }
|
||||
.atn { color: #404; }
|
||||
.atv { color: #060; }
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,20 +0,0 @@
|
||||
README (English)
|
||||
##################################################
|
||||
This directory is dedicated to APS package building
|
||||
##################################################
|
||||
|
||||
Docs for APS format 1.1:
|
||||
http://www.apsstandard.org/r/doc/aps-format-1.1-packaging-guide/index.htm
|
||||
|
||||
Docs for APS format 1.2 (need APP-LIST.xml):
|
||||
http://www.apsstandard.org/r/doc/aps-format-1.2-packaging-guide/index.htm
|
||||
|
||||
|
||||
To check an APS package on Debian:
|
||||
* Install libgdiplus with
|
||||
apt-get install libgdiplus
|
||||
* Install apslint.exe (http://www.apsstandard.org/r/doc/aps-format-1.2-packaging-guide/57414.htm)
|
||||
tar -xvf xxxx.tgz
|
||||
* Go into directory of apslint and run command
|
||||
mono ./apslint.exe '/media/DATA/Mes Developpements/dolibarr/build/dolibarr-3.1.0-dev.app.zip'
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/*-----------------------------------------------------
|
||||
*
|
||||
*----------------------------------------------------- */
|
||||
|
||||
// This is list of predefined variables when script is ran
|
||||
// We have to set them manually to run script outside context.
|
||||
/*putenv('SETTINGS_admin_name=admin');
|
||||
putenv('SETTINGS_admin_password=admin-ad');
|
||||
putenv('BASE_URL_SCHEME=http');
|
||||
putenv('BASE_URL_HOST=localhost');
|
||||
putenv('BASE_URL_PORT=0');
|
||||
putenv('BASE_URL_PATH=/');
|
||||
//putenv('WEB___DIR=/var/wwww/dolibarr/htdocs'); // WEB___DIR is dir to htdocs
|
||||
putenv('WEB___DIR=../htdocs'); // WEB___DIR is dir to htdocs
|
||||
putenv('DB_main_NAME=dolibarr');
|
||||
putenv('DB_main_HOST=localhost');
|
||||
putenv('DB_main_PORT=3306');
|
||||
putenv('DB_main_LOGIN=root');
|
||||
putenv('DB_main_PASSWORD=root');
|
||||
*/
|
||||
|
||||
// Check parameters
|
||||
if(count($_SERVER['argv']) < 2)
|
||||
{
|
||||
print "Usage: configure.php (install | upgrade <version> | configure | remove)\n";
|
||||
exit(1);
|
||||
}
|
||||
$command = $_SERVER['argv'][1]; //$command stores the argument with which the script was invoked.
|
||||
|
||||
|
||||
if($command == "install")
|
||||
{
|
||||
$db_id = 'main';
|
||||
|
||||
$rootdir = getenv("WEB___DIR");
|
||||
if ($rootdir != '/') $rootdir = preg_replace('/\/$/','',$rootdir); // Remove last /
|
||||
$datadir = $rootdir.'/dolibarr_documents';
|
||||
|
||||
//List of database-related variables that are passed to the configuration
|
||||
//script. See the 6.3.1.1.1. Environment variables section of the
|
||||
//Specification for details.
|
||||
$db_address = getenv("DB_${db_id}_HOST");
|
||||
$db_port = getenv("DB_${db_id}_PORT");
|
||||
$dblogin = getenv("DB_${db_id}_LOGIN");
|
||||
$dbpassword = getenv("DB_${db_id}_PASSWORD");
|
||||
$dbname = getenv("DB_${db_id}_NAME");
|
||||
|
||||
|
||||
//PHP functions for connecting to the mysql server and
|
||||
//executing SQL queries.
|
||||
//mysql_connect($dbaddress, $dblogin, $dbpassword);
|
||||
//mysql_select_db($dbname);
|
||||
/*
|
||||
$sql_queries = file($query_file);
|
||||
foreach ($sql_queries as $query) mysql_query($query);
|
||||
*/
|
||||
|
||||
|
||||
//Other code to be executed on invoking configure with
|
||||
//the install argument.
|
||||
|
||||
// Create empty config file
|
||||
$file=$rootdir.'/conf/conf.php';
|
||||
print "Create conf file ".$file."\n";
|
||||
$fp = fopen($file, 'wb');
|
||||
if ($fp)
|
||||
{
|
||||
fclose($fp);
|
||||
chmod($file,0775);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "configure.php install: Unable to write file $file.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Create empty directory that will be used by software to store uploaded documents
|
||||
print "Create directory ".$datadir."\n";
|
||||
@mkdir($datadir);
|
||||
chmod($datadir,0775);
|
||||
|
||||
// Create install.forced.php into htdocs/install directory with value.
|
||||
// This will set parameters of install for web installer wizard.
|
||||
$file_source=$rootdir.'/../build/aps/install.forced.php.install';
|
||||
$file=$rootdir.'/install/install.forced.php';
|
||||
print "Create file ".$file.' from '.$file_source."\n";
|
||||
|
||||
$modify_hash=array(
|
||||
'WEB___DIR'=>$rootdir,
|
||||
'DB_'.$db_id.'_HOST'=>$db_address,
|
||||
'DB_'.$db_id.'_PORT'=>$db_port,
|
||||
'DB_'.$db_id.'_LOGIN'=>$dblogin,
|
||||
'DB_'.$db_id.'_PASSWORD'=>$dbpassword,
|
||||
'DB_'.$db_id.'_NAME'=>$dbname
|
||||
);
|
||||
|
||||
$file_content = fread(fopen($file_source, 'r'), filesize($file_source));
|
||||
foreach($modify_hash as $param => $val){
|
||||
$file_content = str_replace($param, php_quote($val), $file_content);
|
||||
}
|
||||
$fp = fopen($file, 'wb');
|
||||
if ($fp)
|
||||
{
|
||||
fputs($fp, $file_content);
|
||||
fputs($fp, "\n");
|
||||
fclose($fp);
|
||||
chmod($file,0775);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "configure.php install: Unable to write file $file.\n";
|
||||
exit(2);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if($command == "remove")
|
||||
{
|
||||
//Code to be executed on invoking configure with the remove argument
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if($command == "upgrade")
|
||||
{
|
||||
//Code to be executed on invoking configure with the upgrade argument
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if($command == "configure")
|
||||
{
|
||||
//Code to be executed on invoking configure with the configure argument
|
||||
exit(0);
|
||||
}
|
||||
|
||||
print "configure.php: Error: unknown command $command.\n";
|
||||
exit(1);
|
||||
|
||||
|
||||
|
||||
// Content of file-util.php we need
|
||||
|
||||
function php_quote($val)
|
||||
{
|
||||
$res_val = str_replace("\\", "\\\\", $val);
|
||||
$res_val = str_replace("'", "\\'", $res_val);
|
||||
return $res_val;
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
// File to force Dolibarr wizard installer choices.
|
||||
//
|
||||
// This file must be present into htdocs/install directory
|
||||
// during install process to be used.
|
||||
//
|
||||
//
|
||||
$force_install_noedit=1;
|
||||
$force_install_message='KeepDefaultValuesDeb';
|
||||
$force_install_main_data_root='WEB___DIR/dolibarr_documents';
|
||||
$force_install_type='mysqli';
|
||||
$force_install_dbserver='DB_main_HOST';
|
||||
$force_install_port='DB_main_PORT';
|
||||
$force_install_database='DB_main_NAME';
|
||||
$force_install_createdatabase='0';
|
||||
$force_install_databaselogin='DB_main_LOGIN';
|
||||
$force_install_databasepass='DB_main_PASSWORD';
|
||||
$force_install_createuser='0';
|
||||
$force_install_databaserootlogin='';
|
||||
$force_install_databaserootpass='';
|
||||
$force_install_dolibarrlogin='admin';
|
||||
$force_install_nophpinfo='1';
|
||||
$force_install_lockinstall='444';
|
||||
@@ -13,8 +13,8 @@ AssocingFileExtension=Associating %1 with the %2 file extension...
|
||||
|
||||
YouWillInstallDoliWamp=You will install or upgrade DoliWamp (Apache+Mysql+PHP+Dolibarr) on your computer.
|
||||
ThisAssistantInstallOrUpgrade=This assistant installs or upgrades Dolibarr ERP-CRM and all required third party softwares (Apache, Mysql and PHP) optimized for a Dolibarr usage.
|
||||
IfYouHaveTechnicalKnowledge=If you have technical knowledge and plan to share your Apache, Mysql and PHP with other projects than Dolibarr, you should not use this assistant and make a manual installation of Dolibarr on your existing Apache, Mysql and PHP installation.
|
||||
ButIfYouLook=But if you look for an automatic setup, you''re on the good way...
|
||||
IfYouHaveTechnicalKnowledge=If you are looking for a hosted version in the Cloud, you should look at https://saas.dolibarr.org. If you have technical knowledge and want to manage your Apache, Mysql and PHP yourself, you should not use this assistant and make a manual installation of Dolibarr on your existing Apache, Mysql and PHP installation.
|
||||
ButIfYouLook=But if you look for an automatic setup on your local computer, you''re on the good way...
|
||||
DoYouWantToStart=Do you want to start installation/upgrade process ?
|
||||
|
||||
TechnicalParameters=Technical parameters
|
||||
|
||||
@@ -13,8 +13,8 @@ AssocingFileExtension=Associe %1 avec l'extension de fichier %2...
|
||||
|
||||
YouWillInstallDoliWamp=Vous allez installer ou mettre <20> jour DoliWamp (Apache+Mysql+PHP+Dolibarr) sur votre ordinateur.
|
||||
ThisAssistantInstallOrUpgrade=Cet assistant installe ou met <20> jour Dolibarr ERP-CRM et tous ses composants pr<70>requis (Apache, Mysql et PHP) optimis<69>s pour une utilisation de Dolibarr.
|
||||
IfYouHaveTechnicalKnowledge=Si vous avez des comp<6D>tences techniques et envisagez de partager votre Apache, Mysql et PHP avec d'autres applications que Dolibarr, vous ne devriez pas utiliser cet assistant mais faire plut<75>t une installation manuelle de Dolibarr sur un socle Apache, Mysql et PHP existant.
|
||||
ButIfYouLook=Mais si vous recherchez une installation cl<EFBFBD> en main automatis<EFBFBD>e, vous <20>tes sur la bonne voie...
|
||||
IfYouHaveTechnicalKnowledge=Si vous cherchez un h<>bergement dans le Cloud, aller voir sur https://saas.dolibarr.org. Si vous avez des comp<6D>tences techniques et voulez g<>rer vous m<>me Apache, Mysql et PHP, vous ne devriez pas utiliser cet assistant mais faire plut<75>t une installation manuelle de Dolibarr sur votre socle Apache, Mysql et PHP existant.
|
||||
ButIfYouLook=Mais si vous recherchez une installation automatis<69>e locale sur votre ordinateur, cl<63> en main, vous <20>tes sur la bonne voie...
|
||||
DoYouWantToStart=Voulez-vous d<>marrer le processus d'installation/mise <20> jour ?
|
||||
|
||||
TechnicalParameters=Param<61>tres techniques
|
||||
|
||||
@@ -32,7 +32,7 @@ AppPublisherURL=https://www.nltechno.com
|
||||
AppSupportURL=https://www.dolibarr.org
|
||||
AppUpdatesURL=https://www.dolibarr.org
|
||||
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
|
||||
AppCopyright=Copyright (C) 2008-2017 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre)
|
||||
AppCopyright=Copyright (C) 2008-2018 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre)
|
||||
DefaultDirName=c:\dolibarr
|
||||
DefaultGroupName=Dolibarr
|
||||
;LicenseFile=COPYING
|
||||
|
||||
1
build/flatpack/org.flatpak.Dolibarr.json
Normal file
1
build/flatpack/org.flatpak.Dolibarr.json
Normal file
@@ -0,0 +1 @@
|
||||
Help wanted...
|
||||
@@ -22,6 +22,8 @@
|
||||
* \brief This script create a xml checksum file
|
||||
*/
|
||||
|
||||
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
|
||||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=dirname(__FILE__).'/';
|
||||
@@ -32,8 +34,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once($path."../htdocs/master.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
require_once $path."../htdocs/master.inc.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
||||
|
||||
|
||||
/*
|
||||
@@ -45,7 +47,7 @@ $includeconstants=array();
|
||||
|
||||
if (empty($argv[1]))
|
||||
{
|
||||
print "Usage: ".$script_file." release=auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||
exit -1;
|
||||
}
|
||||
@@ -68,30 +70,52 @@ while ($i < $argc)
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (empty($release))
|
||||
{
|
||||
print "Error: Missing release paramater\n";
|
||||
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||
exit -1;
|
||||
}
|
||||
|
||||
$savrelease = $release;
|
||||
|
||||
// If release is auto, we take current version
|
||||
$tmpver=explode('-', $release, 2);
|
||||
if ($tmpver[0] == 'auto')
|
||||
if ($tmpver[0] == 'auto' || $tmpver[0] == 'autostable')
|
||||
{
|
||||
$release=DOL_VERSION;
|
||||
if ($tmpver[1]) $release.='-'.$tmpver[1];
|
||||
if ($tmpver[1] && $tmpver[0] == 'auto') $release.='-'.$tmpver[1];
|
||||
}
|
||||
|
||||
if (empty($includecustom))
|
||||
{
|
||||
$tmpver=explode('-', $release, 2);
|
||||
if (DOL_VERSION != $tmpver[0])
|
||||
{
|
||||
print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpver[0].')'."\n";
|
||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
|
||||
exit -1;
|
||||
}
|
||||
$tmpverbis=explode('-', $release, 2);
|
||||
if (empty($tmpverbis[1]) || $tmpver[0] == 'autostable')
|
||||
{
|
||||
if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto')
|
||||
{
|
||||
print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n";
|
||||
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||
exit -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpverter=explode('-', DOL_VERSION, 2);
|
||||
if ($tmpverter[0] != $tmpverbis[0])
|
||||
{
|
||||
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n";
|
||||
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||
exit -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release))
|
||||
{
|
||||
print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parmater (ex: '.DOL_VERSION.'-mydistrib).'."\n";
|
||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
|
||||
print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n";
|
||||
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||
exit -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||
$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
||||
|
||||
|
||||
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
%REQUIREMENTPUBLISH=(
|
||||
"SF"=>"git ssh rsync",
|
||||
@@ -37,7 +37,7 @@ $PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpd
|
||||
"RPM_MANDRIVA"=>"rpmbuild",
|
||||
"RPM_OPENSUSE"=>"rpmbuild",
|
||||
"DEB"=>"dpkg",
|
||||
"APS"=>"zip",
|
||||
"FLATPACK"=>"flatpack",
|
||||
"EXEDOLIWAMP"=>"ISCC.exe",
|
||||
"SNAPSHOT"=>"tar"
|
||||
);
|
||||
@@ -142,7 +142,6 @@ $FILENAMETGZ = "$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEZIP = "$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEXZ = "$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEDEB = "see later";
|
||||
$FILENAMEAPS = "$PROJECT-$MAJOR.$MINOR.$BUILD.app";
|
||||
$FILENAMEEXEDOLIWAMP = "DoliWamp-$MAJOR.$MINOR.$BUILD";
|
||||
# For RPM
|
||||
$ARCH='noarch';
|
||||
@@ -466,10 +465,12 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.xz`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.xz`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`;
|
||||
@@ -690,7 +691,7 @@ if ($nboftargetok) {
|
||||
print "Go to directory $BUILDROOT\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$BUILDROOT");
|
||||
$cmd= "xz -9 -r $BUILDROOT/$FILENAMEAPS.xz \*";
|
||||
$cmd= "xz -9 -r $BUILDROOT/$FILENAMEXZ.xz \*";
|
||||
print $cmd."\n";
|
||||
$ret= `$cmd`;
|
||||
chdir("$olddir");
|
||||
@@ -849,6 +850,8 @@ if ($nboftargetok) {
|
||||
unlink("$NEWDESTI/${FILENAMEDEB}.changes");
|
||||
print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n";
|
||||
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz");
|
||||
print "Remove target ${FILENAMEDEB}.debian.tar.xz...\n";
|
||||
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.xz");
|
||||
print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n";
|
||||
unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz");
|
||||
|
||||
@@ -1024,97 +1027,11 @@ if ($nboftargetok) {
|
||||
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'APS')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
if ($NEWDESTI =~ /stable/)
|
||||
{
|
||||
mkdir($DESTI.'/package_aps');
|
||||
if (-d $DESTI.'/package_aps') { $NEWDESTI=$DESTI.'/package_aps'; }
|
||||
}
|
||||
|
||||
$newbuild = $BUILD;
|
||||
$newbuild =~ s/(dev|alpha)/0/gi; # dev
|
||||
$newbuild =~ s/beta/1/gi; # beta
|
||||
$newbuild =~ s/rc./2/gi; # rc
|
||||
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
|
||||
# now newbuild is 0-0 or 0-3 for example
|
||||
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
|
||||
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
|
||||
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
|
||||
|
||||
print "Remove target $FILENAMEAPS.zip...\n";
|
||||
unlink "$NEWDESTI/$FILENAMEAPS.zip";
|
||||
|
||||
#rmdir "$BUILDROOT/$PROJECT.tmp";
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp`;
|
||||
print "Create directory $BUILDROOT/$PROJECT.tmp\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp"`;
|
||||
print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp\n";
|
||||
$cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\"";
|
||||
$ret=`$cmd`;
|
||||
|
||||
print "Remove other files\n";
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/deb`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/dmg`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/doap`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/exe`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/live`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/patch`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/rpm`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/zip`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/perl`;
|
||||
|
||||
$APSVERSION="1.2";
|
||||
print "Create APS files $BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml\n";
|
||||
open (SPECFROM,"<$BUILDROOT/$PROJECT/build/aps/APP-META-$APSVERSION.xml") || die "Error";
|
||||
open (SPECTO,">$BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml") || die "Error";
|
||||
while (<SPECFROM>) {
|
||||
$newbuild = $BUILD;
|
||||
$newbuild =~ s/(dev|alpha)/0/gi; # dev
|
||||
$newbuild =~ s/beta/1/gi; # beta
|
||||
$newbuild =~ s/rc./2/gi; # rc
|
||||
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
|
||||
# now newbuild is 0-0 or 0-3 for example
|
||||
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/;
|
||||
$_ =~ s/__RELEASE__/$RPMSUBVERSION/;
|
||||
print SPECTO $_;
|
||||
}
|
||||
close SPECFROM;
|
||||
close SPECTO;
|
||||
print "Version set to $MAJOR.$MINOR.$newbuild\n";
|
||||
$cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure.php\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure.php\"";
|
||||
$ret=`$cmd`;
|
||||
$cmd="cp -pr \"$BUILDROOT/$PROJECT/doc/images\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/images\"";
|
||||
$ret=`$cmd`;
|
||||
|
||||
print "Remove other files\n";
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc`;
|
||||
|
||||
print "Build APP-LIST.xml files\n";
|
||||
|
||||
print "Compress $BUILDROOT/$PROJECT.tmp/$PROJECT into $FILENAMEAPS.zip...\n";
|
||||
|
||||
print "Go to directory $BUILDROOT/$PROJECT.tmp\/$PROJECT\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$BUILDROOT\/$PROJECT.tmp\/$PROJECT");
|
||||
$cmd= "zip -9 -r $BUILDROOT/$FILENAMEAPS.zip \*";
|
||||
print $cmd."\n";
|
||||
$ret= `$cmd`;
|
||||
chdir("$olddir");
|
||||
|
||||
# Move to final dir
|
||||
print "Move $BUILDROOT/$FILENAMEAPS.zip to $NEWDESTI/$FILENAMEAPS.zip\n";
|
||||
$ret=`mv "$BUILDROOT/$FILENAMEAPS.zip" "$NEWDESTI/$FILENAMEAPS.zip"`;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'EXEDOLIWAMP')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
@@ -1168,7 +1085,7 @@ if ($nboftargetok) {
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'none', # none means it won't be published on SF
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'none', # none means it won't be published on SF
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'none', # none means it won't be published on SF
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'none', # none means it won't be published on SF
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none', # none means it won't be published on SF
|
||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
|
||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
|
||||
@@ -1181,8 +1098,7 @@ if ($nboftargetok) {
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
|
||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',
|
||||
|
||||
@@ -160,6 +160,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/adherents
|
||||
%_datadir/dolibarr/htdocs/admin
|
||||
%_datadir/dolibarr/htdocs/api
|
||||
%_datadir/dolibarr/htdocs/asset
|
||||
%_datadir/dolibarr/htdocs/asterisk
|
||||
%_datadir/dolibarr/htdocs/barcode
|
||||
%_datadir/dolibarr/htdocs/blockedlog
|
||||
@@ -211,6 +212,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/ticket
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
|
||||
@@ -240,6 +240,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/adherents
|
||||
%_datadir/dolibarr/htdocs/admin
|
||||
%_datadir/dolibarr/htdocs/api
|
||||
%_datadir/dolibarr/htdocs/asset
|
||||
%_datadir/dolibarr/htdocs/asterisk
|
||||
%_datadir/dolibarr/htdocs/barcode
|
||||
%_datadir/dolibarr/htdocs/blockedlog
|
||||
@@ -291,6 +292,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/ticket
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
|
||||
@@ -157,6 +157,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/adherents
|
||||
%_datadir/dolibarr/htdocs/admin
|
||||
%_datadir/dolibarr/htdocs/api
|
||||
%_datadir/dolibarr/htdocs/asset
|
||||
%_datadir/dolibarr/htdocs/asterisk
|
||||
%_datadir/dolibarr/htdocs/barcode
|
||||
%_datadir/dolibarr/htdocs/blockedlog
|
||||
@@ -208,6 +209,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/ticket
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
|
||||
@@ -168,6 +168,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/adherents
|
||||
%_datadir/dolibarr/htdocs/admin
|
||||
%_datadir/dolibarr/htdocs/api
|
||||
%_datadir/dolibarr/htdocs/asset
|
||||
%_datadir/dolibarr/htdocs/asterisk
|
||||
%_datadir/dolibarr/htdocs/barcode
|
||||
%_datadir/dolibarr/htdocs/blockedlog
|
||||
@@ -219,6 +220,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/ticket
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
|
||||
@@ -48,6 +48,23 @@ into
|
||||
// initialize subsetchars
|
||||
$subsetchars = array_fill(0, 256, true);
|
||||
|
||||
* Replace the continue into switch with a break:
|
||||
|
||||
case 're': {
|
||||
// justify block
|
||||
if (!TCPDF_STATIC::empty_string($this->lispacer)) {
|
||||
$this->lispacer = '';
|
||||
continue;
|
||||
}
|
||||
|
||||
into
|
||||
case 're': {
|
||||
// justify block
|
||||
if (!TCPDF_STATIC::empty_string($this->lispacer)) {
|
||||
$this->lispacer = '';
|
||||
break;
|
||||
}
|
||||
|
||||
* Optionnaly, removed all fonts except
|
||||
dejavusans* (used by greek, arab, persan, romanian, turkish),
|
||||
freemono* (russian),
|
||||
@@ -90,6 +107,14 @@ var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
|
||||
vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
|
||||
vTmpNode.setAttribute('href',vTaskList[i].getLink());
|
||||
|
||||
* Replace '% Comp.' to have a smaller text column header
|
||||
'comp':'% Comp.'
|
||||
with
|
||||
'comp':'%'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
JCROP:
|
||||
------
|
||||
|
||||
@@ -40,7 +40,7 @@ $error=0;
|
||||
|
||||
// -------------------- START OF YOUR CODE HERE --------------------
|
||||
// Include Dolibarr environment
|
||||
require_once($path."../../htdocs/master.inc.php");
|
||||
require_once $path."../../htdocs/master.inc.php";
|
||||
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
|
||||
|
||||
//$langs->setDefaultLang('en_US'); // To change default language of $langs
|
||||
@@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n";
|
||||
// Start of transaction
|
||||
$db->begin();
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||
require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
|
||||
|
||||
// Create invoice object
|
||||
$obj = new Facture($db);
|
||||
|
||||
@@ -40,7 +40,7 @@ $error=0;
|
||||
|
||||
// -------------------- START OF YOUR CODE HERE --------------------
|
||||
// Include Dolibarr environment
|
||||
require_once($path."../../htdocs/master.inc.php");
|
||||
require_once $path."../../htdocs/master.inc.php";
|
||||
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
|
||||
|
||||
//$langs->setDefaultLang('en_US'); // To change default language of $langs
|
||||
@@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n";
|
||||
// Start of transaction
|
||||
$db->begin();
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||
require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
|
||||
|
||||
// Create order object
|
||||
$com = new Commande($db);
|
||||
|
||||
@@ -40,7 +40,7 @@ $error=0;
|
||||
|
||||
// -------------------- START OF YOUR CODE HERE --------------------
|
||||
// Include Dolibarr environment
|
||||
require_once($path."../../htdocs/master.inc.php");
|
||||
require_once $path."../../htdocs/master.inc.php";
|
||||
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
|
||||
|
||||
//$langs->setDefaultLang('en_US'); // To change default language of $langs
|
||||
@@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n";
|
||||
// Start of transaction
|
||||
$db->begin();
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
|
||||
|
||||
// Create instance of object
|
||||
$myproduct=new Product($db);
|
||||
|
||||
@@ -40,7 +40,7 @@ $error=0;
|
||||
|
||||
// -------------------- START OF YOUR CODE HERE --------------------
|
||||
// Include Dolibarr environment
|
||||
require_once($path."../../htdocs/master.inc.php");
|
||||
require_once $path."../../htdocs/master.inc.php";
|
||||
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
|
||||
|
||||
//$langs->setDefaultLang('en_US'); // To change default language of $langs
|
||||
@@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n";
|
||||
// Start of transaction
|
||||
$db->begin();
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
|
||||
require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
|
||||
|
||||
// Create user object
|
||||
$obj = new User($db);
|
||||
|
||||
@@ -40,7 +40,7 @@ $error=0;
|
||||
|
||||
// -------------------- START OF YOUR CODE HERE --------------------
|
||||
// Include Dolibarr environment
|
||||
require_once($path."../../htdocs/master.inc.php");
|
||||
require_once $path."../../htdocs/master.inc.php";
|
||||
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
|
||||
|
||||
//$langs->setDefaultLang('en_US'); // To change default language of $langs
|
||||
@@ -65,7 +65,7 @@ print 'Argument id_thirdparty='.$argv[1]."\n";
|
||||
// Start of transaction
|
||||
$db->begin();
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
|
||||
require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
|
||||
|
||||
// Create contract object
|
||||
$obj = new Contrat($db);
|
||||
|
||||
@@ -32,9 +32,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
||||
// Recupere root dolibarr
|
||||
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
||||
require __DIR__. '/../../htdocs/master.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -33,14 +33,14 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
||||
// Recupere root dolibarr
|
||||
//$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||
require __DIR__. '/../../htdocs/master.inc.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||
require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
||||
// Recupere root dolibarr
|
||||
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||
require __DIR__. '/../../htdocs/master.inc.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
@@ -33,11 +33,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
||||
// Recupere root dolibarr
|
||||
//$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
||||
require __DIR__. '/../../htdocs/master.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
|
||||
|
||||
/*
|
||||
* Parameters
|
||||
@@ -157,7 +157,7 @@ $user->rights->propal->propal_advance->validate=1;
|
||||
|
||||
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php");
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php";
|
||||
}
|
||||
|
||||
$i=0;
|
||||
|
||||
@@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
||||
// Recupere root dolibarr
|
||||
//$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||
require __DIR__. '/../../htdocs/master.inc.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file dev/initdata/import-product.php
|
||||
* \brief Script example to insert products from a csv file.
|
||||
* \brief Script example to insert products from a csv file.
|
||||
* To purge data, you can have a look at purge-data.php
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=preg_replace('/import-products.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../../htdocs/master.inc.php");
|
||||
require $path."../../htdocs/master.inc.php";
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
@@ -118,22 +118,22 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
|
||||
{
|
||||
$i++;
|
||||
$errorrecord=0;
|
||||
|
||||
|
||||
if ($startlinenb && $i < $startlinenb) continue;
|
||||
if ($endlinenb && $i > $endlinenb) continue;
|
||||
|
||||
|
||||
$nboflines++;
|
||||
|
||||
|
||||
$produit = new Product($db);
|
||||
$produit->type = 0;
|
||||
$produit->status = 1;
|
||||
$produit->ref = trim($fields[0]);
|
||||
|
||||
|
||||
print "Process line nb ".$i.", ref ".$produit->ref;
|
||||
$produit->label = trim($fields[2]);
|
||||
$produit->description = trim($fields[4]."\n".($fields[5] ? $fields[5].' x '.$fields[6].' x '.$fields[7] : ''));
|
||||
$produit->volume = price2num($fields[8]);
|
||||
$produit->volume_unit = 0;
|
||||
$produit->volume_unit = 0;
|
||||
$produit->weight = price2num($fields[9]);
|
||||
$produit->weight_units = 0; // -3 = g
|
||||
|
||||
@@ -142,9 +142,9 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
|
||||
|
||||
$produit->status = 1;
|
||||
$produit->status_buy = 1;
|
||||
|
||||
|
||||
$produit->finished = 1;
|
||||
|
||||
|
||||
$produit->price_min = null;
|
||||
$produit->price_min_ttc = null;
|
||||
$produit->price = price2num($fields[11]);
|
||||
@@ -152,25 +152,25 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
|
||||
$produit->price_base_type = 'TTC';
|
||||
$produit->tva_tx = price2num($fields[13]);
|
||||
$produit->tva_npr = 0;
|
||||
|
||||
|
||||
$produit->cost_price = price2num($fields[16]);
|
||||
|
||||
|
||||
// Extrafields
|
||||
$produit->array_options['options_ecotaxdeee']=price2num($fields[17]);
|
||||
|
||||
|
||||
$ret=$produit->create($user);
|
||||
if ($ret < 0)
|
||||
{
|
||||
print " - Error in create result code = ".$ret." - ".$produit->errorsToString();
|
||||
$errorrecord++;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print " - Creation OK with ref ".$produit->ref." - id = ".$ret;
|
||||
}
|
||||
|
||||
dol_syslog("Add prices");
|
||||
|
||||
|
||||
// If we use price level, insert price for each level
|
||||
if (! $errorrecord && 1)
|
||||
{
|
||||
@@ -181,14 +181,14 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
|
||||
print " - Error in updatePrice result code = ".$ret1." ".$ret2." - ".$produit->errorsToString();
|
||||
$errorrecord++;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print " - updatePrice OK";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dol_syslog("Add multilangs");
|
||||
|
||||
|
||||
// Add alternative languages
|
||||
if (! $errorrecord && 1)
|
||||
{
|
||||
@@ -201,15 +201,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
|
||||
print " - Error in setMultiLangs result code = ".$ret." - ".$produit->errorsToString();
|
||||
$errorrecord++;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print " - setMultiLangs OK";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "\n";
|
||||
|
||||
if ($errorrecord)
|
||||
|
||||
if ($errorrecord)
|
||||
{
|
||||
fwrite($fhandleerr, 'Error on record nb '.$i." - ".$produit->errorsToString()."\n");
|
||||
$error++; // $errorrecord will be reset
|
||||
|
||||
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=preg_replace('/import-thirdparties.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../../htdocs/master.inc.php");
|
||||
require $path."../../htdocs/master.inc.php";
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file dev/initdata/import-thirdparties.php
|
||||
* \brief Script example to insert thirdparties from a csv file.
|
||||
* \brief Script example to insert thirdparties from a csv file.
|
||||
* To purge data, you can have a look at purge-data.php
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=preg_replace('/import-users.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../../htdocs/master.inc.php");
|
||||
require $path."../../htdocs/master.inc.php";
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
@@ -118,15 +118,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
|
||||
{
|
||||
$i++;
|
||||
$errorrecord=0;
|
||||
|
||||
|
||||
if ($startlinenb && $i < $startlinenb) continue;
|
||||
if ($endlinenb && $i > $endlinenb) continue;
|
||||
|
||||
|
||||
$nboflines++;
|
||||
|
||||
|
||||
$object = new User($db);
|
||||
$object->statut = 1;
|
||||
|
||||
|
||||
$tmp=explode(' ',$fields[3],2);
|
||||
$object->firstname = trim($tmp[0]);
|
||||
$object->lastname = trim($tmp[1]);
|
||||
@@ -134,23 +134,23 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
|
||||
else $object->login=strtolower($object->firstname);
|
||||
$object->login=preg_replace('/ /','',$object->login);
|
||||
$object->password = 'init';
|
||||
|
||||
|
||||
print "Process line nb ".$i.", login ".$object->login;
|
||||
|
||||
|
||||
$ret=$object->create($user);
|
||||
if ($ret < 0)
|
||||
{
|
||||
print " - Error in create result code = ".$ret." - ".$object->errorsToString();
|
||||
$errorrecord++;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print " - Creation OK with login ".$object->login." - id = ".$ret;
|
||||
}
|
||||
|
||||
print "\n";
|
||||
|
||||
if ($errorrecord)
|
||||
|
||||
if ($errorrecord)
|
||||
{
|
||||
fwrite($fhandleerr, 'Error on record nb '.$i." - ".$object->errorsToString()."\n");
|
||||
$error++; // $errorrecord will be reset
|
||||
|
||||
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=preg_replace('/purge-data.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../../htdocs/master.inc.php");
|
||||
require $path."../../htdocs/master.inc.php";
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
@@ -44,8 +44,7 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("errors");
|
||||
$langs->loadLangs(array("main", "errors"));
|
||||
|
||||
// Global variables
|
||||
$version=DOL_VERSION;
|
||||
|
||||
@@ -41,15 +41,15 @@ $passwordbase=isset($argv[6])?$argv[6]:'';
|
||||
|
||||
// Include Dolibarr environment
|
||||
$res=0;
|
||||
if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
|
||||
if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php");
|
||||
if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
|
||||
if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
|
||||
if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
|
||||
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
|
||||
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
|
||||
if (! $res && file_exists($path."../../master.inc.php")) $res=@include $path."../../master.inc.php";
|
||||
if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $path."../../htdocs/master.inc.php";
|
||||
if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php";
|
||||
if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php";
|
||||
if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
|
||||
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
|
||||
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
|
||||
if (! $res) die ("Failed to include master.inc.php file\n");
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*
|
||||
*
|
||||
* Get a distant dump file and load it into a mysql database
|
||||
*/
|
||||
|
||||
@@ -36,15 +36,15 @@ $confirm=isset($argv[1])?$argv[1]:'';
|
||||
|
||||
// Include Dolibarr environment
|
||||
$res=0;
|
||||
if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
|
||||
if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php");
|
||||
if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
|
||||
if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
|
||||
if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
|
||||
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
|
||||
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
|
||||
if (! $res && file_exists($path."../../master.inc.php")) $res=@include $path."../../master.inc.php";
|
||||
if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $path."../../htdocs/master.inc.php";
|
||||
if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php";
|
||||
if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php";
|
||||
if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
|
||||
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
|
||||
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
|
||||
if (! $res) die ("Failed to include master.inc.php file\n");
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
|
||||
/*
|
||||
@@ -74,7 +74,7 @@ $tables=array(
|
||||
|
||||
$year=2010;
|
||||
$currentyear=$tmp['year'];
|
||||
while ($year <= $currentyear)
|
||||
while ($year <= $currentyear)
|
||||
{
|
||||
//$year=2021;
|
||||
$delta=($currentyear - $year);
|
||||
@@ -84,7 +84,7 @@ while ($year <= $currentyear)
|
||||
{
|
||||
foreach($tables as $tablekey => $tableval)
|
||||
{
|
||||
print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
|
||||
print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
|
||||
$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)";
|
||||
//$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." > NOW()";
|
||||
$resql = $db->query($sql);
|
||||
@@ -110,14 +110,14 @@ while ($year <= $currentyear)
|
||||
//print $sql2."\n";
|
||||
$resql2 = $db->query($sql2);
|
||||
if (! $resql2) dol_print_error($db);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$year++;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,49 +4,37 @@
|
||||
<description>Dolibarr coding standard.</description>
|
||||
|
||||
<exclude-pattern type="relative">build/html</exclude-pattern>
|
||||
<exclude-pattern type="relative">build/aps</exclude-pattern>
|
||||
<exclude-pattern type="relative">documents</exclude-pattern>
|
||||
<exclude-pattern type="relative">htdocs/custom</exclude-pattern>
|
||||
<exclude-pattern type="relative">htdocs/includes</exclude-pattern>
|
||||
<exclude-pattern type="relative">htdocs/conf.php</exclude-pattern>
|
||||
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
|
||||
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
||||
<exclude-pattern type="relative">*.min.css</exclude-pattern>
|
||||
<exclude-pattern type="relative">*.js</exclude-pattern>
|
||||
|
||||
<!-- List of all tests -->
|
||||
|
||||
|
||||
|
||||
<!-- Rules from Internal Standard -->
|
||||
|
||||
|
||||
<rule ref="Internal.NoCodeFound">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<!-- Rules from Generic Standard -->
|
||||
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
|
||||
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedCATCH">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedFOREACH">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIF">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSE">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSEIF">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.NotAllowed">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.NotAllowedWarning">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<!-- Rules from Generic Standard -->
|
||||
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement">
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedIf"/>
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElse"/>
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"/>
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedForeach"/>
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowed"/>
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowedWarning"/>
|
||||
</rule>
|
||||
|
||||
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
|
||||
|
||||
@@ -82,7 +70,7 @@
|
||||
<!-- Lines can be 85 chars long, but never show errors -->
|
||||
<rule ref="Generic.Files.LineLength">
|
||||
<properties>
|
||||
<property name="lineLimit" value="1000" />
|
||||
<property name="lineLimit" value="500" />
|
||||
<property name="absoluteLineLimit" value="0" />
|
||||
</properties>
|
||||
</rule>
|
||||
@@ -146,7 +134,7 @@
|
||||
<rule ref="Generic.PHP.DeprecatedFunctions.Deprecated">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule ref="Generic.PHP.DisallowShortOpenTag" />
|
||||
|
||||
<rule ref="Generic.PHP.ForbiddenFunctions" />
|
||||
@@ -162,7 +150,7 @@
|
||||
<rule ref="Generic.Strings.UnnecessaryStringConcat.Found">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<!-- Disallow usage of tab -->
|
||||
<!-- <rule ref="Generic.WhiteSpace.DisallowTabIndent" /> -->
|
||||
|
||||
@@ -170,7 +158,23 @@
|
||||
<!-- Disabled as this does not support tab -->
|
||||
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
|
||||
|
||||
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
|
||||
<properties>
|
||||
<property name="ignoreBlankLines" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
||||
|
||||
<!-- Rules from PEAR Standard -->
|
||||
|
||||
@@ -185,7 +189,7 @@
|
||||
<rule ref="PEAR.Commenting.ClassComment.Missing">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
@@ -205,14 +209,14 @@
|
||||
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
|
||||
<!--
|
||||
<rule ref="PEAR.Commenting.FileComment" />
|
||||
<rule ref="PEAR.Commenting.FileComment.WrongStyle">
|
||||
<severity>0</severity>
|
||||
@@ -224,20 +228,20 @@
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
-->
|
||||
|
||||
|
||||
<rule ref="PEAR.Commenting.FunctionComment" />
|
||||
|
||||
<rule ref="PEAR.Commenting.FunctionComment.Empty">
|
||||
<severity>5</severity>
|
||||
</rule>
|
||||
|
||||
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
|
||||
|
||||
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="PEAR.Commenting.FunctionComment.Missing">
|
||||
</rule>-->
|
||||
<!--<rule ref="PEAR.Commenting.FunctionComment.Missing">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
</rule>-->
|
||||
|
||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
|
||||
|
||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
|
||||
@@ -253,11 +257,11 @@
|
||||
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
@@ -284,7 +288,20 @@
|
||||
<!-- <rule ref="PEAR.ControlStructures.MultiLineCondition" /> -->
|
||||
|
||||
<!-- Test if () are removed for includes -->
|
||||
<!-- <rule ref="PEAR.Files.IncludingFile"/> -->
|
||||
<rule ref="PEAR.Files.IncludingFile" />
|
||||
<!-- Disable some error messages that we do not want. -->
|
||||
<rule ref="PEAR.Files.IncludingFile.UseInclude">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="PEAR.Files.IncludingFile.UseRequire">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="PEAR.Files.IncludingFile.UseRequireOnce">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<rule ref="PEAR.Formatting.MultiLineAssignment" />
|
||||
|
||||
@@ -314,14 +331,14 @@
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule ref="PEAR.Functions.ValidDefaultValue" />
|
||||
|
||||
<rule ref="PEAR.NamingConventions.ValidClassName" />
|
||||
<rule ref="PEAR.NamingConventions.ValidClassName.Invalid">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
@@ -329,7 +346,7 @@
|
||||
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCaptial">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule ref="PEAR.NamingConventions.ValidFunctionName" />
|
||||
|
||||
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore">
|
||||
@@ -346,31 +363,37 @@
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps">
|
||||
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
</rule>-->
|
||||
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
|
||||
<severity>0</severity>
|
||||
</rule>-->
|
||||
<rule ref="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="PEAR.NamingConventions.ValidVariableName" />
|
||||
|
||||
<rule ref="PSR2.Classes.ClassDeclaration" />
|
||||
<rule ref="PSR2.Methods.FunctionClosingBrace" />
|
||||
|
||||
<!-- This is not in PSR2 -->
|
||||
<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" />
|
||||
|
||||
<!-- Need to be commented to be disabled
|
||||
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
-->
|
||||
|
||||
|
||||
<!-- Already found as a Generic rule -->
|
||||
<!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> -->
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
* @since 2008-03-04
|
||||
*/
|
||||
|
||||
require_once('../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php');
|
||||
require_once('../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php');
|
||||
require_once '../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php';
|
||||
require_once '../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php';
|
||||
|
||||
// create new PDF document
|
||||
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||
|
||||
@@ -47,8 +47,8 @@ print 'Files has been created. Check its name from your explorer'."\n";
|
||||
* @since 2008-09-15
|
||||
*/
|
||||
|
||||
require_once('../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php');
|
||||
require_once('../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php');
|
||||
require_once '../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php';
|
||||
require_once '../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php';
|
||||
|
||||
// create new PDF document
|
||||
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||
|
||||
@@ -64,8 +64,7 @@ class autoTranslator
|
||||
// Translate
|
||||
//ini_set('default_charset','UTF-8');
|
||||
ini_set('default_charset',$this->_outputpagecode);
|
||||
$this->parse_refLangTranslationFiles();
|
||||
|
||||
$this->parseRefLangTranslationFiles();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,7 +72,7 @@ class autoTranslator
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function parse_refLangTranslationFiles()
|
||||
private function parseRefLangTranslationFiles()
|
||||
{
|
||||
|
||||
$files = $this->getTranslationFilesArray($this->_refLang);
|
||||
@@ -346,5 +345,4 @@ class autoTranslator
|
||||
|
||||
return $rep;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Include Dolibarr environment
|
||||
require_once($path.'../../htdocs/master.inc.php');
|
||||
require_once($path.'../../htdocs/core/lib/files.lib.php');
|
||||
require_once $path.'../../htdocs/master.inc.php';
|
||||
require_once $path.'../../htdocs/core/lib/files.lib.php';
|
||||
// After this $db is an opened handler to database. We close it at end of file.
|
||||
|
||||
// Load main language strings
|
||||
@@ -88,7 +88,7 @@ if ($argv[2] != 'all')
|
||||
}
|
||||
}
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/../dev/translation/autotranslator.class.php");
|
||||
require_once DOL_DOCUMENT_ROOT."/../dev/translation/autotranslator.class.php";
|
||||
|
||||
$langParser = new autoTranslator($argv[2],$argv[1],$dir,$file,$argv[3]);
|
||||
|
||||
|
||||
@@ -295,6 +295,10 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
|
||||
if (preg_match('/^DescADHERENT_/', $value)) $qualifiedforclean=0;
|
||||
if (preg_match('/^SubmitTranslation/', $value)) $qualifiedforclean=0;
|
||||
if (preg_match('/^ModuleCompanyCode/', $value)) $qualifiedforclean=0;
|
||||
if (preg_match('/InDolibarr$/', $value)) $qualifiedforclean=0;
|
||||
// admin.lang
|
||||
if (preg_match('/^DAV_ALLOW_PUBLIC_DIR/i', $value)) $qualifiedforclean=0;
|
||||
if (preg_match('/^DAV_ALLOW_ECM_DIR/i', $value)) $qualifiedforclean=0;
|
||||
// boxes.lang
|
||||
if (preg_match('/^BoxTitleLast/', $value)) $qualifiedforclean=0;
|
||||
if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0;
|
||||
|
||||
@@ -15,7 +15,7 @@ then
|
||||
echo "This push local files to transifex for project $project."
|
||||
echo "Note: If you push a language file (not source), file will be skipped if transifex file is newer."
|
||||
echo " Using -f will overwrite translation but not memory."
|
||||
echo "Usage: ./dev/translation/txpush.sh (source|xx_XX|all) [-r ".$project.".file] [-f] [--no-interactive]"
|
||||
echo "Usage: ./dev/translation/txpush.sh (source|xx_XX|all) [-r $project.file] [-f] [--no-interactive]"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 268 KiB |
@@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","admin","accountancy","salaries"));
|
||||
|
||||
$mesg = '';
|
||||
@@ -62,9 +63,9 @@ if (! $sortorder) $sortorder = "ASC";
|
||||
$arrayfields=array(
|
||||
'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
||||
'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>0),
|
||||
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1),
|
||||
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
||||
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
||||
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'),
|
||||
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
||||
);
|
||||
|
||||
@@ -120,14 +121,35 @@ if (empty($reshook))
|
||||
if ($country_code)
|
||||
{
|
||||
$sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
|
||||
$result = run_sql($sqlfile, 1, 0, 1);
|
||||
|
||||
$offsetforchartofaccount = 0;
|
||||
// Get the comment line '-- ADD CCCNNNNN to rowid...' to find CCCNNNNN (CCC is country num, NNNNN is id of accounting account)
|
||||
// and pass CCCNNNNN + (num of company * 100 000 000) as offset to the run_sql as a new parameter to say to update sql on the fly to add offset to rowid and account_parent value.
|
||||
// This is to be sure there is no conflict for each chart of account, whatever is country, whatever is company when multicompany is used.
|
||||
$tmp = file_get_contents($sqlfile);
|
||||
if (preg_match('/-- ADD (\d+) to rowid/ims', $tmp, $reg))
|
||||
{
|
||||
$offsetforchartofaccount += $reg[1];
|
||||
}
|
||||
$offsetforchartofaccount+=($conf->entity * 100000000);
|
||||
|
||||
$result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
setEventMessages($langs->trans("ChartLoaded"), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorDuringChartLoad"), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,9 +192,9 @@ $pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, ";
|
||||
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent";
|
||||
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = " . $conf->entity;
|
||||
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = " . $conf->entity;
|
||||
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = " . $conf->entity;
|
||||
$sql .= " WHERE asy.rowid = " . $pcgver;
|
||||
//print $sql;
|
||||
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
|
||||
@@ -225,7 +247,7 @@ if ($resql)
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create">' . $langs->trans("Addanaccount");
|
||||
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle">' . $langs->trans("Addanaccount").'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
|
||||
@@ -405,5 +427,6 @@ if ($resql)
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -41,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("errors","admin","companies","resource","holiday","compta","accountancy","hrm"));
|
||||
|
||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
||||
@@ -523,62 +524,18 @@ if ($id)
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
$align="left";
|
||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||
if ($fieldlist[$field]=='taux') {
|
||||
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
|
||||
else $valuetoshow=$langs->trans("Amount");
|
||||
$align='right';
|
||||
}
|
||||
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("UseLocalTax")." 2"; $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2";}
|
||||
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("UseLocalTax")." 3"; $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3";}
|
||||
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
|
||||
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
|
||||
if ($fieldlist[$field]=='type') {
|
||||
if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,''));
|
||||
else $valuetoshow=$langs->trans("Type");
|
||||
}
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
|
||||
{
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
if ($id != 25) $valuetoshow.="*";
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
|
||||
if ($fieldlist[$field]=='country') {
|
||||
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
||||
$valuetoshow=$langs->trans("Country");
|
||||
}
|
||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; }
|
||||
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
||||
if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $align="center"; }
|
||||
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
|
||||
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
|
||||
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
|
||||
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); }
|
||||
if ($fieldlist[$field]=='country_id') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
|
||||
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountparent"); }
|
||||
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
|
||||
if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); }
|
||||
if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); }
|
||||
if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); }
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); }
|
||||
if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Sens"); }
|
||||
if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); }
|
||||
if ($fieldlist[$field]=='formula') { $valuetoshow=$langs->trans("Formula"); }
|
||||
|
||||
if ($id == 2) // Special cas for state page
|
||||
{
|
||||
if ($fieldlist[$field]=='region_id') { $valuetoshow=' '; $showfield=1; }
|
||||
if ($fieldlist[$field]=='region') { $valuetoshow=$langs->trans("Country").'/'.$langs->trans("Region"); $showfield=1; }
|
||||
}
|
||||
|
||||
if ($valuetoshow != '')
|
||||
{
|
||||
@@ -708,50 +665,15 @@ if ($id)
|
||||
*/
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // By defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||
if ($fieldlist[$field]=='taux') {
|
||||
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
|
||||
else $valuetoshow=$langs->trans("Amount");
|
||||
$align='right';
|
||||
}
|
||||
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("UseLocalTax")." 2"; $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("UseLocalTax")." 3"; $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
|
||||
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
|
||||
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
|
||||
{
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
if ($id != 25) $valuetoshow.="*";
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
|
||||
if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); }
|
||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; }
|
||||
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
||||
if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $align="center"; }
|
||||
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
|
||||
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
|
||||
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
|
||||
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
|
||||
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; }
|
||||
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; }
|
||||
if ($fieldlist[$field]=='country_id') { $showfield=0; }
|
||||
if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
|
||||
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountsparent"); }
|
||||
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
|
||||
if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); }
|
||||
if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); }
|
||||
if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); }
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); }
|
||||
if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Sens"); }
|
||||
if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); }
|
||||
if ($fieldlist[$field]=='formula') { $valuetoshow=$langs->trans("Formula"); }
|
||||
|
||||
// Affiche nom du champ
|
||||
if ($showfield)
|
||||
@@ -831,120 +753,9 @@ if ($id)
|
||||
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
||||
}
|
||||
}
|
||||
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
||||
if(empty($valuetoshow)) $valuetoshow = $langs->trans('None');
|
||||
elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
|
||||
elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
||||
$valuetoshow=price($valuetoshow);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle_facture') {
|
||||
$langs->loadLangs(array("bills"));
|
||||
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
$valuetoshow=nl2br($valuetoshow);
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
|
||||
$key=$langs->trans("Country".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
||||
$langs->loadLangs(array("propal"));
|
||||
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
|
||||
$key=$langs->trans("Action".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
|
||||
$key=$langs->trans("Currency".strtoupper($obj->code_iso));
|
||||
$valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') {
|
||||
$key=$langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') {
|
||||
$key=$langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') {
|
||||
$key=$langs->trans("Civility".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
|
||||
$langs->loadLangs(array("agenda"));
|
||||
$key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') {
|
||||
$langs->loadLangs(array("bills"));
|
||||
$key=$langs->trans("PaymentConditionShort".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
|
||||
$langs->loadLangs(array("bills"));
|
||||
$key=$langs->trans("PaymentType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
|
||||
$key=$langs->trans("DemandReasonType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') {
|
||||
$langs->loadLangs(array("orders"));
|
||||
$key=$langs->trans($obj->code);
|
||||
$valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]};
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') {
|
||||
$langs->loadLangs(array("sendings"));
|
||||
$key=$langs->trans("SendingMethod".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format')
|
||||
{
|
||||
$key = $langs->trans('PaperFormat'.strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
|
||||
{
|
||||
$langs->loadLangs(array("trips"));
|
||||
$key = $langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
||||
else if ($fieldlist[$field]=='country_id') {
|
||||
$showfield=0;
|
||||
}
|
||||
else if ($fieldlist[$field]=='unicode') {
|
||||
$valuetoshow = $langs->getCurrencySymbol($obj->code,1);
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||
$langs->loadLangs(array("products"));
|
||||
$valuetoshow=$langs->trans($obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||
$langs->loadLangs(array("products"));
|
||||
$valuetoshow = $langs->trans($obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
|
||||
{
|
||||
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
|
||||
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='taux') {
|
||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||
$align="right";
|
||||
}
|
||||
else if (in_array($fieldlist[$field],array('recuperableonly')))
|
||||
{
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
|
||||
$valuetoshow = length_accountg($valuetoshow);
|
||||
}
|
||||
|
||||
$class='tddict';
|
||||
if ($fieldlist[$field] == 'tracking') $class.=' tdoverflowauto';
|
||||
@@ -955,17 +766,6 @@ if ($id)
|
||||
|
||||
// Can an entry be erased or disabled ?
|
||||
$iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default
|
||||
if (isset($obj->code) && $id != 10)
|
||||
{
|
||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
|
||||
else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
||||
else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
|
||||
}
|
||||
|
||||
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
|
||||
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; }
|
||||
$canbemodified=$iserasable;
|
||||
if ($obj->code == 'RECEP') $canbemodified=1;
|
||||
|
||||
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'');
|
||||
if ($param) $url .= '&'.$param;
|
||||
@@ -1003,7 +803,7 @@ if ($id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -1054,53 +854,7 @@ function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'region')
|
||||
{
|
||||
print '<td>';
|
||||
$formcompany->select_region($region_id,'region');
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'region_id')
|
||||
{
|
||||
$region_id = (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:0);
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$region_id.'">';
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'lang')
|
||||
{
|
||||
print '<td>';
|
||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang');
|
||||
print '</td>';
|
||||
}
|
||||
// Le type de template
|
||||
elseif ($fieldlist[$field] == 'type_template')
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('type_template', $elementList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''));
|
||||
print '</td>';
|
||||
}
|
||||
// Le type de l'element (pour les type de contact)
|
||||
elseif ($fieldlist[$field] == 'element')
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('element', $elementList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''));
|
||||
print '</td>';
|
||||
}
|
||||
// La source de l'element (pour les type de contact)
|
||||
elseif ($fieldlist[$field] == 'source')
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('source', $sourceList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''));
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm")
|
||||
{
|
||||
print '<td>';
|
||||
print 'user<input type="hidden" name="type" value="user">';
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
||||
elseif ($fieldlist[$field] == 'type_cdr') {
|
||||
if ($fieldlist[$field] == 'type_cdr') print '<td align="center">';
|
||||
else print '<td>';
|
||||
if ($fieldlist[$field] == 'type_cdr') {
|
||||
@@ -1110,49 +864,9 @@ function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) {
|
||||
$align="left";
|
||||
if (in_array($fieldlist[$field],array('taux','localtax1','localtax2'))) $align="right"; // Fields aligned on right
|
||||
print '<td align="'.$align.'">';
|
||||
print '<input type="text" class="flat" value="'.(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" size="3" name="'.$fieldlist[$field].'">';
|
||||
print '</td>';
|
||||
}
|
||||
elseif (in_array($fieldlist[$field], array('libelle_facture'))) {
|
||||
print '<td><textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea></td>';
|
||||
}
|
||||
elseif (in_array($fieldlist[$field], array('content')))
|
||||
{
|
||||
print '<td>';
|
||||
if ($context != 'hide')
|
||||
{
|
||||
//print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
||||
$okforextended=true;
|
||||
$doleditor = new DolEditor($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_5, '90%');
|
||||
print $doleditor->Create(1);
|
||||
}
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
||||
print '<td><input type="text" class="flat" value="'.price((! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')).'" size="8" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
|
||||
print '<td><input type="text" class="flat" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" size="10" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy')
|
||||
{
|
||||
print '<td>';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountancy_account = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print $formaccounting->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
@@ -1160,7 +874,6 @@ function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
|
||||
if ($fieldlist[$field]=='code') $size='size="8" ';
|
||||
if ($fieldlist[$field]=='position') $size='size="4" ';
|
||||
if ($fieldlist[$field]=='libelle') $size='centpercent';
|
||||
if ($fieldlist[$field]=='tracking') $class='centpercent';
|
||||
if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" ';
|
||||
print '<input type="text" '.$size.' class="flat'.($class?' '.$class:'').'" value="'.(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
||||
print '</td>';
|
||||
|
||||
@@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills","accountancy"));
|
||||
|
||||
$mesg = '';
|
||||
@@ -396,6 +397,6 @@ else if ($id > 0 || $ref) {
|
||||
}
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
$db->close();
|
||||
|
||||
@@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills","accountancy"));
|
||||
|
||||
$mesg = '';
|
||||
@@ -183,6 +184,6 @@ if ($action == 'display' || $action == 'delete') {
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("errors","admin","companies","resource","holiday","accountancy","hrm"));
|
||||
|
||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
||||
@@ -799,7 +800,7 @@ if ($id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","admin","accountancy","salaries","loan"));
|
||||
|
||||
// Security check
|
||||
@@ -189,5 +190,6 @@ print '<div class="center"><input type="submit" class="button" value="' . $langs
|
||||
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","admin","accountancy"));
|
||||
|
||||
// Security access
|
||||
@@ -49,11 +50,11 @@ $main_option = array (
|
||||
|
||||
$configuration = AccountancyExport::getTypeConfig();
|
||||
|
||||
$listparam = $configuration[param];
|
||||
$listparam = $configuration['param'];
|
||||
|
||||
$listformat = $configuration[format];
|
||||
$listformat = $configuration['format'];
|
||||
|
||||
$listcr = $configuration[cr];
|
||||
$listcr = $configuration['cr'];
|
||||
|
||||
|
||||
$model_option = array (
|
||||
@@ -78,6 +79,7 @@ $model_option = array (
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
@@ -116,13 +118,15 @@ if ($action == 'update') {
|
||||
if (! $error) {
|
||||
// reload
|
||||
$configuration = AccountancyExport::getTypeConfig();
|
||||
$listparam = $configuration[param];
|
||||
$listparam = $configuration['param'];
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -141,27 +145,27 @@ print ' {'."\n";
|
||||
foreach ($listparam as $key => $param) {
|
||||
print ' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.'")'."\n";
|
||||
print ' {'."\n";
|
||||
print ' //console.log("'.$param[label].'");'."\n";
|
||||
if (empty($param[ACCOUNTING_EXPORT_FORMAT])) {
|
||||
print ' //console.log("'.$param['label'].'");'."\n";
|
||||
if (empty($param['ACCOUNTING_EXPORT_FORMAT'])) {
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$conf->global->ACCOUNTING_EXPORT_FORMAT.'");'."\n";
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'."\n";
|
||||
} else {
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param[ACCOUNTING_EXPORT_FORMAT].'");'."\n";
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param['ACCOUNTING_EXPORT_FORMAT'].'");'."\n";
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'."\n";
|
||||
}
|
||||
if (empty($param[ACCOUNTING_EXPORT_SEPARATORCSV])) {
|
||||
if (empty($param['ACCOUNTING_EXPORT_SEPARATORCSV'])) {
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'."\n";
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'."\n";
|
||||
} else {
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV.'");'."\n";
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'."\n";
|
||||
}
|
||||
if (empty($param[ACCOUNTING_EXPORT_ENDLINE])) {
|
||||
if (empty($param['ACCOUNTING_EXPORT_ENDLINE'])) {
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'."\n";
|
||||
} else {
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'."\n";
|
||||
}
|
||||
if (empty($param[ACCOUNTING_EXPORT_DATE])) {
|
||||
if (empty($param['ACCOUNTING_EXPORT_DATE'])) {
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'."\n";
|
||||
print ' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'."\n";
|
||||
} else {
|
||||
@@ -256,17 +260,17 @@ if ($num2) {
|
||||
print '<tr class="oddeven value">';
|
||||
|
||||
// Param
|
||||
$label = $key[label];
|
||||
$label = $key['label'];
|
||||
print '<td width="50%">' . $langs->trans($label) . '</td>';
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
if (is_array($key[param])) {
|
||||
print $form->selectarray($label, $key[param], $conf->global->$label, 0);
|
||||
if (is_array($key['param'])) {
|
||||
print $form->selectarray($label, $key['param'], $conf->global->$label, 0);
|
||||
} else {
|
||||
print '<input type="text" size="20" id="'. $label .'" name="' . $key[label] . '" value="' . $conf->global->$label . '">';
|
||||
print '<input type="text" size="20" id="'. $label .'" name="' . $key['label'] . '" value="' . $conf->global->$label . '">';
|
||||
}
|
||||
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -277,5 +281,6 @@ print '<div class="center"><input type="submit" class="button" value="' . dol_es
|
||||
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -39,6 +39,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield="f.rowid"; // Set here default search field
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin","compta"));
|
||||
|
||||
// Security check
|
||||
@@ -155,6 +156,6 @@ if ($result)
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
$db->close();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -26,6 +27,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin","compta"));
|
||||
|
||||
// Security check
|
||||
@@ -168,12 +170,12 @@ if ($action == 'create')
|
||||
|
||||
// Date start
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
|
||||
print $form->select_date(($date_start ? $date_start : ''), 'fiscalyear');
|
||||
print $form->selectDate(($date_start ? $date_start : ''), 'fiscalyear');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
|
||||
print $form->select_date(($date_end ? $date_end : - 1), 'fiscalyearend');
|
||||
print $form->selectDate(($date_end ? $date_end : - 1), 'fiscalyearend');
|
||||
print '</td></tr>';
|
||||
|
||||
/*
|
||||
@@ -224,12 +226,12 @@ if ($action == 'create')
|
||||
|
||||
// Date start
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
|
||||
print $form->select_date($object->date_start ? $object->date_start : - 1, 'fiscalyear');
|
||||
print $form->selectDate($object->date_start ? $object->date_start : - 1, 'fiscalyear');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
|
||||
print $form->select_date($object->date_end ? $object->date_end : - 1, 'fiscalyearend');
|
||||
print $form->selectDate($object->date_end ? $object->date_end : - 1, 'fiscalyearend');
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
@@ -317,5 +319,6 @@ if ($action == 'create')
|
||||
}
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -26,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin","compta"));
|
||||
|
||||
// Security check
|
||||
@@ -57,5 +58,6 @@ if ($id) {
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/importaccounts.php
|
||||
* \file htdocs/accountancy/admin/importaccounts.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page import accounting account
|
||||
*/
|
||||
@@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","accountancy"));
|
||||
|
||||
// Security check
|
||||
@@ -83,7 +83,7 @@ if ($_POST["action"] == 'import') {
|
||||
$accounting->pcg_type = $monType;
|
||||
$accounting->pcg_subtype = $monSubType;
|
||||
$accounting->active = 1;
|
||||
|
||||
|
||||
$result = $accounting->create($user);
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("AccountingAccountAdd"), null, 'mesgs');
|
||||
@@ -101,7 +101,7 @@ if ($_POST["action"] == 'import') {
|
||||
print '<div><font color="red">' . $langs->trans("EndProcessing") . '</font></div>';
|
||||
}
|
||||
|
||||
// list accounting account from product
|
||||
// list accounting account from product
|
||||
|
||||
$sql = "(SELECT p.rowid as product_id, p.accountancy_code_sell as accounting ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "product as p ";
|
||||
@@ -172,14 +172,15 @@ if ($result) {
|
||||
print '</tr>';
|
||||
$i ++;
|
||||
}
|
||||
|
||||
|
||||
print '<tr><td colspan="8"> </td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Import") . '"></td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
@@ -32,6 +32,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","admin","accountancy"));
|
||||
|
||||
// Security access
|
||||
@@ -131,6 +132,18 @@ if ($action == 'setdisabledirectinput') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setenabledraftexport') {
|
||||
$setenabledraftexport = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -212,6 +225,19 @@ if (! empty($user->admin))
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
|
||||
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||
@@ -269,5 +295,6 @@ print '<br>';
|
||||
print '<br>';
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Setup page to configure journals
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
@@ -30,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin","compta","accountancy"));
|
||||
|
||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
||||
@@ -126,16 +128,16 @@ complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,
|
||||
|
||||
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
|
||||
$elementList = array();
|
||||
// Must match ids defined into eldy.lib.php
|
||||
$sourceList = array(
|
||||
'1' => $langs->trans('AccountingJournalType1'),
|
||||
'2' => $langs->trans('AccountingJournalType2'),
|
||||
'3' => $langs->trans('AccountingJournalType3'),
|
||||
'4' => $langs->trans('AccountingJournalType4'),
|
||||
'5' => $langs->trans('AccountingJournalType5'),
|
||||
'8' => $langs->trans('AccountingJournalType8'),
|
||||
'9' => $langs->trans('AccountingJournalType9')
|
||||
);
|
||||
// Must match ids defined into eldy.lib.php
|
||||
$sourceList = array(
|
||||
'1' => $langs->trans('AccountingJournalType1'),
|
||||
'2' => $langs->trans('AccountingJournalType2'),
|
||||
'3' => $langs->trans('AccountingJournalType3'),
|
||||
'4' => $langs->trans('AccountingJournalType4'),
|
||||
'5' => $langs->trans('AccountingJournalType5'),
|
||||
'8' => $langs->trans('AccountingJournalType8'),
|
||||
'9' => $langs->trans('AccountingJournalType9'),
|
||||
);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -292,10 +294,10 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||
}
|
||||
|
||||
if (GETPOST('actioncancel'))
|
||||
{
|
||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||
}
|
||||
//if (GETPOST('actioncancel'))
|
||||
//{
|
||||
// $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||
//}
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
||||
{
|
||||
@@ -600,6 +602,7 @@ if ($id)
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
$langs->load("accountancy");
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
|
||||
@@ -610,10 +613,12 @@ if ($id)
|
||||
$valuetoshow=$langs->trans('All');
|
||||
}
|
||||
else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
$key=$langs->trans("AccountingJournalType".strtoupper($obj->nature));
|
||||
$valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($obj->nature)?$key:$obj->{$fieldlist[$field]});
|
||||
$valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature))?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
||||
$valuetoshow=$langs->trans($obj->label);
|
||||
}
|
||||
|
||||
$class='tddict';
|
||||
// Show value for field
|
||||
@@ -678,7 +683,7 @@ if ($id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies","compta","accountancy","products"));
|
||||
|
||||
// Security check
|
||||
@@ -495,5 +495,6 @@ if ($result)
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
$db->close();
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -34,12 +35,12 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
|
||||
// Langs
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
$page = GETPOST("page");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
$sortfield = GETPOST("sortfield");
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
|
||||
@@ -53,7 +54,7 @@ if ($search_accountancy_code_end == - 1) {
|
||||
$search_accountancy_code_end = '';
|
||||
}
|
||||
|
||||
if (GETPOST("exportcsv")) $action = 'export_csv';
|
||||
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
|
||||
|
||||
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
@@ -129,11 +130,6 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
$filter = array();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
if ($action == 'export_csv') {
|
||||
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
@@ -155,13 +151,23 @@ if ($action == 'export_csv') {
|
||||
print price($line->credit - $line->debit) . $sep;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
else {
|
||||
$title_page = $langs->trans("AccountBalance");
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$title_page = $langs->trans("AccountBalance");
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
|
||||
if ($action != 'export_csv')
|
||||
{
|
||||
// List
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
@@ -186,16 +192,16 @@ else {
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
$button = '<input type="submit" name="exportcsv" class="butActionNew" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $result, 'title_accountancy', 0, $button);
|
||||
$button = '<input type="submit" name="exportcsv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, $button, $result, $result, 'title_accountancy', 0);
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= $langs->trans('DateStart') . ': ';
|
||||
$moreforfilter .= $form->select_date($search_date_start?$search_date_start:-1, 'date_start', 0, 0, 1, '', 1, 0, 1);
|
||||
$moreforfilter .= $form->selectDate($search_date_start?$search_date_start:-1, 'date_start', 0, 0, 1, '', 1, 0);
|
||||
$moreforfilter .= $langs->trans('DateEnd') . ': ';
|
||||
$moreforfilter .= $form->select_date($search_date_end?$search_date_end:-1, 'date_end', 0, 0, 1, '', 1, 0, 1);
|
||||
$moreforfilter .= $form->selectDate($search_date_end?$search_date_end:-1, 'date_end', 0, 0, 1, '', 1, 0);
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
if (! empty($moreforfilter)) {
|
||||
@@ -298,7 +304,8 @@ else {
|
||||
print "</table>";
|
||||
print '</form>';
|
||||
|
||||
llxFooter();
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -29,7 +29,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills","compta","accountancy","other"));
|
||||
|
||||
// Filter
|
||||
@@ -71,7 +71,22 @@ if ($result) {
|
||||
$y = $year_current;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width=150>' . $langs->trans("Label") . '</td><td align="center">' . $langs->trans("JanuaryMin") . '</td><td align="center">' . $langs->trans("FebruaryMin") . '</td><td align="center">' . $langs->trans("MarchMin") . '</td><td align="center">' . $langs->trans("AprilMin") . '</td><td align="center">' . $langs->trans("MayMin") . '</td><td align="center">' . $langs->trans("JuneMin") . '</td><td align="center">' . $langs->trans("JulyMin") . '</td><td align="center">' . $langs->trans("AugustMin") . '</td><td align="center">' . $langs->trans("SeptemberMin") . '</td><td align="center">' . $langs->trans("OctoberMin") . '</td><td align="center">' . $langs->trans("NovemberMin") . '</td><td align="center">' . $langs->trans("DecemberMin") . '</td><td align="center"><b>Total</b></td></tr>';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width=150>' . $langs->trans("Label") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("JanuaryMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("FebruaryMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("MarchMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("AprilMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("MayMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("JuneMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("JulyMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("AugustMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("SeptemberMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("OctoberMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("NovemberMin") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("DecemberMin") . '</td>';
|
||||
print '<td align="center"><b>Total</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
$sql = "SELECT bk.numero_compte AS 'compte',";
|
||||
$sql .= " ROUND(SUM(IF(MONTH(bk.doc_date)=1,bk.montant,0)),2) AS 'Janvier',";
|
||||
@@ -125,5 +140,6 @@ if ($resql) {
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
$db->close();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -32,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("accountancy", "bills", "compta"));
|
||||
|
||||
$action = GETPOST('action','aZ09');
|
||||
@@ -349,7 +351,7 @@ if ($action == 'create')
|
||||
print '<tr>';
|
||||
print '<td class="titlefieldcreate fieldrequired">' . $langs->trans("Docdate") . '</td>';
|
||||
print '<td>';
|
||||
print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1);
|
||||
print $html->selectDate('', 'doc_date', '', '', '', "create_mvt", 1, 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -431,7 +433,7 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="setdate">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
$form->select_date($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
|
||||
print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
|
||||
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
|
||||
print '</form>';
|
||||
} else {
|
||||
@@ -554,8 +556,9 @@ if ($action == 'create')
|
||||
*/
|
||||
print "</table>\n";
|
||||
|
||||
print '</div></div>';
|
||||
print '</div>';
|
||||
print '</div></div><!-ee-->';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div style="clear:both"></div>';
|
||||
|
||||
@@ -711,5 +714,7 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -32,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
@@ -438,7 +440,7 @@ $button.= '</a>';
|
||||
|
||||
|
||||
$groupby = ' <a class="nohover marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param.'">' . $langs->trans("GroupByAccountAccounting") . '</a>';
|
||||
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt");
|
||||
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle">' . $langs->trans("NewAccountingMvt").'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
|
||||
@@ -464,11 +466,11 @@ if (! empty($arrayfields['t.doc_date']['checked']))
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('From') . ' ';
|
||||
print $form->select_date($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
|
||||
print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('to') . ' ';
|
||||
print $form->select_date($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
|
||||
print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@@ -555,11 +557,11 @@ if (! empty($arrayfields['t.date_creation']['checked']))
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('From') . ' ';
|
||||
print $form->select_date($search_date_creation_start, 'date_creation_start', 0, 0, 1);
|
||||
print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('to') . ' ';
|
||||
print $form->select_date($search_date_creation_end, 'date_creation_end', 0, 0, 1);
|
||||
print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@@ -569,11 +571,11 @@ if (! empty($arrayfields['t.tms']['checked']))
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('From') . ' ';
|
||||
print $form->select_date($search_date_modification_start, 'date_modification_start', 0, 0, 1);
|
||||
print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $langs->trans('to') . ' ';
|
||||
print $form->select_date($search_date_modification_end, 'date_modification_end', 0, 0, 1);
|
||||
print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1);
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
@@ -747,6 +749,6 @@ print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -33,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
$page = GETPOST("page");
|
||||
@@ -255,7 +257,7 @@ if ($action == 'delbookkeepingyear') {
|
||||
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
|
||||
$viewflat = ' <a class="nohover marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param.'">' . $langs->trans("ViewFlatList") . '</a>';
|
||||
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt");
|
||||
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle">' . $langs->trans("NewAccountingMvt").'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
|
||||
@@ -286,10 +288,10 @@ print '</td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $langs->trans('From') . ': ';
|
||||
print $form->select_date($search_date_start, 'search_date_start', 0, 0, 1);
|
||||
print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1);
|
||||
print '<br>';
|
||||
print $langs->trans('to') . ': ';
|
||||
print $form->select_date($search_date_end, 'search_date_end', 0, 0, 1);
|
||||
print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="' . dol_escape_htmltag($search_doc_ref) . '"/></td>';
|
||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="' . dol_escape_htmltag($search_label_operation) . '"/></td>';
|
||||
@@ -420,5 +422,6 @@ print '</tr>';
|
||||
print "</table>";
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file accounting/bookkeeping/thirdparty_lettrage.php
|
||||
* \file accountancy/bookkeeping/thirdparty_lettrage.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Onglet de gestion de parametrages des ventilations
|
||||
*/
|
||||
@@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
@@ -81,8 +82,9 @@ $socid = GETPOST("socid", 'int');
|
||||
$object = new Societe($db);
|
||||
$object->id = $socid;
|
||||
$result = $object->fetch($socid);
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error, 'errors');
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
@@ -251,7 +253,6 @@ if ($resql) {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var = false;
|
||||
$solde = 0;
|
||||
$tmp = '';
|
||||
while ( $obj = $db->fetch_object($resql) ) {
|
||||
@@ -260,11 +261,10 @@ if ($resql) {
|
||||
$tmp = $obj->lettering_code;
|
||||
|
||||
if ($tmp != $obj->lettering_code || empty($obj->lettering_code))
|
||||
$var = ! $var;
|
||||
|
||||
$solde += ($obj->credit - $obj->debit);
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
if (empty($obj->lettering_code)) {
|
||||
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
|
||||
@@ -292,14 +292,13 @@ if ($resql) {
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td colspan="4">Mouvement totaux</td>' . "\n";
|
||||
print '<td><strong>' . price($debit) . '</strong></td>';
|
||||
print '<td><strong>' . price($credit) . '</strong></td>';
|
||||
print '<td colspan="5"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="9">Solde Comptable</td>' . "\n";
|
||||
print '<td><strong>' . price($credit - $debit) . '</strong></td>';
|
||||
print '<td colspan="5"></td>';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file accounting/bookkeeping/thirdparty_lettrage.php
|
||||
* \file accountancy/bookkeeping/thirdparty_lettrage_supplier.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Tab to setup lettering
|
||||
*/
|
||||
@@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
@@ -85,8 +86,9 @@ $socid = GETPOST("socid", 'int');
|
||||
$object = new Societe($db);
|
||||
$object->id = $socid;
|
||||
$result = $object->fetch($socid);
|
||||
if ($result<0) {
|
||||
setEventMessage($object->error,'errors');
|
||||
if ($result<0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
@@ -132,7 +134,7 @@ if (!empty($search_doc_ref)) $param.='&search_doc_ref='.$search_doc_ref;
|
||||
|
||||
|
||||
/*
|
||||
* Affichage onglets
|
||||
* Display tabs
|
||||
*/
|
||||
$head = societe_prepare_head($object);
|
||||
|
||||
@@ -271,7 +273,6 @@ if ($resql) {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var = false;
|
||||
$solde = 0;
|
||||
$tmp = '';
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
@@ -280,11 +281,10 @@ if ($resql) {
|
||||
$tmp = $obj->lettering_code;
|
||||
|
||||
if ($tmp != $obj->lettering_code || empty($obj->lettering_code))
|
||||
$var = ! $var;
|
||||
|
||||
$solde += ($obj->credit - $obj->debit);
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
if (empty($obj->lettering_code)) {
|
||||
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
|
||||
@@ -319,7 +319,7 @@ if ($resql) {
|
||||
print '<td colspan="5"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="9">Solde Comptable</td>' . "\n";
|
||||
print '<td><strong>' . price($credit - $debit) . '</strong></td>';
|
||||
print '<td colspan="5"></td>';
|
||||
|
||||
@@ -28,27 +28,97 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
/**
|
||||
* Class to manage categories of an accounting account
|
||||
*/
|
||||
class AccountancyCategory // extends CommonObject
|
||||
class AccountancyCategory // extends CommonObject
|
||||
{
|
||||
public $db; //!< To store db handler
|
||||
public $error; //!< To return error code (or message)
|
||||
public $errors=array(); //!< To return several error codes (or messages)
|
||||
public $element='c_accounting_category'; //!< Id that identify managed objects
|
||||
public $table_element='c_accounting_category'; //!< Name of table without prefix where object is stored
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
public $id;
|
||||
/**
|
||||
* @var string Error string
|
||||
* @see errors
|
||||
*/
|
||||
public $error;
|
||||
|
||||
/**
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
public $element='c_accounting_category';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
public $table_element='c_accounting_category';
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $code;
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string Accountancy Category label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $range_account;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $sens;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $category_type;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $formula;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $position;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $fk_country;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $active;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $lines_cptbk;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $lines_display;
|
||||
|
||||
/**
|
||||
* @var mixed Sample property 1
|
||||
*/
|
||||
public $sdc;
|
||||
|
||||
|
||||
@@ -125,18 +195,18 @@ class AccountancyCategory // extends CommonObject
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_accounting_category");
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
//if (! $notrigger)
|
||||
//{
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
//}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@@ -264,18 +334,17 @@ class AccountancyCategory // extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
//if (! $notrigger)
|
||||
//{
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
//}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@@ -320,18 +389,17 @@ class AccountancyCategory // extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
|
||||
//// Call triggers
|
||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
//$interface=new Interfaces($this->db);
|
||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
//// End call triggers
|
||||
}
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action call a trigger.
|
||||
//if (! $notrigger)
|
||||
//{
|
||||
// // Call triggers
|
||||
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
// $interface=new Interfaces($this->db);
|
||||
// $result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// // End call triggers
|
||||
//}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@@ -359,10 +427,13 @@ class AccountancyCategory // extends CommonObject
|
||||
* @param int $id Id
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function display($id) {
|
||||
public function display($id)
|
||||
{
|
||||
global $conf;
|
||||
$sql = "SELECT t.rowid, t.account_number, t.label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t";
|
||||
$sql .= " WHERE t.fk_accounting_category = " . $id;
|
||||
$sql .= " AND t.entity = " . $conf->entity;
|
||||
|
||||
$this->lines_display = array();
|
||||
|
||||
@@ -392,7 +463,8 @@ class AccountancyCategory // extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function getCptBK($id) {
|
||||
public function getCptBK($id)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT t.numero_compte, t.label_operation, t.doc_ref";
|
||||
@@ -400,13 +472,14 @@ class AccountancyCategory // extends CommonObject
|
||||
$sql .= " WHERE t.numero_compte NOT IN (";
|
||||
$sql .= " SELECT t.account_number";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t";
|
||||
$sql .= " WHERE t.fk_accounting_category = " . $id . ")";
|
||||
$sql .= " WHERE t.fk_accounting_category = " . $id . " AND t.entity = " . $conf->entity.")";
|
||||
$sql .= " AND t.numero_compte IN (";
|
||||
$sql .= " SELECT DISTINCT aa.account_number";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql .= " AND aa.active = 1)";
|
||||
$sql .= " AND aa.active = 1";
|
||||
$sql .= " AND aa.entity = = " . $conf->entity . ")";
|
||||
$sql .= " GROUP BY t.numero_compte, t.label_operation, t.doc_ref";
|
||||
$sql .= " ORDER BY t.numero_compte";
|
||||
|
||||
@@ -439,8 +512,9 @@ class AccountancyCategory // extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function getAccountsWithNoCategory($id) {
|
||||
global $conf;
|
||||
public function getAccountsWithNoCategory($id)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT aa.account_number as numero_compte, aa.label as label_compte";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
@@ -448,6 +522,7 @@ class AccountancyCategory // extends CommonObject
|
||||
$sql .= " WHERE (aa.fk_accounting_category != ".$id." OR aa.fk_accounting_category IS NULL)";
|
||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql .= " AND aa.active = 1";
|
||||
$sql .= " AND aa.entity = " . $conf->entity;
|
||||
$sql .= " GROUP BY aa.account_number, aa.label";
|
||||
$sql .= " ORDER BY aa.account_number, aa.label";
|
||||
|
||||
@@ -481,7 +556,8 @@ class AccountancyCategory // extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function updateAccAcc($id_cat, $cpts = array()) {
|
||||
public function updateAccAcc($id_cat, $cpts = array())
|
||||
{
|
||||
global $conf;
|
||||
$error = 0;
|
||||
|
||||
@@ -492,6 +568,7 @@ class AccountancyCategory // extends CommonObject
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql .= " AND aa.active = 1";
|
||||
$sql .= " AND aa.entity = " . $conf->entity;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@@ -543,7 +620,8 @@ class AccountancyCategory // extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function deleteCptCat($cpt_id) {
|
||||
public function deleteCptCat($cpt_id)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
@@ -581,7 +659,7 @@ class AccountancyCategory // extends CommonObject
|
||||
*/
|
||||
public function getCatsCpts()
|
||||
{
|
||||
global $mysoc;
|
||||
global $mysoc,$conf;
|
||||
|
||||
$sql = "";
|
||||
|
||||
@@ -595,8 +673,10 @@ class AccountancyCategory // extends CommonObject
|
||||
$sql .= " WHERE t.fk_accounting_category IN ( SELECT c.rowid ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "c_accounting_category as c";
|
||||
$sql .= " WHERE c.active = 1";
|
||||
$sql .= " AND c.entity = " . $conf->entity;
|
||||
$sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)";
|
||||
$sql .= " AND cat.rowid = t.fk_accounting_category";
|
||||
$sql .= " AND t.entity = " . $conf->entity;
|
||||
$sql .= " ORDER BY cat.position ASC";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -681,11 +761,11 @@ class AccountancyCategory // extends CommonObject
|
||||
* Return list of personalized groups that are active
|
||||
*
|
||||
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
|
||||
* @return array Array of groups
|
||||
* @return array|int Array of groups or -1 if error
|
||||
*/
|
||||
public function getCats($categorytype=-1)
|
||||
{
|
||||
global $db, $langs, $user, $mysoc;
|
||||
global $db, $langs, $user, $mysoc, $conf;
|
||||
|
||||
if (empty($mysoc->country_id)) {
|
||||
dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined');
|
||||
@@ -695,6 +775,7 @@ class AccountancyCategory // extends CommonObject
|
||||
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "c_accounting_category as c";
|
||||
$sql .= " WHERE c.active = 1 ";
|
||||
$sql .= " AND c.entity = " . $conf->entity;
|
||||
if ($categorytype >= 0) $sql.=" AND c.category_type = 1";
|
||||
$sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)";
|
||||
$sql .= " ORDER BY c.position ASC";
|
||||
@@ -737,7 +818,7 @@ class AccountancyCategory // extends CommonObject
|
||||
*
|
||||
* @param int $cat_id Id if personalized accounting group/category
|
||||
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
|
||||
* @return array Array of accounting accounts
|
||||
* @return array|int Array of accounting accounts or -1 if error
|
||||
*/
|
||||
public function getCptsCat($cat_id, $predefinedgroupwhere='')
|
||||
{
|
||||
@@ -791,5 +872,4 @@ class AccountancyCategory // extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ class AccountancyExport
|
||||
/**
|
||||
* @var Type of export. Defined by $conf->global->ACCOUNTING_EXPORT_MODELCSV
|
||||
*/
|
||||
public static $EXPORT_TYPE_NORMAL = 1; // Classic CSV
|
||||
public static $EXPORT_TYPE_NORMAL = 1; // CSV
|
||||
public static $EXPORT_TYPE_CONFIGURABLE = 10; // CSV
|
||||
public static $EXPORT_TYPE_CEGID = 2;
|
||||
public static $EXPORT_TYPE_COALA = 3;
|
||||
public static $EXPORT_TYPE_BOB50 = 4;
|
||||
@@ -53,13 +54,13 @@ class AccountancyExport
|
||||
public static $EXPORT_TYPE_EBP = 7;
|
||||
public static $EXPORT_TYPE_COGILOG = 8;
|
||||
public static $EXPORT_TYPE_AGIRIS = 9;
|
||||
public static $EXPORT_TYPE_CONFIGURABLE = 10;
|
||||
public static $EXPORT_TYPE_FEC = 11;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array ();
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -78,7 +79,8 @@ class AccountancyExport
|
||||
*
|
||||
* @param DoliDb $db Database handler
|
||||
*/
|
||||
public function __construct(DoliDB &$db) {
|
||||
public function __construct(DoliDB &$db)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db = &$db;
|
||||
@@ -91,11 +93,13 @@ class AccountancyExport
|
||||
*
|
||||
* @return array of type
|
||||
*/
|
||||
public static function getType() {
|
||||
public static function getType()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
return array (
|
||||
self::$EXPORT_TYPE_NORMAL => $langs->trans('Modelcsv_normal'),
|
||||
//self::$EXPORT_TYPE_NORMAL => $langs->trans('Modelcsv_normal'),
|
||||
self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans('Modelcsv_configurable'),
|
||||
self::$EXPORT_TYPE_CEGID => $langs->trans('Modelcsv_CEGID'),
|
||||
self::$EXPORT_TYPE_COALA => $langs->trans('Modelcsv_COALA'),
|
||||
self::$EXPORT_TYPE_BOB50 => $langs->trans('Modelcsv_bob50'),
|
||||
@@ -104,27 +108,53 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
|
||||
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
|
||||
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
|
||||
self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans('Modelcsv_configurable'),
|
||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return string to summarize the format (Used to generated export filename)
|
||||
*
|
||||
* @param int $type Format id
|
||||
* @return string Format code
|
||||
*/
|
||||
private static function getFormatCode($type)
|
||||
{
|
||||
$formatcode = array (
|
||||
//self::$EXPORT_TYPE_NORMAL => 'csv',
|
||||
self::$EXPORT_TYPE_CONFIGURABLE => 'csv',
|
||||
self::$EXPORT_TYPE_CEGID => 'cegid',
|
||||
self::$EXPORT_TYPE_COALA => 'coala',
|
||||
self::$EXPORT_TYPE_BOB50 => 'bob50',
|
||||
self::$EXPORT_TYPE_CIEL => 'ciel',
|
||||
self::$EXPORT_TYPE_QUADRATUS => 'quadratus',
|
||||
self::$EXPORT_TYPE_EBP => 'ebp',
|
||||
self::$EXPORT_TYPE_COGILOG => 'cogilog',
|
||||
self::$EXPORT_TYPE_AGIRIS => 'agiris',
|
||||
self::$EXPORT_TYPE_FEC => 'fec',
|
||||
);
|
||||
|
||||
return $formatcode[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Array with all export type available (key + label) and parameters for config
|
||||
*
|
||||
* @return array of type
|
||||
*/
|
||||
public static function getTypeConfig() {
|
||||
public static function getTypeConfig()
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
return array (
|
||||
'param' => array(
|
||||
self::$EXPORT_TYPE_NORMAL => array(
|
||||
/*self::$EXPORT_TYPE_NORMAL => array(
|
||||
'label' => $langs->trans('Modelcsv_normal'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT)?'txt':$conf->global->ACCOUNTING_EXPORT_FORMAT,
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV)?',':$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
|
||||
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
|
||||
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
|
||||
),
|
||||
),*/
|
||||
self::$EXPORT_TYPE_CEGID => array(
|
||||
'label' => $langs->trans('Modelcsv_CEGID'),
|
||||
),
|
||||
@@ -158,6 +188,10 @@ class AccountancyExport
|
||||
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
|
||||
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
|
||||
),
|
||||
self::$EXPORT_TYPE_FEC => array(
|
||||
'label' => $langs->trans('Modelcsv_FEC'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
),
|
||||
),
|
||||
'cr'=> array (
|
||||
'1' => $langs->trans("Unix"),
|
||||
@@ -170,31 +204,30 @@ class AccountancyExport
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download the export
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function downloadFile() {
|
||||
global $conf;
|
||||
$filename = 'general_ledger';
|
||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Function who chose which export to use with the default config
|
||||
*
|
||||
* @param unknown $TData data
|
||||
* @param array $TData data
|
||||
* @return void
|
||||
*/
|
||||
public function export(&$TData) {
|
||||
public function export(&$TData)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
self::downloadFile();
|
||||
|
||||
$filename = 'general_ledger-'.$this->getFormatCode($conf->global->ACCOUNTING_EXPORT_MODELCSV);
|
||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||
|
||||
|
||||
switch ($conf->global->ACCOUNTING_EXPORT_MODELCSV) {
|
||||
case self::$EXPORT_TYPE_NORMAL :
|
||||
$this->exportNormal($TData);
|
||||
/*$this->exportNormal($TData);
|
||||
break;*/
|
||||
case self::$EXPORT_TYPE_CONFIGURABLE :
|
||||
$this->exportConfigurable($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_NORMAL :
|
||||
case self::$EXPORT_TYPE_CEGID :
|
||||
$this->exportCegid($TData);
|
||||
break;
|
||||
@@ -219,8 +252,8 @@ class AccountancyExport
|
||||
case self::$EXPORT_TYPE_AGIRIS :
|
||||
$this->exportAgiris($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_CONFIGURABLE :
|
||||
$this->exportConfigurable($TData);
|
||||
case self::$EXPORT_TYPE_FEC :
|
||||
$this->exportFEC($TData);
|
||||
break;
|
||||
default:
|
||||
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
|
||||
@@ -235,7 +268,9 @@ class AccountancyExport
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportNormal($objectLines) {
|
||||
/* Use $EXPORT_TYPE_CONFIGURABLE instead
|
||||
public function exportNormal($objectLines)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
foreach ( $objectLines as $line ) {
|
||||
@@ -251,6 +286,7 @@ class AccountancyExport
|
||||
print $this->end_line;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Export format : CEGID
|
||||
@@ -259,7 +295,8 @@ class AccountancyExport
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportCegid($objectLines) {
|
||||
public function exportCegid($objectLines)
|
||||
{
|
||||
foreach ( $objectLines as $line ) {
|
||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
$separator = ";";
|
||||
@@ -284,7 +321,8 @@ class AccountancyExport
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportCogilog($objectLines) {
|
||||
public function exportCogilog($objectLines)
|
||||
{
|
||||
foreach ( $objectLines as $line ) {
|
||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
$separator = ";";
|
||||
@@ -317,7 +355,8 @@ class AccountancyExport
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportCoala($objectLines) {
|
||||
public function exportCoala($objectLines)
|
||||
{
|
||||
// Coala export
|
||||
$separator = ";";
|
||||
$end_line = "\n";
|
||||
@@ -344,7 +383,8 @@ class AccountancyExport
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportBob50($objectLines) {
|
||||
public function exportBob50($objectLines)
|
||||
{
|
||||
|
||||
// Bob50
|
||||
$separator = ";";
|
||||
@@ -382,7 +422,8 @@ class AccountancyExport
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportCiel(&$TData) {
|
||||
public function exportCiel(&$TData)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$end_line ="\r\n";
|
||||
@@ -422,12 +463,13 @@ class AccountancyExport
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportQuadratus(&$TData) {
|
||||
public function exportQuadratus(&$TData)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$end_line ="\r\n";
|
||||
|
||||
//We should use dol_now function not time however this is wrong date to transfert in accounting
|
||||
//We should use dol_now function not time however this is wrong date to transfert in accounting
|
||||
//$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
//$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
foreach ( $TData as $data ) {
|
||||
@@ -441,8 +483,8 @@ class AccountancyExport
|
||||
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
|
||||
$Tab['folio'] = '000';
|
||||
|
||||
//We use invoice date $data->doc_date not $date_ecriture which is the transfert date
|
||||
//maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
|
||||
//We use invoice date $data->doc_date not $date_ecriture which is the transfert date
|
||||
//maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
|
||||
//$Tab['date_ecriture'] = $date_ecriture;
|
||||
$Tab['date_ecriture'] = dol_print_date($data->doc_date, '%d%m%y');
|
||||
$Tab['filler'] = ' ';
|
||||
@@ -450,25 +492,25 @@ class AccountancyExport
|
||||
$Tab['sens'] = $data->sens; // C or D
|
||||
$Tab['signe_montant'] = '+';
|
||||
|
||||
//elarifr le montant doit etre en centimes sans point decimal !
|
||||
//elarifr le montant doit etre en centimes sans point decimal !
|
||||
$Tab['montant'] = str_pad(abs($data->montant*100), 12, '0', STR_PAD_LEFT); // TODO manage negative amount
|
||||
// $Tab['montant'] = str_pad(abs($data->montant), 12, '0', STR_PAD_LEFT); // TODO manage negative amount
|
||||
// $Tab['montant'] = str_pad(abs($data->montant), 12, '0', STR_PAD_LEFT); // TODO manage negative amount
|
||||
$Tab['contrepartie'] = str_repeat(' ', 8);
|
||||
|
||||
// elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting
|
||||
// elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting
|
||||
if (! empty($data->date_echeance))
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y' ); // elarifr: format must be ddmmyy
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y' ); // elarifr: format must be ddmmyy
|
||||
else
|
||||
$Tab['date_echeance'] = '000000';
|
||||
|
||||
//elarifr please keep quadra named field lettrage(2) + codestat(3) instead of fake lettrage(5)
|
||||
//elarifr please keep quadra named field lettrage(2) + codestat(3) instead of fake lettrage(5)
|
||||
//$Tab['lettrage'] = str_repeat(' ', 5);
|
||||
$Tab['lettrage'] = str_repeat(' ', 2);
|
||||
$Tab['codestat'] = str_repeat(' ', 3);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 5), 5);
|
||||
|
||||
//elarifr keep correct quadra named field instead of anon filler
|
||||
//elarifr keep correct quadra named field instead of anon filler
|
||||
//$Tab['filler2'] = str_repeat(' ', 20);
|
||||
$Tab['affaire'] = str_repeat(' ', 10);
|
||||
$Tab['quantity1'] = str_repeat(' ', 10);
|
||||
@@ -477,16 +519,16 @@ class AccountancyExport
|
||||
$Tab['code_journal2'] = str_pad(self::trunc($data->code_journal, 3), 3);
|
||||
$Tab['filler3'] = str_repeat(' ', 3);
|
||||
|
||||
//elarifr keep correct quadra named field instead of anon filler libelle_ecriture2 is 30 char not 32 !!!!
|
||||
//as we use utf8, we must remove accent to have only one ascii char instead of utf8 2 chars for specials that report wrong line size that will exceed import format spec
|
||||
//todo we should filter more than only accent to avoid wrong line size
|
||||
//TODO: remove invoice number doc_ref in libelle,
|
||||
//TODO: we should offer an option for customer to build the libelle using invoice number / name / date in accounting software
|
||||
//elarifr keep correct quadra named field instead of anon filler libelle_ecriture2 is 30 char not 32 !!!!
|
||||
//as we use utf8, we must remove accent to have only one ascii char instead of utf8 2 chars for specials that report wrong line size that will exceed import format spec
|
||||
//todo we should filter more than only accent to avoid wrong line size
|
||||
//TODO: remove invoice number doc_ref in libelle,
|
||||
//TODO: we should offer an option for customer to build the libelle using invoice number / name / date in accounting software
|
||||
//$Tab['libelle_ecriture2'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref) . ' ' . dol_string_unaccent($data->label_operation), 30), 30);
|
||||
$Tab['libelle_ecriture2'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 30), 30);
|
||||
$Tab['codetva'] = str_repeat(' ', 2);
|
||||
|
||||
//elarifr we need to keep the 10 lastest number of invoice doc_ref not the beginning part that is the unusefull almost same part
|
||||
//elarifr we need to keep the 10 lastest number of invoice doc_ref not the beginning part that is the unusefull almost same part
|
||||
//$Tab['num_piece3'] = str_pad(self::trunc($data->piece_num, 10), 10);
|
||||
$Tab['num_piece3'] = substr(self::trunc($data->doc_ref, 20), -10);
|
||||
$Tab['filler4'] = str_repeat(' ', 73);
|
||||
@@ -505,7 +547,8 @@ class AccountancyExport
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportEbp($objectLines) {
|
||||
public function exportEbp($objectLines)
|
||||
{
|
||||
|
||||
$separator = ',';
|
||||
$end_line = "\n";
|
||||
@@ -537,7 +580,8 @@ class AccountancyExport
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportAgiris($objectLines) {
|
||||
public function exportAgiris($objectLines)
|
||||
{
|
||||
|
||||
$separator = ';';
|
||||
$end_line = "\n";
|
||||
@@ -574,7 +618,8 @@ class AccountancyExport
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportConfigurable($objectLines) {
|
||||
public function exportConfigurable($objectLines)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
@@ -585,25 +630,121 @@ class AccountancyExport
|
||||
$tab[] = $date;
|
||||
$tab[] = $line->doc_ref;
|
||||
$tab[] = $line->label_operation;
|
||||
$tab[] = length_accountg($line->numero_compte);
|
||||
$tab[] = length_accounta($line->subledger_account);
|
||||
$tab[] = price($line->debit);
|
||||
$tab[] = price($line->credit);
|
||||
$tab[] = price($line->montant);
|
||||
$tab[] = $line->code_journal;
|
||||
$tab[] = length_accountg($line->numero_compte);
|
||||
$tab[] = length_accounta($line->subledger_account);
|
||||
$tab[] = price($line->debit);
|
||||
$tab[] = price($line->credit);
|
||||
$tab[] = price($line->montant);
|
||||
$tab[] = $line->code_journal;
|
||||
|
||||
$separator = $this->separator;
|
||||
print implode($separator, $tab) . $this->end_line;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : FEC
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportFEC($objectLines)
|
||||
{
|
||||
$separator = "\t";
|
||||
$end_line = "\n";
|
||||
|
||||
print "JournalCode" . $separator;
|
||||
print "JournalLib" . $separator;
|
||||
print "EcritureNum" . $separator;
|
||||
print "EcritureDate" . $separator;
|
||||
print "CompteNum" . $separator;
|
||||
print "CompteLib" . $separator;
|
||||
print "CompAuxNum" . $separator;
|
||||
print "CompAuxLib" . $separator;
|
||||
print "PieceRef" . $separator;
|
||||
print "PieceDate" . $separator;
|
||||
print "EcritureLib" . $separator;
|
||||
print "Debit" . $separator;
|
||||
print "Credit" . $separator;
|
||||
print "EcritureLet" . $separator;
|
||||
print "DateLet" . $separator;
|
||||
print "ValidDate" . $separator;
|
||||
print "Montantdevise" . $separator;
|
||||
print "Idevise";
|
||||
print $end_line;
|
||||
|
||||
foreach ( $objectLines as $line ) {
|
||||
$date_creation = dol_print_date($line->date_creation, '%d%m%Y');
|
||||
$date_doc = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
$date_valid = dol_print_date($line->date_validated, '%d%m%Y');
|
||||
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal . $separator;
|
||||
|
||||
// FEC:JournalLib
|
||||
print $line->journal_label . $separator;
|
||||
|
||||
// FEC:EcritureNum
|
||||
print $line->piece_num . $separator;
|
||||
|
||||
// FEC:EcritureDate
|
||||
print $date_creation . $separator;
|
||||
|
||||
// FEC:CompteNum
|
||||
print $line->numero_compte . $separator;
|
||||
|
||||
// FEC:CompteLib
|
||||
print $line->label_compte . $separator;
|
||||
|
||||
// FEC:CompAuxNum
|
||||
print $line->subledger_account . $separator;
|
||||
|
||||
// FEC:CompAuxLib
|
||||
print $line->subledger_label . $separator;
|
||||
|
||||
// FEC:PieceRef
|
||||
print $line->doc_ref . $separator;
|
||||
|
||||
// FEC:PieceDate
|
||||
print $date_doc . $separator;
|
||||
|
||||
// FEC:EcritureLib
|
||||
print $line->label_operation . $separator;
|
||||
|
||||
// FEC:Debit
|
||||
print price2num($line->debit) . $separator;
|
||||
|
||||
// FEC:Credit
|
||||
print price2num($line->credit) . $separator;
|
||||
|
||||
// FEC:EcritureLet
|
||||
print $line->lettering_code . $separator;
|
||||
|
||||
// FEC:DateLet
|
||||
print $line->date_lettering . $separator;
|
||||
|
||||
// FEC:ValidDate
|
||||
print $date_valid . $separator;
|
||||
|
||||
// FEC:Montantdevise
|
||||
print $line->multicurrency_amount . $separator;
|
||||
|
||||
// FEC:Idevise
|
||||
print $line->multicurrency_code;
|
||||
|
||||
print $end_line;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $str data
|
||||
* @param integer $size data
|
||||
* @param string $str data
|
||||
* @param integer $size data
|
||||
* @return string
|
||||
*/
|
||||
public static function trunc($str, $size) {
|
||||
public static function trunc($str, $size)
|
||||
{
|
||||
return dol_trunc($str, $size, 'right', 'UTF-8', 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,22 +28,44 @@
|
||||
*/
|
||||
class AccountancySystem
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
var $rowid;
|
||||
var $fk_pcg_version;
|
||||
var $pcg_type;
|
||||
var $pcg_subtype;
|
||||
var $label;
|
||||
var $account_number;
|
||||
var $account_parent;
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $rowid;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_pcg_version;
|
||||
|
||||
public $pcg_type;
|
||||
public $pcg_subtype;
|
||||
|
||||
/**
|
||||
* @var string Accountancy System label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $account_number;
|
||||
public $account_parent;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db handler
|
||||
*/
|
||||
function __construct($db) {
|
||||
function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
@@ -102,7 +124,8 @@ class AccountancySystem
|
||||
* @param User $user making insert
|
||||
* @return int if KO, Id of line if OK
|
||||
*/
|
||||
function create($user) {
|
||||
function create($user)
|
||||
{
|
||||
$now = dol_now();
|
||||
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_system";
|
||||
@@ -130,4 +153,4 @@ class AccountancySystem
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,15 @@
|
||||
class AccountingAccount extends CommonObject
|
||||
{
|
||||
public $element='accounting_account';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
public $table_element='accounting_account';
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
public $picto = 'billr';
|
||||
|
||||
/**
|
||||
@@ -39,29 +47,72 @@ class AccountingAccount extends CommonObject
|
||||
* @var int
|
||||
*/
|
||||
public $ismultientitymanaged = 1;
|
||||
|
||||
/**
|
||||
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
|
||||
* @var integer
|
||||
*/
|
||||
public $restrictiononfksoc = 1;
|
||||
|
||||
var $db;
|
||||
var $error;
|
||||
var $errors;
|
||||
var $id;
|
||||
var $rowid;
|
||||
var $datec; // Creation date
|
||||
var $fk_pcg_version;
|
||||
var $pcg_type;
|
||||
var $pcg_subtype;
|
||||
var $account_number;
|
||||
var $account_parent;
|
||||
var $account_category;
|
||||
var $label;
|
||||
var $fk_user_author;
|
||||
var $fk_user_modif;
|
||||
var $active; // duplicate with status
|
||||
var $status;
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
/**
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $rowid;
|
||||
|
||||
public $datec; // Creation date
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_pcg_version;
|
||||
|
||||
public $pcg_type;
|
||||
public $pcg_subtype;
|
||||
public $account_number;
|
||||
public $account_parent;
|
||||
public $account_category;
|
||||
|
||||
/**
|
||||
* @var int Status
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* @var string Label of account
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_user_author;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_user_modif;
|
||||
|
||||
public $active; // duplicate with status
|
||||
|
||||
|
||||
/**
|
||||
@@ -69,7 +120,8 @@ class AccountingAccount extends CommonObject
|
||||
*
|
||||
* @param DoliDB $db Database handle
|
||||
*/
|
||||
function __construct($db) {
|
||||
function __construct($db)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db = $db;
|
||||
@@ -84,7 +136,8 @@ class AccountingAccount extends CommonObject
|
||||
* @param int $limittocurrentchart 1=Do not load record if it is into another accounting system
|
||||
* @return int <0 if KO, 0 if not found, Id of record if OK and found
|
||||
*/
|
||||
function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0) {
|
||||
function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if ($rowid || $account_number) {
|
||||
@@ -96,10 +149,10 @@ class AccountingAccount extends CommonObject
|
||||
if ($rowid) {
|
||||
$sql .= " a.rowid = '" . $rowid . "'";
|
||||
} elseif ($account_number) {
|
||||
$sql .= " a.account_number = '" . $account_number . "'";
|
||||
$sql .= " a.account_number = '" . $this->db->escape($account_number) . "'";
|
||||
}
|
||||
if (! empty($limittocurrentchart)) {
|
||||
$sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
|
||||
$sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $this->db->escape($conf->global->CHARTOFACCOUNTS) . ')';
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
|
||||
@@ -145,7 +198,8 @@ class AccountingAccount extends CommonObject
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function create($user, $notrigger = 0) {
|
||||
function create($user, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
$error = 0;
|
||||
$now = dol_now();
|
||||
@@ -201,9 +255,9 @@ class AccountingAccount extends CommonObject
|
||||
$sql .= ", " . (empty($this->pcg_type) ? 'NULL' : "'" . $this->db->escape($this->pcg_type) . "'");
|
||||
$sql .= ", " . (empty($this->pcg_subtype) ? 'NULL' : "'" . $this->db->escape($this->pcg_subtype) . "'");
|
||||
$sql .= ", " . (empty($this->account_number) ? 'NULL' : "'" . $this->db->escape($this->account_number) . "'");
|
||||
$sql .= ", " . (empty($this->account_parent) ? 'NULL' : "'" . $this->db->escape($this->account_parent) . "'");
|
||||
$sql .= ", " . (empty($this->account_parent) ? '0' : "'" . $this->db->escape($this->account_parent) . "'");
|
||||
$sql .= ", " . (empty($this->label) ? 'NULL' : "'" . $this->db->escape($this->label) . "'");
|
||||
$sql .= ", " . (empty($this->account_category) ? 'NULL' : "'" . $this->db->escape($this->account_category) . "'");
|
||||
$sql .= ", " . (empty($this->account_category) ? 0 : $this->db->escape($this->account_category));
|
||||
$sql .= ", " . $user->id;
|
||||
$sql .= ", " . (! isset($this->active) ? 'NULL' : $this->db->escape($this->active));
|
||||
$sql .= ")";
|
||||
@@ -274,7 +328,7 @@ class AccountingAccount extends CommonObject
|
||||
$sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'";
|
||||
$sql .= " , account_parent = '" . $this->db->escape($this->account_parent) . "'";
|
||||
$sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "null");
|
||||
$sql .= " , fk_accounting_category = '" . $this->db->escape($this->account_category) . "'";
|
||||
$sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : $this->db->escape($this->account_category));
|
||||
$sql .= " , fk_user_modif = " . $user->id;
|
||||
$sql .= " , active = " . $this->active;
|
||||
$sql .= " WHERE rowid = " . $this->id;
|
||||
@@ -296,7 +350,8 @@ class AccountingAccount extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function checkUsage() {
|
||||
function checkUsage()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet";
|
||||
@@ -329,7 +384,8 @@ class AccountingAccount extends CommonObject
|
||||
* @param int $notrigger 0=triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user, $notrigger = 0) {
|
||||
function delete($user, $notrigger = 0)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
$result = $this->checkUsage();
|
||||
@@ -390,7 +446,7 @@ class AccountingAccount extends CommonObject
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0, $save_lastsearch_value=-1)
|
||||
{
|
||||
@@ -456,7 +512,8 @@ class AccountingAccount extends CommonObject
|
||||
* @param int $id of record
|
||||
* @return void
|
||||
*/
|
||||
function info($id) {
|
||||
function info($id)
|
||||
{
|
||||
$sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms';
|
||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a';
|
||||
$sql .= ' WHERE a.rowid = ' . $id;
|
||||
@@ -487,13 +544,16 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Account deactivated
|
||||
*
|
||||
* @param int $id Id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function account_desactivate($id) {
|
||||
function account_desactivate($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$result = $this->checkUsage();
|
||||
|
||||
if ($result > 0) {
|
||||
@@ -519,13 +579,16 @@ class AccountingAccount extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Account activated
|
||||
*
|
||||
* @param int $id Id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function account_activate($id) {
|
||||
function account_activate($id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||
@@ -556,6 +619,7 @@ class AccountingAccount extends CommonObject
|
||||
return $this->LibStatut($this->status,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@@ -565,6 +629,7 @@ class AccountingAccount extends CommonObject
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->loadLangs(array("users"));
|
||||
|
||||
@@ -574,27 +639,27 @@ class AccountingAccount extends CommonObject
|
||||
if ($statut == 1) return $langs->trans('Enabled');
|
||||
if ($statut == 0) return $langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
if ($statut == 1) return $langs->trans('Enabled');
|
||||
if ($statut == 0) return $langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||
|
||||
@@ -26,16 +26,44 @@
|
||||
*/
|
||||
class AccountingJournal extends CommonObject
|
||||
{
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
public $element='accounting_journal';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
public $table_element='accounting_journal';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = '';
|
||||
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
/**
|
||||
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
* @var int
|
||||
*/
|
||||
public $ismultientitymanaged = 0;
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
*/
|
||||
public $picto = 'generic';
|
||||
|
||||
var $rowid;
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $rowid;
|
||||
|
||||
public $code;
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string Accounting Journal label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $nature; // 1:various operations, 2:sale, 3:purchase, 4:bank, 5:expense-report, 8:inventory, 9: has-new
|
||||
public $active;
|
||||
|
||||
@@ -46,7 +74,8 @@ class AccountingJournal extends CommonObject
|
||||
*
|
||||
* @param DoliDB $db Database handle
|
||||
*/
|
||||
function __construct($db) {
|
||||
function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
@@ -117,7 +146,8 @@ class AccountingJournal extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') {
|
||||
function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||
{
|
||||
$sql = "SELECT rowid, code, label, nature, active";
|
||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
|
||||
// Manage filter
|
||||
@@ -245,6 +275,7 @@ class AccountingJournal extends CommonObject
|
||||
return $this->LibType($this->nature,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return type of an accounting journal
|
||||
*
|
||||
@@ -254,6 +285,7 @@ class AccountingJournal extends CommonObject
|
||||
*/
|
||||
function LibType($nature,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
@@ -35,19 +35,25 @@ class BookKeeping extends CommonObject
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error;
|
||||
|
||||
/**
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array ();
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
* @var string Id to identify managed objects
|
||||
*/
|
||||
public $element = 'accountingbookkeeping';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
public $table_element = 'accounting_bookkeeping';
|
||||
|
||||
/**
|
||||
* @var int Entity
|
||||
*/
|
||||
public $entity;
|
||||
|
||||
/**
|
||||
@@ -59,14 +65,22 @@ class BookKeeping extends CommonObject
|
||||
* @var int ID
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
*/
|
||||
|
||||
public $doc_date;
|
||||
public $date_lim_reglement;
|
||||
public $doc_type;
|
||||
public $doc_ref;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_doc;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_docdet;
|
||||
|
||||
public $thirdparty_code;
|
||||
public $subledger_account;
|
||||
public $subledger_label;
|
||||
@@ -77,7 +91,12 @@ class BookKeeping extends CommonObject
|
||||
public $credit;
|
||||
public $montant;
|
||||
public $sens;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_user_author;
|
||||
|
||||
public $import_key;
|
||||
public $code_journal;
|
||||
public $journal_label;
|
||||
@@ -88,7 +107,8 @@ class BookKeeping extends CommonObject
|
||||
*
|
||||
* @param DoliDb $db Database handler
|
||||
*/
|
||||
public function __construct(DoliDB $db) {
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
@@ -99,7 +119,8 @@ class BookKeeping extends CommonObject
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
*/
|
||||
public function create(User $user, $notrigger = false) {
|
||||
public function create(User $user, $notrigger = false)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
@@ -328,18 +349,15 @@ class BookKeeping extends CommonObject
|
||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action to call a trigger.
|
||||
//if (! $error && ! $notrigger) {
|
||||
|
||||
if (! $notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action to call a trigger.
|
||||
|
||||
// // Call triggers
|
||||
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
||||
// if ($result < 0) $error++;
|
||||
// // End call triggers
|
||||
}
|
||||
}
|
||||
// // Call triggers
|
||||
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
||||
// if ($result < 0) $error++;
|
||||
// // End call triggers
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
@@ -420,7 +438,8 @@ class BookKeeping extends CommonObject
|
||||
* @param string $mode Mode
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
*/
|
||||
public function createStd(User $user, $notrigger = false, $mode='') {
|
||||
public function createStd(User $user, $notrigger = false, $mode='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
@@ -558,15 +577,15 @@ class BookKeeping extends CommonObject
|
||||
if (! $error) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element . $mode);
|
||||
|
||||
if (! $notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action to call a trigger.
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action to call a trigger.
|
||||
//if (! $notrigger) {
|
||||
|
||||
// // Call triggers
|
||||
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
||||
// if ($result < 0) $error++;
|
||||
// // End call triggers
|
||||
}
|
||||
// // Call triggers
|
||||
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
||||
// if ($result < 0) $error++;
|
||||
// // End call triggers
|
||||
//}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@@ -590,7 +609,8 @@ class BookKeeping extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $ref = null, $mode='') {
|
||||
public function fetch($id, $ref = null, $mode='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
@@ -687,7 +707,8 @@ class BookKeeping extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') {
|
||||
public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
@@ -711,6 +732,10 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.credit,";
|
||||
$sql .= " t.montant,";
|
||||
$sql .= " t.sens,";
|
||||
$sql .= " t.multicurrency_amount,";
|
||||
$sql .= " t.multicurrency_code,";
|
||||
$sql .= " t.lettering_code,";
|
||||
$sql .= " t.date_lettering,";
|
||||
$sql .= " t.fk_user_author,";
|
||||
$sql .= " t.import_key,";
|
||||
$sql .= " t.code_journal,";
|
||||
@@ -779,6 +804,10 @@ class BookKeeping extends CommonObject
|
||||
$line->credit = $obj->credit;
|
||||
$line->montant = $obj->montant;
|
||||
$line->sens = $obj->sens;
|
||||
$line->multicurrency_amount = $obj->multicurrency_amount;
|
||||
$line->multicurrency_code = $obj->multicurrency_code;
|
||||
$line->lettering_code = $obj->lettering_code;
|
||||
$line->date_lettering = $obj->date_lettering;
|
||||
$line->fk_user_author = $obj->fk_user_author;
|
||||
$line->import_key = $obj->import_key;
|
||||
$line->code_journal = $obj->code_journal;
|
||||
@@ -811,7 +840,8 @@ class BookKeeping extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') {
|
||||
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
@@ -1016,7 +1046,8 @@ class BookKeeping extends CommonObject
|
||||
* @param string $mode Mode
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update(User $user, $notrigger = false, $mode='') {
|
||||
public function update(User $user, $notrigger = false, $mode='')
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
@@ -1119,15 +1150,15 @@ class BookKeeping extends CommonObject
|
||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||
}
|
||||
|
||||
if (! $error && ! $notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
//if (! $error && ! $notrigger) {
|
||||
|
||||
// // Call triggers
|
||||
// $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
|
||||
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||
// // End call triggers
|
||||
}
|
||||
// // Call triggers
|
||||
// $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
|
||||
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||
// // End call triggers
|
||||
//}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
@@ -1185,24 +1216,23 @@ class BookKeeping extends CommonObject
|
||||
* @param string $mode Mode
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete(User $user, $notrigger = false, $mode='') {
|
||||
public function delete(User $user, $notrigger = false, $mode='')
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (! $error) {
|
||||
if (! $notrigger) {
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
// Uncomment this and change MYOBJECT to your own tag if you
|
||||
// want this action calls a trigger.
|
||||
//if (! $error && ! $notrigger) {
|
||||
|
||||
// // Call triggers
|
||||
// $result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
||||
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||
// // End call triggers
|
||||
}
|
||||
}
|
||||
// // Call triggers
|
||||
// $result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
||||
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||
// // End call triggers
|
||||
//}
|
||||
|
||||
if (! $error) {
|
||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.$mode;
|
||||
@@ -1234,7 +1264,8 @@ class BookKeeping extends CommonObject
|
||||
* @param string $importkey Import key
|
||||
* @return int Result
|
||||
*/
|
||||
function deleteByImportkey($importkey) {
|
||||
function deleteByImportkey($importkey)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
// first check if line not yet in bookkeeping
|
||||
@@ -1263,7 +1294,8 @@ class BookKeeping extends CommonObject
|
||||
* @param string $mode Mode
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function deleteByYearAndJournal($delyear='', $journal='', $mode='') {
|
||||
function deleteByYearAndJournal($delyear='', $journal='', $mode='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (empty($delyear) && empty($journal))
|
||||
@@ -1302,7 +1334,8 @@ class BookKeeping extends CommonObject
|
||||
* @param int $piecenum Piecenum to delete
|
||||
* @return int Result
|
||||
*/
|
||||
function deleteMvtNum($piecenum) {
|
||||
function deleteMvtNum($piecenum)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db->begin();
|
||||
@@ -1336,7 +1369,8 @@ class BookKeeping extends CommonObject
|
||||
*
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone($fromid) {
|
||||
public function createFromClone($fromid)
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
global $user;
|
||||
@@ -1381,7 +1415,8 @@ class BookKeeping extends CommonObject
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initAsSpecimen() {
|
||||
public function initAsSpecimen()
|
||||
{
|
||||
global $user;
|
||||
|
||||
$now=dol_now();
|
||||
@@ -1417,7 +1452,8 @@ class BookKeeping extends CommonObject
|
||||
* @param string $mode Mode
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetchPerMvt($piecenum, $mode='') {
|
||||
public function fetchPerMvt($piecenum, $mode='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation";
|
||||
@@ -1481,7 +1517,8 @@ class BookKeeping extends CommonObject
|
||||
* @param string $mode Mode
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetchAllPerMvt($piecenum, $mode='') {
|
||||
function fetchAllPerMvt($piecenum, $mode='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||
@@ -1533,13 +1570,16 @@ class BookKeeping extends CommonObject
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Export bookkeping
|
||||
*
|
||||
* @param string $model Model
|
||||
* @return int Result
|
||||
*/
|
||||
function export_bookkeping($model = 'ebp') {
|
||||
function export_bookkeping($model = 'ebp')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||
@@ -1684,19 +1724,22 @@ class BookKeeping extends CommonObject
|
||||
*/
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of accounts with label by chart of accounts
|
||||
*
|
||||
* @param string $selectid Preselected chart of accounts
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param string $selectid Preselected chart of accounts
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param int $showempty Add an empty field
|
||||
* @param array $event Event options
|
||||
* @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1)
|
||||
* @param int $select_out Set value returned by select 0=rowid (default), 1=account_number
|
||||
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '') {
|
||||
*/
|
||||
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
@@ -1753,6 +1796,7 @@ class BookKeeping extends CommonObject
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Description of a root accounting account
|
||||
*
|
||||
@@ -1761,6 +1805,7 @@ class BookKeeping extends CommonObject
|
||||
*/
|
||||
function get_compte_racine($account = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
@@ -1793,6 +1838,7 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Description of accounting account
|
||||
*
|
||||
@@ -1801,6 +1847,7 @@ class BookKeeping extends CommonObject
|
||||
*/
|
||||
function get_compte_desc($account = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
@@ -1838,12 +1885,25 @@ class BookKeeping extends CommonObject
|
||||
*/
|
||||
class BookKeepingLine
|
||||
{
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $id;
|
||||
|
||||
public $doc_date = '';
|
||||
public $doc_type;
|
||||
public $doc_ref;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_doc;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_docdet;
|
||||
|
||||
public $thirdparty_code;
|
||||
public $subledger_account;
|
||||
public $subledger_label;
|
||||
@@ -1854,7 +1914,12 @@ class BookKeepingLine
|
||||
public $credit;
|
||||
public $montant;
|
||||
public $sens;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_user_author;
|
||||
|
||||
public $import_key;
|
||||
public $code_journal;
|
||||
public $journal_label;
|
||||
|
||||
@@ -35,7 +35,7 @@ class lettering extends BookKeeping
|
||||
* lettrageTiers
|
||||
*
|
||||
* @param int $socid Thirdparty id
|
||||
* @return void
|
||||
* @return int 1 OK, <0 error
|
||||
*/
|
||||
public function lettrageTiers($socid)
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills","accountancy"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
@@ -158,5 +159,6 @@ if (! empty($id)) {
|
||||
print "Error ID incorrect";
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
$db->close();
|
||||
|
||||
@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
|
||||
// Langs
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","other","main","accountancy"));
|
||||
|
||||
// Security check
|
||||
@@ -66,38 +66,53 @@ $year_current = $year_start;
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'clean' || $action == 'validatehistory')
|
||||
{
|
||||
// Clean database
|
||||
$db->begin();
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql1 .= " SET fk_code_ventilation = 0";
|
||||
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN';
|
||||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
|
||||
$sql1 .= ' AND fd.fk_facture IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture WHERE entity = '.$conf->entity.')';
|
||||
$sql1 .= ' AND fk_code_ventilation <> 0';
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
// End clean database
|
||||
}
|
||||
|
||||
if ($action == 'validatehistory') {
|
||||
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
|
||||
// First clean corrupted data
|
||||
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sqlclean .= " SET fk_code_ventilation = 0";
|
||||
$sqlclean .= ' WHERE fd.fk_code_ventilation NOT IN ';
|
||||
$sqlclean .= ' (SELECT accnt.rowid ';
|
||||
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
|
||||
$resql = $db->query($sqlclean);
|
||||
|
||||
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
|
||||
if ($db->type == 'pgsql') {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
|
||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
|
||||
$sql1 .= " AND " . MAIN_DB_PREFIX . "facturedet.fk_code_ventilation = 0";
|
||||
} else {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
|
||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
|
||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
||||
}
|
||||
@@ -128,26 +143,6 @@ $textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
|
||||
|
||||
print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');
|
||||
|
||||
// Clean database
|
||||
$db->begin();
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql1 .= " SET fk_code_ventilation = 0";
|
||||
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
|
||||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
setEventMessage($db->lasterror(), 'errors');
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
// End clean database
|
||||
|
||||
print $langs->trans("DescVentilCustomer") . '<br>';
|
||||
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
|
||||
print '<br>';
|
||||
@@ -158,7 +153,7 @@ $y = $year_current;
|
||||
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -234,7 +229,7 @@ print '<br>';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -314,7 +309,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
print '<br>';
|
||||
|
||||
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -420,6 +415,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -33,7 +32,9 @@ require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills","compta","accountancy","productbatch"));
|
||||
|
||||
$account_parent = GETPOST('account_parent');
|
||||
@@ -168,17 +169,18 @@ print '<script type="text/javascript">
|
||||
* Customer Invoice lines
|
||||
*/
|
||||
$sql = "SELECT f.rowid as facid, f.facnumber as ref, f.type, f.datef, f.ref_client,";
|
||||
$sql.= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
||||
$sql.= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
||||
$sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
||||
$sql.= " fd.situation_percent,";
|
||||
$sql.= " co.label as country, s.tva_intra";
|
||||
$sql.= " co.code as country_code, co.label as country,";
|
||||
$sql.= " s.tva_intra";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
@@ -228,7 +230,18 @@ else if ($search_year > 0)
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||
}
|
||||
if (strlen(trim($search_country))) {
|
||||
$sql .= natural_search("co.label", $search_country);
|
||||
$arrayofcode = getCountriesInEEC();
|
||||
$country_code_in_EEC = $country_code_in_EEC_without_me = '';
|
||||
foreach ($arrayofcode as $key => $value)
|
||||
{
|
||||
$country_code_in_EEC.=($country_code_in_EEC ? "," : "")."'".$value."'";
|
||||
if ($value != $mysoc->country_code) $country_code_in_EEC_without_me.=($country_code_in_EEC_without_me ? "," : "")."'".$value."'";
|
||||
}
|
||||
if ($search_country == 'special_allnotme') $sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
|
||||
elseif ($search_country == 'special_eec') $sql .= " AND co.code IN (".$country_code_in_EEC.")";
|
||||
elseif ($search_country == 'special_eecnotme') $sql .= " AND co.code IN (".$country_code_in_EEC_without_me.")";
|
||||
elseif ($search_country == 'special_noteec') $sql .= " AND co.code NOT IN (".$country_code_in_EEC.")";
|
||||
else $sql .= natural_search(array("co.code","co.label"), $search_country);
|
||||
}
|
||||
if (strlen(trim($search_tvaintra))) {
|
||||
$sql .= natural_search("s.tva_intra", $search_tvaintra);
|
||||
@@ -296,9 +309,9 @@ if ($result) {
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
|
||||
print '<td class="liste_titre center nowraponall">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
|
||||
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
|
||||
$formother->select_year($search_year,'search_year',1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
@@ -306,7 +319,10 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1);
|
||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
@@ -342,8 +358,8 @@ if ($result) {
|
||||
|
||||
$product_static->ref = $objp->product_ref;
|
||||
$product_static->id = $objp->product_id;
|
||||
$product_static->type = $objp->type;
|
||||
$product_static->label = $objp->product_label;
|
||||
$product_static->type = $objp->line_type;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@@ -351,7 +367,7 @@ if ($result) {
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
// Ref Invoice
|
||||
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
||||
print '<td class="nowraponall">' . $facture_static->getNomUrl(1) . '</td>';
|
||||
|
||||
print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
|
||||
|
||||
@@ -369,9 +385,10 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
|
||||
print '<td align="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
|
||||
|
||||
print '<td>' . $objp->country .'</td>';
|
||||
print '<td>' . $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')</td>';
|
||||
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
|
||||
@@ -399,6 +416,6 @@ if ($result) {
|
||||
print $db->lasterror();
|
||||
}
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -34,8 +34,9 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills","compta","accountancy","other","productbatch"));
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
@@ -201,8 +202,9 @@ llxHeader('', $langs->trans("Ventilation"));
|
||||
if (empty($chartaccountcode))
|
||||
{
|
||||
print $langs->trans("ErrorChartOfAccountSystemNotSelected");
|
||||
llxFooter();
|
||||
$db->close();
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -211,7 +213,8 @@ $sql = "SELECT f.rowid as facid, f.facnumber as ref, f.datef, f.type as ftype,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " aa.rowid as aarowid,";
|
||||
$sql.= " co.label as country, s.tva_intra";
|
||||
$sql.= " co.code as country_code, co.label as country,";
|
||||
$sql.= " s.tva_intra";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
@@ -220,9 +223,9 @@ $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.fk_pcg_version = '" . $chartaccountcode."'";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.fk_pcg_version = '" . $chartaccountcode."'";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.fk_pcg_version = '" . $chartaccountcode."' AND aa2.entity = " . $conf->entity;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.fk_pcg_version = '" . $chartaccountcode."' AND aa3.entity = " . $conf->entity;
|
||||
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql.= " AND l.product_type <= 2";
|
||||
// Add search filter like
|
||||
@@ -264,7 +267,18 @@ else if ($search_year > 0)
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||
}
|
||||
if (strlen(trim($search_country))) {
|
||||
$sql .= natural_search("co.label", $search_country);
|
||||
$arrayofcode = getCountriesInEEC();
|
||||
$country_code_in_EEC = $country_code_in_EEC_without_me = '';
|
||||
foreach ($arrayofcode as $key => $value)
|
||||
{
|
||||
$country_code_in_EEC.=($country_code_in_EEC ? "," : "")."'".$value."'";
|
||||
if ($value != $mysoc->country_code) $country_code_in_EEC_without_me.=($country_code_in_EEC_without_me ? "," : "")."'".$value."'";
|
||||
}
|
||||
if ($search_country == 'special_allnotme') $sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
|
||||
elseif ($search_country == 'special_eec') $sql .= " AND co.code IN (".$country_code_in_EEC.")";
|
||||
elseif ($search_country == 'special_eecnotme') $sql .= " AND co.code IN (".$country_code_in_EEC_without_me.")";
|
||||
elseif ($search_country == 'special_noteec') $sql .= " AND co.code NOT IN (".$country_code_in_EEC.")";
|
||||
else $sql .= natural_search(array("co.code","co.label"), $search_country);
|
||||
}
|
||||
if (strlen(trim($search_tvaintra))) {
|
||||
$sql .= natural_search("s.tva_intra", $search_tvaintra);
|
||||
@@ -361,8 +375,8 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre center nowraponall">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
$formother->select_year($search_year,'search_year',1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
@@ -370,7 +384,10 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50 right" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1);
|
||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
@@ -449,7 +466,7 @@ if ($result) {
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
// Ref Invoice
|
||||
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
||||
print '<td class="nowraponall">' . $facture_static->getNomUrl(1) . '</td>';
|
||||
|
||||
print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
|
||||
|
||||
@@ -524,5 +541,6 @@ jQuery(document).ready(function() {
|
||||
});
|
||||
</script>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -31,6 +31,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills","accountancy","trips"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
@@ -166,5 +167,6 @@ if (! empty($id)) {
|
||||
print "Error ID incorrect";
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
$db->close();
|
||||
|
||||
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
|
||||
// Langs
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","other","main","accountancy"));
|
||||
|
||||
// Security check
|
||||
@@ -68,33 +68,48 @@ $action = GETPOST('action','aZ09');
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'clean' || $action == 'validatehistory')
|
||||
{
|
||||
// Clean database
|
||||
$db->begin();
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql1 .= " SET fk_code_ventilation = 0";
|
||||
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN';
|
||||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
|
||||
$sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'expensereport WHERE entity = '.$conf->entity.')';
|
||||
$sql1 .= ' AND fk_code_ventilation <> 0';
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
// End clean database
|
||||
}
|
||||
|
||||
if ($action == 'validatehistory') {
|
||||
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
|
||||
// First clean corrupted data
|
||||
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sqlclean .= " SET fk_code_ventilation = 0";
|
||||
$sqlclean .= ' WHERE erd.fk_code_ventilation NOT IN ';
|
||||
$sqlclean .= ' (SELECT accnt.rowid ';
|
||||
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
|
||||
$resql = $db->query($sqlclean);
|
||||
|
||||
// Now make the binding
|
||||
if ($db->type == 'pgsql') {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det";
|
||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
|
||||
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code = accnt.account_number";
|
||||
$sql1 .= " AND " . MAIN_DB_PREFIX . "expensereport_det.fk_code_ventilation = 0";
|
||||
} else {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd, " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
$sql1 .= " SET erd.fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
|
||||
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code=accnt.account_number";
|
||||
$sql1 .= " AND erd.fk_code_ventilation = 0";
|
||||
}
|
||||
@@ -124,26 +139,6 @@ $textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
|
||||
|
||||
print load_fiche_titre($langs->trans("ExpenseReportsVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');
|
||||
|
||||
// Clean database
|
||||
$db->begin();
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql1 .= " SET fk_code_ventilation = 0";
|
||||
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN ';
|
||||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
setEventMessage($db->lasterror(), 'errors');
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
// End clean database
|
||||
|
||||
print $langs->trans("DescVentilExpenseReport") . '<br>';
|
||||
print $langs->trans("DescVentilExpenseReportMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
|
||||
print '<br>';
|
||||
@@ -155,7 +150,7 @@ $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' .
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -226,7 +221,7 @@ print '<br>';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@@ -302,7 +297,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
print '<br>';
|
||||
|
||||
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -350,5 +345,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","other","accountancy","trips","productbatch"));
|
||||
|
||||
$account_parent = GETPOST('account_parent','int');
|
||||
@@ -101,10 +102,10 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql1 .= " SET erd.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
|
||||
$sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
@@ -235,8 +236,6 @@ if ($result) {
|
||||
if ($search_day) $param .= '&search_day='.urlencode($search_day);
|
||||
if ($search_month) $param .= '&search_month='.urlencode($search_month);
|
||||
if ($search_year) $param .= '&search_year='.urlencode($search_year);
|
||||
if ($search_country) $param .= "&search_country=" . urlencode($search_country);
|
||||
if ($search_tvaintra) $param .= "&search_tvaintra=" . urlencode($search_tvaintra);
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
@@ -348,6 +347,6 @@ if ($result) {
|
||||
print $db->lasterror();
|
||||
}
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills","compta","accountancy","other","trips","productbatch"));
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
@@ -180,8 +180,9 @@ llxHeader('', $langs->trans("ExpenseReportsVentilation"));
|
||||
if (empty($chartaccountcode))
|
||||
{
|
||||
print $langs->trans("ErrorChartOfAccountSystemNotSelected");
|
||||
llxFooter();
|
||||
$db->close();
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -193,7 +194,7 @@ $sql.= " aa.rowid as aarowid";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "expensereport_det as erd ON er.rowid = erd.fk_expensereport";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
|
||||
$sql.= " WHERE er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0";
|
||||
// Add search filter like
|
||||
if (strlen(trim($search_expensereport))) {
|
||||
@@ -308,8 +309,8 @@ if ($result) {
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
$formother->select_year($search_year,'search_year',1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
@@ -422,5 +423,6 @@ jQuery(document).ready(function() {
|
||||
});
|
||||
</script>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -26,6 +26,7 @@ require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict"));
|
||||
|
||||
// Security check
|
||||
@@ -54,7 +55,7 @@ if ($conf->accounting->enabled)
|
||||
print $langs->trans("AccountancyAreaDescIntro")."<br>\n";
|
||||
print "<br>\n";print "<br>\n";
|
||||
|
||||
print_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
|
||||
@@ -75,7 +76,7 @@ if ($conf->accounting->enabled)
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
@@ -130,7 +131,7 @@ if ($conf->accounting->enabled)
|
||||
|
||||
|
||||
print "<br>\n";
|
||||
print_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
|
||||
print load_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
$step = 0;
|
||||
@@ -162,5 +163,6 @@ else
|
||||
print $langs->trans("Module10Desc")."<br>\n";
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -24,9 +24,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/journal/bankjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page with bank journal
|
||||
* \file htdocs/accountancy/journal/bankjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page with bank journal
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
|
||||
@@ -53,8 +53,11 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/paymentvarious.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/loan/class/loan.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/loan/class/paymentloan.class.php';
|
||||
|
||||
$langs->loadLangs(array("companies","other","compta","banks",'bills','donations',"accountancy","trips","salaries","hrm"));
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies","other","compta","banks","bills","donations","loan","accountancy","trips","salaries","hrm"));
|
||||
|
||||
// Multi journal
|
||||
$id_journal = GETPOST('id_journal', 'int');
|
||||
@@ -143,6 +146,8 @@ $paymentvatstatic = new TVA($db);
|
||||
$paymentsalstatic = new PaymentSalary($db);
|
||||
$paymentexpensereportstatic = new PaymentExpenseReport($db);
|
||||
$paymentvariousstatic = new PaymentVarious($db);
|
||||
$paymentloanstatic = new PaymentLoan($db);
|
||||
$accountLinestatic=new AccountLine($db);
|
||||
|
||||
// Get code of finance journal
|
||||
$accountingjournalstatic = new AccountingJournal($db);
|
||||
@@ -254,7 +259,7 @@ if ($result) {
|
||||
// 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', 'payment_salary', 'payment_various')))
|
||||
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'payment_loan', 'payment_salary', 'payment_various')))
|
||||
{
|
||||
// So we excluded 'company' and 'user' here. We want only payment lines
|
||||
|
||||
@@ -358,8 +363,16 @@ if ($result) {
|
||||
$paymentvariousstatic->fetch($paymentvariousstatic->id);
|
||||
$account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word
|
||||
$tabtp[$obj->rowid][$account_various] += $obj->amount;
|
||||
} else if ($links[$key]['type'] == 'payment_loan') {
|
||||
$paymentloanstatic->id = $links[$key]['url_id'];
|
||||
$paymentloanstatic->ref = $links[$key]['url_id'];
|
||||
$paymentloanstatic->fk_loan = $links[$key]['url_id'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentloanstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id;
|
||||
//$tabtp[$obj->rowid][$account_pay_loan] += $obj->amount;
|
||||
} else if ($links[$key]['type'] == 'banktransfert') {
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer");
|
||||
$accountLinestatic->fetch($links[$key]['url_id']);
|
||||
$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- ' .$accountLinestatic ->getNomUrl(1);
|
||||
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
|
||||
$bankaccountstatic->fetch($tabpay[$obj->rowid]['fk_bank_account']);
|
||||
$tabpay[$obj->rowid]["soclib"] = $bankaccountstatic->getNomUrl(2);
|
||||
@@ -548,6 +561,11 @@ if (! $error && $action == 'writebookkeeping') {
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = '';
|
||||
} else if ($tabtype[$key] == 'payment_loan') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = '';
|
||||
} else if ($tabtype[$key] == 'payment_various') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
@@ -713,8 +731,8 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"' . $langs->trans("LedgerAccount") . '"' . $sep;
|
||||
print '"' . $langs->trans("SubledgerAccount") . '"' . $sep;
|
||||
print '"' . $langs->trans("Label"). '"' . $sep;
|
||||
print '"' . $langs->trans("Amount") . '"' . $sep;
|
||||
print '"' . $langs->trans("Amount") . '"' . $sep;
|
||||
print '"' . $langs->trans("Debit") . '"' . $sep;
|
||||
print '"' . $langs->trans("Credit") . '"' . $sep;
|
||||
print '"' . $langs->trans("Journal") . '"' . $sep;
|
||||
print '"' . $langs->trans("Note") . '"' . $sep;
|
||||
print "\n";
|
||||
@@ -822,18 +840,20 @@ if (empty($action) || $action == 'view') {
|
||||
$expensereportstatic = new ExpenseReport($db);
|
||||
$vatstatic = new Tva($db);
|
||||
$donationstatic = new Don($db);
|
||||
$loanstatic = new Loan($db);
|
||||
$salarystatic = new PaymentSalary($db);
|
||||
$variousstatic = new PaymentVarious($db);
|
||||
|
||||
llxHeader('', $langs->trans("FinanceJournal"));
|
||||
|
||||
$nom = $langs->trans("FinanceJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
|
||||
$nom = $langs->trans("FinanceJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1);
|
||||
$builddate=dol_now();
|
||||
//$description = $langs->trans("DescFinanceJournal") . '<br>';
|
||||
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||
|
||||
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
||||
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||
|
||||
$varlink = 'id_journal=' . $id_journal;
|
||||
|
||||
@@ -865,7 +885,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
|
||||
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
|
||||
if ($in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||
else print '<a class="butActionRefused" name="writebookkeeping">' . $langs->trans("WriteBookKeeping") . '</a>';
|
||||
print '</div>';
|
||||
@@ -893,7 +913,7 @@ if (empty($action) || $action == 'view') {
|
||||
print '<br>';
|
||||
|
||||
$i = 0;
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<div class="div-table-responsive">';
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print "<td></td>";
|
||||
@@ -1119,6 +1139,9 @@ function getSourceDocRef($val, $typerecord)
|
||||
if ($ref == '(ExpenseReportPayment)') {
|
||||
$ref = $langs->trans('Employee');
|
||||
}
|
||||
if ($ref == '(LoanPayment)') {
|
||||
$ref = $langs->trans('Loan');
|
||||
}
|
||||
if ($ref == '(payment_salary)') {
|
||||
$ref = $langs->trans('Employee');
|
||||
}
|
||||
@@ -1173,6 +1196,13 @@ function getSourceDocRef($val, $typerecord)
|
||||
$sqlmid .= " WHERE payd.fk_donation=" . $val["paymentdonationid"];
|
||||
$ref = $langs->trans("Donation");
|
||||
}
|
||||
elseif ($typerecord == 'payment_loan')
|
||||
{
|
||||
$sqlmid = 'SELECT l.rowid as ref';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_loan as l";
|
||||
$sqlmid .= " WHERE l.rowid=" . $val["paymentloanid"];
|
||||
$ref = $langs->trans("LoanPayment");
|
||||
}
|
||||
elseif ($typerecord == 'payment_various')
|
||||
{
|
||||
$sqlmid = 'SELECT v.rowid as ref';
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -36,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("commercial", "compta","bills","other","accountancy","trips","errors"));
|
||||
|
||||
$id_journal = GETPOST('id_journal', 'int');
|
||||
@@ -398,11 +400,13 @@ if ($action == 'writebookkeeping') {
|
||||
$param.='&date_endmonth='.$date_endmonth;
|
||||
$param.='&date_endyear='.$date_endyear;
|
||||
$param.='&in_bookkeeping='.$in_bookkeeping;
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF'].($param?'?'.$param:''));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -525,7 +529,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
llxHeader('', $langs->trans("ExpenseReportsJournal"));
|
||||
|
||||
$nom = $langs->trans("ExpenseReportsJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
|
||||
$nom = $langs->trans("ExpenseReportsJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1);
|
||||
$nomlink = '';
|
||||
$periodlink = '';
|
||||
$exportlink = '';
|
||||
@@ -533,7 +537,8 @@ if (empty($action) || $action == 'view') {
|
||||
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||
|
||||
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
||||
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||
|
||||
$varlink = 'id_journal=' . $id_journal;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -36,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("commercial", "compta","bills","other","accountancy","errors"));
|
||||
|
||||
$id_journal = GETPOST('id_journal', 'int');
|
||||
@@ -712,7 +714,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
llxHeader('', $langs->trans("PurchasesJournal"));
|
||||
|
||||
$nom = $langs->trans("PurchasesJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
|
||||
$nom = $langs->trans("PurchasesJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1);
|
||||
$nomlink = '';
|
||||
$periodlink = '';
|
||||
$exportlink = '';
|
||||
@@ -725,7 +727,8 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
|
||||
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
||||
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||
|
||||
$varlink = 'id_journal=' . $id_journal;
|
||||
|
||||
@@ -737,7 +740,7 @@ if (empty($action) || $action == 'view') {
|
||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
|
||||
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
|
||||
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
|
||||
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -39,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("commercial", "compta","bills","other","accountancy","errors"));
|
||||
|
||||
$id_journal = GETPOST('id_journal', 'int');
|
||||
@@ -59,11 +61,15 @@ $now = dol_now();
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
|
||||
$hookmanager->initHooks(array('sellsjournal'));
|
||||
$parameters=array();
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
// Get informations of journal
|
||||
$accountingjournalstatic = new AccountingJournal($db);
|
||||
$accountingjournalstatic->fetch($id_journal);
|
||||
@@ -643,7 +649,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
llxHeader('', $langs->trans("SellsJournal"));
|
||||
|
||||
$nom = $langs->trans("SellsJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
|
||||
$nom = $langs->trans("SellsJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1);
|
||||
$nomlink = '';
|
||||
$periodlink = '';
|
||||
$exportlink = '';
|
||||
@@ -655,7 +661,8 @@ if (empty($action) || $action == 'view') {
|
||||
$description .= $langs->trans("DepositsAreIncluded");
|
||||
|
||||
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
||||
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||
|
||||
$varlink = 'id_journal=' . $id_journal;
|
||||
|
||||
@@ -667,7 +674,7 @@ if (empty($action) || $action == 'view') {
|
||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
|
||||
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
|
||||
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
|
||||
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills","accountancy"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
@@ -161,5 +162,6 @@ if (! empty($id)) {
|
||||
print "Error ID incorrect";
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
$db->close();
|
||||
|
||||
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
|
||||
// Langs
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","other","main","accountancy"));
|
||||
|
||||
// Security check
|
||||
@@ -69,33 +69,48 @@ $action = GETPOST('action','aZ09');
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'clean' || $action == 'validatehistory')
|
||||
{
|
||||
// Clean database
|
||||
$db->begin();
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
|
||||
$sql1 .= " SET fk_code_ventilation = 0";
|
||||
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN';
|
||||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
|
||||
$sql1 .= ' AND fd.fk_facture_fourn IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture_fourn WHERE entity = '.$conf->entity.')';
|
||||
$sql1 .= ' AND fk_code_ventilation <> 0';
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
// End clean database
|
||||
}
|
||||
|
||||
if ($action == 'validatehistory') {
|
||||
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
|
||||
// First clean corrupted data
|
||||
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
|
||||
$sqlclean .= " SET fk_code_ventilation = 0";
|
||||
$sqlclean .= ' WHERE fd.fk_code_ventilation NOT IN ';
|
||||
$sqlclean .= ' (SELECT accnt.rowid ';
|
||||
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
|
||||
$resql = $db->query($sqlclean);
|
||||
|
||||
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
|
||||
if ($db->type == 'pgsql') {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
|
||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
|
||||
$sql1 .= " AND " . MAIN_DB_PREFIX . "facture_fourn_det.fk_code_ventilation = 0";
|
||||
} else {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
|
||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
|
||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
||||
}
|
||||
@@ -125,26 +140,6 @@ $textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
|
||||
|
||||
print load_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');
|
||||
|
||||
// Clean database
|
||||
$db->begin();
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
|
||||
$sql1 .= " SET fk_code_ventilation = 0";
|
||||
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
|
||||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
setEventMessage($db->lasterror(), 'errors');
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
// End clean database
|
||||
|
||||
print $langs->trans("DescVentilSupplier") . '<br>';
|
||||
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
|
||||
print '<br>';
|
||||
@@ -155,7 +150,7 @@ $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' .
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -226,7 +221,7 @@ print '<br>';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -300,7 +295,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
print '<br>';
|
||||
|
||||
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -347,6 +342,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -34,7 +34,9 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta","bills","other","accountancy","productbatch"));
|
||||
|
||||
$account_parent = GETPOST('account_parent');
|
||||
@@ -169,20 +171,21 @@ print '<script type="text/javascript">
|
||||
* Supplier Invoice lines
|
||||
*/
|
||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
|
||||
$sql.= " l.rowid, l.fk_product, l.product_type as line_type, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
|
||||
$sql.= " aa.label, aa.account_number, ";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, co.label as country, s.tva_intra";
|
||||
$sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type,";
|
||||
$sql.= " co.code as country_code, co.label as country,";
|
||||
$sql.= " s.tva_intra";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql.= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
||||
$sql.= " AND aa.rowid = l.fk_code_ventilation";
|
||||
if ($search_lineid) {
|
||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||
}
|
||||
@@ -221,7 +224,18 @@ else if ($search_year > 0)
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||
}
|
||||
if (strlen(trim($search_country))) {
|
||||
$sql .= natural_search("co.label", $search_country);
|
||||
$arrayofcode = getCountriesInEEC();
|
||||
$country_code_in_EEC = $country_code_in_EEC_without_me = '';
|
||||
foreach ($arrayofcode as $key => $value)
|
||||
{
|
||||
$country_code_in_EEC.=($country_code_in_EEC ? "," : "")."'".$value."'";
|
||||
if ($value != $mysoc->country_code) $country_code_in_EEC_without_me.=($country_code_in_EEC_without_me ? "," : "")."'".$value."'";
|
||||
}
|
||||
if ($search_country == 'special_allnotme') $sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
|
||||
elseif ($search_country == 'special_eec') $sql .= " AND co.code IN (".$country_code_in_EEC.")";
|
||||
elseif ($search_country == 'special_eecnotme') $sql .= " AND co.code IN (".$country_code_in_EEC_without_me.")";
|
||||
elseif ($search_country == 'special_noteec') $sql .= " AND co.code NOT IN (".$country_code_in_EEC.")";
|
||||
else $sql .= natural_search(array("co.code","co.label"), $search_country);
|
||||
}
|
||||
if (strlen(trim($search_tvaintra))) {
|
||||
$sql .= natural_search("s.tva_intra", $search_tvaintra);
|
||||
@@ -299,9 +313,9 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
print '<td class="liste_titre center nowraponall">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
$formother->select_year($search_year,'search_year',1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
@@ -309,7 +323,10 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1);
|
||||
// print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
@@ -348,8 +365,8 @@ if ($result) {
|
||||
|
||||
$product_static->ref = $objp->product_ref;
|
||||
$product_static->id = $objp->product_id;
|
||||
$product_static->type = $objp->type;
|
||||
$product_static->label = $objp->product_label;
|
||||
$product_static->type = $objp->line_type;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@@ -357,7 +374,7 @@ if ($result) {
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
// Ref Invoice
|
||||
print '<td>' . $facturefournisseur_static->getNomUrl(1) . '</td>';
|
||||
print '<td class="nowraponall">' . $facturefournisseur_static->getNomUrl(1) . '</td>';
|
||||
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
print $objp->invoice_label;
|
||||
@@ -380,9 +397,11 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
|
||||
print '<td align="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
|
||||
|
||||
print '<td>' . $objp->country .'</td>';
|
||||
print '<td>' . $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')</td>';
|
||||
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
@@ -406,7 +425,6 @@ if ($result) {
|
||||
print $db->lasterror();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -34,8 +34,9 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills","compta","accountancy","other","productbatch"));
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
@@ -202,8 +203,9 @@ llxHeader('', $langs->trans("SuppliersVentilation"));
|
||||
if (empty($chartaccountcode))
|
||||
{
|
||||
print $langs->trans("ErrorChartOfAccountSystemNotSelected");
|
||||
llxFooter();
|
||||
$db->close();
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -212,7 +214,8 @@ $sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_lab
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " aa.rowid as aarowid,";
|
||||
$sql.= " co.label as country, s.tva_intra";
|
||||
$sql.= " co.code as country_code, co.label as country,";
|
||||
$sql.= " s.tva_intra";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
@@ -221,7 +224,7 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
|
||||
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql.= " AND l.product_type <= 2";
|
||||
// Add search filter like
|
||||
@@ -249,9 +252,6 @@ if (strlen(trim($search_account))) {
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= natural_search("l.tva_tx", price2num($search_vat), 1);
|
||||
}
|
||||
if (strlen(trim($search_tvaintra))) {
|
||||
$sql .= natural_search("s.tva_intra", $search_tvaintra);
|
||||
}
|
||||
if ($search_month > 0)
|
||||
{
|
||||
if ($search_year > 0 && empty($search_day))
|
||||
@@ -266,7 +266,21 @@ else if ($search_year > 0)
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||
}
|
||||
if (strlen(trim($search_country))) {
|
||||
$sql .= natural_search("co.label", $search_country);
|
||||
$arrayofcode = getCountriesInEEC();
|
||||
$country_code_in_EEC = $country_code_in_EEC_without_me = '';
|
||||
foreach ($arrayofcode as $key => $value)
|
||||
{
|
||||
$country_code_in_EEC.=($country_code_in_EEC ? "," : "")."'".$value."'";
|
||||
if ($value != $mysoc->country_code) $country_code_in_EEC_without_me.=($country_code_in_EEC_without_me ? "," : "")."'".$value."'";
|
||||
}
|
||||
if ($search_country == 'special_allnotme') $sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
|
||||
elseif ($search_country == 'special_eec') $sql .= " AND co.code IN (".$country_code_in_EEC.")";
|
||||
elseif ($search_country == 'special_eecnotme') $sql .= " AND co.code IN (".$country_code_in_EEC_without_me.")";
|
||||
elseif ($search_country == 'special_noteec') $sql .= " AND co.code NOT IN (".$country_code_in_EEC.")";
|
||||
else $sql .= natural_search(array("co.code","co.label"), $search_country);
|
||||
}
|
||||
if (strlen(trim($search_tvaintra))) {
|
||||
$sql .= natural_search("s.tva_intra", $search_tvaintra);
|
||||
}
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . FactureFournisseur::TYPE_STANDARD . "," . FactureFournisseur::TYPE_REPLACEMENT . "," . FactureFournisseur::TYPE_CREDIT_NOTE . "," . FactureFournisseur::TYPE_SITUATION . ")";
|
||||
@@ -362,8 +376,8 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre center nowraponall">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
|
||||
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
|
||||
$formother->select_year($search_year,'search_year',1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
@@ -371,7 +385,10 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1);
|
||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
@@ -452,7 +469,7 @@ if ($result) {
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
// Ref Invoice
|
||||
print '<td>' . $facturefourn_static->getNomUrl(1) . '</td>';
|
||||
print '<td class="nowraponall">' . $facturefourn_static->getNomUrl(1) . '</td>';
|
||||
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
print $objp->invoice_label;
|
||||
@@ -532,5 +549,6 @@ jQuery(document).ready(function() {
|
||||
});
|
||||
</script>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
/* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -27,11 +27,21 @@ $code = $conf->global->MAIN_INFO_ACCOUNTANT_CODE;
|
||||
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
||||
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
||||
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
|
||||
$siren = $conf->global->MAIN_INFO_SIREN;
|
||||
|
||||
$date_export = "_" . dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||
$endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d');
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
|
||||
$completefilename = ($code?$code . "_":"") . ($prefix?$prefix . "_":"") . $filename . ($nodateexport?"":$date_export) . "." . $format;
|
||||
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11") // Specific filename for FEC model export
|
||||
{
|
||||
$completefilename = $siren . "FEC" . $search_date_end . $endaccountingperiod . "." . $format;
|
||||
}
|
||||
else
|
||||
{
|
||||
$completefilename = ($code?$code . "_":"") . ($prefix?$prefix . "_":"") . $filename . ($nodateexport?"":$date_export) . "." . $format;
|
||||
}
|
||||
|
||||
header('Content-Disposition: attachment;filename=' . $completefilename);
|
||||
|
||||
@@ -33,8 +33,8 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("members");
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin","members"));
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
@@ -265,7 +265,6 @@ form_constantes($constantes, 0, $helptext);
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -33,8 +33,8 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("members");
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin","members"));
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
@@ -160,7 +160,6 @@ form_constantes($constantes, 0, $helptext);
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user